Mac and macOS
Extract RPM File to Current Directory
brew install rpm2cpio
rpm2cpio file.rpm | cpio -i --make-directoriesUse VS Code code Command on Terminal Without Admin Rights
Add this to your .zshrc
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}Set a Mac Mini to Turn On After a Power Failure Without macOS
If using Linux on a Mac mini hardware, search for an LPC controller
sudo lspci | grep LPCSet the auto-start flag on this controller
sudo setpci -s 00:1f.0 0xa4.b=0If needed, search for the right flag on this datasheet.
Resizing a Sparseimage
First, unmount the image if in use.
To increase the image size to 50GB:
hdiutil resize -size 50g filename.sparseimageTo shrink the image size:
hdiutil compact filename.sparseimageReference: Sparse image Wikipedia article
Find a File Encoding
$ file -I original.csv
original.csv: text/plain; charset=iso-8859-1Convert File to Another Encoding
iconv -f iso-8859-1 -t utf-8 < original.csv > copy.csvRemove Windows Line Breaks
Install Homebrew. Follow the instructions on https://brew.sh
After that, use Homebrew to install dos2unix
brew install dos2unixAnd use it
dos2unix original.csvRebuild the Spotlight Index
sudo mdutil -E /What does the -E option do?
-E This flag will cause each local
store for the volumes indicated to
be erased. The stores will be
rebuilt if appropriate.Remove Duplicated Entries in the Open With List
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain userReference: Rebuild LaunchServices to Fix Duplicate Entries in OS X’s ‘Open With’ Menu
Add a Directory to the $PATH
On macOS there's a directory called /etc/paths.d. Inside that, the path_helper utility adds the reference to all directories used on $PATH.
To add any directory to /etc/paths.d:
sudo -s 'echo "/my/new/path" > /etc/paths.d/my'Pay attention: the files inside /etc/pths.d can't have empty line endings.
Reference: Mac OS X: Set / Change $PATH Variable
Run More Than One Instance of an App
open -n -a "app name"
Rodrigo de Avila