The 10 Best Tools for Ripping DVDs and Blu-rays to Your Computer

https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2021/03/makemkv.png

Despite the prevalence of free and paid streaming services, DVDs and Blu-rays persist. So, if you’ve got shelves full of DVDs and Blu-rays waiting to be ripped, we’ve got the tools you need to digitize your collection.

Here are the best tools for ripping DVDs and Blu-rays to your computer.

1. MakeMKV


Available on: Windows, Mac

In MakeMKV, you’ll find a superb cross-platform Blu-ray and DVD backup utility. It boasts DVD and Blu-ray decrypter functionality. To rip a DVD or Blu-ray to your computer, pop in a disc, select the media in MakeMKV. Upon doing so, MakeMKV runs through some initial work loading information. You’ll see the various titles and can expand the sections to view subtitle and audio track information.

From here, select the subtitle and audio tracks you’d like to rip, along with the titles you want to transfer. Generally, the title with the most tracks will be the feature, while smaller titles are bonus features, deleted scenes, or whatever else is on the disc. However, this varies by disc. Deselect everything you don’t need, then click the MakeMKV button.

Now, let MakeMKV get to work. DVDs typically rip in under 20 minutes. However, Blu-rays can range from 30 minutes to a couple of hours depending on the length of the movie and the extras you want.

MKV files are slightly smaller than original disc images. DVD backups are about 10% smaller, with Blu-ray rips roughly 40% smaller than their disc counterparts. Ripping a Blu-ray disc provides a much larger file than a DVD, well over 4GB. While a Blu-ray MKV rip provides maximum quality, it takes up more space. Converting your MKV to another format such as an MP4 might produce a smaller file, albeit at the cost of audio and video quality.

2. Handbrake

Available on: Windows, Mac, Linux

Handbrake is a fantastic open-source DVD ripper. It’s a completely free Blu-ray ripper. Aside from ripping DVDs and Blu-rays, Handbrake can do lots of clever things, including converting videos, adding subtitles to films, and more.

Simply select a profile depending on the target device or quality, decide if you want to use Handbrake to attach subtitles to a movie file, then hit Start Encode.

Presets range from device options including iPad and iPod to high-quality 1080p options, and more. Plus, you can pick different formats such as MP4, H.265, and H.264.

Since you can tweak tons of settings or merely choose a preset and start encoding, Handbrake is as intuitive or complicated as you make it. Overall, it’s one of the best free DVD rippers you can download.

This Blu-ray and DVD decrypter is cross-platform, free, and open-source. Moreover, frequent updates ensure that Handbrake offers a cutting-edge feature set.

3. Freemake Video Converter


Available on: Windows

Freemake remains a top choice for DVD ripping software. What’s neat is Freemake’s arsenal of video editing options. Not only is Freemake one of the top free DVD ripping software options available, it’s packed with editing capabilities.

Using Freemake, you can join files together. You can even join up files to have one big merged file. Videos can also be converted to Flash or HTML5, as well as MP3. Among its many output file formats, you can rip DVDs to MP4, AVI, MKV, 3GP, and more.

One great feature is when you rip it to become a DVD, you can also add a menu with clickable chapter titles. With its ability to rip videos to a variety of formats as well as video modification, Freemake is an excellent free DVD ripper.

4. WinX DVD Ripper


Available on: Windows, Mac

WinX is another one of the best DVD rippers. It comes in two flavors: there’s a free DVD ripper as well as WinX DVD Ripper Platinum Edition. While WinX’s def ripping software is free, it’s basically a trial version of the Platinum edition. However, once the trial expires, it’s totally usable and merely drops a few premium features.

The free iteration will rip a DVD to MP4, WMV, AVI, FLV, MOV, MPEG, H.264, iPhone, iPod, Apple TV, Android, Samsung, HTC, and PSP. With it, you create an exact 1:1 clone with no quality loss. WinX DVD Ripper boasts a fast backup speed, with taking roughly five minutes to create an MPEG2 copy of a DVD.

The Platinum version adds additional output formats, such as creating ISO files. You’ll see faster ripping speeds as well as video editing features. WinX DVD Ripper is a superb alternative to Handbrake and Freemake.

5. WonderFox DVD Ripper Pro


Available on: Windows

In addition to WinX, we really enjoyed WonderFox DVD Ripper Pro. It’s simple to use, making DVD ripping easy. Just pop in a DVD, select your preferred output format, and start digitizing your DVDs.

WonderFox DVD Ripper Pro lets you quickly back up DVDs in as little as five minutes, and can create 1:1 copies for top-notch quality.

The app costs $40.

6. Aurora


Available on: Windows, Mac

Aurora is a free Blu-ray ripper that sports cross-platform compatibility. It will burn the Blu-ray disc into an ISO file, and then burn the ISO file onto a blank disc. Alternatively, simply use media server software such as Plex to play your ISO files. This is a powerful Blu-ray decrypter that’s fast and free.

While Aurora includes a solid feature set, it’s limited as Blu-ray ripping software. You may copy a Blu-ray to an ISO file. Unlike options such as Handbrake, WinX DVD Ripper, or MakeMKV, you won’t find additional video file output formats or compression tools.

Still, Blu-ray ripping is indeed speedy, and it’s a robust Blu-ray ripper with Mac and Windows installers.

7. CloneDVD and CloneBD


Available on: Windows

Aptly named, CloneDVD clones your DVDs. Simply insert your disc, select which chapters you want copied, choose your language, whether you want subtitles, then rip your DVD.

Once the file, in DVD format, has been copied to your computer, you can burn the ISO to a blank DVD disc, use software like Handbrake to convert your DVD file to an MP4, or mount the ISO file on your computer using a virtual drive.

Aside from its DVD backup utility, there’s Blu-ray ripping software as well. CloneBD can back up entire Blu-ray discs as ISO files, or output to the likes of MKV, AVI, and MP4.

CloneDVD costs $50; CloneBD will set you back $100.

8. VLC Player

Available on: Windows, Mac, Linux

While there are loads of video playback apps, VLC remains one of the most popular and feature-rich media players.

VLC Player rightfully earned its reputation for being able to play virtually any video format you want to watch. Although it’s commonly considered the go-to for media playback, you can also use VLC to rip a DVD or Blu-ray.

Choose what you want to be converted, select No disc menus if you don’t want menus, point VLC to the disc drive on your computer, then click Convert/Save. Ripping can take quite some time, though. Some users have reported it taking up to two hours. Options like MakeMKV or Freemake can do it in 15-20 minutes.

Related: Top Secret Features of the Free VLC Media Player

9. DVDFab


Available on: Windows, Mac

DVDFab is DVD ripping software which has received a lot of positive praise. As well as being able to rip a DVD to your computer in standard formats, it can also rip only the audio. So if you’d like music from a film or show, then DVDFab can grab it for you.

Batch conversion allows you to rip more than one title at a time. Specify the start point and end point that you want to be converted in a disc, and you can also automatically crop the screen to show what you want. For a nifty Blu-ray decrypter, check out DVDFab’s Blu-ray ripper.

The DVD version is $85; the Blu-ray version is $125.

10. DVD Decrypter


Available on: Windows

DVD Decrypter is an awesome free DVD ripper. While its official site shut down in 2005, it’s still available via an unofficial mirror. Ridiculously easy to use, DVD Decrypter loads title information making it easy to back up an entire or partial disc.

The biggest selling point of the app (and the reason it still makes our list despite its age), however, is the ease with which it can remove region restrictions from your disks. It can get rid of CSS (Content Scrambler System), user operation prohibitions, and Macrovision Content Protection with a single click. All of them are among the most common DVD issues you are likely to encounter.

Overall, it’s an excellent DVD ripping software option that’s totally free to use.

(Note: Remember, if you don’t want to rip all your region-blocked DVDs, you can buy a region-free DVD player.)

The Best Tools for Ripping DVDs and Blu-rays

While these are the best DVD rippers and Blu-ray rippers available, there are plenty of options to rip a DVD or Blu-ray to your computer. Which option you choose depends on whether you’re ripping Blu-rays or DVDs, what file formats you prefer, your ideal quality, and more.

MUO – Feed

Backyard Squirrel Maze 2.0

https://theawesomer.com/photos/2021/05/backyard_squirrel_maze_two_t.jpg

Backyard Squirrel Maze 2.0

Link

A while back, engineer Mark Rober built an obstacle course to try and keep squirrels from getting to his birdseed. Ultimately, the smart squirrels figured it out, so he decided to up his game with a far more complicated maze that’s even trickier to navigate. Will the squirrels get their claws on Mark’s nuts again?

The Awesomer

6 (More) Badass Lady Shooters: Past & Present

https://www.pewpewtactical.com/wp-content/uploads/2021/05/Corrine-Mosher.jpg

While you might get the feeling that the gun world is a man’s world — it’s not.

As long as there have been guns, there have been badass women shooting them.

Lady Death
Lyudmila “Lady Death” Pavlichenko is always one of our favorites!

They may not always get the recognition they deserve, but today we’re going to celebrate six more awe-inspiring lady shooters that you need to know about! 

Don’t worry if your favorite gal isn’t on here, though — I’m working my way through a long list of seriously cool women shooters, a few at a time.

But it never hurts to drop her name in the comments, either!

Women & Guns
Every one of these women is the definition of #GirlBoss!

(Missed the first round? Check out 6 Badass Lady Shooters.)

Anyways, without further ado, let’s dive in!

Lady Shooters You Should Know

1. Calamity Jane

Born Martha Jane Cannary in 1852, Calamity Jane was an American frontierswoman, sharpshooter, and exceptional storyteller who is known for touring with Buffalo Bill.

Most of what we know about her life story comes from some (greatly exaggerated) autobiographical pamphlets, but there isn’t any doubt…she was a highly skilled shooter, creative survivor, and all-around tough cookie.

Calamity Jane
Calamity Jane doesn’t have time for skirts, thanks.

By age 14, Jane was in charge of raising her five siblings after losing both of her parents. She hauled the whole family off to Piedmont, Wyoming, where she began her very colorful work history so she could provide for them.

Among some of her jobs, Jane served as a scout for the Army at Fort Russell. The Army regularly engaged in skirmishes with the Native Americans living in the area.

Calamity Jane and horse
Calamity Jane working as a mounted scout and courier.

She claimed her moniker came from Captain Egan sometime during the 1872-1873 conflict with Native Americans near what is now Sheridan, Wyoming. 

But the tale was debunked by others who were there. Best we can figure, she either earned the name from a headline announcing the arrival of the Hickok wagon train…or as an unfortunate nod to her dating life.

Her autobiography says she carried dispatches at top speed to Fort Laramie. That is where she met Wild Bill Hickok.

Calamity Jane in 1895
Calamity Jane in 1895

Despite her rough-and-ready reputation, Calamity Jane also came to be known for her compassion and bravery in helping others.

She saved a stagecoach from an attack and drove it back to Deadwood, SD after the driver was killed. Around 1876 or ‘78, she helped nurse the victims of a smallpox outbreak in Deadwood.

Buffalo Bill's Wild West Show
Buffalo Bill’s Wild West Show

Her later years didn’t slow her down much — she began touring with Buffalo Bill’s Wild West Show and even appeared on the Pan-American Exposition in 1901.

When she wasn’t touring, Jane owned and operated a series of inns with her husband, Clinton Burke — first in Miles City, MT, then in Boulder, MT.

Calamity Jane 2
Jane was a character in her own right — complex and faceted.

Rumor had it, Jane and Hickok were involved (according to her, he was the love of her life), and may have even had a daughter together.

It was known that Jane did have two daughters, but their fathers are unknown. 

Calamity Jane at Bill Hickok's Grave
Calamity Jane at Bill Hickok’s Grave

She passed away in Terry, SD, a small mining town near Deadwood as a result of her long battle with alcoholism.

Jane was buried beside Hickok at the Mount Moriah cemetery in Deadwood in 1903.

2. Amy Robbins

How does a professional model end up on a list of badass lady shooters, you might ask? Well, when you’re Amy Robbins, it’s easy!

Amy Robbins
Amy Robbins

Amy wears many, many hats in her work.

Not only is she an awesome 2A advocate, producer, writer, and host of several different firearms shows and podcasts, and avid runner — she’s the founder and CEO of Alexo Athletica.

Y’know, that lil ol’ company that combined the two best things in the world as far as I am concerned — CCW yoga pants!

Womens Concealed Alexo Athletica Leggings
Jacki rocks the Women’s Concealed Alexo Athletica Leggings!

Amy grew up shooting with her father but didn’t really jump into the firearms world until she got her carry license. She ended up being scouted as a host for an upcoming firearms show with Colion Noir.

From there, Amy went on to work for NRATV, write and produce for Noir, co-host the Not Your Average Gun Girls podcast with Emily Valentine, and start her own company designing comfortable, sporty clothing that would still allow women to keep their guns handy.

Amy Robbins on the Set of Noir
Amy Robbins on the Set of Noir

“I knew that women were most vulnerable while wearing activewear, as this caused them to throw their self-defense tools in their purses. I wanted to create something that would allow them to keep their tools on their bodies and retrieve them quickly,” she told Personal Defense World.

“My dream was an entire product line that would work together to conceal whatever it was that women wanted to hold in the waistbands, but in a stylish way.”

Amy Robbins in Alexo Athletica
Amy Robbins in Alexo Athletica

Anyways, there’s a reason that Alexo Athletica is one of our favorite brands for gun-toting gals. As a fashion-loving gun girl myself, I appreciate Amy’s creativity and drive!

3. Kay and Lena Miculek

For our number three spot, we have a bit of a tie.

This mother-daughter duo was highly requested by our readers, and I am more than happy to share just how cool Kay Clark-Miculek and Lena Miculek are!

Lena Miculek (left) and Kay Clark-Miculek (right)
Lena Miculek (left) and Kay Clark-Miculek (right)

You may have heard of Jerry Miculek — I guess he’s pretty famous for a male shooter. (I’m kidding, I’m kidding! Of course, you know who he is!)

He also happens to be the husband of ISPC World and ISPC US Handgun multi-gold-medalist Kay Clark-Miculek and father of ISPC World Handgun and Shotgun multi-gold-medalist Lena Miculek.

The Miculek clan
The Miculek clan

Between the three of them, that family has a lot of gold medals, and even more shooting experience!

Kay is the daughter of a gunsmith and nationally ranked bullseye shooter. She shot on her high school rifle team with her brother before beginning to compete professionally.

She even met her future husband at the Bianchi Cup. 

Kay Miculek
Kay Miculek

She founded Babes with Bullets, a women’s handgun shooting camp that tours the country and teaches women how to shoot. She’s also a host for the Outdoor Channel. 

While we’d never tattle on a lady’s age, Kay has plenty of experience and translates her skills into teaching women who got into shooting later in life.

Empowering women is cool, and Kay has spent her life working towards that.

Kay Miculek competing
Kay Miculek competing

Her daughter, Lena, is a champion shooter in her own right!

Lena began competing at 8 years old after traveling with her parents to matches for most of her life. She also hosts over at the Outdoor Channel and is the driving force behind her father’s YouTube channel.

Lena Miculek
Lena Miculek

Lena also is a highly active competitive shooter, like her parents. She often competes in competitions for 3-Gun, USPSA, Steel Challenge, outlaw PCC matches, IPSC Shotgun, and IPSC Rifle.

Lena Miculek 2
Even a broken arm doesn’t stop her!

4. Corrine Mosher

Unlike most of the others on our list, Corrine Mosher wasn’t raised around guns. 

She’s the daughter of two Marines, but she didn’t begin shooting until her husband encouraged her to get her concealed carry permit.

Even then, she tells Shooting Sports USA, “I did fairly well, but I didn’t necessarily enjoy it.”

Corrine Mosher
Corrine Mosher

Corrine is a natural-born teacher though. She found herself working as a firearms instructor for the training company she founded with her husband.

From there, she moved to a position as the Director of Education at Centerfire Sports in Olathe, KS.

Corrine Mosher at competition
Corrine Mosher at competition

It didn’t take too long for Corrine to grow interested in the competitive side of shooting.

She’s an avid and decorated 3-Gun competitor and a vocal advocate of the AK platform.

Corrine Mosher with an AK
Queen of the American AK

Before she became a famous gun gal, Corrine had an unlikely background as a trained violinist.

She attended the University of Missouri Kansas City Music Conservatory, and even had her own private music studio for several years, where she taught!

5. Jane Frazier

This one might be a little more rumor than reality, but we still think her story is worth sharing. 

Jane Frazier (also spelled Fraser or Frazer) was the wife of Scottish gunsmith, fur trader, interpreter, and British Army Lieutenant John Frazier. They lived in the Province of Pennsylvania after they married in 1754.

Jane Frazier
Jane Frazier

In 1755, Jane was returning from the Cumberland trading post to her home, accompanied by the couple’s hired hand, Bradley. They were ambushed by Native Americans and Bradley was killed.

Jane, pregnant and close to giving birth to her first child, was captured and brought to live with the tribe.

Jane Frazier 2
An artistic rendering of Jane’s capture

According to her account, the tribe adopted Jane. She eventually gave birth to her child, but the child passed away after three months.

Grieving all that she lost, Jane planned an escape with two other captured fur traders.

The group scavenged supplies and a broken rifle from the camp as they waited for another raid to provide them the opportunity to escape.

Some accounts say Jane used skills she’d learned from her husband’s gunsmithing to repair the rifle — which is what lands her on this list, whether or not it’s true.

Jane Frazier Historical Marker
Jane Frazier Historical Marker

After 13 (or possibly 18) months of captivity, Jane escaped and made the nearly two-week journey home. She ventured on alone after the men she escaped with were unable to continue. 

When she returned home, Jane found out had remarried, thinking she was dead!

For Jane, the story ends well, though — her husband took her back and they later had three children. (The second wife returned back to her father. Oops.)

The Frazier House
The Frazier House

6. Melody Lauer

Finally, I want to introduce you to Melody Lauer.

She acts as one half of the team behind Citizens Defense Research and an all-around amazing instructor.

Melody Lauer
Melody Lauer

What sets Melody apart? She burst onto the self-defense scene as one of the first women to talk about defensive carry with a child.

After all, moms want to protect their families, too.

Melody Lauer demonstrating babywearing and concealed carry!
Melody Lauer demonstrating baby-wearing and IWB carry!

Unfortunately, not many courses exist on the topic of carrying as a parent or guardian.

But Melody and her partner John Johnston at Citizens Defense Research created the definitive course for parents, babysitters, grandparents, or anyone else who carries a gun while with kids. 

Melody Lauer teaching The Armed Parent/Guardian.
Melody Lauer teaching The Armed Parent/Guardian.

The Armed Parent/Guardian is must-have training with both a classroom session and practical range practice to prepare you to engage threats with a child in your care.

Drilling hand holding
Drilling hand holding in one of Melody’s classes

In addition to being a phenomenal instructor with a unique area of expertise, Melody is also an active EMT, a martial artist…and a mom!

If you’re looking for training specifically as it applies to caregiving…Melody is your expert!

Melody Lauer teaching
Seriously…no one knows this stuff better than her!

(We also have an article about self-defense with kids…but nothing replaces hands-on training.)

Conclusion

As it turns out, there are a lot of really cool women out there in the gun world. Some develop cutting-edge training, others design gear, and even more wait in the annals of history for us to rediscover them.

Women teaching girl to shoot pistol
After all, someone has to train the next generation of badass lady shooters!

But no matter what makes them a badass lady shooter…we’re excited to share them with you!

Now it’s your turn — who is your favorite lady shooter? Share their name or their story in the comments! Want more content for the gals? Check out our woman-centric articles. But if history is more your jam…check out our history category!

The post 6 (More) Badass Lady Shooters: Past & Present appeared first on Pew Pew Tactical.

Pew Pew Tactical

Making Mora Knives

https://theawesomer.com/photos/2021/05/making_mora_knives_t.jpg

Making Mora Knives

Link

We’ve seen how individual blacksmiths and blademakers painstakingly handcraft knives one at a time. This factory footage from Sweden’s Morakniv shows us the opposite – how robots and other machines crank out thousands of knives each day. Humans are still involved in the assembly and quality assurance processes.

The Awesomer

Ford Designs Simple Anti-COVID DIY Air Filtration with Common Box Fan

https://s3files.core77.com/blog/images/1185521_81_108828_LPsS3rIgM.jpg

Now that we know COVID is spread via aerosol rather than fomites, having clean air is of more concern than clean hands. Automaker Ford, working together with fan manufacturer Lasko, is addressing this with their design of a simple air filtration system centered on a common box fan.

The design stemmed from research conducted "using supercomputer air flow analysis to determine if a low-cost box fan air cleaner can mitigate the risk of airborne transmission of COVID-19 in a classroom equipped with a single horizontal unit ventilator."

"The study found that box fan air cleaners like this can serve as an effective low-cost alternative for mitigating airborne transmission risks in poorly ventilated spaces."

Ford and Lasko’s inexpensive fix is simply a cardboard cutout that supports an ordinary air filter (they’re recommending MERV 13 or higher, so it looks like you don’t have to go full HEPA) and attaches to a box fan.

They’re calling it the Scrappy Filtration system, and they’ve donated 20,000 kits to schools in underserved communities.

If you want to make your own, they’ve got a template you can download here.

Core77

A configuration that can double MySQL write performance

https://mysqlonarm.github.io/images/blog21/img1.png

MySQL is heavily tunable and some of the configuration can have significant impact on its performance. During my experiment for numa scalability I encountered one such configuration. Default configuration tends to suggest heavy contention for write workload but once tuned it helps scale MySQL by more than 2x.

Understanding the problem

I started testing write-workloads with different numa levels (1 numa [32 cores]/2 numa [64 cores]/ 4 numa [128 cores]) and observed a weird behavior.

  • With increasing compute power we expected throughput to grow. The pattern is observed when we move from 1 numa to 2 numa but there is significant throughput loss (despite double compute power) when switched from 2 numa to 4 numa.
  • This is exactly what we call as NUMA SCALABILITY BOTTLENECK (vs a SCALABILITY BOTTLENECK that tends to achieve optimal performance with a given set of compute and io resources).

server: mysql-8.0.24.
configuration: click here (+ skip-log-bin)
machine: ARM machine (kunpeng 920 (2 sockets, 128 cores, 4 numa nodes), nvme ssd)
workload: sysbench update-index (cpu-bound)

Identifying the bottleneck

To get more insight on contention I resorted to perf-schema.

+-----------------------------------------------+---------------+------------+
| EVENT_NAME                                    | WAIT_MS       | COUNT_STAR |
+-----------------------------------------------+---------------+------------+
| wait/synch/mutex/innodb/trx_sys_mutex         | 28341923.1285 |    8637971 |
| wait/synch/mutex/innodb/undo_space_rseg_mutex | 24417716.9238 |    3895877 |
| wait/synch/mutex/innodb/sync_array_mutex      |  3619893.6460 |   38717477 |
+-----------------------------------------------+---------------+------------+
3 rows in set (0.05 sec)

Surprisingly the 2nd most contended mutex is rollback segment mutex. (1st being trx_sys that is a known issue and mysql hopefully is working on it to make trx_sys lock-free).

Fortunately, there is a way out.

undo tablespaces

MySQL has been working on improving the undo tablespace framework for quite some time, starting with undo tablespace truncation (and I am fortunate enough to code it back in 5.7x timeframe). I still remember discussing the limitation of the 128 rollback segments but given it would need major change it was deferred to 8.x and eventually it came with 8.x (changes around 8.0.14 and then again 8.0.23) where-in user can now configure extra undo tablespaces and that in turn defines number of rollback segments.

Here is the latest and simplified view:

InnoDB will create 2 default undo tablespaces (also known as implicit tablespaces)
Users can add 125 (maximum) undo tablespaces (also known as explicit tablespaces).
Total: 127 undo tablespaces.

Each undo tablespace can host 128 rollback segments (controlled using innodb_rollback_segments).

So 127 * 128 = 16256 rollback segments are available for transactions.

mysql> show status like '%undo%';
+----------------------------------+-------+
| Variable_name                    | Value |
+----------------------------------+-------+
| Innodb_undo_tablespaces_total    | 127   |
| Innodb_undo_tablespaces_implicit | 2     |
| Innodb_undo_tablespaces_explicit | 125   |
| Innodb_undo_tablespaces_active   | 127   |
+----------------------------------+-------+
4 rows in set (0.00 sec)

(It is just 128 rollback segments in 5.7. Starting 8.x given 2 default undo tablespaces 256 rollback segments are made active by default)

Resolving Contention

So with default 2 undo-tablespaces only 256 rollback segments are made active and N transactions will share these rollback segments. With N = 150K approximately 586 transactions use the same rollback segments creating heavy contention as all of them need the said mutex latch in order to add their undo-logs to transaction history during commit stage (check trx_write_serialisation_history for more details).

If we create additional 125 explicit undo tablespaces it would make 127 * 128 = 16256 rollback segments that is around 9 transactions per rollback segment significantly reducing the contention.

Let’s see if this solution helps.

Same could be confirmed with perf schema output

With 2 undo tablespaces:

+-----------------------------------------------+---------------+------------+
| EVENT_NAME                                    | WAIT_MS       | COUNT_STAR |
+-----------------------------------------------+---------------+------------+
| wait/synch/mutex/innodb/trx_sys_mutex         | 88168453.5988 |   19540096 |
| wait/synch/mutex/innodb/undo_space_rseg_mutex | 78933376.9118 |   14811159 |
| wait/synch/mutex/innodb/sync_array_mutex      | 11274812.8370 |  111143905 |
+-----------------------------------------------+---------------+------------+
3 rows in set (0.04 sec)

With 127 undo tablespaces:

+-------------------------------------------------+----------------+------------+
| EVENT_NAME                                      | WAIT_MS        | COUNT_STAR |
+-------------------------------------------------+----------------+------------+
| wait/synch/mutex/innodb/trx_sys_mutex           | 153155037.4916 |   33537120 |
| wait/synch/mutex/innodb/buf_pool_LRU_list_mutex |  18706130.3456 |   38819242 |
| wait/synch/mutex/innodb/sync_array_mutex        |   4240650.4708 |   93054607 |
+-------------------------------------------------+----------------+------------+
3 rows in set (0.08 sec)

| wait/synch/mutex/innodb/undo_space_rseg_mutex           |    213977.8787 |   31464777 |

Wait has reduced from 78933376 milli-seconds (77 seconds per thread) to 213977 milli-seconds (0.2 seconds per thread).

Fallback (if any?)

Approach of increasing undo tablespace is really good but enabling 125 explicit tablespaces consumes disk space and to keep this in limit users should configure undo tablespace truncate.

Default innodb_max_undo_log_size = 1GB assuming all 127 tablespaces are growing uniformly, truncate will not kick in till all of them are around 1GB in size there-by consuming 127GB of the disk space.

If you plan to enable 127 tablespaces then better is to reduce the innodb_max_undo_log_size (unless disk space is not a concern).

Effect of enabling 127 tablespaces on lesser numa nodes

As we could see there is negligible/marginal effect on enabling 127 tablespaces for lower numa nodes. NUMA scalability fix/solution effects are observed with increased numa nodes but minimal change is observed for lower numa nodes. We can have a separate blog post about NUMA scalability explaining why such effects are observed.

Conclusion

Scaling MySQL for NUMA has its own challenges and while the solution for some of these problems pre-exist extra configuration may be needed. It would be really helpful if MySQL can auto detect and configure some of these limits based on the numa configuration it is running on.

If you have more questions/queries do let me know. Will try to answer them.

Planet MySQL

The Best Bug Repellents

https://cdn.thewirecutter.com/wp-content/uploads/2019/03/bug-repellent-lowres-9664-630×420.jpg

The Best Bug Repellents

Everyone should avoid bug bites. For a bug repellent that’s safe and effective—and that won’t stink or leave a puddle of oil on your skin—skip the DEET and get a picaridin formula, like Sawyer Products Premium Insect Repellent with 20 percent picaridin. It’s the best bottle of bug spray we found after testing 17 repellents and talking to everyone—from the EPA to the American Mosquito Control Association. One fact to establish up front: There’s no evidence that mosquitoes can transmit the coronavirus—but the diseases that biting insects do carry ain’t no picnic either.

Wirecutter: Reviews for the Real World

Laravel 8 Roles and Permissions Without Package

https://www.codecheef.org/user/img/fevicon.png

Laravel 8 Roles and Permissions Without Package

Posted By


Mahedi Hasan

Category

Framework

Sub-category

Laravel 5.6

November 14, 2019

Roles and permissions are an important part of many web applications. In this tutorial we will see how we can implement user roles and permissions system in laravel. We will see it from scratch. We won’t use /laravel-permission package for doing it. But you can use /laravel-permission to create this roles and permissions system in laravel 8.

It is important to add laravel user roles and permissions mechanism in our large scale application to give the permit to user to specific task. We will see from scratch laravel 8 user roles and permissions tutorial. 

If you don’t know how to create laravel 8 roles and permissions, then you are a right place. I will teach you from scratch laravel roles and permissions.But in this tutorial we will do user roles and permissions in laravel using our own custom code. So let’s start how to implement & setup roles and permissions in Laravel.

I updated this tutorial for laravel 8 version. So if you face any error, then you can check git repository. Let’s start laravel 8 user roles and permissions tutorial.

 

Git Repository : User Roles & Access Permission Laravel 

 

roles-permissions-laravel

 

Step 1 : Download Laravel Project

Open up your terminal and create a new Laravel project by typing in the following command

composer create-project --prefer-dist laravel/laravel blog

 

Step 2:  Make Auth

If you are using laravel version 6 then run below command to make auth

composer require laravel/ui --dev
php artisan ui vue --auth
npm install
npm run watch

 

If you are using below laravel version 6 then run below command to make auth

php artisan make:auth

 

Step 3 : Make Model

We need model to make users roles and permissions. So let’s create our model using below command.

php artisan make:model Permission -m
php artisan make:model Role -m

 

As you may know, -m flag will create a migration file for the model. Now you’ll have two new migration files waiting for you to add new fields. 

 

Step 4 : Edit the migration file

 

