ssh completion
complete -W "$(( cat .ssh/known_hosts | cut -d' ' -f1 | cut -d, -f1 ; cat .ssh/config | awk '/^[Hh]ost/{print $2}' ) | sort -u)" ssh
(Source: commandlinefu.com)
including the origin of g/re/p
complete -W "$(( cat .ssh/known_hosts | cut -d' ' -f1 | cut -d, -f1 ; cat .ssh/config | awk '/^[Hh]ost/{print $2}' ) | sort -u)" ssh
(Source: commandlinefu.com)
Just added an ip toy to http://th.issh.it
http://th.issh.it/ip will return the client ip (actually the X-Forwarded-For if it exists, remote address if not )
http://th.issh.it/ip.json will return it as json with the X-Forwarded-For
Ran out of inodes on one drive which contains tons of tiny files because of the imaxpct setting, which dictates the maximum percentage of the disk to use for inodes (default 25%.) Setting it to 0 allows it to use the whole disk for inodes if need be.
Before
[root@cloud-g05 ~]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 1310720 88887 1221833 7% / none 186059 1 186058 1% /dev/shm /dev/sdf 209715200 178480304 31234896 86% /gate-1 /dev/sdg 209715200 150757936 58957264 72% /gate-2 /dev/sdh 209715200 157235005 52480195 75% /gate-3 /dev/sdi 209715200 -18446744073499836224 18446744073709551424 - /gate-4
After
Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 1310720 88887 1221833 7% / none 186059 1 186058 1% /dev/shm /dev/sdf 209715200 178480304 31234896 86% /gate-1 /dev/sdg 209715200 150757957 58957243 72% /gate-2 /dev/sdh 209715200 157235026 52480174 75% /gate-3 /dev/sdi 362042608 209715602 152327006 58% /gate-4
Use :TOhtml to create a syntax highlighted html file
Include the following in ~/.ssh/config before any Host declaration to have the ssh client choose from possible keys in order
IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_dsa IdentityFile ~/.ssh/%h/%r/id_rsa IdentityFile ~/.ssh/%h/%r/id_dsa IdentityFile ~/.ssh/%h/id_rsa IdentityFile ~/.ssh/%h/id_dsa
%h becomes remote hostname and %r becomes remote username, so when you
ssh harry@hogwarts
it will check in
~/.ssh/id_rsa ~/.ssh/id_dsa ~/.ssh/hogwarts/harry/id_rsa IdentityFile ~/.ssh/hogwarts/harry/id_dsa IdentityFile ~/.ssh/hogwarts/id_rsa IdentityFile ~/.ssh/hogwarts/id_dsa
See also: ssh_config man page