mirror of
https://github.com/cheat/cheat.git
synced 2024-11-14 08:01:09 +01:00
Adding more cheat sheets.
This commit is contained in:
parent
8093424dbd
commit
e51fa9b29f
1 changed files with 53 additions and 2 deletions
55
cheat
55
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']:
|
||||
|
|
Loading…
Reference in a new issue