Eloquent Subquery Enhancements in Laravel 6.0

Eloquent Subquery Enhancements in Laravel 6.0

If you’ve been following my work for any length of time, you know that I am a big fan of pushing more work in our Laravel applications to the database layer. By doing more work in the database we can often reduce the number of database queries we make, reduce the amount of memory our applications use, and reduce the amount of time required by Eloquent to process our models. This can result in some pretty significant performance wins.

One excellent way to push more work to the database is by using subqueries. Subqueries allow you to run nested queries within another database query. This can be a powerful way to retrieve ancillary model data, without making any additional database queries, when it’s not possible to do via a relationship. You can also use subqueries in order by statements, where statements, and other database clauses.

During my Laracon US 2019 talk, I made reference to a couple of query builder macros I’ve been using that make it easier to use subqueries in Laravel. I’ve since submitted three pull requests to Laravel to add these to the core framework.

Here’s an overview of each:

“Select” subqueries

Pull request #29567 adds support for subqueries to both the select() and addSelect() query builder methods.

For example, let’s imagine that we have a table of flight destinations and a table of flights to destinations. The flights table contains an arrived_at column which indicates when the flight arrived at the destination.

Using the new subquery select functionality in Laravel 6.0, we can select all of the destinations and the name of the flight that most recently arrived at that destination using a single query:

return Destination::addSelect(['last_flight' => Flight::select('name') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1) ])->get(); 

Notice how we’re using Eloquent to generate the subquery here. This makes for a nice, expressive syntax. That said, you can also do this using the query builder:

return Destination::addSelect(['last_flight' => function ($query) { $query->select('name') ->from('flights') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1); }])->get(); 

“Order by” subqueries

In addition, pull request #29563 makes it possible to use subqueries in the query builder’s orderBy() method. Continuing our example above, we can use this to sort the destinations based on when the last flight arrived at that destination.

return Destination::orderByDesc( Flight::select('arrived_at') ->whereColumn('destination_id', 'destinations.id') ->orderBy('arrived_at', 'desc') ->limit(1) )->get(); 

As with selects, you can also use the query builder directly to create the subquery. For example, maybe you want to order users based on their last login date:

return User::orderBy(function ($query) { $query->select('created_at') ->from('logins') ->whereColumn('user_id', 'users.id') ->latest() ->limit(1); })->get(); 

“From” subqueries

Finally, pull request #29602 makes it possible to use subqueries within the query builder’s from() method. These are sometimes called derived tables.

For example, maybe you want to calculate the average total donations made by users in your application. However, in SQL it’s not possible to nest aggregate functions:

AVG(SUM(amount)) 

Instead, we can use a from subquery to calculate this:

return DB::table(function ($query) { $query->selectRaw('sum(amount) as total') ->from('donations') ->groupBy('user_id'); }, 'donations')->avg('total'); 

You probably won’t need to use this every day, but when you do need it, it’s indispensable.

One breaking change to be aware of if you’re using Eloquent outside of Laravel is a signature change to the table() method on the Illuminate/Database/Capsule/Manager object. It’s been changed from table($table, $connection = null) to table($table, $as = null, $connection = null).

Learn more

If you’re interested in learning more about subqueries and other advanced database techniques, be sure to follow my blog, and also watch my Laracon US 2019 talk.

At Laracon I also announced a new video course I’m working on called Eloquent Performance Patterns. My goal with this course is to teach Laravel developers how to drastically improve the performance of their Laravel applications by pushing more work to the database layer, all while still using the Eloquent ORM. Be sure to join the mailing list for that if you’re interested!


Filed in: News


Enjoy this? Get Laravel News delivered straight to your inbox every Sunday.

No Spam, ever. We’ll never share your email address and you can opt out at any time.

via Laravel News
Eloquent Subquery Enhancements in Laravel 6.0

Make It Glide With UHMW Tape

Transcript

“Today I have some UHMW tape. It’s a very slippery plastic and so if you need things to slide across each other like you know when you’re pulling out your antique wooden drawers and they just kind of rub and stick. This tape solves that problem.”

Jordan Bunker

[Cool Tools has a YouTube channel with many more tool reviews]

UHMW Tape (TapeCase 423-5 UHMW Tape Roll)

Available from Amazon

via Cool Tools
Make It Glide With UHMW Tape

Fact Check: The Founding Fathers *DID* Know About Repeating Rifles

Philadelphia, PA – -(AmmoLand.com)- Many people try to claim that the Founding Fathers couldn’t have conceived of repeating rifles when they drafted the Second Amendment to the Bill of Rights. However, the story of Joseph Belton and his correspondence with the Continental Congress proves otherwise.

If you’d prefer to watch and learn, the video I made below details the entire event. If you’d prefer to read about it, the story unfolds below.

Belton, an inventor and gunsmith from Philadelphia, claimed to have devised a new form of flintlock musket that was capable of firing as many as sixteen consecutive shots in as little as twenty seconds. After the gun had fired its consecutive loads, it could then be reloaded individually like all other traditional firearms of that era. He first wrote to Congress about his new invention on April 11, 1777, letting them know he was available to demonstrate his invention to them at any time.

Intrigued by Belton’s claim, Congress ordered 100 examples of his “new improved gun.” They authorized him to oversee the construction of new guns, or alteration of existing guns, so that they were capable of discharging eight rounds with one loading and that he “receive a reasonable compensation for his trouble, and be allowed all just and necessary expences [sic].”

On May 7, Belton replied to Congress with his terms regarding what he felt to be “reasonable compensation.” In order to determine his fee, Belton wanted to arm 100 soldiers with his invention and demonstrate the capabilities of such armed men to a panel of four military officers – two of Congress’ choosing and two of Belton’s choosing. The officers would then determine how many men they felt Belton’s 100 men were equivalent to when carrying a standard firearm. (For example, 100 specially-armed men were equivalent to 200 regularly-armed men, or more.)

For his ability to double the manpower, Belton felt that he was entitled to £1,000 for every 100 men he armed from a given state. Belton justified his price by claiming that a state could not raise, equip, and clothe 100 men for £1,000, making his 100 men armed as though they were 200 men a bargain. (For reference, £1,000 in 1777 is the equivalent of £150,000 today. If all 13 states outfitted 100 men, Belton would receive £13,000 – or £1,900,000 today.)

Joseph Belton
Belton felt his rate of compensation was “vastly reasonable.” Congress disagreed.

Belton argued that arming 3,000 men or more with his invention created enumerable advantages beyond description on the battlefield, making his compensation “vastly reasonable.” As such, his terms were nonnegotiable. If Congress refused or attempted to haggle in any way, he would withdraw his offer completely. (For those doing the math, 3,000 men armed with Belton’s repeater would mean that he’d collect more than £4,500,000 in today’s currency.)

Belton must have realized immediately that his demands were more than outlandish because the next day, on May 8, he wrote a letter to John Hancock lowering his fee to £500 for doubling, £1,500 for tripling, £2,000 for quadrupling, and so forth.

On May 15, Congress read Belton’s letter to the body. They quickly dismissed it because of his “extraordinary allowance.” (No one saw that coming, right?) Congress considered the matter dropped and didn’t reply to Belton, likely assuming he would take their lack of reply as a refusal.

They assumed wrong.

Having heard nothing from Congress for more than a month, Belton wrote them again on Saturday, June 14. This time, he claimed he could accurately hit targets with his rifle out to 100 yards, and possibly even out to 200 yards. He offered to demonstrate this feat to Congress on the following Monday at 10:00am in the State House Yard.

The same day that Belton wrote this letter, Congress was involved with something that would prove to be far more important. On June 14, 1777, the Continental Congress approved the design for a national flag.

With Congress engaged in more pressing matters, Belton’s letter went unanswered for almost a month when he decided to write again.

His letter from July 10 was not nearly as polite as his previous ones. This time, he tried to rile members of the body by claiming that Great Britain regularly pays £500 for lesser services. If, he mused, the “little Island” could afford such payments, surely this “extensive continent” could do the same.

Rittenhouse, Arnold, and Gates all signed a letter endorsing Belton.

He also enclosed a letter signed by General Horatio Gates, Major General Benedict Arnold (before he became a turncoat), well-known scientist David Rittenhouse, and others, all claiming that his invention would be of “great Service, in the Defense of lives, Redoubts, Ships &c, & even in the Field,” and that they felt Belton was entitled to “a hansome [sic] reward from the Publick [sic].”

Having received the letter immediately, Congress resolved that same day to refer Belton’s petition to the Board of War, made up of five delegates. Among these five delegates were future 2nd President of the United States, John Adams; and Benjamin Harrison V, father and great-grandfather of the 9th and 23rd Presidents of the United States, respectively.

Nine days later on July 19, Congress got word from the Board of War. Much to Belton’s dismay, they dismissed his petition altogether. At this point, he must have finally gotten the hint that Congress wasn’t going to authorize such exorbitant payment for his services. The historic record turns up no more correspondence between Belton and Congress.

Despite the fact that Joseph Belton failed to convince the Continental Congress to outfit colonial soldiers with his repeating rifle, it’s still a very important story. Belton invented his gun in 1777. The Bill of Rights wasn’t ratified until 1791. That means our Founding Fathers not only knew about repeating rifles 14 years before the creation of the Second Amendment, but that they thought highly enough of the idea to pursue further development and implementation of such technology. The fact that it proved to be cost-prohibitive is moot, as it certainly could have been done if Congress and Belton had agreed upon the definition of “reasonable compensation.”

So, the next time someone tells you the Second Amendment was never designed to protect the right to own a repeating rifle, or that it was only meant to apply to flintlock firearms, sit them down and tell them the story of Joseph Belton and his repeating flintlock musket.


About Logan MeteshLogan Metesh

Logan Metesh is a historian with a focus on firearms history and development. He runs High Caliber History LLC and has more than a decade of experience working for the Smithsonian Institution, the National Park Service, and the NRA Museums. His ability to present history and research in an engaging manner has made him a sought after consultant, writer, and museum professional. The ease with which he can recall obscure historical facts and figures makes him very good at Jeopardy!, but exceptionally bad at geometry.

The post Fact Check: The Founding Fathers *DID* Know About Repeating Rifles appeared first on AmmoLand.com.

via AmmoLand.com
Fact Check: The Founding Fathers *DID* Know About Repeating Rifles

DIY Improvements for Howard Leight Impact Sport Electronic Ear Protection

Howard Leight Impact Sport DIY Improvement
Howard Leight Impact Sport DIY Improvement

U.S.A. –-(Ammoland.com)–  The Howard Leight Impact Sport electronic ear protection is certainly among the most commonly used ear-pro you’ll find at the shooting ranges of America today.  I’ve used various versions of the Leights for more than a decade, and am more than familiar with its features and shortfalls (review here).  Being popular and common in use is great, but that doesn’t mean there isn’t room for growth.  Behold, two simple ways you can DIY improve your Howard Leight Impact Sport headsets.  One is nearly free, and the other is a lot cheaper than a hearing aid.

Howard Leight Impact Sport DIY Improvement
Shown: everything you need. New gel cups and foam from an old rifle case.

Before we can dive in to improvements, lets identify the shortcomings that lead the Impact Sports to a middle-of-the-pack 22 dB Noise Reduction Rating (NRR).

  1.  The earcups.  The stock earcups are a little bit of what feels like vinyl, filled with the least dense foam imaginable.  Each cup weight 9 grams, and does little to stop sound.  The OEM cups also deteriorate quickly, causing them to stiffen up.  Once that happens, it’s very easy to “break the seal” around your ear, and let in a full-volume blast of noise.  Honeywell (Howard Leight parent company) recommends replacing the  cups every 6 months, at around $15-$20 a year for upkeep.
  2. Dead space.  If you pop open the ear cups (as I do below), you’ll see a lot of empty space.  Open space like that does nothing to stop noise from blowing right through.  We need to fill that up to improve the sound absorption!

So let’s disassemble our ear pro.  First, grab the original foam ear cups and give them a pull.  They’re held in with a few retaining tabs, and pop out easily.

Howard Leight Impact Sport DIY Improvement
First, grab the original foam ear cups and give them a pull.

Next, use a flathead screwdriver to pop off the plastic rim that held in the ear cups.  Once off, set those (and the small foam sheet underneath) to the side.

 

Howard Leight Impact Sport DIY Improvement
Next, use a flathead screwdriver to pop off the plastic rim that held in the ear cups.

Now you can see into the belly of the beast.  The left side (as worn), which has the volume adjustment knob, has a bit more material inside, as it contains the circuit board and internal section of the volume knob.  Don’t let looks deceive you though, there’s a lot more space than it seems at first glance.

Howard Leight Impact Sport DIY Improvement
Left side
Howard Leight Impact Sport DIY Improvement
Right side

So now we’re at the spot where we can make a big difference, for very little money.  We need to fill up all that empty space!  On this headset I used foam from an old, unused gun case.  I used my screwdriver to (carefully!) squeeze as much extra foam into the case as I could.

Howard Leight Impact Sport DIY Improvement
On this headset I used foam from an old, unused gun case.
Howard Leight Impact Sport DIY Improvement
Left side
Howard Leight Impact Sport DIY Improvement
Right side

It’s OK if some of the foam is a little loose, or if it sticks out slightly above the lip of the case.  When we reassemble, the foam sheet that goes under the ear cup retaining ring will hold everything in.  I’ll take a moment to mention foam isn’t the only thing you can use to fill the empty space in the case.  I’ve also used silicon caulking and liquid electrical tape in conjunction with foam for good effect.  I put up a video showing this process years ago.  The silicone worked well, though it’s not much better (if at all) than foam, and much more permanent.

Howard Leight DIY improvement
I’ve also used silicon caulking and liquid electrical tape in conjunction with foam for good effect.

Let’s reassemble!  Lay your foam sheet back on.

Howard Leight Impact Sport DIY Improvement
Howard Leight Impact Sport DIY Improvement
Howard Leight Impact Sport DIY Improvement
Snap the ear cup retaining ring back on.

Now let’s pause.  We’re not putting the stock ear cups back on, instead we’re using Sightlines gel cups from Noisefighters.  The Sightlines improves the effectiveness of ear pro such as the Howard Leights in a few ways.

  1.  They’re more comfortable.  This is especially true with eye protection on, as the Sightlines have channels cut out for the ear bridge of your glasses.  No more temple-pressure induced headaches while shooting!
  2. They seal better.  Being gel rather than vinyl/foam, the Sightlines cups contour to your head and maintain the ear seal.  If you’ve had the ear seal unexpectedly give out while someone is firing off a rifle with a massive muzzle break next to you, you’ll immediately see the benefit here.
  3. They reduce ambient noise passing into your ear.  Simply put, there’s more material that sound has to pass through to get to your ear canal.  I have an old set of Gen 1 Sightlines, they weight in at 33 grams, versus 9 grams for the OEM’s.  That’s a 366% increase in material!
  4. They’re cheaper than maintaining the OEM cups as recommended.  Honeywell wants you to spend $15-$20 a year.  The Sightlines last much longer, and run $40.  My Gen 1 Sightlines are over a year and a half old, and still look just like the brand new Gen 2’s despite regular use.
Howard Leight Impact Sport DIY Improvement
They seal better.  Being gel rather than vinyl/foam, the Sightlines cups contour to your head and maintain the ear seal.

OK, let’s get back to reassembly.  While the Gen 1 Noisefighters Sightlines gel cups simply snapped back into the retaining tabs, the Gen 2 Sightlines have a pressure sensitive, non-permanent adhesive.  Peel the backing sheet off, then carefully align and press in the gel cups.  Once they’re in, give them a firm press to make sure the adhesive is all the way in.

Howard Leight Impact Sport DIY Improvement
That’s it!  Your DIY improvements are done.

That’s it!  Your DIY improvements are done.  Even comparing performance at low levels of sound (same Megadeth song, same volume, same distance) the improved Howard Leight Impact Sport headset shows a noticeable sound reduction with the electronics off against the unimproved set.  That improvement is greatly exacerbated at louder volumes, such as at the shooting range.  Given that the difference is easily apparent to the naked ear means that we’ve improved our headsets by at least 1 decibel.  Since decibels are logarithmic, not linear, the jump from 22 dB NRR to 23 (or greater) dB NRR is a significant reduction in sound pressure slamming into your eardrum.

As someone who’s dealt with significant hearing loss since my early twenties, take it from me:  good ear protection is always worth the money.  Get the best set you can, whether by buying it or improving a good set into a great one.  There are more ways to improve ear pro than the ones I’ve listed, if you have a cool technique post it in the comments below so all shooters have the chance to benefit!


About Rex NanorumJens Hammer

Rex Nanorum is an Alaskan Expatriate living in Oregon with his wife and kids. Growing up on commercial fishing vessels, he found his next adventure with the 2nd Bn, 75th Ranger Regt. After 5 tours to Afghanistan and Iraq, he adventured about the west coast becoming a commercial fisheries and salvage SCUBA diver, rated helicopter pilot instructor (CFII) and personal trainer, before becoming a gear reviewer and writer.”

-Rex Nanorum

@Rexnanorum

The post DIY Improvements for Howard Leight Impact Sport Electronic Ear Protection appeared first on AmmoLand.com.

via AmmoLand.com
DIY Improvements for Howard Leight Impact Sport Electronic Ear Protection

Here’s the first trailer for the upcoming Disney+ Star Wars series, The Mandalorian

It’s here!

About ten months after we learned that Jon Favreau would be heading up a Star Wars series called “The Mandalorian” on Disney’s soon-to-launch streaming service Disney+, we have the first full trailer. It premiered this evening during the Disney+ panel at the D23 conference.

 

Everyone involved had stayed relatively hush-hush about the series until now, with only a couple of details mentioned with its announcement. We knew it takes place about five years after Return of the Jedi — so a few decades before Force Awakens. Favreau had also said that it follows “the travails of a lone gunfighter in the outer reaches of the galaxy” — which we later learned would be played by Pedro Pascal (perhaps best known as Oberyn Martell from Game of Thrones.)

According to the New York Times, Disney is dropping “roughly $100 million” to produce the first 10 episodes.

The Mandalorian is set to debut alongside Disney+ on November 12th, 2019.

 

 


via TechCrunch
Here’s the first trailer for the upcoming Disney+ Star Wars series, The Mandalorian

The Best Silencer Host Gun? The Hush Puppy Project Smith & Wesson M&P 2.0

The Best Silencer Host Gun? The Hush Puppy Project Smith & Wesson M&P 2.0

Posted in NFA / Suppressors / Class III, Pistols, Semi-Auto, Subsonic Ammunition, TFBTV by with No Comments
Tags: , , ,

In this episode of TFBTV, James Reeves reviews the Hush Puppy Project S&W M&P 2.0. What is the Hush Puppy Project? From their website:

“The Hush Puppy Project® provides innovative solutions to reduce or remove noise signatures from gunshots. Guns produce three distinct sounds: the cartridge’s firing, the bullet’s sonic crack and the gun’s operational cycle.
Addressing the loudest of the three— the gunshot— requires a silencer (or sound suppressor) to reduce and impede the flow of high-pressure gases produced by the combustion of the cartridge’s powder charge. Hush Puppy® Project silencers reduce the sound of a gunshot through a marriage of technology from both monocore-style and wipe-style silencer designs.
The second sound source is the sonic boom, or “crack,” of a bullet exceeding the speed of sound, which is eliminated with subsonic ammunition. Our silencers are optimized for Hush Puppy® subsonic ammunition, made by our sister company, Super Vel Ammunition.
Finally, the metallic noise of a pistol’s operational cycle is removed by transforming the pistol into a locked breech firearm, thus preventing the pistol from self-loading. A Hush Puppy® Slide Lock Device (patent pending) prevents a semi-automatic pistol’s slide from reciprocating on the frame while the pistol is in locked breech mode.”

««« PATREON GIVEAWAYS »»»

PLEASE check out our Patreon page if you enjoy our program, and consider helping us at TFBTV out! We give away hundreds of dollars of gear a month on our Patreon page!

https://ift.tt/20aijRh

NOTE: These giveaways are not affiliated with, associated with, or in any way endorsed by YouTube and TFBTV is solely responsible for the giveaways mentioned in this video and this description.

««« FOLLOW US ON SOCIAL MEDIA »»»
https://ift.tt/2Ny4xaJ
https://ift.tt/2wqXNET
https://ift.tt/2THAj8m

««« G-U-N-S IN THIS VIDEO »»»

S&W Hush Puppy Project M&P 2.0

««« SPONSORS »»»

Please Support Them! They help make our videos possible.

– Ventura Munitions

– Federal Premium – Building the industry’s widest variety of ammunition and offering leading products for every facet of the shooting sports.
https://ift.tt/P4n5jx

-Blue Alpha Gear: https://ift.tt/2hKMfnu

««« TFB CHAT ROOM »»»

Want to join the TFBTV chat room? Use our Discord Invite: https://ift.tt/2t6R69l

#TFBTV

via The Firearm Blog
The Best Silencer Host Gun? The Hush Puppy Project Smith & Wesson M&P 2.0

4 Ways to Set Up a VPN at Home

setup-home-vpn

Using a VPN (Virtual Private Network) is a great way to maintain your privacy online. However, there are several different ways to set up a VPN. In this article we’ll show you how to set up a VPN in several different ways, some easy, some more complex.

1. How to Set Up a VPN Using Third-Party Software

how to set up a VPN - third-party software

The quickest and easiest solution if you’re wondering how to create a VPN is to use the software that comes with your VPN subscription.

When you purchase a personal VPN service from a company like ExpressVPN or CyberGhost, you’ll get a link to download its software. Usually you visit your VPN provider’s website and it will have links to download the software for all of your devices, including your desktop.

You download and install the VPN software as you would any other piece of software. Once installation is complete you enter your VPN username and password and you can start using the VPN.

The software differs between companies but most will have options to select a server from locations around the world, to connect to and disconnect from a server, to toggle automatic connections on or off, and other features including a kill switch.

2. How to Set Up a VPN at Home Using a Router With VPN Support

If you have lots of people in your home using your network, it can be a hassle to install VPN software on every single one of their devices. Instead, you can set up a VPN at home by installing software directly onto your router.

There are several reasons to set up a VPN on your router, and the main advantage of this method is that any traffic that passes over your network will be encrypted by your VPN, no matter what device you use. This will even protect Internet of Things (IoT) devices. Your VPN is always on and you won’t need to configure it.

The easiest way to get VPN software on your router is by purchasing one of the best VPN routers which have software support for VPNs. TRENDnet routers, for example, allow you to configure VPN connections within their software.

To use your home VPN, log into your router by entering its IP address into your web browser. Find the option saying VPN or similar and add in your VPN username and password. You should be able to enable the VPN across your whole network from here.

3. How to Set Up a VPN by Installing VPN Software on Your Wi-Fi Router

how to set up a VPN - install VPN on your router

What if you already have a router you’re happy with and you don’t want to buy a new one to set up your VPN? In that case, you can still install VPN software onto compatible routers. However, it will require a little more work.

Two popular options for adding VPN capabilities to your router are DD-WRT (which can turn your router into a super-router) and Tomato.

Both of these options are open source and can add all sorts of new capabilities to your router. This includes monitoring bandwidth usage, increased wireless coverage, and better security. But let’s take a look at how to use the software to add a VPN to your router.

Upgrade Your Router’s Firmware

First, check if your particular router model is supported by DD-WRT or supported by Tomato. If it is, you can go ahead and download the right firmware for your router from the relevant website. Now make sure your computer is connected to your router via Ethernet cable rather than Wi-Fi, so you can still connect to the router once you change the settings.

Open up the web interface to your router. If you know your router’s IP address already, just type it in. If you don’t know it, use the ipconfig command to view your IP address. Log in to your router using your username and password.

You should find a menu option saying Administration or something similar, depending on your particular router. Choose this option and look for an option that says Upgrade Firmware or Upload Firmware. Use this option to upload the new firmware you just downloaded.

Once the firmware upgrade is complete, you’ll need to restart your router. To be certain the old settings are cleared, turn off your router and wait for 30 seconds before turning it on again.

When the router restarts, go back to the web interface by typing the IP address into your browser again. You should set a username and password, and your new software is ready to use.

Set Up a VPN on an Upgraded Router

You’ll need to know your VPN provider’s settings to use the VPN on your upgraded firmware. You can usually find these settings on your VPN provider’s website. For example, here is ExpressVPN’s instructions for setting up Linksys routers.

In your router firmware, go to VPN Tunneling in Tomato or Services > VPN on DD-WRT. Turn on OpenVPN Client and add the information you got from your VPN provider. Now, save your changes and your VPN should be up and running for your whole network.

4. How to Set Up Your Own Custom VPN Server

Finally, if you’re really dedicated and you want more control over your VPN, you could create your own VPN server. You can create a VPN on Windows if you have an old PC you’re not using any more, or you could use a Raspberry Pi. You can install software called OpenVPN to create your own VPN server.

The downside to this method is that the device will need to be on all the time for your VPN to function. The upside is that you don’t have to pay a subscription to a VPN provider and you know that you are in complete control of your data.

To create a VPN server you’ll need to download the OpenVPN software and install it on your chosen device. There’s an installer available for Windows users, but if you’re using a Raspberry Pi and having difficulties with installation, you can try an installer script like PiVPN.

Then, you can configure your VPN by following the instructions on the OpenVPN website.

Alternatively, another option is to use a software bundle for VPN hosting such as Algo VPN hosted on a Virtual Machine on a cloud provider like DigitalOcean.

How to Set Up a VPN at Home

These methods will let you set up your own VPN at home. The easiest way is to pay for a VPN subscription and use the software from your VPN provider to access the VPN. If you want more control, you could try installing a VPN on your router or even hosting your own VPN server.

And if you’re not yet convinced that you need a VPN, here are the reasons you should be using a VPN.

Read the full article: 4 Ways to Set Up a VPN at Home

via MakeUseOf.com
4 Ways to Set Up a VPN at Home