Bring a Connection Up in NetworkManager From the Command-Line

You can also use this for the VPN. Occasionally my taskbar freezes on one of my laptops, so this is a contingency to start my VPN if that is happening at the time.

$ nmcli con up id "ML (east)"

Listing Available Package Versions in Ubuntu: The “Madison” Subcommand

There is an unlisted subcommand to apt-cache called “madison”. This will simply list all available versions:

$ apt-cache madison git
git | 1:2.11.0-2~ppa0~ubuntu14.04.1 | trusty/main amd64 Packages
git | 1:1.9.1-1ubuntu0.3 | trusty-updates/main amd64 Packages
git | 1:1.9.1-1ubuntu0.3 | trusty-security/main amd64 Packages
git | 1:1.9.1-1 | trusty/main amd64 Packages
git | 1:1.9.1-1 | trusty/main Sources
git | 1:1.9.1-1ubuntu0.3 | trusty-updates/main Sources
git | 1:1.9.1-1ubuntu0.3 | trusty-security/main Sources

In all likelihood this will work under Debian, too.

Environment Variables Under SSH

It’s a fairly important point that if you want to define global environment variables on an Ubuntu host that will be accessible from a command executed via SSH, OpenSSH provides few options and most blogs will give users incorrect advice.

It turns out that adding variables to /etc/profile or /etc/profile.d/* is patently incorrect.

If you want to add an environment variable that any script for any user can see when executed via SSH (“ssh <user>@<host> <command>“), add it to /etc/environment. It’s similar to ~/.ssh/environment (if that’s turned-on with PermitUserEnvironment), but global.