How to Set Process Priorities With nice and renice on Linux

Bash shell on Ubuntu laptop

The nice and renice commands let you fine-tune how the kernel treats your processes by adjusting their priorities. Read this tutorial to learn how to use them in Linux and Unix-like operating systems such as macOS.

It’s All a Matter of Process

Inside your Linux or Unix-like computer, there will be many processes running even before you launch the application you want to use. The majority of these processes are vital elements of Linux itself or supporting processes for your graphical desktop environment. There’s a lot going on behind the scenes. Of course, there are only so many system resources and CPU time to go around. The Linux kernel is the controller for all of these processes.

It is the kernel that has to decide which processes get attention and resources right now, and which ones have to wait. The kernel is continually juggling processes and priorities to ensure that the computer runs as smoothly as it can and that all processes get their appropriate share. Some processes get preferential treatment. They are so important to the general operation of the computer that their needs have to come first ahead of, say, your browser.

The nice Value

One of the criteria used to determine how the kernel treats a process is the nice value. Every process has a nice value. The nice value is an integer in the range of -19 to 20. All standard processes are launched with a nice value of zero.

The trick here is that the higher the nice value, the nicer your process is being to the other processes. In other words, a high nice value tells the kernel that this process is happy to wait. A negative number is the opposite of being nice. The larger the negative nice value, the more selfish the process is. It is trying to get as much CPU time as it can, with no regard for the other processes.

We can use the nice command to set the nice value when a process is launched and we can use renice to adjust the nice value of a running process.

The nice Command

We can use the nice command to adjust the nice value for a program as we launch it. This allows us to increase or decrease the priority given to the process by the kernel, relative to the other processes.

Let’s suppose a programmer has written a program called ackermann . This calculates Ackerman functions. It is CPU and memory intensive. The programmer can launch the program with the following command:

./ackermann

Read the remaining 24 paragraphs

How to Configure the Windows Sandbox

windows sandbox running

Windows 10’s new Sandbox feature lets you safely test programs and files downloaded from the internet by running them in a secure container. It’s easy to use, but its settings are buried in a text-based configuration file.

Windows Sandbox Is Easy to Use If You Have It

This feature is part of Windows 10’s May 2019 Update. Once you’ve installed the update, you’ll also have to be using the Professional, Enterprise, or Education editions of Windows 10. It isn’t available on Windows 10 Home. But, if it is available on your system, you can easily activate the Sandbox feature and then launch it from the Start menu.

RELATED: How to Use Windows 10’s New Sandbox (to Safely Test Apps)

Sandbox will launch, make a copy of your current Windows operating system, remove access to your personal folders, and give you a clean Windows desktop with internet access. Before Microsoft added this configuration file, you couldn’t customize Sandbox at all. If you didn’t want internet access, you normally had to disable it right after launch. If you needed access to files on your host system, you had to copy and paste them into Sandbox. And, if you wanted particular third-party programs installed, you had to install them after launching Sandbox.

Because Windows Sandbox deletes its instance entirely when close it, you had to go through that process of customization every time you launch. On the one hand, that makes for a more secure system. If something goes wrong, close the Sandbox, and everything gets deleted. On the other hand, if you need to make changes regularly, having to do this on every launch gets frustrating quickly.

To alleviate that issue, Microsoft introduced a configuration feature for Windows Sandbox. Using XML files, you can launch Windows Sandbox with set parameters. You can tighten or loosen the sandbox’s restrictions. For example, you can disable the internet connection, configure shared folders with your host copy of Windows 10, or run a script to install applications. The options are a bit limited in the first release of the Sandbox feature, but Microsoft will probably add more in future updates to Windows 10.

How to Configure Windows Sandbox

Windows Sandbox Explorer and Host system Explorer showing a shared file
Your sandboxed copy of Windows 10 can have access to a shared folder on your host operating system.

This guide assumes you have already set up Sandbox for general use. If you haven’t done yet, you’ll need to enable it first with the Windows Features dialog.

To get started, you’ll need Notepad or your favorite text editor—we like Notepad++—and a blank new file. You’ll be creating an XML file for configuration. While familiarity with the XML coding language is helpful, it’s not necessary. Once you have your file in place, you’ll save it with a .wsb extension (think Windows Sand Box.) Double-clicking the file will launch Sandbox with the specified configuration.

Read the remaining 23 paragraphs

Daily Deals: A $24 Google Home Mini, a $260 Nintendo Switch, a $650 Surface Pro 6, and More

The Nintendo Switch, the Google Home MIni, and the Microsoft Surface Pro 6
Nintendo, Google, Microsoft

In the mood for a good deal? The internet’s full of discounts today, ranging from the $170 Philips Hue and Google Home Mini kit to Amazon’s massive board game sale. As always, we’ve picked out a few favorites.

Right now, you can grab a Google Home Mini for just $24. That’s a 50% discount on one of the most popular smarthome devices. If you want to grab a Google Home Mini for each room in your house, check out Massgenie’s $68 Home Mini 3-Pack. Of course, you might be more interested in the $260 Nintendo Switch from Massgenie, or the $650 Surface Pro 6 + Office Home 2019 from Best Buy (the lowest price we’ve seen for the Pro 6).

Laptops and Desktops

Is your old computer falling apart? Maybe it’s time to upgrade at a discount.

  • MacBook Pro 13″ 256GB SSD Newest Model, $1,600 ($200 off) [Best Buy]
  • MacBook Pro 15″ 256GB SSD Newest Model, $2,100 ($300 off) [Best Buy]
  • Microsoft Surface Pro 6 12.3″ + Office Home 2019, $650 ($200 off) [Best Buy]
  • HP Spectre 13.3″ Touch Screen Laptop, $1,050 ($500 off) [Best Buy]
  • HP 15.6″ Touch Screen Laptop, $490 ($110 off) [Best Buy]
  • Lenovo 15.6″ 128 GB Laptop, $220 ($80 off) [Best Buy]

Keyboards, Routers, and Other Computer Accessories

Upgrade your computer storage or authenticate that Windows 10 license you’ve been using.

  • Anker USB C Hub, $40 ($30 off with coupon clip) [Amazon]
  • CORSAIR K68 Mechanical Gaming Keyboard, $80 ($40 off) [Newegg]
  • LG FreeSync 27″ 4K Monitor, $420 ($40 off with coupon code EMCTVY22) [Newegg]
  • Seagate Barracuda 500GB Internal SSD, $60 ($23 off) [Woot]
  • WD Easystore 4TB External USB 3.0 Hard Drive, $80 ($40 off) [Best Buy]
  • QNAP 2-Bay NAS Storage Device, $233 ($30 off with coupon code 42REM53) [Newegg]
  • Respawn-115 Gaming Chair, $115 ($28 off with coupon code OFFICE20) [Rakuten]
  • Windows 10 Pro CD-Key, $17 ($100 off) [SCDKey]

Phones, Tablets, and Mobile Accessories

Upgrade your phone or grab a $200 Apple Watch.

  • iPhone X 64GB Unlocked, $700 ($200 off) [Best Buy]
  • iPhone 8 Plus 64GB Unlocked, $450 ($350 off) [eBay]
  • Nokia 6.1 32GB Phone Unlocked + 3 Months of SiriusXM, $130 ($100 off) [Best Buy]
  • iPad Mini 4 128GB, $300 ($100 off) [Walmart]
  • Apple Watch Series 3, $200 ($80 off) [Walmart]
  • OLEBR Charging Stand for Phone, Watch, and Earbuds, $16 ($12 off with coupon code QNF3NNTZ) [Amazon]

Smart Home Gadgets

Is your home falling behind the times? Today’s the day to buy a Google smarthome products at a discount.

  • Google Home Mini, $24 ($26 off) [Massgenie]
  • Google Home Mini 3-Pack, $68 ($90 off) [Massgenie]
  • Google Home Hub + Google Home Mini, $80 ($70 off with coupon code HOME20) [Rakuten]
  • Nest Thermostat with Google Home Mini, $133 ($120 off) [GeorgiaPower]
  • Philips Hue Starter Kit + 2 Google Home Minis, $170 ($128 off) [Best Buy]
  • Google Home Hub 7″, $74 ($20 off) [Massgenie]
  • Ring Video Doorbell Pro, $170 ($30 off) [Massgenie]

Video Games

