Skip to content

Instantly share code, notes, and snippets.

@whomwah
Last active April 11, 2019 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whomwah/308567 to your computer and use it in GitHub Desktop.
Save whomwah/308567 to your computer and use it in GitHub Desktop.
[unix] #unix #ssh

Manually setting the date and time

$ sudo date MMDDhhmmYYYY

MM - Two digit month number
DD - Two digit date
hh - Two digit 24 hour system hour
mm - Two digit minute
YYYY - Four digit year code

Expand short urls

curl -Is <link> | grep Location | sed -e 's/^.* //g'

# e.g
# curl -Is http://bit.ly/whomwah | grep Location | sed -e 's/^.* //g'

Splits a file into 1gb chunks called bits_ab etc

split -b 1000m path/to/file bits_

join the bits on unix cat bits_* > file

or on windows type bits_* > file

Create a new ssh key (RSA) with human readable string at the end

ssh-keygen -t rsa -C 'domain.com'

Covert p12 to pem

openssl pkcs12 -nodes -in /path/to/my/cert.p12 -out /pathto/my/cert.pem

SSH keys permissions

mkdir .ssh
$ touch .ssh/authorized_keys
$ chmod 700 .ssh
$ chmod 600 .ssh/authorized_keys

Private key

$ chmod 0400 xxx_private_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment