Mac OS X
March 15, 2018

Preferences

Preview for PDFs - Incorrect Pages are Bookmarked

Turn off logical page numbers by going to Preferences > PDF and then unticking the Viewing documents: Use logical page numbers box.

Hidden Utilities

afplay - Audio File Play

afplay [option…] audio_file

1
2
3
4
#loop a file
$ while :; do afplay "file.mp3"; done;
#individually play all file in a directory
$ find . -name '*.mp3' -exec afplay '{}' \;
1
2
3
4
5
6
7
8
9
brew install transmission-cli watch
#Launch the daemon
transmission-daemon
#Start the download
transmission-remote -a "magnet:link"
#To have a visual update write: (add the -n flag to specify an interval, the standard is 2 seconds)
watch "transmission-remote -l"
#Stop the daemon
transmission-remote --exit

or create a magnet.links file including magnet: link list of files you want to download, and then run below script to download all.

1
2
3
4
5
file="magnet.links"
while IFS= read -r line
do
transmission-remote -n 'transmission:transmission' -a $line
done <"$file"

Some options:

To target to a directory

1
transmission-remote -a magnet:?xt=urn:btih:e249fe4dc957be4b4ce3ecaac280fdf1c71bc5bb&dn=ubuntu-mate-16.10-desktop-amd64.iso -w ~/Downloads

To download torrent file

1
2
transmission-remote -a ubuntu-16.10-desktop-amd64.iso.torrent -w ~/Downloads
transmission-remote -a http://releases.ubuntu.com/16.10/ubuntu-16.10-desktop-amd64.iso.torrent -w ~/Downloads

To enable a peer blocklist: Since transmission-cli works different than its GTK counterpart, it often doesn’t save settings. This means peer blocklists need to be specified each time before use. The -b switch enables a blocklist.

1
transmission-remote -a http://releases.ubuntu.com/16.10/ubuntu-16.10-desktop-amd64.iso.torrent -w ~/Downloads -b http://john.bitsurge.net/public/biglist.p2p.gz

To download with encryption: It is possible to encrypt the traffic while downloading.

1
transmission-remote -a http://releases.ubuntu.com/16.10/ubuntu-16.10-desktop-amd64.iso.torrent -w ~/Downloads -er

To remove a torrent

1
2
3
4
5
6
#remove a torrent with ID 3
transmission-remote -t 3 -r
#remove a torrent with ID 3 and 4
transmission-remote -t 3,4 -r
#remove all torrents
transmission-remote -t all -r

Free NTFS read and write on Mac

Edit fstab file

1
sudo nano /etc/fstab

Add below line where DRIVE_NAME is the name of the drive. The drive’s name should contain no spaces, as adding a space to the configuration file would tell your Mac to interpret whatever’s after that space as a separate command. If your DRIVE_NAME is made up of two words separated with a space, for example, “NO NAME”, you have to add a “\” before the space for the system to recognize the space. For example, “NO\ NAME”.

1
LABEL=DRIVE_NAME none ntfs rw,auto,nobrowse

Instead of using above, we can use the following command line.

1
UUID=Universal Unique Identifier none ntfs rw

Open Disk Utility and check File System UUID by opening Volume Info. Go back to Disk Utility to Unmount then Mount the NTFS disk to see if it is able to read and write to NTFS Disk.