Blog / Linux

How to find the Wi-Fi network password (and other settings) via command line in Ubuntu

February 7, 2018

While you can get this information via the "Network Connections" GUI, it could come in handy sometimes to know where this is located. For example, you might want to write a script to display the SSID and passwords of all the Wi-Fi networks you've connected to.

Basically, all the network connections are saved under /etc/NetworkManager/system-connections in Ubuntu in separate configuration files. If you want to delete all the Wi-Fi settings in bulk ...

Upgrading to Ubuntu 16.04, Python 3.6, and Django 1.11

August 12, 2017

I've finally decided to perform major version upgrades of the main components of this blog: the operating system (Ubuntu), the programming language (Python), and the web framework (Django). Doing these upgrades to the latest LTS (long-term support) versions will future-proof the stack for at least the next 3 years.

One of the main reasons you'd want to do this is to get the latest security updates. It's hard to keep up with ...

Generate random passwords on Linux with the "pwgen" command

February 26, 2017

With the recent Cloudflare hack ("CloudBleed"), I currently find myself resetting a bunch of passwords.

I tend to use very random passwords for most of my accounts, where each account uses a different random password. Thankfully, with tools like pwgen this is very quick and easy to do. Before using pwgen, I would normally go to a site like to generate random passwords.

Using `pwgen` is very simple, just install it and type ...

How to delete files older than x hours in Ubuntu

November 5, 2016

The command is a pretty simple one-liner, though I probably won't remember it so I'm making a note of it here for future reference:

find /webapps/myproject/media -type f -cmin +120 -delete

This command basically just deletes all the files in my media folder where the last changed time is older than 120 minutes.