How to Set a Password Expiration Date in Windows 10

To maintain your cybersecurity, it’s a good idea to change your computer’s password every once in a while. Windows 10 makes this easier because you can set a password expiration date.

The steps to do this vary, depending on whether you use a local or Microsoft account to log in to your Windows PC, so we’ll look at the process for both.

Set a Password Expiration Date for Your Microsoft Account

On Windows 10, you might have noticed that Microsoft wants you to use a linked Microsoft account to sign in instead of a local account.

You can set a password expiration date for your Microsoft account online. You will then be prompted to reset your password every 72 days. You have to set a new password before you can enable (or disable) this setting.

To do that, head to the Microsoft account security area and sign in. In the “Change Password” section at the top, click “Change.”

Click "Change" in the "Change Password" section.

You’re prompted to provide your existing password, as well as a new one (you can’t reuse your existing one, so type a new, secure password instead).

RELATED: How to Create a Strong Password (and Remember It)

Because you want to set a password expiration date, click the box next to “Make Me Change My Password Every 72 Days” to enable this feature.

Click “Save” to apply your new password and expiration date.

Type your current password, type a new password, click the checkbox next to "Make Me Change My Password Every 72 Days," and then click "Save."

If the change was successful, you’re redirected back to the Microsoft account security page. Sign in and out of Windows to use your new password.

The password for your Microsoft account will expire after 72 days, and you’ll be prompted to change it after your next sign in.

Set a Password Expiration Date for Your Local Account

If you use a local account on your PC rather than a Microsoft one, you can still set an expiration date for your password.

Enable Password Expiration

First, you have to disable a setting that prevents your password from ever expiring.

To do this, press Windows+R keys to open the “Run” launch box. Type netplwiz , and then click “OK” to open your user account settings.

Type "netplwiz," and then click "OK."

In the “Advanced” tab, click “Advanced” to open the “Advanced User Management” tool.

Click "Advanced," and then click "Advanced."

Here, click “Users” in the menu on the left, and then right-click your user account. Click “Properties” to enter the advanced user settings for your local user account.

Click "Users, and then click "Properties."

In the “Properties” menu, uncheck the “Password Never Expires” option, and then click “OK.”

Uncheck the "Password Never Expires" option, and then click "OK."

Set the Maximum Password Age via Local Group Policy Editor

You now need to set the maximum password age for your password. Unlike a Microsoft account, you can set the password for your local account to expire at any time you want.

The default on Windows 10 is 42 days. If you want to leave it this length, you can continue using your PC as normal. When it’s time to reset your password, you’ll be prompted to change it.

If your machine runs Windows 10 Pro, Education, or Enterprise, press Windows+R to open the “Run” launch box. Here, type gpedit.msc, and then click “OK” to open the Local Group Policy Editor.

(If your computer runs Windows 10 Home, follow the instructions in the next section instead.)

Type "gpedit.msc," and then click "OK."

In the menu on the left, navigate to Computer Configuration>Windows Settings>Security Settings>Account Policies>Password Policy, and double-click “Maximum Password Age.”

Double-click "Maximum Password Age."

Change the value from “42” to your preferred length of days, and then click “OK” to save the setting.

Set the maximum password age, and then click "OK."

The expiration date for local accounts on your PC is now set to your preferred length. After this period has elapsed, Windows will prompt you to reset your password.

Set the Maximum Password Age via Windows PowerShell

If your computer runs Windows 10 Home, you have to use the PowerShell or command prompt to set the maximum password age. You can also use this as an alternative to the Local Group Policy Editor process on Windows 10 Pro, Enterprise, and Education.

To get started, right-click the Start menu, and then click “Windows PowerShell (Admin)” or “Command Prompt (Admin),” depending on your version of Windows.

Click "Windows PowerShell (Admin)."

In the PowerShell window, type net accounts to find the existing maximum password age for your accounts.

If you want to change the figure from the default 42 days, type net accounts /maxpwage:00 and replace “00” with the length of time (in days) you want to use.

A password expiration age changed in Windows PowerShell.

The maximum password age you chose is applied to all local accounts on your PC.

[mai mult...]

How HTTP/3 and QUIC Will Speed Up Your Web Browsing

A global map featuring network-style connections focused on North America.
HTTP/3 is becoming more widespread. Cloudflare is now supporting HTTP/3, which is already part of Chrome Canary and will be added to Firefox Nightly soon. This new standard will make your web browsing faster and more secure.

Here’s the short explanation: Web browsers, web servers, and other critical pieces of web infrastructure are getting support for a new standard named HTTP/3, which uses QUIC. This is a more modern version of HTTP, which web browsers use to communicate with web servers and send data back and forth.

HTTP/3 has been rewritten to send data more quickly with better resistance to errors. It has built-in encryption, too. That means more speed and security. It’s not just data transfer speed, either: HTTP/3 should reduce latency as well, meaning websites will start loading more quickly after you click or tap a link.

The average person never needs to know about HTTP/3 and QUIC. People who run websites and develop web software have some work to do, but it’s all going to be transparent to the average person. One day, your web browser and the websites you use will start communicating over HTTP/3 instead, and the web will get better and better as more sites opt to use HTTP/3.

From HTTP/1 to HTTP/2

HTTP shown in Google Chrome's address bar.

The original version of HTTP uses the Transmission Control Protocol (TCP.) First described in 1974, TCP was never designed with the speed and responsiveness of today’s web in mind.  Google tried to fix many of TCP’s problems with a new protocol named SPDY, which informed HTTP/2.

HTTP/2 arrived in most major browsers by the end of 2015, adding features like data compression and pipelining of multiple requests over a single TCP connection to speed things up.

As of September 2019, W3Techs estimates that HTTP/2 is now being used by 41% of websites.

What Are HTTP/3 and QUIC?

HTTP/3 is more of a rewrite of the HTTP protocol. Instead of using TCP, HTTP/3 uses Google’s QUIC protocol. HTTP/3 was initially known as HTTP-over-QUIC. HTTP/3 also includes TLS 1.3 encryption, so there’s no need for a separate HTTPS that bolts security onto the protocol, as there is today.

QUIC originally stood for “Quick UDP Internet Connections.” This protocol is designed to be faster with lower latency than TCP. QUIC offers less overhead when establishing a connection and quicker data transfers over the connection. Unlike TCP, an error like a piece of data that gets lost along the way won’t cause the connection to stop and wait for the problem to be fixed. QUIC will keep transferring other data while the issue is being resolved.

In fact, QUIC was added to Google Chrome back in 2013. Chrome uses it when communicating with Google services and some other websites like Facebook, and it’s available to Android applications. But QUIC isn’t a standard integrated into other web browsers. With HTTP/3 the technology is coming in a standard way to other browsers, too.

In summary: HTTP/3 is a newer, better, faster protocol. It’s a more modern solution that should deliver improved security and speed to the web.

They’re Coming to a Web Browser Near You

HTTP/3 was added to the bleeding-edge Canary version of Google Chrome in September 2019, hidden behind a command-line flag. Launching Chrome Canary with the --enable-quic --quic-version=h3-23  command-line arguments will enable HTTP/3.

Mozilla announced it’s working on adding HTTP/3 to an experimental version of Firefox Nightly this fall. The new Chromium-based version of Microsoft Edge will inherit Google’s HTTP/3 work for Chrome, as will other Chromium-based browsers like Opera. We would expect Apple to jump on board with HTTP/3 in Safari at some point, too.

Cloudflare has even announced that it’s making HTTP/3 adoption easier for sites that use its content delivery network. Cloudflare customers will soon be able just to flip a switch and enable “HTTP/3 (with QUIC)” for their sites. That should hopefully help boost HTTP/3 adoption by making it easier for websites to enable once browsers get HTTP/3 stable and enabled for everyone.

HTTP/3 is coming to other software, too—for example, the Nginx web server is working on HTTP/3 support for Nginx version 1.17.

We’re in the early stages of implementation. Cloudflare says it will “continue working alongside other organizations, including Google and Mozilla, to finalize the QUIC and HTTP/3 standards and encourage broad adoption.” In other words, not only is the software not final yet—the standard itself may see some changes. There’s a lot of work to be done before this is enabled by default in modern browsers and automatically used.

More Technical Details

Want to know more? Check out Cloudflare’s in-depth look at HTTP/3 or dig through the draft HTTP/3 standard for the real tech specs.

[mai mult...]

How DNS Over HTTPS (DoH) Will Boost Privacy Online

Electric blue lock icon in a circle.
Anci Valiart/Shutterstock.com

Companies like Microsoft, Google, and Mozilla are pushing forward with DNS over HTTPS (DoH). This technology will encrypt DNS lookups, improving online privacy and security. But it’s controversial: Comcast is lobbying against it. Here’s what you need to know.

What Is DNS Over HTTPS?

The web has been pushing towards encrypting everything by default. At this point, most of the websites you access are likely using HTTPS encryption. Modern web browsers like Chrome now mark any sites using standard HTTP as “not secure.” HTTP/3, the new version of the HTTP protocol, has encryption baked in.

This encryption ensures that no one can tamper with a web page while you’re viewing it or snoop on what you’re doing online. For example, if you connect to Wikipedia.org, the network operator—whether that’s a business’s public Wi-Fi hotspot or your ISP—can only see that you’re connected to wikipedia.org. They can’t see which article you’re reading, and they can’t modify a Wikipedia article in transit.

But, in the push towards encryption, DNS has been left behind. The domain name system makes it possible to connect to websites through their domain names rather than by using numerical IP addresses. You type a domain name like google.com, and your system will contact its configured DNS server to get the IP address associated with google.com. It will then connect to that IP address.

Performing a DNS lookup with the nslookup command on Windows 10.

Until now, these DNS lookups haven’t been encrypted. When you connect to a website, your system fires off a request saying you’re looking for the IP address associated with that domain. Anyone in between—possibly your ISP, but perhaps also just a public Wi-Fi hotspot logging traffic—could log which domains you’re connecting to.

DNS over HTTPS closes this oversight. When DNS over HTTPS, your system will make a secure, encrypted connection to your DNS server and transfer the request and response over that connection. Anyone in between won’t be able to see which domain names you’re looking up or tamper with the response.

