Z-Car

Verizon FIOS box keeps beeping and red battery light is on – Cheap Replacement

Battery-Girl-2

So you suddenly notice that your FIOS box, usually mounted in your basement or garage, is beeping. On closer inspection, the red replace battery light is on. If you call Verizon, you will also learn that they will not replace the battery, it is your responsibility. They will sell you a new one, but it is not cheap.

Save yourself time, frustration, and money!  There are DIY solutions that will help you solve this issue.  Don’t waste your time trying to contact Verizon, or paying someone to turn off the beep.  This will only leave you frustrated, and out a lot of money.  

Now that you know this, you have two options that will save you a lot of money.

The first is to simply reset the unit. It seems that the FIOS box will often erroneously report that you have a bad battery, when you actually do not. To do this, unplug the FIOS box. Then open the battery compartment. Inside will be the sealed battery with two wires coming from it. Remove either the black or red connector, it may be easier to do if you slightly remove the battery by pressing down on the two plastic clips holding it place. Then wait for a minute or two after unplugging the battery. Then reconnect, close up the panel, and plug the box back into AC. At this point, you most likely will notice that the red light goes out, and no more beeping.

If this does not work, it means your battery is bad. Replacing your battery is a very easy process, and a new battery is amazingly cheap.  Don’t pay an outrageous amount of money for an “official” battery.  A OEM quality battery can be had for less than $20. You can buy a replacement locally, or order from Amazon here.  To install, remove power, open box, and remove both connectors.  Remove the battery and replace with the new one.  Make sure you hook up the red lead to the positive battery terminal, and the black lead to the negative.  Close everything up, and turn back on.  Congratulate yourself on saving some bucks and eliminating the annoying beep.

 Verizon FIOS Battery Backup

fios battery backup


Installing LetsEncrypt Certbot on Amazon Linux Server

The LetsEncrypt Certbot is an awesome tool for getting and maintaining SSL certificates for your sites.  In most cases, it is extremely easy to setup and maintain.  However, installing it on Amazon’s proprietary Linux server in EC2, it often fails.  These are the steps I took to get it to install properly in my environment.  

wget https://dl.eff.org/certbot-auto
chmod a+x ./certbot-auto
sudo yum install libffi-devel
sudo yum install openssl-devel
sudo chown -R ec2-user:ec2-user .well-known/
./certbot-auto –no-self-upgrade –no-bootstrap

After performing these commands, you should now be able to use Certbot as you would normally.

Certbot will place your completed SSL certs in the following paths.

  • Certificate: /etc/letsencrypt/live/YOUR_WEBSITE_HERE/cert.pem
  • Full Chain: /etc/letsencrypt/live/YOUR_WEBSITE_HERE/fullchain.pem
  • Private Key: /etc/letsencrypt/live/YOUR_WEBSITE_HERE/privkey.pem

To setup auto renew, you will need to add the following line to your crontab file.  Make sure you are running as root when you do so using sudo su.

Adding this  line will run the renewal process twice per day.

0 2,14 * * * /home/ec2-user/certbot-auto renew

 If you have any issues, leave a message in the comments so we can help.


Upgrade your Miata’s headlights with Hella H4 halogen bulbs, Cibie eCode projectors, and a relay kit.

 

My 1994 Mazda Miata has suffered over the years with a very poor headlight setup.  It got to the point where I just did not enjoy driving it at night anymore.  The pathetic yellow light dripped from the front of the car, providing limited visibility, even in urban driving.  Rural driving, out where I live, was just down right scary.

So, I finally decided to do something about it.  I ultimately decided to upgrade my sealed beams for a set of Cibie eCode projectors fitted with H4 100/80W bulbs.  When upping the watts and amperage from stock values to these floodlights, it is important to add an aftermarket lighting relay.  Your factory wiring harness and light switch will thank you, 20 year old thin wire usually does not like having 10+A flowing through it on a regular basis.  

First step, buy a quality relay harness that will work with your Miata.  The picture below shows the unit I went with.  Installation took all of about an hour.  I suggest connecting the power to the main fuse panel via the main breaker bolt.  Also, wire it in with your stock lights first to test operation before upgrading to the H4’s.  Changing one thing at a time helps with troubleshooting if you run into any issues.

The next step is to replace your sealed beams with the Cibie eCodes.  These are European styled projectors that will amaze you with how much better they project light down the road.  The light is focused, yet is aimed so as not to dazzle oncoming traffic.  Swapping out the projectors just involve popping your headlights, removing the plastic shroud around the pop-up, and then loosen the three screws around the silver retaining benzel.  

 

Lastly, we get to the Hella H4 100/80W bulbs.  Most folks will stick with the more standard 60/55W bulbs, however I highly recommend upgrading to a higher wattage.  The difference in output is just stunning, and when combined with the Cibie eCodes, you will not blind other drivers.  There are other wattage H4’s such as a 130/90, 130/100, and 100/90.  As long as you have upgraded your wiring with a relay harness, it is safe to give these bulbs a try.  However, it has been reported that the high wattage bulbs have very short lifetimes, sometimes only hundreds of hours before they fail.  Also, care must be taken when installing an H4 to get NO fingerprints on the bulb.  The oil from your hands will cause early failure as well. 

If you shop around (click on pictures to see on Amazon), you can pick up all the parts you need for less than $150.  And, future replacement bulbs can be picked up for less than $10 each.  Don’t put it off, click on the pictures above, go to Amazon, and be amazed at how awesome a new headlight setup will enhance your night time driving!  Leave a message to let us know how it goes for you.  

 


Troubleshooting and Hacking the Ambient Weather WS-0900 Weather Station

For Christmas I received the Ambient Weather WS-0900-IP Wireless Internet Remote Monitoring Weather Station.  This little unit is a great way to setup your own personal weather station, which as a bonus allows you to access the data over the Internet.

So, after setting up the unit, and playing with it for a while, I got the urge to start hacking it.  I found out that you can access the device over telnet.  The built-in controller has a limited set of commands, and unfortunately on this model, does not really have much utility.  After playing around with various commands to try and redirect the units update from weather underground to my own servers, I accidently used the fwupdate command which wiped out the units ROM.

Lesson learned, don’t mess around with stuff unless you are ok breaking it!  After a bit, I was able to work out the following procedure for reloading a valid firmware.

This is the proper fix if your  IP Observer is not connecting.  In this case, only the Power, Link and ACT lights are lit blue on the unit, and the ObserverIP module does not communicate to the server, and you cannot access the unit via the built-in web server.   This state will require that the firmware be reloaded.

  • Download the latest firmware here:  http://www.AmbientWeather.com/observerip.html 
  • Turn off the power to  the ObserverIP module however leave it connected to your network. 
  • Launch the IP Tools.   Because the ObserverIP module is turned off, you will not be able to locate it on your network, but continue anyway. 
  • Select the Upgrade button in IP Tools. 
  • Select the Select File button, and browse to the location of the file you downloaded in Step 1. 
  • Select the Upgrade Firmware button. 
  • Plug in the ObserverIP module. The software will locate the device on your network and begin the update.  The dialog box will display Received a Read Request from the ObserverIP module. A green progress bar will provide you with the upgrade status. 
  • Once the firmware upgrade is complete, the dialog box will display Read session is completed successfully.
  • Wait about one minute for the ObserverIP module to reboot, and then access the web server.

You should have a restored fully functioning unit!  I still have not been able to redirect the weather updates to another server.  In my unit, a WS-0900 with the 3.0.8 version it appear that the server that it connects to is a hard coded IP address.  Leave a message here if you have found a way to make this work.


Some useful custom SpamAssassin rules and settings – modify your own

 

I have a Linux server that I use for managing web sites, development work, etc.  In addition, I use it to host a mail server for two domains that I have had since 1993.  Because of their age, and the number of email addresses that were used on them over the years, they receive a LOT of Spam.  In order to manage this huge volume of SPAM, I use SpamAssassin, and a ton of custom rules in Postfix to minimize the amount of spam that ultimately reached my inbox.  

Here is a collection of score changes, and custom filters that I use.  These change on a fairly regular basis, as the Spammers are always making changes.  I will try and keep this updated fairly often.

If you have any questions on how to write a rule, or have a suggestion for a good one, leave a comment or email.  

score RAZOR2_CHECK 5
score BAYES_999 1.0
score BAYES_00 -4
score T_FREEMAIL_DOC_PDF 2
score DIGEST_MULTIPLE 5
score MPART_ALT_DIFF 5
score RCVD_IN_MSPIKE_L5 4
score URIBL_BLACK 5
score URIBL_DBL_SPAM 5
score DCC_CHECK 5
score PYZOR_CHECK 5

mimeheader ZIP_ATTACHED Content-Type =~ /zip|xls|docm|doc/i
describe ZIP_ATTACHED email contains a zip file attachment
score ZIP_ATTACHED 4.5
header CUSTOM_PHP_ID_SPAM X-PHP-Originating-Script =~ /class.php/
score CUSTOM_PHP_ID_SPAM 5

header CUSTOM_UNQ_ID_SPAM X-MC-Unique =~ /randcase/
score CUSTOM_UNQ_ID_SPAM 5

header CUSTOM_UA_ID_SPAM User-Agent =~ /Mutt/
score CUSTOM_UA_ID_SPAM 5

rawbody CUSTOM_GMAIL_SPAM /style\=\”color\:\#245dc1\;text\-decoration\:none\;/
score CUSTOM_GMAIL_SPAM 4

rawbody CUSTOM_WHATSAP_SPAM /background\:\#d9d9d9\;font\-family\:arial\;font\-weight\:normal\;font\-size\:11px\;color\:\#808080\;/
score CUSTOM_WHATSAP_SPAM 4

rawbody CUSTOM_FEDEX_SPAM /style\=\”text\-decoration\:none\;color\:\#4d148c\;\” alt\=\”Privacy policy\” title\=\”Privacy policy/
score CUSTOM_FEDEX_SPAM 4

body CUSTOM_FARGO_SPAM /FARGO\, ND 58103/
score CUSTOM_FARGO_SPAM 4

rawbody CUSTOM_INLINE_IMAGE /src=”cid:/
score CUSTOM_INLINE_IMAGE 5.5

rawbody CUSTOM_TRACKING_CODE /img src=”(.*)\.us(.*)\?email/
score CUSTOM_TRACKING_CODE 5.5

rawbody CUSTOM_ENDS_IN_GUID /[A-Za-z0-9]{8}[A-Za-z0-9]{4}[A-Za-z0-9]{4}[A-Za-z0-9]{4}[A-Za-z0-9]{12}$/
score CUSTOM_ENDS_IN_GUID 7.5

rawbody CUSTOM_ALT_IN_GUID /alt=”[A-Za-z0-9]{8}[A-Za-z0-9]{4}[A-Za-z0-9]{4}[A-Za-z0-9]{4}[A-Za-z0-9]{12}”/
score CUSTOM_ALT_IN_GUID 0.5

 


Building a custom version of Apache 2.4 on CentOS – Support for socket.io proxying

Last year I needed a way to create a specific Apache version that would support proper handling of proxying socket.io  connections to a Node client.  I had to hunt around, however here are some notes I created to get the version I needed built.

There are a lot of threads on the Internet that point to running Apache 2.4 on RHEL 6 as being a difficult setup. It’s actually quite easy, thanks to Apache’s wonderful packaging. Since Apache builds their source packages so they can easily be compiled into RPMs. (All of these steps were performed on a fresh installation of CentOS 6.6.)

First we need to install all of the tools for building RPMs and create the directory structure –

yum -y install rpm-build
mkdir -p ~/rpmbuild/{SOURCES,SPECS,BUILD,RPMS,SRPMS}

Let’s start by downloading the Apache Httpd sources and trying to compile –

cd ~/rpmbuild/SOURCES
wget http://www.gtlib.gatech.edu/pub/apache/httpd/httpd-2.4.4.tar.bz2

Now we can identify the missing dependencies and figure out how to continue –

# rpmbuild -tb httpd-2.4.4.tar.bz2 
error: Failed build dependencies:
    autoconf is needed by httpd-2.4.4-1.x86_64
    apr-devel >= 1.4.0 is needed by httpd-2.4.4-1.x86_64
    apr-util-devel >= 1.4.0 is needed by httpd-2.4.4-1.x86_64
    pcre-devel >= 5.0 is needed by httpd-2.4.4-1.x86_64
    openldap-devel is needed by httpd-2.4.4-1.x86_64
    lua-devel is needed by httpd-2.4.4-1.x86_64
    libxml2-devel is needed by httpd-2.4.4-1.x86_64
    distcache-devel is needed by httpd-2.4.4-1.x86_64

We have packages available for autoconf, pcre-devel, openldap-devel, lua-devel, and libxml2-devel. APR is included in RHEL and CentOS, but it’s unfortunately an old version, so we’ll have to recompile that too. distcache is often the problem people are reporting when installing Apache 2.4, but continue reading for a nice trick to make this easier.

Next, we’ll download the sources of all of the custom packages we need to compile for Apache (your versions may change) –

cd ~/rpmbuild/SOURCES
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-1.4.6.tar.bz2
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-util-1.5.2.tar.bz2

Each of these can now be easily used to create RPMs for installation. Let’s start with APR –

cd ~/rpmbuild/SOURCES
# Install apr dependencies
yum -y install autoconf libtool doxygen
rpmbuild -tb apr-1.4.6.tar.bz2
# Install our freshly build apr RPMs
rpm -ivh ~/rpmbuild/RPMS/x86_64/apr-1.4.6-1.x86_64.rpm ~/rpmbuild/RPMS/x86_64/apr-devel-1.4.6-1.x86_64.rpm
# Install apr-util dependencies
yum -y install expat-devel libuuid-devel db4-devel postgresql-devel mysql-devel freetds-devel unixODBC-devel openldap-devel nss-devel
# For some reason this has failed for me once or twice, but completed successfully the next time.
rpmbuild -tb apr-util-1.5.2.tar.bz2
rpm -ivh ~/rpmbuild/RPMS/x86_64/apr-util-1.5.2-1.x86_64.rpm ~/rpmbuild/RPMS/x86_64/apr-util-devel-1.5.2-1.x86_64.rpm

Installing distcache on RHEL can be a pain, but we can take advantage of Fedora’s SRPM to get us started –

cd ~/rpmbuild/SRPMS
wget http://www.gtlib.gatech.edu/pub/fedora.redhat/linux/releases/18/Fedora/source/SRPMS/d/distcache-1.4.5-23.src.rpm
rpmbuild --rebuild distcache-1.4.5-23.src.rpm
rpm -ivh ~/rpmbuild/RPMS/x86_64/distcache-1.4.5-23.x86_64.rpm ~/rpmbuild/RPMS/x86_64/distcache-devel-1.4.5-23.x86_64.rpm

Now that we have apr and distcache taken care of, the Apache compilation and install is quite easy –

cd ~/rpmbuild/SOURCES/
# Install remaining httpd dependencies
yum -y install pcre-devel lua-devel libxml2-devel
rpmbuild -tb httpd-2.4.4.tar.bz2

Now you’re ready to install httpd, but you’ll get one last error –

$ rpm -ivh ~/rpmbuild/RPMS/x86_64/httpd-2.4.4-1.x86_64.rpm 
    error: Failed dependencies:
        /etc/mime.types is needed by httpd-2.4.4-1.x86_64

Let’s find out which package provides that file –

$ yum whatprovides "/etc/mime.types"
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.osuosl.org
 * epel: ftp.osuosl.org
 * extras: ftp.osuosl.org
 * updates: ftp.usf.edu
mailcap-2.1.31-2.el6.noarch : Helper application and MIME type associations for file types
Repo        : base
Matched from:
Filename    : /etc/mime.types

We’re finally ready to install httpd –

yum -y install mailcap
rpm -ivh ~/rpmbuild/RPMS/x86_64/httpd-2.4.4-1.x86_64.rpm

Now you’re all ready to go with Apache 2.4! And since you’ve built proper RPMs, you’re also ready to deploy the packages out to all of your servers.

ProxyPass        /    ws://localhost:8080/
ProxyPassReverse /    ws://localhost:8080/
ProxyPass        /    wss://localhost:8080/
ProxyPassReverse /    wss://localhost:8080/

ProxyPass        /  http://localhost:8080/
ProxyPassReverse /  http://localhost:8080/

 

This works

RewriteEngine on

    RewriteCond %{QUERY_STRING} transport=polling
    RewriteRule /(.*)$ http://localhost:$port/$1 [P]

    ProxyRequests off
    ProxyPass /socket.io-client/ ws://localhost:$port/socket.io-client/
    ProxyPassReverse /socket.io-client/ ws://localhost:$port/socket.io-client/

    ProxyPass / http://localhost:$port/
    ProxyPassReverse / http://localhost:$port/


How to add DRL and LED to your Miata NA.

girl fixing a miata

As I have been daily driving my 1994 Miata NA for the last year or so, I have been more cognisant of trying to make the little Miata more visible. We also have a lot of divided highways out this way that require headlights to be on, and the police enforce it. I hate raising the barn doors, and if I just turn on my parking lights, they don’t really do much, and I always forget that I left them on.

So, I decided to get a couple of smoked replacement lights ($50 on Amazon for a pair), and modify them. I opened up the unused half of the light and used a LED for the parking and turn signal, and used the main bay with a H11 LED.  If you follow along, I will show you what you need to do to make this work.  In addition, you can easily wire in a relay to make your parking lights come on whenever the car is running.

First get some of these nice smoked turn signal assemblies.

IMG_1783

Then buy a set of 3157 parking and turn signal bulbs, I like these, and get this pigtail harness.  I also used H11 LED bulbs as the main DRL, I got these, and also the pigtails.  What we are going to do is open up the normally closed section on the parking light assembly.  I used a soldering iron to melt it out.   Once you get a good fit, a glob of silicone sealant will hold them in place and seal the opening from moisture.

IMG_1781

You will now need to wire the lights up.  This will vary by pigtail, lights, and assembly, but in general you will want to wire red to red and black to black.  The blue for the turn signal light will connect with the turn signal light coming from your original parking light wiring.  This is all pretty simple, leave a message if you have any issues.

IMG_1782

As you can see, it worked out pretty well. I wired in a relay that turns them on whenever the the car is in Run, instant DRL. I also wired the side markers to flash with the turn signals.

IMG_1784