Monday, November 20, 2017

Connecting to a Wifi SSID from the macOS command line

Sometimes it's useful to be able to connect to an SSID (or switch from one to the other) from the command line. Here is how to do this on macOS (tested on High Sierra):

networksetup -setairportnetwork [interface] [SSID] [password]

For example:

networksetup -setairportnetwork en0 SSID1
networksetup -setairportnetwork en0 SSID2
networksetup -setairportnetwork en0 MyHouseSSID MyPassword

Using this command to connect to the same SSID your already connected acts as a reconnect.

Displaying a MySQL/Mariadb table on a web page using Ruby Sinatra and JS DataTables

My son was working on a project where he needed to display data from a MySQL/Mariadb table on a web page. Having no prior HTML/JS experience...