Did you spend your Easter weekend in a state of debilitating boredom? Now’s your chance to grab a cheap Switch and some discounted PC games.

  • Nintendo Switch Console, $260 ($40 off) [Massgenie]
  • Nintendo Labo Robot Kit, Variety Kit, and Vehicle Kit Bundle, $68 ($25 off) [Massgenie]
  • Xbox One S 1TB + Extra Red Sport Controller, $230 ($90 off) [Massgenie]
  • Mortal Kombat 11 Xbox One, $50 ($10 off) [Massgenie]
  • PlayStation Plus 12-Month Membership, $40 ($20 off) [Massgenie]
  • Street Fighter V PC, $8 ($11 off) [Steam]
  • Mortal Kombat 11 Premium Edition PC, $75 ($25 off) [Fanatical]
  • Fanatical Mystery Egg, Random PC Games for $1 [Fanatical]
  • Civilization VI Gold Edition PC, $29 ($71 off) [Fanatical]
  • Extra 25% off Warner Bros Games PC [GreenManGaming]
  • LA Noire the VR Case Files PC, $13 ($14 off) [GreenManGaming]
  • Up to 50% off Board Games [Amazon]

Audio Equipment and TVs

Upgrade your audio equipment or invest in a cheap 50″ TV.

  • Bose QuietComfort 32 Wireless Headphones, $260 ($80 off) [Massgenie]
  • Sony Bluetooth Wireless Headphones, $325 ($25 off) [Massgenie]
  • LG XBOOM 550W Speaker System, $200 ($150 off) [eBay]
  • Insignia 50″ HDTV, $200 ($80 off) [Best Buy]

Site-Wide Deals, Gift Cards, and Free Stuff

Grab some free Ms. Marvel comics or take 53% off delicious Lindt chocolates.

  • Up to 53% off Lindt Lindor Chocolates [Woot]
  • Up to 50% off Board Games [Amazon]
  • Up to 60% off Almost Everything [Jos. A. Bank]
  • Extra 25% off Warner Bros Games PC [GreenManGaming]
  • Up to 50% off Select Styles [GAP]
  • Get $10 Amazon Credit for Your First In-Garage Delivery [MyQ]
  • Free Ms. Marvel Comics [Comixology]

Everything Else

Read the remaining 4 paragraphs

The Best Accessories for Your Apple TV

ExhaustedResearch / Shutterstock.com

The Apple TV is a great way of getting big screen entertainment onto your television, and with more streaming services popping up daily, it gets better and better. However, it could always be complemented by some awesome accessories. But which?

Even though the Apple TV stands well on its own two feet, sometimes adding just the right mix of accessories can give it that little bit extra. Apple doesn’t give you much in the box—just the Apple TV, a power cable, the Siri Remote, and a Lightning cable—so you’ll need to pick up an HDMI cable of your own at the very least.

While you’re shopping for something that really should be in the box already, why not treat your Apple TV to a couple more new friends, too? Not all of these accessories are as vital as the aforementioned HDMI cable, but we do think that each and every one of them will enhance your Apple TV-watching experience.

Best HDMI Cable: Atevon High Speed HDMI Cable ($12)

Atevon High Speed HDMI Cable
Atevon

Apple’s decision not to ship the Apple TV with its own HDMI cable seems like a silly cost-saving measure, but fortunately, good HDMI cables are inexpensive. If you want the best picture and sound from your Apple TV, you owe it to yourself to choose a cable that meets the standards required.

The Atevon High Speed HDMI Cable does that, thanks to its 18Gbps throughput and HDMI 2.0 compliance. It’s good for 4K HDR and 60Hz, and it’s HDCP 2.2 capable so you won’t experience any copy protection issues, either. Support for Audio Return (ARC) and 4:4:4 chroma rounds out the features. And it’s not particularly costly for a lengthy 6ft cable, either.

Best Remote Sleeve: Elago Intelli Case (From $6)

Elago Intelli Case
Elago

The Siri Remote is fine but it’s so slender and easy to lose. The solution? Put it in a case that makes the remote much more ergonomic and easier to hold—a case like the Elago Intelli Case.

The Intelli Case is available in a handful of colors, but no matter which color you go for you’ll get a case that makes it easier to hold your Siri Remote and, gloriously, make it less likely to disappear down the back of a sofa cushion.

For an added bonus, the case also has a built-in magnet, so you can attach it to any metal object around the home. You need never lose your Siri Remote again.

Best MFi Game Controller: SteelSeries Nimbus Wireless Gaming Controller ($50)

SteelSeries Nimbus Wireless Gaming Controller
SteelSeries

Apple keeps trying to turn the Apple TV into a game console, with limited success. That’s a shame because there are some great games in the App Store that are perfect for couch play. You’ll need an MFi controller if you want to enjoy them to their fullest, and the SteelSeries Nimbus is the pick of the bunch.

Read the remaining 9 paragraphs

What is Cryptojacking and How Do I Stop It?

You know about malware and ransomware. You know what a computer virus is and probably had one. But do you know about cryptojacking?

Cryptojacking is a bit like ransomware, but stealthy and potentially worth more money to the criminals that use it. While ransomware takes your data hostage until you pay the ransom, cryptojacking uses your computer or phone’s resources to mine cryptocurrencies like Monero or Ethereum.

You may never know that it is there. The only thing you might notice is that your computer isn’t working as well or fast as it used to.

Why is Cryptojacking a Big Deal?

You might be thinking, “If I won’t even notice
cryptojacking, it doesn’t cost me anything, and it doesn’t harm anything, why
should I care?”

The money made from these sorts of criminal operations don’t
just go to hacker’s living in the basement buying expensive booze and fancy
watches. The money could be supporting organized crime or state-sponsored
cyberwar.

According to hackmageddon.com, over 81% of hacking events in 2018 were cybercrime based and almost 3% were classified as cyberwarfare. They’ve got to pay for all that hacking somehow.

How Does Cryptojacking Malware Get on a Computer?

Cryptojackers invade your computer in several ways. Sometimes you can get it from opening an infected attachment in an e-mail or clicking on a phishing link on a website. Or it might show up inside of a browser attachment that you installed for a legitimate reason.

That’s like the traditional way that viruses were spread. If the cryptojacker gets on your computer this way, it will run in the background on your computer all the time, quietly digging up cryptocoins.

The drive-by cryptojacking is more devious. It will hide on
a website or in an ad just waiting to show up on your computer. Then it will
start mining with your computer if you are on that website or that ad is
showing.  The cryptojacker is unloaded
when you leave the site, leaving no trace that it was ever there.

Do I Have a Cryptojacker on My Computer or Phone?

It used to be obvious. Your CPU usage would spike to near 100% and your computer would crawl when you only had maybe one program open or just browsing a website.

Hackers using cryptojackers are getting wiser though and it
will get harder and harder to stop. When they first started, they would consume
as much of your CPU power as they could. This alarmed people to its existence
though. Now, they’re using less resources on any single computer, but trying to
hit as many computers as possible.

How Do I Stop Cryptojacking?

Keep practicing good computer security and use your smartphone’s security features. Make sure you’re using an antivirus app, keep your operating system up to date, and allow your browser to update freely.

Most major security apps have cryptojacker detection and protection now. Look at getting antivirus and security apps like ESET, Avast!, or Norton.

If you want to make sure a drive-by cryptojacker isn’t running in your browser, you can try extensions for Chrome like Coin-Hive Blocker, No-Coin, or minerBlock. Try No-miner or minerBlock for Firefox. All major browsers are continuing to bake-in security features with each update, so let those updates happen.

Is There a Good Use for Cryptojacking?

There might be. It could be used as an alternate revenue
source to support web sites and apps. Some sites will ask you if they may use a
javascript-based cryptominer on your computer while you’re on their site, some
will not.

The Pirate Bay, Salon.com, UFC.com, and others have tried
this in the past. People did not respond well. As a method of revenue
generating, it appears to have small gains for the high cost of user
alienation.

The Future of Cryptojacking

Is cryptojacking going to be an ongoing threat? If cryptocurrencies
continue to have real world value, it will. But how much of a threat will it be
to you?

Hackers are getting wiser. They’re realizing that stealing
pennies from millions is much harder to stop than stealing thousands from a
few. Cryptojacking will be a minor nuisance to you and your computer use. The
social cost from it being used to fund more evil schemes may continue to grow.

Do what you can to stop it. Keep your antivirus up to date
and continue to update your operating system and browser. If most of us can do
that, we’ll keep cryptojacking a minor threat.