Adding more cheat sheets.

This commit is contained in:
Chris Lane 2013-08-10 10:16:13 -04:00
parent 8093424dbd
commit e51fa9b29f
1 changed files with 53 additions and 2 deletions

55
cheat
View File

@ -9,17 +9,34 @@ cheatsheets = {
# @todo: # @todo:
# - adb # - adb
# - apt-cache # - at
# - cut / split?
# - dd # - dd
# - df
# - du
# - fdisk # - fdisk
# - mount # - mount
# - mysqldump
# - mysqlimport
# - mongodump
# - mongoimport
# - nc # - nc
# - redirect to stdout
# - rsync # - rsync
# - sed
# - shred # - shred
# - ssh-keygen
# - useradd / adduser # - useradd / adduser
# - xargs
# @see: http://www.thegeekstuff.com/2010/11/50-linux-commands/ # @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 ###############################################################
'bash' : ''' 'bash' : '''
To implement a for loop: To implement a for loop:
@ -105,6 +122,14 @@ To view which users/processes are listening to which ports:
sudo netstat -lnptu 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 ##########################################################
'sockstat' : ''' 'sockstat' : '''
To view which users/processes are listening to which ports: 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 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 ###############################################################
'tar' : ''' 'tar' : '''
To extract an uncompressed archive: 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 # print help if requested
if keyphrase in ['', 'help', '--help', '-h']: if keyphrase in ['', 'help', '--help', '-h']: