ssh host alias (~/.ssh/config)
~/.ssh/config # always login as `marioosh` user Host * User marioosh # aliases for marioosh.net Host alias1 alias2 alias3 HostName marioosh.net Now You can login as below: $ ssh alias1 $ ssh alias2 $ ssh alias3
~/.ssh/config # always login as `marioosh` user Host * User marioosh # aliases for marioosh.net Host alias1 alias2 alias3 HostName marioosh.net Now You can login as below: $ ssh alias1 $ ssh alias2 $ ssh alias3
Substring $ a=teststring $ echo ${a:2:5} ststr Remove prefix (#) $ a=text_test.txt $ echo ${a#*_} test.txt Remove suffix (%) $ a=text_test.txt $ echo ${a%.txt} text_test
$ cat server.key server.crt > server.pem $ openssl pkcs12 -export -in server.pem -out keystore.p12 -name alias$ cat server.key server.crt > server.pem $ openssl pkcs12 -export -in server.pem -out keystore.p12 -name alias
tail -f /var/log/apache2/error.log | grep –line-buffered mod_rewritetail -f /var/log/apache2/error.log | grep –line-buffered mod_rewrite with awk: tail -f /var/log/messages | grep –line-buffered auth | stdbuf -o0 awk -F" " ‘{print $2}’tail -f /var/log/messages | grep –line-buffered auth | stdbuf -o0 awk -F" " ‘{print $2}’
curl -s -L -D – http://marioosh.net:80 -o /dev/null -w ‘EFFECTIVE-URL: %{url_effective}\n’curl -s -L -D – http://marioosh.net:80 -o /dev/null -w ‘EFFECTIVE-URL: %{url_effective}\n’ https://www.chrislatta.org/articles/web/curl/track-redirects-curl-command-line
# grep for windows grep -rlE –include="*.properties" ‘user.*gmail’grep -rlE –include="*.properties" ‘user.*gmail’
sendmail someone@somewhere.com < somefile
curl -k ‘https://localhost:4200/api/pdf/130869’ -H "Authorization: Bearer …" -O -Jcurl -k ‘https://localhost:4200/api/pdf/130869’ -H "Authorization: Bearer …" -O -J
cat /var/log/auth.log|grep fail|awk ‘{ print $14}’|sort|uniq –count|sort -nrcat /var/log/auth.log|grep fail|awk ‘{ print $14}’|sort|uniq –count|sort -nr
Resize all images in current directory to 600px height: for i in *; do mogrify -verbose -resize x600 “$i” ; done Resize all images (*.jpeg, *.jpg, *.JPG) in current directory and subdirectories to 800px height: find -type f -iregex ‘\(.*\.jpeg\)\|\(.*\.jpg\)\|\(.*\.JPG\)’|xargs mogrify -verbose -resize x800