Far from a comprehensive list.
Switching back and forth between directories using cd -;
$ cd ~/Downloads
$ cd ~/Documents
$ cd -
Use
cdto enter directoryDownloadsthenDocumentand then return to directoryDownloads.
| # List make targets since this is not something make can do the way we want it to | |
| list_make_targets() { | |
| file=Makefile && [[ -f "$file" ]] && grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' "$file" | sed 's/[^a-zA-Z0-9_.-]*$//' || printf '"%s" not found\n' "$file" | |
| } | |
| # Tell (ba)sh completion to use function "list_make_targets" for completion | |
| make_load_autocomplete() { | |
| complete -W "\`list_make_targets\`" make | |
| } |
| #!/bin/bash | |
| # usage: | |
| # $ ./sync.sh /home/user/tmp/A /home/user/tmp/B /home/user/tmp/C /home/user/script.py | |
| source="$1" | |
| temp="$2" | |
| destination="$3" | |
| scriptpath="$4" | |
| rsync -avr "${source}/" "${temp}/" > /dev/null | |
| diff "${temp}" "${destination}" > /dev/null | |
| exitcode="$?" |
| #!/bin/bash | |
| alias dck="echo '-- docker cleanup: kill..' && docker ps -q | xargs docker kill" | |
| alias dcrm="echo '-- docker cleanup: rm..' && docker ps -q | xargs docker rm" | |
| alias dcrmi="echo '-- docker cleanup: rmi..' && docker images -q -f dangling=true | xargs docker rmi" | |
| alias dcrmia="echo '-- docker cleanup: rmia..' && docker images -q | xargs docker rmi" | |
| alias dockercleanup="echo '-- docker cleanup: all..' && dck; dcrm; dcrmi; dcrmia" | |
| # usage, output: | |
| # $ dockercleanup | |
| # -- docker cleanup: all.. |
| Port 80 happens to close every reboot. | |
| Opening it should work using these. It is however quite unclear why my setup closes it (and others don't. | |
| $ cat /etc/pf.conf | |
| … | |
| # Allow access to port 80 | |
| pass in proto tcp from any to any port 80 | |
| $ sudo pfctl -F all | |
| No ALTQ support in kernel |
Far from a comprehensive list.
Switching back and forth between directories using cd -;
$ cd ~/Downloads
$ cd ~/Documents
$ cd -
Use
cdto enter directoryDownloadsthenDocumentand then return to directoryDownloads.
from bleroy
tvservice -d edid
edidparser edid
example output: HDMI:EDID DMT mode (82) 1920x1080p @ 60 Hz with pixel clock 148 MHz
| $HOME/Library/Calendars/Calendar\ Cache is a sqlite3 embedded database. | |
| 1) Close your Apple iCal. | |
| 2) Open your Terminal or any shell application | |
| 3) Go to the above directory "$HOME/Library/Calendars" | |
| 4) Open the db using "sqlite3 Calendar\ Cache" | |
| 5) ".tables" will show you all the tables in this database | |
| 6) "select * from ZMESSAGE" will show you all the pending notifications | |
| 7) To remove all the pending notifications, use "delete from ZMESSAGE;" | |
| 8) to quit, type ".quit" |
| # creates a new gitignore file that ignores everything except the gitignore file itself | |
| add_gitignore() | |
| { | |
| directory=$1 | |
| if [[ "$directory" == "" ]] | |
| then | |
| directory="." | |
| fi |