My Blog

Migrated my site to a new server

Written by Justin Goetz -

So I finally got around to migrating this site to a new webserver. My old webserver VM was originally Debian 6, upgraded to 7. As of now, it was still stuck on Debian 7, and after attempting to upgrade to Debian 9 and subsequently causing apache and mysql to explode, I figured it'd be best to start from scratch. After all, that webserver VM was the first server I ever created.

It was funny to look back to when I first started messing with servers, and all the mistakes I made on that VM. I'm also pretty impressed that I actually managed to create that VM way back in 2011 on Virtual box on windows, migrate it to virtualbox on linux, finally to migrate it to ProxMox. I'm going to preserve a backup of it just for fun, just something special to me as one of my oldest VMs.
RIP Old Webserver: 2011-2018

I'll be posting more useful info here soon I promise.

OpenWRT Garage Door Controller

Written by Justin Goetz -

This is a quick tutorial for turning an OpenWRT router into a garage door controller. In this tutorial, I will be using the MT300N from GL-Inet to control my garage door over WiFi.

First, you'll need to SSH into the router. We need to edit the file /etc/rc.local. In this file I will put the following lines before exit 0:

/bin/echo 44 > /sys/class/gpio/export
/bin/echo "out" > /sys/class/gpio/gpio44/direction

The first command enabled GPIO pin 44. The 2nd line sets the GPIO port as "output", what we will use to control the relay. Now reboot the router.

Next, lets wire up the relay to the router. For my MT300N router, I used GPIO port 44 (labeled as LINK4 on the router board). Conect GPIO pin 44 to the "IN" pin on the relay. Now, connect GND to GND on relay, and connect the 3.3v pin on the router to the VCC pin on the relay. Here is a wiring diagram:

Now to test if it works, run the following commands. To turn the relay ON, run:

/bin/echo "1" > /sys/class/gpio/gpio44/value

The green light on the relay module should turn on, and you should hear a click. Now to turn the relay off, run:

/bin/echo "0" > /sys/class/gpio/gpio44/value

and the green light will turn off. If this works, your relay is wired correctly.

Now we need to install PHP to run the commands from a web interface. Run the following commands in order to install PHP to your router.

opkg update
opkg install php5 php5-cgi

Now edit /etc/config/uhttpd to enable PHP. Right below the first block of text, add the following lines:

        option interpreter '.php=/usr/bin/php-cgi'
        option index_page 'index.php index.html'

And now restart uhttpd.

/etc/init.d/uhttpd restart

Now lets create a quick script to turn the relay on, wait 1 second, then turn the relay off again. This simulates someone pressing a button to make the garage door open. I wrote this quick and dirty bash script to do just that. I saved this file to /root/

/bin/echo "0" > /sys/class/gpio/gpio44/value
sleep 1;
/bin/echo "1" > /sys/class/gpio/gpio44/value

And lastly, lets create the quick PHP page to run this shell script. I put this file in /www/garage.php. Here is a link to the script:

Lastly, we need to wire the relay to the garage door opener itself. This process in concept is simple, you just need to find the two screw terminals on your garage door opener that connect to the garage door button, and wire them to the NO and COM ports on your relay.

Now, when I navigate to http://router-ip-here/garage.php, I can activate the relay, opening my garage door.

A picture of the final setup:


How to run FileRun behind apache2 reverse proxy

Written by Justin Goetz -

This will be a guide on to run FileRun behind apache2 reverse proxy with SSL support. FileRun,, is an excellent file sharing program that looks very similar to Google Drive, making it great for users who are used to already accustomed to using gDrive.

First, install FileRun as usual. I personally installed this on a fresh Debian 8 VM, so I followed FileRun's excellent guide for installation. Oddly enough I found these directions on their blog rather than their documentation section, but oh well.

When your finished, configure your main internet-facing node as a reverse proxy. I personally use letsencrypt for all of my SSL certificates. Here is my apache2 reverse proxy configuration:

Note: SSL configuration (including the redirects at the bottom) was done by letsencrypt.

Now, we'll want to setup a self-signed certificate on the VM running FileRun, because if its not being accessed via HTTPS it freaks out. I followed this guide to accomplish this.

Lastly, we need to change a configuration file. This part is importaint. cd to the directory where you installed FileRun. For example mine will be /var/www/html/. cd into the customizables directory. Create and edit a file called config.php.

Paste the following: Change the URL to of course what fits your configuration.

Load the site and test if it works!

Convert an old Actiontec router into a MoCA bridge

Written by Justin Goetz -

MoCA in my opinion is an awesome technology. However, the current MoCA adapters on the market are extremely overpriced, turning many away from MoCA. However, using a cheap old Verizon Actiontec router (can be found on ebay for around $15-20 used), we can create our own MoCA bridge for 1/10th the cost.

After seeing the need for a documented tutorial, I have written the following, which describes how to configure an old Verizon actiontec router as a dumb MoCA bridge, to extend your home network anywhere that coax exists.

Please, feel free to leave comments or shoot me an email if you need help!

Link to documentation