CategoryLinux Stuff

Random Router Fix

Recently, I have seen an issue where my router is losing its internet connection for an extended period. The way that I have noticed to fix this is to reboot the router by unplugging it from the wall. If I don’t do that, it can take forever to come back on its own. Other than this issue, I can’t complain about the service with U-Verse. From the speed test below, you can see that it is pretty fast.

To get around the random router hangs, I put an SSR that I have lying around to use. I have these from a Christmas light project that I was working on, and they were pretty cheap and easy to build. They are DirkCheapSSRs. I remembered that I could trigger them from my Raspberry Pi that is already running on the network. The Raspberry Pi runs PiHole, and it is already sitting next to the router. I wrote a small python script to trigger the GPIO pins on the Raspberry Pi based on certain conditions. Essentially, the Pi cycles the power on the router based on it being able to ping google.com, and it checks for the ping every five seconds. If the ping fails, it waits ten minutes before it starts the check again.

from __future__ import print_function 
import RPi.GPIO as GPIO, time, os 
log = open("/home/pi/reboot/logs/reboot.log","a") 
GPIO.setmode(GPIO.BCM) 
GPIO.setup(18, GPIO.OUT)
try: 
  while True: 
    if os.system("ping -c 1 google.com") != 0: 
      print('Ping failed. The router is being rebooted.', file = log) 
      GPIO.output(18,GPIO.HIGH) time.sleep(5) 
      GPIO.output(18,GPIO.LOW) 
      time.sleep(600) 
    else: 
      GPIO.output(18,GPIO.LOW) 
      time.sleep(5)

except KeyboardInterrupt: 
  print('Program quit.', file = log)
 
finally: 
  GPIO.cleanup()

Here is a picture of the Raspberry Pi and the SSR in the closet. I could technically control all four outputs on the SSR, but I am only using one at the moment. I had to change my Pi’s case some because it didn’t have access to the GPIO pins.

The cheapest way that I could find to do this when searching was around $100. From what I remember, the DirkCheapSSR cost me around $7 with the case.

Solid.pw Updated

A few days ago, a friend of mine sent me a message letting me know that he liked my http://solid.pw site. I had written about it here a few months ago, Solid.pw, and he had used it somewhat regularly for password generation.

After his note to me, I went back and looked at it, and it looked horrible! I was surprised that I never went back and did anything else to it, but I did that this weekend. It is much more presentable now, and I have added some more things to it that make it work a little better for the user. If you a need a password, I think that it is an even better option now.

Here is a screenshot of it.

Screenshot 2014-03-22 22.31.35

 

– Drew

ISPConfig 3 Script Updated

Over the past few years, I have maintained an installation script for ISPConfig3. The script is hosted over on Github, ISPConfig-3-Debian-Installer, and I recently made a few changes to it. I had wanted to make it just work better, and a few issue were submitted in a row that made me take a look at it again. It now works in just one file, and I think that is the biggest improvement. If you have an empty VPS or Server, you should give the script a shot. The control panel that it installs is pretty cool, and it is actively maintained over at How To Forge.

If you use the script and find any issues, feel free to send me an email here or open an issue at GitHub. Either way, I will take a look at it.

– Drew

Solid.pw

A few weeks ago, a person at a forum that I visit regularly gave away a pretty cool domain name. When I saw it, I instantly wanted to get it and make a password generator out of it. I use one all the time for random stuff, and I wanted something that I know how it works. So, I did just that. You can find the site over at http://solid.pw. It uses freely available open-source software, and you can find more information about this on the About page.

The site is a pretty simple site that allows you to generate random passwords based on different settings. It is really nothing to write home about, but it is mine! I will use it pretty heavily, and I hope that other people can find some use for it.

Let me know what you think.

– Drew

Updated ISPConfig 3 Theme

Yesterday, I took the time to update my ISPConfig 3 Theme. I call this theme ISPConfig Clean. It just seemed like a good idea at the time, and you can’t really go back on that. It is a cleaner version of the default theme that ships with ISPConfig 3. I use or used the styling that is on the ISPConfig website as a base, and I am still working on it. I will be converting it over to SASS and Compass pretty soon. I just have to clean up a lot of things that are still in there. I will be constantly pushing updates to the Github Repo as I have time. This version will only work with 3.0.5. The older version for 3.0.4 is still available, but I will no longer be maintaining it.

Here are some pics of it.

 

ISPConfig-Login

ISPConfig-Dashboard

 

ISPConfig-DNS