Today, most people use the DNS servers provided by their internet service provider. However, there are many third-party DNS servers like Cloudflare’s 1.1.1.1Google Public DNS, and OpenDNS. These third-party providers are among the first to enable server-side support for DNS over HTTPS. To use DNS over HTTPS, you’ll need both a DNS server and a client (like a web browser or operating system) that supports it.

Google and Mozilla are already testing DNS over HTTPS in Google Chrome and Mozilla Firefox. On November 17, 2019, Microsoft announced it would be adopting DNS over HTTPS in the Windows networking stack. This will ensure every application on Windows will get the benefits of DNS over HTTPS without being explicitly coded to support it.

Google says it will enable DoH by default for 1% of users starting in Chrome 79, expected for release on December 10, 2019. When that version is released, you’ll also be able to go to chrome://flags/#dns-over-https  to enable it.

Enabling secure DNS lookups via a Google Chrome flag.

Mozilla says it will enable DNS over HTTPS for everyone in 2019. In the current stable version of Firefox today, you can head to menu > Options > General, scroll down, and click “Settings” under Network Settings to find this option. Activate “Enable DNS over HTTPS.”

Enabling DNS over HTTPS in Mozilla Firefox's network settings.

Apple hasn’t yet commented on plans for DNS over HTTPS, but we expected the company to follow and implement support in iOS and macOS along with the rest of the industry.y

It’s not enabled by default for everyone yet, but DNS over HTTPS should make using the internet more private and secure once it’s finished.

Why Is Comcast Lobbying Against It?

This doesn’t sound very controversial so far, but it is. Comcast has apparently been lobbying congress to stop Google from rolling out DNS over HTTPS.

In a presentation presented to lawmakers and obtained by Motherboard, Comcast argues that Google is pursuing “unilateral plans” (“along with Mozilla”) to activate DoH and “[centralize] a majority of worldwide DNS data with Google,” which would “mark a fundamental shift in the decentralized nature of the Internet’s architecture.”

Much of this is, quite frankly, false. Mozilla’s Marshell Erwin told Motherboard that “the slides overall are extremely misleading and inaccurate.” In a blog post, Chrome product manager Kenji Beaheux points out that Google Chrome will not be forcing anyone to change their DNS provider. Chrome will obey the system’s current DNS provider—if it doesn’t support DNS over HTTPS, Chrome won’t use DNS over HTTPS.

And, in the time since, Microsoft has announced plans to support DoH at the Windows operating system level. With Microsoft, Google, and Mozilla embracing it, this is hardly a “unilateral” scheme from Google.

Some have theorized that Comcast doesn’t like DoH because it can no longer collect DNS lookup data. However, Comcast has promised it isn’t spying on your DNS lookups. The company insists it supports encrypted DNS but wants a “collaborative, industry-wide solution” rather than “unilateral action.” Comcast’s messaging is messy—its arguments against DNS over HTTPS were clearly meant for lawmakers’ eyes, not the public’s.

How Will DNS Over HTTPS Work?

With Comcast’s strange objections aside, let’s take a look at how DNS over HTTPS will actually work. When DoH support goes live in Chrome, Chrome will use DNS over HTTPS only if the system’s current DNS server supports it.

In other words, if you have Comcast as an internet service provider and Comcast refuses to support DoH, Chrome will work as it does today without encrypting your DNS lookups. If you have another DNS server configured—perhaps you’ve chosen Cloudflare DNS, Google Public DNS, or OpenDNS, or maybe your ISP’s DNS servers do support DoH—Chrome will use encryption to talk to your current DNS server, automatically “upgrading” the connection. Users might choose to switch away from DNS providers that don’t offer DoH—like Comcast’s—but Chrome won’t automatically do this.

This also means that any content-filtering solutions that use DNS won’t be interrupted. If you use OpenDNS and configure certain websites to be blocked, Chrome will leave OpenDNS as your default DNS server, and nothing will change.

Firefox works a bit differently. Mozilla has chosen to go with Cloudflare as Firefox’s encrypted DNS provider in the US. Even if you have a different DNS server configured, Firefox will send your DNS requests to Cloudflare’s 1.1.1.1 DNS server. Firefox will let you disable this or use a custom encrypted DNS provider, but Cloudflare will be the default.

Firefox encrypted DNS lookups by Cloudflare alert.
Mozilla

Microsoft says DNS over HTTPS in Windows 10 will work similarly to Chrome. Windows 10 will obey your default DNS server and only enable DoH if your DNS server of choice supports it. However, Microsoft says it will guide “privacy-minded Windows users and administrators” to DNS server settings.

Windows 10 might encourage you to switch DNS servers to one that’s secured with DoH, but Microsoft says Windows won’t make the switch for you.

[mai mult...]

How to Use OneDrive’s “Personal Vault” to Secure Your Files

Microsoft’s OneDrive cloud storage service now includes a “Personal Vault” for your sensitive files. These files are encrypted and protected with additional two-factor verification, even when they’re synced to your Windows 10 PC.

OneDrive’s Personal Vault became available worldwide on September 30, 2019. It works on Windows 10, Android, iPhone, iPad, and the web.

What Is the “Personal Vault” in OneDrive?

The Personal Vault is an extra-secure storage area for your files in OneDrive. For example, if you’re going to store sensitive financial documents or copies of your passport in OneDrive, you’ll probably want to put them in your Personal Vault to extra security.

Your Personal Vault requires extra authentication before you can access any files inside it. Every time you access them, you’ll have to provide a two-factor authentication code, a PIN, fingerprint authentication, or facial authentication. On Windows 10, you can use Windows Hello to authenticate. They’ll automatically lock after twenty minutes of inactivity, forcing you to authenticate again before accessing them. If you access them via the OneDrive website, they won’t be cached by your browser.

The Personal Vault encrypts the files inside it. On Windows 10, the Personal Vault stores these files on a BitLocker-encrypted area of your hard drive. This works even if you have Windows 10 Home and aren’t using BitLocker for anything else. Microsoft says your files are also encrypted at rest on Microsoft’s servers.

Files stored in the Personal Vault can’t be shared with anyone. Even if you share a file and then move it into the Personal Vault, sharing will be disabled for that file. This gives you peace of mind: You can’t accidentally share a sensitive file as long as it’s stored in here.

With the OneDrive app on your phone, you can scan documents and take photos directly from the Personal Vault, storing them in the secure location without placing them elsewhere on your phone first.

Other big cloud storage services—Dropbox, Google Drive, and Apple iCloud Drive—don’t yet offer a similar feature.

Works Best With Office 365

Before you get started, it’s worth noting that the free version of OneDrive and the 100GB plan restrict you to a maximum of three files in your Personal Vault. You could add multiple files to an archive (like a ZIP file) and store the archive as a single file in your vault, but you are limited to three files.

With a paid Office 365 Personal or Office 365 Home plan, you get the ability to store as many files as you want in your Personal Vault—up to your OneDrive storage limit, which will likely be 1TB or more.

At $10 per month for Office 365 Home, a plan six people can share, Microsoft’s Office 365 plans are a great deal if you want Microsoft Office—or just some inexpensive cloud storage. $10 per month gives up to six people each 1TB of storage and access to Office 365 apps.

What Platforms Does It Support?

The Personal Vault works in OneDrive on Windows 10, Android, iPhone, iPad, and on the web at onedrive.live.com.

It isn’t available in OneDrive for macOS, Windows 7, Windows 8.1, Windows Phone, Xbox, HoloLens, Surface Hub, or Windows 10 S. Consult Microsoft’s OneDrive feature comparison for more details.

The Personal Vault is also only available in OneDrive Personal. It’s not available in OneDrive Business.

How to Use the Personal Vault

To use the Personal Vault, just open your OneDrive folder and click or tap the “Personal Vault” folder. You can do this on a Windows 10 PC via the website or by using a smartphone app—whatever you prefer.

For example, on Windows 10, you can just open File Explorer, click “OneDrive” in the sidebar, and double-click “Personal Vault.”

The first time you open it, OneDrive will require User Account Control authorization to enable the Personal Vault—likely because of the BitLocker features it uses. Click through the short setup wizard to set things up.

Place whatever files you want to secure into your Personal Vault.

Your vault will stay unlocked until you’re inactive for twenty minutes. You can also lock it immediately by right-clicking inside the Personal Vault folder and selecting “Lock Personal Vault.”

When you try to access the Personal Vault while it’s locked, you’ll be prompted for additional authentication.

For example, if you’ve set up two-factor authentication for your Microsoft account, you’ll be prompted for an authentication code. It works just as it would if you were signing into your Microsoft account from a new device for the first time.

You’ll find the Personal Vault in the main folder of your OneDrive account on every supported platform, from Windows 10 to the website to smartphone apps. Just open it to unlock it and access the files inside.

Should You Use OneDrive’s Personal Vault?

The Personal Vault is a welcome feature that’s available on most modern platforms—Mac excluded. If it supports the devices you use, it’s a more secure way to store sensitive files than just dumping them in your regular OneDrive folder.

It’s also nice that the Personal Vault encrypts files on your Windows 10 system, too. We think Microsoft should offer full-disk BitLocker encryption to everyone on Windows 10, but this is better than nothing.

If you’re already squeamish about storing sensitive files in OneDrive, you may want to pause before dumping them all in the Personal Vault. Another solution—like storing confidential documents alongside your website login details in your password manager’s vault—may be more secure. They’ll be encrypted with your password manager’s master password.

For example, Microsoft’s documentation notes that “Personal Vault on Windows 10 doesn’t protect the names and hashes of the files in your Personal Vault when the Vault is locked.” If you want maximum privacy for your files, you’re probably better off using another solution. Microsoft does promise it’s “committed to extending protection to these attributes in a future update,” but this is the kind of problem you won’t have with more mature file-encryption solutions.

Overall, however, the Personal vault is a great feature. More cloud storage services should offer additional protection for sensitive files like this. It’s just a shame people who aren’t paying for Office 365 are limited to three files.

[mai mult...]

How to Mute Mail Threads on iPhone, iPad, and Mac

iOS 13 Mail app Share Sheet with Mute button

There’s no way to leave email conversations if someone accidentally hits the “Reply All” button. What you can do is mute the conversation on your end to disable notifications. Here’s how to mute threads on your iPhone, iPad, or Mac using the Mail app.

How to Mute Mail Threads on iPhone and iPad

To mute a thread on an iPhone or iPad, you need to be running iOS 13 or iPadOS 13 and higher.

There are two ways to do this. The first works without even opening the email. You can also mute a message from the reply menu.

If you’re in the Inbox, swipe left on an email and select the “More” option.

Swipe left and tap on the More button

From the popup, tap on the “Mute” button.

Tap on the Mute button

The email will now have a small “Bell” icon to tell you that the thread has been muted.

Check the Mute symbol on muted threads

If the email is already open, tap on the “Reply” button from the bottom-right corner.

Tap on the Reply button

Then, scroll down a bit until you see the “Mute” option. Tap on the button to mute the thread.

Tap on the Mute button from the Share sheet

If you want to unmute the thread later on, follow the same process, and tap on the “Unmute” option.

Tap on the Unmute button from the Share sheet

How to Mute Mail Threads on Mac

Open the Mail app on your Mac that’s running macOS Catalina. Next, select an email or multiple emails. From the top toolbar, locate the “Bell” icon and click on it.

Click on Mute button to mute the thread

The icon will change to a bell icon with a dash across it. This means that the conversation has been muted.

You can also mute a conversation by right-clicking on an email from the list view and selecting the “Mute” option.

Click on Mute from the menu

To unmute a thread, click on the “mute” button from the toolbar again.

Click on the Unmute button to unmute the thread

This is just one of the new features in iOS 13. Take a look at our best new features list for iOS 13, and once you update, make sure to try the new Dark mode.

[mai mult...]

How to Install a Smart Lock

A Schlage Encode satin style smartlock installed on a green door.

When you’re setting up a new smarthome, one of the easiest gadgets you can add to your arsenal is a smart lock. It’s not much harder than changing a standard lock on your home. Here’s what to do.

The Basics

For this guide, we’re installing a Schlage Encode smart lock. Even if you have a different smart lock from another brand, most (if not all) the steps will be the same. You’ll generally find three main components in a smart lock: an exterior piece that may have a keypad, lock for a key, or both, an interior piece that holds the batteries and circuitry, and the bolt that secures your door. The tricky part is connecting them all.

As a quick tip: You may have seen advice to test your smart lock before installing it by inserting the batteries to turn it on. Then you can be sure the lock powers up before it’s in the door.

That seems like sound advice, but the first time a smart lock turns on, it tests if the door is left facing or right facing and adjusts the bolt mechanism to match. Without an actual door to test against, it may guess wrong, and your install will fail to work correctly. If you want to perform this test, you should check the instructions for a factory reset process. After running the test, factory-reset the lock.

Removing the Old Lock

Before you can install your new smart lock, you need to take the old one out. Standard locks are easy to remove, so long as you have access to the interior of your home anyway. Start with finding the two screws on the interior thumb turn piece. Then unscrew them.

A standard thumbturn on a lock,with two red arrows pointing to two screws.

Open the door (if you haven’t already) and go to the front side of the lock (where you insert your key). The key assembly should be loose, pull that off.

The key assembly of a lock, slightly tilted out of the door.

Now on the side of your door, look for the bolt that slides out when you lock it. Unscrew the two screws and pull the bolt assembly out.

Installing Your Smart Lock

Now find the bolt for your new lock, and look for the top mark:

Slide the bolt into your door frame, and make sure to keep the “top” face up. Look in the door hole to see if the bolt interior centers with your door well. You’ll notice three holes in the assembly—those should be as close to the center as possible. If they aren’t, you can either lengthen or shorten the bolt (depending on the current length) to center it. Usually, you do that by twisting the bolt mechanism, but you may also have to use a screwdriver instead. Then, install the two screws to lock the bolt in place.

A lock cavity with a bolt in it, and lines crossing through the vertical and horizontal center.

Next, find the outdoor assembly piece to the lock. Pay attention to the long thing bar and the electronic wire.

A Schlage Encode assembly with a red box around a wire assembly and bar.

Insert the assembly to your door. As you do so, thread the thing bar through the middle hole of the bolt assembly. It should be the only hole the bar fits through. Carefully side the wiring beneath the bolt hardware. You want to make sure hardware won’t pitch the wiring.

The door lock hole interior, showing the wiring running beneath the bolt assembly.

If your smart lock assembly seems prone to falling out of the door at this point, we’ll be securing it in later steps. This is particularly common with tall keypads. You might consider using double-sided sticky tape to hold it in place until you can fully secure the lock.

Some smart locks include a steel or plastic plate that goes against the interior of the door. Grab that, and run the wire from the front assembly through it. Then find the two long screws and run them through the two other holds the bolt assembly to the front assembly. This will lock everything in place.

With some locks, you’ll attach the interior assembly with the two long screws without the metal plate.

A metal plate with two screws and a power wire sticking through it.

Connect the wire from the outdoor piece to the interior assembly. Usually, the interior piece contains channels to run the wiring through and prevent pinching.

An interior lock piece wired to the rest of the lock.

Once you have the wire connected, place the interior lock on the door, and secure it with screws.

A close up of a Schlage Encode lock, showing stabilizing screws.

Now all that’s left to do is insert your batteries. The first time your lock turns on, it will test which way the door faces. It’s normal for it to lock and unlock several times as part of that process. Once it finishes, you can start pairing your app and setting up PINs if you have a keypad.

[mai mult...]

How to Create Aliases and Shell Functions on Linux

A terminal window on a Linux laptop
Fatmawati Achmad Zaenuri/Shutterstock.com

Create your own Linux commands using aliases and Bash shell functions. Tame repetitive tasks, truncate long-winded processes, and configure standard commands with the options you always use and struggle to remember.

Aliases and shell scripts are powerful techniques in Linux and Unix-like operating systems that allow you to hone your command line experience to be just what you want. You can define your own commands suited to your specific needs, and to ease the burden of repetitive tasks.

Aliases and shell scripts do the same sort of job. They allow you to define—and name—a set of Bash shell functionality that is then callable by the name you’ve given to it. Typing the name is easier and more convenient than having to type out all of the steps or commands each time you want to use them.

The difference between an alias and a script is one of complexity and scale. Scripts are better at holding longer and more elaborate chunks of code. Aliases are perfect for holding shorter, more succinct, sets of commands.

Predefined Aliases

Some aliases are predefined for you. To see the list of aliases that are defined in your system, use the alias command with no parameters:

alias

alias in a terminal window

These are the aliases that are defined on the Ubuntu test machine this article was researched on. If I’d defined any custom aliases, these would show up in this list too.

At the top of the listing, there’s a complicated-looking alias called alert. We’ll come to that in a moment. There’s a bunch of different aliases for the ls command, and there’s a group of aliases that provide color output to the grep family of commands. For example, with these aliases defined, whenever you type:

grep

The system will interpret it as:

grep --color=auto

This shows an important point with aliases. They can have the same name as existing commands.  They can even contain the original command within themselves.

Here is the definition of the grep alias.

alias grep='grep --color=auto'
  • The alias command is used to define an alias.
  • The name of the alias is given next. In this example it is grep.
  • The equals sign connects the name of the alias to the body of the alias. For all but very simple aliases, the body of the alias is enclosed within single quote marks '.
  • The body of the alias is the section which is executed when the alias is used on the command line.

The body of this alias simply calls the grep command with the --color=auto option.

The alert Alias

As a quick aside, and so that you know what it does, the alert alias is used to let you know when a command has finished. It also indicates whether the command completed successfully or not. It provides a graphical system alert at the top of the screen.

Here’s a simple example. The sleep command will sleep for five seconds., The alert alias will then be called. The alias checks the response from the previous command. It extracts the last command from the history file. It determines whether the command completed successfully or not. It then presents the results in a system alert.

If the command completed as expected, the icon in the system alert is a small terminal window. If the command returned an error code, the icon in the system alert is a red error icon.

sleep 5; alert

sleep 5; alert in a terminal window

After five seconds, we see this system alert:

System alert for the sleep command

The icon is a small terminal window, meaning everything went well. Let’s try that again with a command that we know will fail:

DoomedToFail; alert

DoomedToFail; alert in a terminal window

Our system alert now has an error icon.

System alert for a failed command with error icon

Defining a Trivial Alias

As we’ve seen, to define an alias, we use the alias command.

We’re going to create a pseudonym for the clear command. Our alias will be called cls and it will call the clear command.

Our alias definition is so trivial that it doesn’t warrant being wrapped in single quote marks. If the body of the alias is any more complex than this, or if it contains spaces, wrap it in single quotes. We’ll define the alias, use ls to put some output in the terminal window and then use our new alias cls to clear the screen.

alias cls=clear
ls -l
cls

alias cls=clear in a terminal window

The screen is cleared. Success, albeit shortlived. The alias will survive only as long as this terminal window remains open. Once the window is closed, the alias will vanish.

So how do we make our aliases permanent?

The .bashrc File and Aliases

You might be wondering where the pre-packaged aliases are defined. it is in the “.bashrc” file in your home folder. This file is read, and the commands inside it executed whenever you start an interactive shell. That is, when you open a terminal window.

Type the following command in your home folder to see the contents of the “.bashrc” file with syntax highlighting.

gedit .bashrc

gedit .bashrc in a terminal window

This will launch the gedit editor with the “.bashrc” file loaded into it.

gedit with .bashrc loaded int it

The highlighted areas show two areas where aliases are defined.

Scrolling through the document will reveal two other sections related to aliases:

gedit with .bashrc loaded into it, and the .bash_aliases section highlighted

The first of these is the definition of the alert alias. The second is an if statement. It translates to, “if the file “.bash_aliases” exists, read it in.”

If you only have a few aliases that you wish to define, you might put them in your “.bashrc” file. Tuck them in below the section containing the ls aliases.

If you are going to create a lot of aliases, or you just like the idea of having your aliases encapsulated within their own file, you can define them in your “.bash_aliases” file. One advantage of creating them in your “.bash_aliases” file is you can’t accidentally change any of the settings in the “.bashrc” file. Another advantage is your aliases are easily copied to new systems because they are totally divorced from the “.bashrc” file.

Storing Aliases in the .bash_aliases File

The “.bash_aliases” file will not exist until you create it. You can create the file with this command:

touch .bash_aliases

touch .bash_aliases in a terminal window

Let’s edit the file and add a few aliases to it. This command will open the “.bash_aliases” file in the gedit editor.

gedit .bash_aliases

gedit editor with .bash_aliases loaded into it

We’ve added three aliases. The first is our cls alias which we used earlier. The next is called h. and is a shorthand way of calling the history command.

The third alias is called ftc. This stands for “file type count.”

This alias is more involved, so it is wrapped in single quote marks. It uses a chain of commands linked together by pipes. It produces a sorted list of the different file extensions and directory names, with a count for each list entry.

RELATED: How to Use Pipes on Linux

When we have saved the “.bash_aliases” file, we might expect our aliases to be live and accessible. That’s not the case. The file has to be read in by the Bash shell before the alias definitions are live. This is done whenever an interactive shell is opened.

We can also use the Bash shell built-in . to read and execute the commands in a file. Because our “.bash_alias” file is read in when “.bashrc” is processed, we ought to perform our test by calling “.bashrc”. That way we can check that the “.bash_alias” file is called from “.bashrc” and that our aliases are alive and well.

The commands we’ve used are:

gedit .bash_alias

To edit the “.bash_alias” file.

. .bashrc

This will read in and execute the commands within “.bashrc”, which will call “.bash_alias”.

ftc

This will call the ftc alias.

. .bashrc in a terminal window

Our alias responds which means Bash has read in both “.bashrc” and “.bash_aliases”, and our new aliases are now live.

You can now go ahead and add new aliases to the “.bash_aliases” file as they occur to you. If you find yourself doing things more than once or twice, consider making an alias for it.

Removing Aliases

There is a command to remove aliases so that BAsh doesn’t recognize them nor respond to them. Refreshingly forthright, the command is called unalias.

To use it, give the name of the alias you wish to have Bash forget. To make Bash forget our ftc alias, use unalias like this:

unalias ftc

You can use unalias to remove aliases you have defined and any of the predefined aliases.

To remove all of the aliases from your system, use the -a (all) option:

unalias -a

Bash’s loss of memory will not be permanent, though. The next time you open a terminal window, the “forgotten” aliases will be back. To truly wipe them out you need to remove them from your “.bashrc” and “.bash_alias” files.

If you think you’d ever like to have them back, don’t delete them from your “.bashrc” file. Instead, comment them out by adding a hash # to the start of each alias line. To make your “.bash_alias” file ineffective, rename it. If your “.bashrc” file can’t see it, it won’t read it in. Reversing these steps to reinstate your aliases is a trivial matter.

Shell Functions

Lika aliases, Bash shell functions can be defined within the “.bashrc” file, but it is often neater to put them in their own definitions file. We’ll call it “.bash_functions”, following the convention used for the “.bash_aliases” file.

That means we need to tell the “.bashrc” file to read in our definitions. We can copy and amend the snippet of code that reads in the “.bash_aliases” file. Launch gedit and load the “.bashrc” file with this command:

gedit .bashrc

gedit .bashrc in a terminal window

You need to add the highlighted section shown below.

You can highlight the alias section and press Ctrl+C and then move to where you’d like the new section and press Ctrl+V to paste a copy of the text. Then all you need to do is change the two places where it says “.bash_aliases” to “.bash_functions.”

gedit with .bashrc loaded and a new .bash)_functions section highlighted

We can save those changes and close gedit.

Now we are going to create and edit the “.bash_functions” file, and put a function definition in it.

touch .bash_functions
gedit .bash_functions

touch .bash_functions in a terminal window

This will open the empty “.bash_functions” file in gedit.

We’re going to add a simple function called upup will take a single command line parameter, which is a digit. up will then call cd .. that number of times. So, if you used the command

up 2

up would call cd .. twice and would move up two levels in the directory tree.

There are different ways to define a function. Here’s one:

function up() {

The word function is optional. If you’re a traditionalist, use it, if you can’t be bothered typing it in, leave it out.

Here’s our entire function in gedit:

The up() Bash shell function in gedit

function up() {

This marks the start of our function definition, and it names the function up.

levels=$1

This creates a variable called levels and sets it to the value of the first parameter. This parameter is going to be a digit provided by the user when they call the function. The $1 means “first command line parameter.”

while [ "$levels" -gt "0" ]; do

We then enter a loop. This translates as “while the value of levels is greater than zero, do what is contained in the body of the loop.”

Inside the body of the loop, we have two commands. They are:

cd ..

Move up a level in the directory tree.

levels=$(($levels - 1))

Set levels to a new value, which is one less than its current value.

We then go back to the top of the loop, the comparison between the value of levels and zero is made once more. If levels is more than zero, the body of the loop is executed again. If it is not greater than zero, the loop is finished, and we drop through to the done statement, and the function is over.

Save these changes and close gedit.

We’ll read in and execute the commands in “.bashrc” which should read in and execute the commands in our “.bash_functions” file.

. .bashrc

. .bashrc in a terminal window

We can test the function by moving to some location in the directory tree and using up to move back to a “higher” point in the directory tree.

cd ./work/backup/
up 2

cd ./work/backup/ in a terminal window

The function works. We’re moved two directory levels higher in the tree.

Keeping Track With type

As you build up a suite of aliases and a library of functions, it can become difficult to remember whether a particular command is an alias or a function. You can use the type command to remind you. The cool thing here is that you also get to see the definition.

Let’s use type on our ftc alias and our up function.

type ftc
type up

type ftc in a terminal window

We get a very useful reminder of what type of command each one is, together with their definitions.

Start Collecting

Aliases and functions can speed up your use of the command line tremendously. They can shorten command sequences, and they let you bake-in the options you always use with standard commands.

Each time you see a nifty one-liner or useful function, you can adapt and personalize it, and then add it to your “.bash_aliases” or “.bash_functions” files.

[mai mult...]

How to Update iPhone and iPad Apps

Apple iPhone Update Apps

Checking for app updates has been easy for iPhone and iPad owners. It got a little more complicated when iOS 13 and iPadOS 13 replaced the Updates tab with Apple Arcade. Now you have to tap your profile icon first.

Your iPhone or iPad automatically installs app updates as long as the “App Updates” option is enabled from Settings > iTunes & App Stores. That’s why Apple made this option a bit harder to find—you don’t have to install app updates manually anymore.

Update Apps in iOS 13, iPadOS 13, and Above

Start by opening the App Store. If you can’t find the icon on your iPhone or iPad, swipe down on the home screen and utilize Spotlight search to find the app.

Apple iPhone Select App Store

Next, tap on your account picture located in the top-right corner of the display.

Apple iPhone iOS 13 App Store Select Avatar

Your list of recently updated apps can be found hidden under your account information and options to add funds to your Apple ID.

If you don’t see any available apps, swipe down on the screen to refresh the App Store. If any updates are available, they will appear under the “Upcoming automatic update” listing.

Select “Update all” to install all of the available updates or tap on the “Update” button next to each app to only install certain ones.

Apple iPhone iOS 13 App Store Select Update All

Update Apps in iOS 12 and Below

If your iPhone or iPad is running iOS 12 or older, the update process is similar (and easier) than the one above. To begin, open the App Store.

Next, tap on the “Updates” tab located in the bottom toolbar.

Apple iPhone iOS 12 App Store Select Updates

You will now see all of your recently updated apps with the available updates located near the top of the display. Select “Update all” to install all of the available updates or tap on the “Update” button next to each app to only install certain ones.

Apple iPhone iOS 12 App Store Select Update All

[mai mult...]

Reset Your Ubuntu Password Easily from the Live CD

Our last article on how to reset your Ubuntu password easily through the grub menu was quite popular, so I’ve decided to make a series on all the different ways to reset your password on either Linux or Windows… today’s lesson is how to use the Live CD to reset the password.

Note that we’ll also cover how to protect yourself against somebody else resetting your password, so stay tuned!

image

Of course, this method will also work if you’ve installed your Ubuntu Live CD to a thumb drive.

Resetting the Password

You’ll want to boot from your Ubuntu Live CD, choosing “Try Ubuntu without any change to your computer” from the boot menu.

image

Once the system boots, open up a new Terminal window from Applications \ Accessories and then type in the following command:

sudo fdisk -l

This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system.

image

Now you’ll need to create a directory to mount the hard drive on. Since we’re actually booting off the live cd, the directory doesn’t really get created anywhere.

sudo mkdir /media/sda1

The next command will mount the hard drive in the /media/sda1 folder.

sudo mount /dev/sda1 /media/sda1

Now it’s time for the command that actually does the magic: chroot. This command is used to open up a shell with a different root directory than the current shell is using, and we’ll pass in the folder where we mounted the hard drive.

sudo chroot /media/sda1

Now you should be able to use the passwd command to change your user account’s password, and it will be applied to the hard drive since we are using chroot.

passwd geek

Note that you’ll have to type your username after the passwd command in order to change the right password.

image

Now you should be able to reboot your system and log yourself in with your new password.

[mai mult...]

Install the Firestarter Firewall on Ubuntu Linux

Firestarter is an easy to use firewall for Ubuntu that includes a GUI administration tool. Installation of this firewall is as easy as using it. In this HowTo we will cover how to install the firewall.

Open a terminal window, and type in the following command:

sudo apt-get install firestarter

After the installation is finished, you can find the administration GUI at System \ Administration \ Firestarter:

When you launch the GUI for the first time, it will take you through a setup wizard:

Click forward, and you will be able to select the network device. If you are using DHCP for your machine, make sure you select that checkbox here:

Click Forward, and then Forward again. You will see the final screen of the wizard:

Click the save button and you will see the normal GUI screen:

This GUI is accessible from the tray icon, shown here:

The firewall is now installed. The firewall will continue running whether or not you are running the GUI, but the GUI will not be started up automatically unless you add it to the startup list using this path:

sudo /usr/sbin/firestarter

[mai mult...]