public function up()
    {
       Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email',191)->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
    });
}

 

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionsTable extends Migration
{
    
    public function up()
    {
        Schema::create('permissions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name'); // edit posts
            $table->string('slug'); //edit-posts
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('permissions');
    }
}

 

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRolesTable extends Migration
{
    public function up()
    {
        Schema::create('roles', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name'); // edit posts
            $table->string('slug'); //edit-posts
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('roles');
    }
}

 

Step 5 : Adding pivot tables

For this first pivot table, we’ll create a new migration file for the table users_permissions. So run below command to create

php artisan make:migration create_users_permissions_table --create=users_permissions

 

For this pivot table between users and permissions, our schema should look like

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersPermissionsTable extends Migration
{
    public function up()
    {
        Schema::create('users_permissions', function (Blueprint $table) {
            $table->unsignedInteger('user_id');
            $table->unsignedInteger('permission_id');

            //FOREIGN KEY CONSTRAINTS
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');
 
            //SETTING THE PRIMARY KEYS
            $table->primary(['user_id','permission_id']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('users_permissions');
    }
}

 

Now let’s create a pivot table for users_roles.

php artisan make:migration create_users_roles_table --create=users_roles

 

The fields inside this table will pretty much the same as in users_permissions table. Our schema for this table will look like:

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersRolesTable extends Migration
{
    public function up()
    {
        Schema::create('users_roles', function (Blueprint $table) {
            $table->unsignedInteger('user_id');
            $table->unsignedInteger('role_id');

         //FOREIGN KEY CONSTRAINTS
           $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
           $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');

         //SETTING THE PRIMARY KEYS
           $table->primary(['user_id','role_id']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('users_roles');
    }
}

 

Under a particular Role, User may have specific Permission

For example, a user may have the permission for post a topic, and an admin may have the permission to edit or delete a topic. In this case, let’s setup a new table for roles_permissions to handle this complexity.

 

php artisan make:migration create_roles_permissions_table --create=roles_permissions

 

The Schema will be like:

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRolesPermissionsTable extends Migration
{
    public function up()
    {
        Schema::create('roles_permissions', function (Blueprint $table) {
             $table->unsignedInteger('role_id');
             $table->unsignedInteger('permission_id');

             //FOREIGN KEY CONSTRAINTS
             $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
             $table->foreign('permission_id')->references('id')->on('permissions')->onDelete('cascade');

             //SETTING THE PRIMARY KEYS
             $table->primary(['role_id','permission_id']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('roles_permissions');
    }
}

 

Now run following command to create migration

php artisan migrate

 

Step 6 : Setting up the relationships

We’ll start by creating the relationships between roles and permissions table. In our Role.php , Permision.php.

App/Role.php

public function permissions() {

   return $this->belongsToMany(Permission::class,'roles_permissions');
       
}

public function users() {

   return $this->belongsToMany(User::class,'users_roles');
       
}

 

App/Permission.php

public function roles() {

   return $this->belongsToMany(Role::class,'roles_permissions');
       
}

public function users() {

   return $this->belongsToMany(User::class,'users_permissions');
       
}

 

Step 7 : Creating a Trait

Inside of our app directory, let’s create a new directory and name it as Permissions and create a new file namely HasPermissionsTrait.php. A nice little trait has been setup to handle user relations. Back in our User model, just import this trait and we’re good to go.

app/User.php

namespace App;

use App\Permissions\HasPermissionsTrait;

class User extends Authenticatable
{
    use HasPermissionsTrait; //Import The Trait
}

 

Now open HasPermissionsTrait.php and paste those following code.

App/Permissions/HasPermissionsTrait.php

namespace App\Permissions;

use App\Permission;
use App\Role;

trait HasPermissionsTrait {

   public function givePermissionsTo(... $permissions) {

    $permissions = $this->getAllPermissions($permissions);
    dd($permissions);
    if($permissions === null) {
      return $this;
    }
    $this->permissions()->saveMany($permissions);
    return $this;
  }

  public function withdrawPermissionsTo( ... $permissions ) {

    $permissions = $this->getAllPermissions($permissions);
    $this->permissions()->detach($permissions);
    return $this;

  }

  public function refreshPermissions( ... $permissions ) {

    $this->permissions()->detach();
    return $this->givePermissionsTo($permissions);
  }

  public function hasPermissionTo($permission) {

    return $this->hasPermissionThroughRole($permission) || $this->hasPermission($permission);
  }

  public function hasPermissionThroughRole($permission) {

    foreach ($permission->roles as $role){
      if($this->roles->contains($role)) {
        return true;
      }
    }
    return false;
  }

  public function hasRole( ... $roles ) {

    foreach ($roles as $role) {
      if ($this->roles->contains('slug', $role)) {
        return true;
      }
    }
    return false;
  }

  public function roles() {

    return $this->belongsToMany(Role::class,'users_roles');

  }
  public function permissions() {

    return $this->belongsToMany(Permission::class,'users_permissions');

  }
  protected function hasPermission($permission) {

    return (bool) $this->permissions->where('slug', $permission->slug)->count();
  }

  protected function getAllPermissions(array $permissions) {

    return Permission::whereIn('slug',$permissions)->get();
    
  }

}

 

Here, we’re iterating through the roles and checking by the slug field, if that specific role exists. You can check or debug this by using:

$user = $request->user(); //getting the current logged in user
dd($user->hasRole('admin','editor')); // and so on

 

Step 8 :  Create CustomProvider

We’ll be utilizing the Laravel’s “can” directive to check if the User have Permission. and instead of using $user->hasPermissionTo().

we’ll use $user->can() To do so, we need to create a new PermissionsServiceProvider for authorization

php artisan make:provider PermissionsServiceProvider

 

Register your service provider and head over to the boot method to provide us a Gateway to use can() method.

namespace App\Providers;

use App\Permission;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;

class PermissionsServiceProvider extends ServiceProvider
{
   
    public function register()
    {
        //
    }

    public function boot()
    {
        try {
            Permission::get()->map(function ($permission) {
                Gate::define($permission->slug, function ($user) use ($permission) {
                    return $user->hasPermissionTo($permission);
                });
            });
        } catch (\Exception $e) {
            report($e);
            return false;
        }

        //Blade directives
        Blade::directive('role', function ($role) {
             return "if(auth()->check() && auth()->user()->hasRole({$role})) :"; //return this if statement inside php tag
        });

        Blade::directive('endrole', function ($role) {
             return "endif;"; //return this endif statement inside php tag
        });

    }
}

 

now we have to register our PermissionsServiceProvider. Open this following file add this in providers array.

config\app.php

 'providers' => [

        App\Providers\PermissionsServiceProvider::class,
    
 ],

 

You can learn more about Laravel’s Gate facade at Laravel’s documentation. You can test it out as:

dd($user->can('permission-slug'));

 

Read also :  Laravel 6 Authorization using Gates

 

Step 9 : Add Dummy Data To Check

For creating roles and permissions tutorial, we need dummy data to check our user access. To create it paste this following code into this followng slug.

Route::get('/roles', 'PermissionController@Permission');

 

App\Http\Controllers\PermissionController.php

namespace App\Http\Controllers;

use App\Permission;
use App\Role;
use App\User;
use Illuminate\Http\Request;

class PermissionController extends Controller
{   

    public function Permission()
    {   
    	$dev_permission = Permission::where('slug','create-tasks')->first();
		$manager_permission = Permission::where('slug', 'edit-users')->first();

		//RoleTableSeeder.php
		$dev_role = new Role();
		$dev_role->slug = 'developer';
		$dev_role->name = 'Front-end Developer';
		$dev_role->save();
		$dev_role->permissions()->attach($dev_permission);

		$manager_role = new Role();
		$manager_role->slug = 'manager';
		$manager_role->name = 'Assistant Manager';
		$manager_role->save();
		$manager_role->permissions()->attach($manager_permission);

		$dev_role = Role::where('slug','developer')->first();
		$manager_role = Role::where('slug', 'manager')->first();

		$createTasks = new Permission();
		$createTasks->slug = 'create-tasks';
		$createTasks->name = 'Create Tasks';
		$createTasks->save();
		$createTasks->roles()->attach($dev_role);

		$editUsers = new Permission();
		$editUsers->slug = 'edit-users';
		$editUsers->name = 'Edit Users';
		$editUsers->save();
		$editUsers->roles()->attach($manager_role);

		$dev_role = Role::where('slug','developer')->first();
		$manager_role = Role::where('slug', 'manager')->first();
		$dev_perm = Permission::where('slug','create-tasks')->first();
		$manager_perm = Permission::where('slug','edit-users')->first();

		$developer = new User();
		$developer->name = 'Mahedi Hasan';
		$developer->email = 'mahedi@gmail.com';
		$developer->password = bcrypt('secrettt');
		$developer->save();
		$developer->roles()->attach($dev_role);
		$developer->permissions()->attach($dev_perm);

		$manager = new User();
		$manager->name = 'Hafizul Islam';
		$manager->email = 'hafiz@gmail.com';
		$manager->password = bcrypt('secrettt');
		$manager->save();
		$manager->roles()->attach($manager_role);
		$manager->permissions()->attach($manager_perm);

		
		return redirect()->back();
    }
}

 

Now goto this url and hit enter on your keyboard. Then you will see some dummy data to those following tables. To test this out in your routes files, we can die and dump on:

$user = $request->user();
dd($user->hasRole('developer')); //will return true, if user has role
dd($user->givePermissionsTo('create-tasks'));// will return permission, if not null
dd($user->can('create-tasks')); // will return true, if user has permission

 

Inside of our view files, we can use it like:

@role('developer')

 Hello developer

@endrole

 

This means only those user can see it whose role are developer. Now you can use many role as you want.

 

Step 10 : Setup the Middleware

 

Read also : How to Create Middleware with Parameters in Laravel 6

 

In order to protect our routes, we can setup the middleware to do so.

php artisan make:middleware RoleMiddleware

 

Add the middleware into your kernel & setup the handle method as follows

App\Http\Middleware\RoleMiddleware.php

namespace App\Http\Middleware;

use Closure;

class RoleMiddleware
{

    public function handle($request, Closure $next, $role, $permission = null)
    {
        if(!$request->user()->hasRole($role)) {

             abort(404);

        }

        if($permission !== null && !$request->user()->can($permission)) {

              abort(404);
        }

        return $next($request);

    }
}

 

Now we have to register this RoleMiddleware. So add this following code to register it.

App\Http\Kernel.php

protected $routeMiddleware = [
    .
    .
    'role' => \App\Http\Middleware\RoleMiddleware::class,
];

 

Right now in our routes, we can do something like this

Route::group(['middleware' => 'role:developer'], function() {

   Route::get('/admin', function() {

      return 'Welcome Admin';
      
   });

});

 

Now you can use your controller like below to give user permission and access.

public function __construct()
{
   $this->middleware('auth'); 
}


public function store(Request $request)
{
    if ($request->user()->can('create-tasks')) {
        //Code goes here
    }
}

public function destroy(Request $request, $id)
{   
    if ($request->user()->can('delete-tasks')) {
      //Code goes here
    }

}

 

Read also : Understanding Constructor and Method Dependency Injection in Laravel

 

Now only those user can access this route whose role is developer. Hope you will understand total procedure. Hope it will help you.

 

Laravel News Links

Snake Eyes’ First Trailer Gives a G.I. Joe Legend a New Beginning

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/ec1af9416e1223be47bac498723dc5b8.jpg

Henry Golding as Snake Eyes in Snake Eyes: G.I. Joe Origins.
Photo: Paramount

Trailer FrenzyA special place to find the newest trailers for movies and TV shows you’re craving.

When you think of Snake Eyes you think of the mask, the swords, the unstoppable ferocity. But how did the popular G.I. Joe character become that guy we’ve seen in comics, cartoons, and toy aisles for decades? We’re about to find out, in a whole new way. The first trailer for Snake Eyes: G.I. Joe Origins is finally here.

The film stars Henry Golding as the titular character, seen here years before he meets up with the Joe crew. Directed by Robert Schwentke, Snake Eyes follows the character as he becomes indoctrinated into the Arashikage clan, learning the ways of the ninja alongside Storm Shadow (Andrew Koji), the group’s heir apparent, and eventually popular Joe characters like The Baroness (Úrsula Corberó), and Scarlett (Samara Weaving) show up too. But this is the Snake Eyes show and, in the first trailer, you get just a taste of what the film has in store.

The film is meant to kick off a whole new G.I. Joe franchise and if you’re curious to know more, check back soon—io9 spoke to Henry Golding all about it. Snake Eyes: G.I. Joe Origins hits theaters on July 23.


For more, make sure you’re following us on our Instagram @io9dotcom.

G/O Media may get a commission

Gizmodo

They really are the enemy of the poeple

https://gunfreezone.net/wp-content/uploads/2016/01/cropped-gfz-ico.png

Tell me why the AP was in a building that Hamas was using to store weapons.

Oh yeah, because the AP were acting as human shields for Hamas, assuming that Israel wouldn’t strike their offices while Hamas hid rockets in the basement.

Everything the Left criticizes people for is projection.

They accuse Israel of war crimes because they were using media offices to protect terrorist weapons caches.