• Replacing 8x RBC43 Batteries in a APC SUA3000RM2U UPS

    So it finally happened. The Batteries in my APC SUA3000RM2U finally went bad. I’ve had them for over 5 years so I am happy with there life. I’ve had to replace UPS Battery Cartridges and Packs before when working as a Data Center consultant. It is usually a simple and straight forward task. I would RMA the Battery Cartridge or Pack, if it’s under warranty, and then the manufacturer would send me back a new Battery Cartridge or Pack already filled with new batteries. Hot swap it with the old one and you are done.

    However, this time it was my home unit and I don’t have warranty coverage or the extended one(usually purchased by an enterprise). So I went online looking for a Battery Cartridge replacement, $300-400!!!, o my! So I decided to try and replace the batteries themselves rather than the entire Battery Cartridge. I was able to find a pack of 8 batteries for around $83 with free expedite shipping. The following steps were what I did to replace each APC RBC43 battery inside the battery cartridge.

    1. Tools needed, New Batteries, Sharpie, Phillips Screwdriver, Utility knife(was in picture for cutting the new box of batteries open only, haha).

    [Read More…]

  • Reset ethX naming for Ubuntu/Debian

    I stumbled across this issue a long time ago and it is still present today. Adding or removing NIC’s from a Linux box, or even replacing them renumbers or messes with the numbering for each NIC. For example if you have 1 NIC and add a second, sometimes it won’t show up as eth0 and eth1, it will show up as eth0 and rename1. Or even sometimes, your original eth0 will be renamed to rename1 and the new NIC will be named eth0 when added. Yikes! Talk about confusion.

    It appears that this naming information is stored in a file located in  /etc/udev/rules.d/70-persistent-net.rules

    So if you want to reset the numbering completely, delete this file and reboot! Now you have clean eth# numbering again!

    rm /etc/udev/rules.d/70-persistent-net.rules

    NOTE: You can also manipulate and edit this file rather than deleting it.

  • Linux dd Operations

    I recently was helping a friend with some computer trouble which resulting in me first creating a full disk Image backup using “dd”. I’ve done this before years ago, but I wanted to add some of the common dd backup/restore methods to my notepad. There are so many articles online on how to use dd to do a Full disk backup and restore it. I will be using similar methods.

    dd Terms

    • if — input device (file,hardware,CD,etc).
    • of — output device (file,hardware,CD,etc).
    • bs — sets “dd” read and write size.
    • noerror — continues after read errors.
    • readom — CD to ISO utility.
    • mount — Linux command to mount file-systems
    • gz — gunzip is a compression utility which helps to reduce the size of images created with dd.
    • md5sum — a checksum utility to ensure integrity when moving large image files.

    [Read More…]

  • Apache Logs -Stop Logging Certain URIs

    I recently posted an article talking about HAProxy as a load balancer. In the article I spoke about using a HTML health check file to maintain status of each servers Apache instance. The problem is this will flood your Apache server access logs every time this health check occurs, which I believe is every 2 seconds.

    So you end up with a log file like this:
    health check apache logs

    To correct this issue we need to modify the apache2.conf file on each server, and explicitly tell Apache NOT to log this URI to the access logs. So, from the previous article the culprit URI is /healthcheck.html. Open your Apache configuration file.

     sudo vi /etc/apache2/apache2.conf

    Now add this above the CustomLog section:

            SetEnvIf Request_URI "^/healthcheck.html$" dontlog
            CustomLog /www/logs/mysite_access_logs combined env=!dontlog
            ErrorLog /www/logs/mysite_error_logs

    NOTICE: Make sure you have the ” escape character for any special characters.

    That’s it! No more spamming of all the health checks to our Apache logs!!


  • Setting Up Your Own Personal Music Cloud with Ampache

    So, I am taking a road trip across the country and I wanted a quick and easy way to access all my music from my media server at home. I also wanted the ability to cache my music for the flight or download it onto my Android phone prior to the flight. Utilizing my 4G phone I realized the best way to do this was to set up my own personal music cloud! Now there are many different services that do this:

    • Pandora.com, which is a music radio station that palys music base on likes. I really like this site.
    • Slacker.com, which is similar to Pandora.com
    • Google Music, which allows you to upload up to 5,000 songs(I think) of you music for free!
    • SubSonic, similar to Ampache that I’ll be using in this article.
    • Ampache, I played with this application a few years ago and liked how customizable it is and it uses Apache (which I have already installed.)

    My set up:

    • Mediaserver with my Music running on Ubuntu 12.04 with LAMP
    • Android Phone with Amdroid
  • Showing Cowsay and Fortune in every Terminal

    I was wondering today…I used to see this screenshot of a ASCII cow in a terminal that was giving some sort of advice or fortune. After a little googling I found the application fortune which shows you a simple fortune when run from a terminal on linux/unix. I also found the application cowsay which is the app that shows the ASCII art of animals with a comic balloon. By default a cow, however there are many others. I chose tux.

    $ fortune | cowsay
    / Don't go around saying the world owes 
    | you a living. The world owes you      |
    | nothing. It was here first.           |
    |                                       |
     -- Mark Twain                         /
                (__)       )/
                    ||----w |
                    ||     ||

    Why the pipe? because fortune echos a string, and cowsay reads in a string.

    Now the problem was I had to type the command every single time. To solve this we turn to your users .bashrc file. Located ~/.bashrc for Ubuntu users. Edit the file with your favorite text editor and add the following lines at the bottom.

    if [ -x /usr/games/cowsay -a -x /usr/games/fortune ]; then
        fortune | cowsay

    (if statement checks to make sure both cowsay and fortune are installed)
    Now, everytime you open a terminal or command prompt you’ll have a cool animal telling you a fortune!

    Cool Android app here. This will send SMS text messages from your phone as cowsay!!