How do I get the current Unix time in milliseconds in Bash?

This: date +%s will return the number of seconds since the epoch. This: date +%s%N returns the seconds and current nanoseconds. So: date +%s%N | cut -b1-13 will give you the number of milliseconds since the epoch – current seconds plus the left three of the nanoseconds. and from MikeyB – echo $(($(date +%s%N)/1000000)) (dividing … Read more

How do I change my private key passphrase?

To change the passphrase on your default key: $ ssh-keygen -p If you need to specify a key, pass the -f option: $ ssh-keygen -p -f ~/.ssh/id_dsa then provide your old and new passphrase (twice) at the prompts. (Use ~/.ssh/id_rsa if you have an RSA key.) More details from man ssh-keygen: […] SYNOPSIS ssh-keygen [-q] … Read more

What is special about /dev/tty?

The ‘c’ means it’s a character device. tty is a special file representing the ‘controlling terminal’ for the current process. Character Devices Unix supports ‘device files’, which aren’t really files at all, but file-like access points to hardware devices. A ‘character’ device is one which is interfaced byte-by-byte (as opposed to buffered IO). TTY /dev/tty … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)