macOS Tips and Tricks

Here are some tips and trick that will be useful if you use an Apple Mac computer.

C05348A3-9AB8-42C9-A6E0-81DB3AC59FEB
           

macOS is generally a very stable and user-friendly operating system. Here are a few valuable tools, as well as tips and tricks that may come in handy.

Locked Files

If you copy files from an NTSF drive that a Windows machine uses, you may run into situations where the resulting files on the Mac drive are "locked", meaning that you can't edit, move or delete these files. They are marked with a small padlock icon appearing on the file's icon or preview, which is also how you can recognize them.

If this issue is only affecting a few files, you can resolve it manually by selecting the file and choosing “Get Info” (or Command+i). Under 'General', the 'Locked' checkbox can be clicked so that it is unselected, which will unlock the file.

However, if you have many files, this quickly becomes very cumbersome. To resolve this issue, open the "Terminal" application, and at the command prompt, type the following command, replacing the last part with the correct path to the directory containing these files:

chflags -R nouchg <path to files>

Application downloaded from the Internet

macOS includes a technology called Gatekeeper, which is designed to ensure that only trusted software runs on your Mac. If you download an application or a command-line tool from a location other than the official Apple App Store, your mac will try to warn you, and will by default prevent you from running the application, displaying a warning like "this application was downloaded from the Internet".

If you are not sure whether you can trust the file in question, use a tool like VirusTotal to scan it and make sure that it isn't malicious.

If you are absolutely sure that the application you downloaded is safe to use (after all, this warning was added for your safety!), you can manually resolve this situation by going to "Security & Privacy". Click the Open Anyway button in the General pane to confirm your intent to open or install the app. 

You can also use the following command line, replacing the last part with the correct path to the directory containing the file in question:

xattr -d com.apple.quarantine <path to file>

How to change the creation date of a file in OS X

If you need to change the “date modified” and “date created” attributes of some file. In OS X can be easily done using the Unix console.

Change date created

For changing the creation date just use use the command touch -t followed by the date and the path of the file. The date has the following format [[CC]YY]MMDDhhmm[.SS]]:

  • CC The first two digits of the year (the century).
  • YY The second two digits of the year.
  • MM The month of the year, from 01 to 12.
  • DD the day of the month, from 01 to 31.
  • hh The hour of the day, from 00 to 23.
  • mm The minute of the hour, from 00 to 59

For example for changing the creation date of the file test.doc to 16:15 11st of December 2022:

touch -t 202212211615 /path_to_file/file_name

Note that this will change both the “date modified” and “date created” attributes.

Change date modified

Changing the “date modified” attribute is similar to the previous step, but just using touch -mt instead:

touch -mt 202212211111 /path_to_the_file/file_name

Change the date for all files

For changing the creation/modification date to all files inside a folder just add /* to the folder path:

touch -t 202212211111 /path_to_folder/*

Another way to get this done using the find command:

find ./path_to_folder/ -type f -exec touch -mt 12011200 {} \;

Public Wi-Fi Captive Portal

Many public Internet Wi-Fi access points now require you to enter information on an access page before allowing you to access the Internet. This page is designed to force you to accept terms and conditions, allow you to enter membership details or login information, and select the level of access you are entitled to.

This process is called "Captive Portal", and the macOS is usually pretty good at detecting this and displaying that page, but sometimes things go wrong and the page doesn't display at all, leaving you connected to the wifi but without access to the internet.

To Force Open a Public Wi-Fi Login Page (Captive Portal), go to the following URL in Safari on your device:

Clear DNS Cache

Open the Terminal application and enter the following command, then hit return:

sudo killall -HUP mDNSResponder

Encrypt folders

Whether you use your computer for business or for personal use, you should always enable full-disk encryption, otherwise, anyone can take out your hard drive and plug it into their system to read all your files without having to break into your user account.

macOS also has the ability to create a new encrypted volume to securely store files and folders on your computer. This provides a great solution when sharing files or uploading them on a cloud drive. It essentially creates a .dmg file that can be mounted as a virtual volume.

To create a new encrypted drive go to the "Finder" > "Applications" > "Utilities" folder. Choose "Disk Utility".  On the top of the menu, select "File" > "New Image" > "Blank Image". Choose the name of the .dmg file and the location you want that file to reside. Select the size you think you will need, you can keep the default options except for the encryption, make sure to select either 128-bit or 256-bit AES Encryption and to set s strong password.

Select 'Save' to exit the window. 

Once the system finishes encrypting the folder, click 'Done', and exit the Disk Utility.

Your newly created .dmg file is secure. You can share the .dmg file just as you would any other file. Double-click on the file to open it, and you'll be prompted for the password. 

Miscellaneous Tools

The following tools can also be useful to you:

AppCleaner is a small application that allows you to thoroughly uninstall apps you no longer want or need.

If you are not ready to entrust your passwords to a cloud-based solution and want to keep them safely on your local system, MacPass is a free, open-source, KeePass-compatible password manager for macOS. When used with the MacPassHTTP Plugin and the KeePassHttp-Connector Chrome Extension, it offers a fairly user-friendly way to enter usernames and passwords on the vast majority of websites. Make sure to always use a key file to encrypt your KeePass database and never store that key file in the same location as your database (and never on a cloud drive!).

Posted Comments: 0