Adding more cheat sheets.

This commit is contained in:
Chris Lane 2013-08-10 10:16:13 -04:00
parent 8093424dbd
commit e51fa9b29f

55
cheat
View File

@ -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']: