Command Line

Bash


Let's Encrypt certificates

  1. Stop apache2
  2. certbot --authenticator standalone -d $domain.$tld,www.$domain.$tld certonly


NPM: Make packages local to user

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'

... add to profile:

NPM_PACKAGES="$HOME/.npm-global"
PATH="$NPM_PACKAGES/bin:$PATH"
export NPM_PACKAGES PATH


JPEG Manipulation

Use identify to see date when photo was taken:

identify -verbose {picture.jpg} | grep exif:DateTimeOriginal

To change DateTimeOriginal:

jhead -dsYYYY:mm:dd {picture.jpg}

... or ...

jhead -tsYYYY:mm:dd-HH:MM:SS {picture.jpg}

... to change date + time.

(Install jhead on ubuntu: sudo apt install jhead)


Mirror Site

Mirror entire site:

wget --mirror [URL]

... mirror site, but don't mirror gif,jpg and png files:

wget --mirror -R gif,jpg,png [URL]


Which programs listen on which ports

sudo lsof -i -P -n | grep LISTEN


Show reserved ports, windows

netsh interface ipv4 show excludedportrange protocol=tcp