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.
Tools needed, New Batteries, Sharpie, Phillips Screwdriver, Utility knife(was in picture for cutting the new box of batteries open only, haha).
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!
NOTE: You can also manipulate and edit this file rather than deleting it.
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.
- 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.
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:
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
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!!
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 /
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!!