Technology

By devin, 22 October, 2015

Whenever I use openvpn I'm stuck carting around 5 files, sending them over Bluetooth and cluttering up my phone's downloads directory or confusing people I'm setting up with openvpn

I decided finally to figure out inline openvpn client config files (note: all-in-one files don't work on the Securepoint SSL windows client). I made this sed script/command that will automate the process. Imagine that the following five correctly configured openvpn files are in my current directory, with the openvpn file referencing the others:

By devin, 7 September, 2015

Here are the commands I use for ssh port forwards. If you add the -N flag it *won't* open an ssh session, but that's almost aesthetic. Imagine I'm running all of these from my laptop.

By devin, 18 November, 2014

I just made two cool bash functions for use at work. One checks if a Debian/Ubuntu package is present and installs it if it isn't. The second takes a string bash command and echos it before running it, exiting the script if there's an error.

By devin, 24 October, 2014

I maintain a Drupal website with several hundred files in the /sites/default/files folder. It's a big mess - they're unsorted, many are no longer referred to, and so on. That's another topic.

I was wondering if there was a way to make future links nicer. People accessing the website or sharing links to files on our website don't want to type "sites/default" - that's stupid!

By devin, 23 September, 2014

I've been trying to access the Canada Post Sell Online API (if it's even still called that, in 2014) and I'm having lots of trouble. I'm using an Ubercart module (uc_canadapost) and it doesn't seem to work or something. It looks like you used to get a Merchant ID when you used Sell Online, and with Canada Post's new APIs you get a username and password as your API key.

It took me a good 2 hours to figure out how to successfully use curl to access the REST API. I'm now going to document the examples of successful curl commands that have actually worked.

By devin, 18 March, 2014

In the same vein as my Drupal permissions setup script, here's a script that should set up a Wordpress install with file permissions that are secure, except Wordpress will allow editing of the files through the admin backend. Permissions are locked down in the same way as with Drupal, except wp-content is set up like Drupal's files directory with write permissions for the webserver.

By devin, 6 March, 2014

My two favourite CMSes and my two favourite web servers. Here are four config files for the same website. Let's assume we have a user devin with two directories in his public_html folder:

/home/devin/public_html/drupal
/home/devin/public_html/wordpress

And then has already created the following logs folders (nginx and Apache have a habit of crashing when you try to specify a non-existent logging directory):

By devin, 6 March, 2014

vsftpd is a simple and secure FTP server, I hear. I've used it to set up an FTP server quickly. Rather than fighting with TLS and FTP, I just use SFTP now - it's much simpler.

You'll need to download and install vsftpd and openssh-server at least. Also, I usually use AllowUsers in my /etc/ssh/sshd_config to whitelist  which users are allowed to ssh in like so: