Deep thought 💭 on Aliases

There are somethings that are just easier to do from the command line. I have created aliases for the most common things that I do, particularly when they aren’t done frequently or the syntax is something that I frequently forget. All of these live in my ~/.aliases file which is part of my ~/.bash_profile.

nosound

alias nosound=’sudo pkill coreaudiod’

I’m not sure why, but occasionally the audio stack gets jacked up. I can turn up the volume and I see it working via the on screen display, but no volume up or down. Killing coreaudio fixes this.

rule2

alias rule2=’until ping -W1 -c1 8.8.8.8; do sleep 5; done && say the internet is back’

When the network is flaky, this is the command that will let me know when things have stabilized. Rule 2 = Always blame the network.

dnsflush

alias dnsflush=’dscacheutil -flushcache; sudo killall -HUP mDNSResponder’

I can never remember how to flush the DNS cache.

disableitunes

alias disableitunes=’sudo chmod -x /Applications/iTunes.app’

I prefer to bind the media keys on my Mac to other software, which leads to a problem, unless iTunes is set to not execute. This makes it easy to disable iTunes.

enableitunes

alias enableitunes=’sudo chmod +x /Applications/iTunes.app’

When I have to use iTunes, which is hardly ever, this is the script that re-enables it.

Published: May 15, 2014 @jeredb →