Comcast’s Awesomely Accurate Progress Bar

One of my favorite parts of being a Comcast customer is getting to login to my client portal and see my data usage.  (Of course I will enjoy this much less if they eventually decide to enforce their 250GB cap in my area, that will require me to find another ISP or pay their unlimited usage charge or a business class tier).

What I do get a good laugh out of is their ridiculously arbitrary progress bar.

Here is my data usage for January 2016:
comcast-meter-january

As you can see, I used 560GB of data… which although their (non-enforced) cap is 250GB, this appears to be roughly 60% of some arbitrary maximum?

 

I was quite surprised to login today on February 2nd and see this fantastic usage meter appear:
comcast-meter-4gb-off

It would seem that 4GB is almost as much usage as 560GB, who’d have thought?!

I checked on the other page as well and found the same ridiculousness:
comcast-meter-february

I would love to know what’s going on in Comcast’s heads sometimes!

Installing Munin Node on XenServer 6.5

I recently was working with XenServer 6.5 and I wanted to install a Munin Node for graphing system vitals.

Getting Yum working properly to do the install required a bit of Googling, so I wanted to document these commands in case this is helpful to anyone else.

First, you’ll need to install the EPEL repository:

yum --enablerepo=extras install epel-release

Then, you’ll need to install munin-node using both base and epel repositories.

yum --enablerepo=epel --enablerepo=base install munin-node

If you are monitoring with a remote Munin server, don’t forget to add an allow rule in /etc/munin/munin-node.conf, using your favorite text editor.

You can put it somewhere by this line:

allow ^127\.0\.0\.1$

Do not fear the regex, that rule allows connections from “127.0.0.1”.  Just replace the digits and leave the other characters alone, and you can use this regex to allow any IPv4 address easily.

Now, we want to go ahead and add the Munin Node to the system startup, and start the process.

chkconfig munin-node on
service munin-node start

Don’t forget to allow incoming port 4949 TCP in your firewall if you are using a remote server to monitor the connections.  Munin shouldn’t talk to unauthorized IPs, but it wouldn’t hurt to only allow connections from the Munin server on that port.  That will not be covered in the scope of this guide, as I don’t know what firewall solution you are using.

Of course, the last step is to add the node in your /etc/munin/munin.conf on your monitoring server.  That config would look something like this, where 123.45.67.89 is your Xen server.

[xen1.myawesomexenstuff.com]
address 123.45.67.89 
use_node_name yes

From here, I assume you know the drill with Munin, the server should appear on your HTML pages in 5-10 minutes.  If you’re impatient, you can nudge the cron job that does this by running this:

su munin --shell /bin/sh --command munin-cron

Have fun!  As always, please feel free to post any questions you have in the comments section, and I will do my best to assist.

Digital Signage with a Raspberry Pi and Google Slides

I have been looking at an easier way to Digital Signage and I just got my first Raspberry Pi.  I figured the low and High def inputs would allow me to strap a rPi on the back of a TV and provide rich content.

I am looking for a opensource, free/very low cost solution that is easy to manage and simple for the people updating it.  I foresee about 10 devices in my future.

I did a lot of reading and found that there are plenty of projects out there already that enable digital signage for the rPi.  I found this site and started down the list.

I tried a few applications and liked Screenly the best.  It is simple, performs well, and overall just works.  See their online demo for their interface. They provide their own rPi image or allow installation onto raspbian if you want to further customize it.  SSH is available on the Screenly image out of the box.  Screenly allows web pages, images, and videos (MP4) to be streamed to the rPi which gives me plenty of flexibility to mix and match what I like.  They have 2 versions; a centrally managed model or a free, per device management model.

My immediate thoughts were to convert our ancient overused powerpoint into something more rich, but to get users to buy into this solution I would first convert them over to Google Slides which would provide an easy to use, collaborative, updating presentation to all devices without actually touching any of the devices.

I created a simple Google Slide presentation with four or five slides and random comments on it.  I followed these instructions to make it automatically full-screen and play right in the browser.  I took that link and threw it right into Screenly-OSE and viola!

Caveats…

  • Google sets a single time for all slides…  Therefore you cannot make one slide longer than the others (as far as I can tell).  Transitions can be set differently though.
    • You could leverage second presentation and set the delay longer, or use the Screenly interface to get more specific in necessary.
  • One issue I ran into was that if you have Google loop the presentation rather than Screenly, the content never updates.  Obviously this defeats the purpose of using Google Slides in the first place.  Let Google finish the presentation and let Screenly reload the presentation and it will be fairly straightforward.
    • Related to the above post, then timing becomes an issue.  Some simple math should work to fix that though.
      • 5 seconds a slide (as per when publishing within Google) plus 3 seconds for transition time (as set in presentation) times 5 (number of slides) should come out to be about 40 seconds.  Tweak as needed.

Things to investigate:

It appears the database being used is simply for the ‘Playlist’.  I would imagine that the application would refresh the playlist frequently.  That being said, would placing the /home folder in a shared NFS location make management easier?  This could also lessen the wear and tear of the SDcard.  If all clients pointed back to this NFS share, would this update all of the clients or would this require a reboot/restart on the clients to apply any updates?  I do not know how the software is triggered or written… So more experiments to come when I get more Pi’s!

Configuration of OVH IP Failover on VMs

Background
I have had a server with OVH for the past several years, and one of the things that took me many months of research, as well as trial and error, to get right was my IP address configuration for virtual machines.  The documentation available from OVH has been consistently lacking these past few years on how to properly configure it.

Debian \ Ubuntu systems will add to the complications, because they do not agree with the necessary configuration.  If you try to add it traditionally, just by editing /etc/network/interfaces, you will most likely end up with no default gateway when you’re all said and done, and your connection still won’t work.

For the first few months I was with OVH, I was launching my networking through a shell script in a cron job, because configuring it with /etc/network/interfaces just didn’t seem possible.

 

What You Need For This Guide \ Assumptions About Your Setup
1. A dedicated server on the OVH network.  This guide has been tested in the Roubaix datacenter, Gravelines datacenter, and the BHS datacenter.
2. A virtualization platform installed, and a virtual switch bridged with your network interface.  I have been using VMWare, and a vSwitch bridged with my eth0 interface.  This guide should be applicable to any virtualization suite (Xen, OpenVZ, etc) as long as your networking is bridged.
3. A Debian \ Ubuntu VM.  You can apply the knowledge gained from this guide to other operating systems (eg. CentOS) but the configuration will be different as the files are located in different places and are parsed differently.
4. A purchased IP range.  You can purchase IP addresses from OVH in your Manager Panel.

 

Gather Your Information \ Initial Setup On OVH Side
1. Your dedicated server’s Main IP will be needed for this guide.   Say, for example, your main IP is 123.4.5.67.
2. Your dedicated server’s Gateway IP will be needed for this guide.  On the OVH network, this is the first three octets of your main IP, ending in 254.  For 123.4.5.67, the gateway is 123.4.5.254.
3. A Fail Over IP Range registered with OVH.  You can register any size IP block, and you can pick any IP from the block.  Say for example, you bought 5.6.77.8/29.  All of the Fail Over IPs are usable at OVH, so you have available all 8 IPs from 5.6.77.8 to 5.6.77.15 for use for your VMs.  You can purchase an IP block from your Manager Panel.
4. A Registered VM MAC Address associated on OVH’s routers.  Without this step, your connection will not work.  You can register VM MACs in your Manager Panel.

 

How To Register A VM MAC Address
In the new OVH Manager panel, you can register a VM MAC address by going to the “Manage IPs” page, clicking the gear icon next to the IP(s) you want to assign to the VM, and clicking “Add A Virtual MAC”.  You can choose an existing MAC address if you are assigning more than 1 IP, otherwise OVH will assign a new MAC address to you, and you will edit your VM preferences so your network interface has this MAC address.  Make sure you select the MAC address type “VMWare” if you are using a VMWare server, as this will generate MAC addresses which VMWare will accept.  You can use type “OVH” for any other virtualization platform.  The “name of virtual machine” field is just for your notes, and can be anything.

 

Operating System Installation
Install Debian \ Ubuntu to the VM, from a full install media.  Do not plan on doing a network install, as this guide does not cover how to make the OVH networking functional during installation; only after installation.  Skip the step for setting up networking during the installer, leave it unconfigured.

 

Setting Up /etc/network/interfaces
Now that you have your operating system installed, you are ready to configure your /etc/network/interfaces file.  This guide assumes that eth0 is your Internet interface. I will use IP addresses from the example above under “Gather Your Information”.  Do not use these addresses, substitute your own IP addresses.

auto eth0
iface eth0 inet static
	address 5.6.77.8
	netmask 255.255.255.255
	broadcast 5.6.77.8
	post-up route add 123.4.5.254 dev eth0
	post-up route add default gw 123.4.5.254
	post-down route del default gw 123.4.5.254
	post-down route del 123.4.5.254 dev eth0

A few things to note, for anyone asking any technical questions about what I just did above:

  • You should choose 1 IP address from your IP block.  If you want to add more, see the further instructions below.  This IP is the Main IP of your VM.
  • Regardless of the size of your block, you will treat the IP address as a /32 with a netmask 255.255.255.255.
  • Because you are using a /32, the network\broadcast IP is your IP.
  • Your default gateway should be the same as your dedicated server’s default gateway.  DO NOT try to use what should logically be the gateway IP for your IP block, and DO NOT try to set your dedicated server itself as the gateway.  The IP block is irrelevant, the gateway is always the dedicated server’s gateway IP.
  • The routes have to be added this way, because the configuration is not valid.  The gateway should not be reachable from this network range, because it’s a /32.  However, the gateway will be reachable anyway, and adding the routes this way should work.

 

DNS Resolution
You will also need to edit your /etc/resolv.conf to put a DNS name server in there, otherwise your server will be able to ping other IPs, but it will not be able to resolve DNS.  You can just put a line in there, like this line which uses the public OpenDNS resolver:

nameserver 208.67.222.222

 

Want To Add More IPs?
Sometimes it is desirable to have more than one IP address on your server.  You can easily add additional IPs from any IP block as an alias IP.  You don’t need to configure any additional gateways, because the gateway is always your dedicated server gateway.  You can purchase as many IP blocks as you want, and assign them all this way, it doesn’t matter if they are totally different IP ranges.  In the example below, I will add 2 additional IPs from the IP range I used as an example, 5.6.77.8/29.

auto eth0:1
	iface eth0:1 inet static
	address 5.6.77.9/32

auto eth0:2
	iface eth0:2 inet static
	address 5.6.77.10/32

 

Having Problems?
If you are having any problems, please review these items:

  • First, reboot the VM to ensure that all of the networking changes you made are fully applied.
  • Can you ping your default gateway?  If not, did your route persist?  Run “route -n” and see if the route is there.  If it isn’t there, try adding it manually by running the commands in the post-up in /etc/network/interfaces.  See if you get any errors.
  • Did you configure DNS?  Try pinging just an IP address, (eg. ping 4.2.2.1) and see if you get any response.
  • Did you remember to register a MAC address, and did you change the MAC address for the VM?  Run “ifconfig eth0” and make sure the MAC address shown matches what’s registered in your OVH Manager Panel.

 

Need Further Assistance?
As always, feel free to leave a comment below if you need any assistance.  I will be happy to help!

Lenovo ThinkPad W520 – Workaround For Linux Freezing Issue At Boot

Background
I have been a proud Lenovo ThinkPad W520 owner for the past several years, but there has been a persistent issue I have experienced, as I have gone the route of dual booting Windows and Linux on my laptop.

Through the years, I have run Ubuntu 10.04, Xubuntu 12.04, Linux Mint 13, Linux Mint 14, and Linux Mint Debian Edition on this laptop.  Of these distributions, Ubuntu 10.04 is the only one I haven’t had an issue with.

The issue I have experienced is that after a fresh install of Linux, the laptop will freeze every other boot.  Sometimes, it freezes before reaching the login screen, sometimes before even reaching the boot splash screen, and sometimes just moments after logging in.  Other times, it would boot and function normally for hours.  It has been a very flaky issue.

In 2012, I posted a thread on the Ubuntu Forums on how I fixed the issue for 12.04.  I have applied this fix, necessarily, on Linux Mint several times since then as I have done new installs.  I wanted to create this post so others can find this information, and understand that it may apply to other future distributions down the line until this issue gets fixed upstream.

 

The Workaround
I have consistently resolved this issue by adding a boot flag to GRUB.

Edit /etc/default/grub, and add “nox2apic” to your boot parameters, like so:

GRUB_CMDLINE_LINUX_DEFAULT="nox2apic quiet splash"

After making this change, run update-grub and reboot the computer.

This has saved me so much frustration over the years, I hope it helps you as well!  If you run into a similar issue on another ThinkPad model, please let me know in the comments if this fix worked for you!