From e51fa9b29f1197cd8df3fc21b76deaf33d5a08ef Mon Sep 17 00:00:00 2001 From: Chris Lane Date: Sat, 10 Aug 2013 10:16:13 -0400 Subject: [PATCH] Adding more cheat sheets. --- cheat | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/cheat b/cheat index ecf5b94..d62ec1e 100755 --- a/cheat +++ b/cheat @@ -9,17 +9,34 @@ cheatsheets = { # @todo: # - adb -# - apt-cache +# - at +# - cut / split? # - dd +# - df +# - du # - fdisk # - mount +# - mysqldump +# - mysqlimport +# - mongodump +# - mongoimport # - nc +# - redirect to stdout # - rsync +# - sed # - shred +# - ssh-keygen # - useradd / adduser +# - xargs # @see: http://www.thegeekstuff.com/2010/11/50-linux-commands/ +########## apt-cache ########################################################## +'apt-cache' : ''' +To search for apt packages: +apt-cache search "whatever" +''', + ########## bash ############################################################### 'bash' : ''' To implement a for loop: @@ -105,6 +122,14 @@ To view which users/processes are listening to which ports: sudo netstat -lnptu ''', +########## notify-send ####################################################### +'notify-send' : ''' +To send a desktop notification via dbus: +notify-send -i 'icon-file/name' -a 'application_name' 'summary' 'body of message' + +The -i and -a flags can be omitted if unneeded. +''', + ########## sockstat ########################################################## 'sockstat' : ''' To view which users/processes are listening to which ports: @@ -126,6 +151,30 @@ For more information, see: http://unix.stackexchange.com/q/12755/44856 ''', +########## ssh-copy-id ######################################################## +'ssh-copy-id' : ''' +To copy a key to a remote host: +ssh-copy-id username@host + +To copy a key to a remote host on a non-standard port: +ssh-copy-id username@host -p 2222 +''', + +########## ssh-keygen ######################################################## +'ssh-keygen' : ''' +To generate an SSH key: +ssh-keygen -t rsa + +To generate a 4096-bit SSH key: +ssh-keygen -t rsa -b 4096 + +To copy a key to a remote host: +ssh-copy-id username@host + +To copy a key to a remote host on a non-standard port: +ssh-copy-id username@host -p 2222 +''', + ########## tar ############################################################### 'tar' : ''' To extract an uncompressed archive: @@ -146,7 +195,9 @@ tar -cjvf /path/to/foo.tgz /path/to/foo/ } -# @todo: demonstrate some keyphrase aliases here +# Cheatsheets can be aliased under a different keyphrase like this: +cheatsheets['dbus'] = cheatsheets['notify-send'] +cheatsheets['imagick'] = cheatsheets['convert'] # print help if requested if keyphrase in ['', 'help', '--help', '-h']: