Pure Win – Monitoring Comcast’s Failures

So this is the greatest thing I have read in ages; for those too lazy to click a person having lots of problems with Comcast took it upon themselves to create a python script that ran a speed test and if certain conditions were met would send a tweet to Comcast complaining about not getting what they paid for.  Unfortunately there are lots of people getting paid to fellate Comcast and they flocked to the r/technology thread on Reddit to remind OP that he should be grateful for paying a pile of cash for “up to 150 Mbit” like he is somehow blessed to have the absolute worst company in the US as his ISP.  Naturally I grabbed the code and set it up on my development box to run every 15 minutes so hopefully in like a week or so I can generate a fancy graph to see just how bad Comcast is boning me on my already high monthly bill.

Snowmageddon 2016

So most of the east coast is currently buried up to its nether-bits in snow in case you haven’t been keeping up with things.  I figured this would be an ideal time to slap my newly purchased GoPro up in the window and let it take time-lapse pictures of the snowfall as it started to come down yesterday.  Unfortunately I found out after I had filled up the 32gb memory card that it was only able to take pictures at half second intervals so I didn’t get anywhere near the amount of data I wanted to create a cool looking timelapse of the snowfall, however I did mange to cover the first maybe hour or two of it and process it to a video for the enjoyment of the masses.

Strange copy behavior?

So a friend hit me up today to let me know he had updated a sqlite database that we use in a project and I could go ahead and copy it over to my home directory to update things with.  Login to the box, sudo to root and cop the file with full paths and something bizarre happened, the file which he had ownership of changed over to my user level account.  Immediately he suggested that it might be the -a flag in an alias, however my alias was simply set to use -i so I deleted the file from my home directory and tried the copy again.  As far as I can tell this shouldn’t actually be happening because I didn’t specify the -a flag and the user moving the file is root, so if anything root should have ownership of the file once it hits the directory.  I doubt this is any kind of nefarious or exploitable situation but it does seem strange because I remember forgetting to chown files in the past after moving them as root and things not working until I went back and corrected the ownership of the files

Troubleshooting Script

I have been planning to try to convince a friend to take up Linux in place of her aging Windows 8.1 system since its been officially put out to pasture by Microsoft so I started thinking about supporting said system since my friend is not exactly a Linux guru.  This of course lead me to think about a very handy script I use at work that does a whole bunch of things like check database settings, look for necessary running processes and look at system loads of our software to determine if there are any easy fixes before getting into logs and headaches.  Naturally I cannot share this script because its work related (and I didn’t write it either) but it made me decide to make a version of my own that I can show off.  Currently the script resembles a rather ugly gnome of some type in that it is short and VERY ugly but I figured I would toss it out so I can test a few other things like my nifty social share buttons that are about as basic as you can get without setting foot inside a HS Chemistry classroom.

Github/Gist

The long term goal for this script is to make it collect a whole load of system data, run some basic checks like pinging Google, and probably a few other things like making sure vital things like crontab haven’t been somehow deleted.  Probably will also make it verify that my ssh key is still active within the system so that if I have to I can remote into said system and might consider some sort of reverse ssh invocation as well if I really want to get fancy with the script.  If it saves me even 10 minutes when trying to fix the system that I haven’t even setup yet then my past hour or so messing with it and remembering all the things I’ve forgotten about scripting in the past few months was well worth it, plus it gets me back to actually posting something here for a change.

Cliche End-of-year Introspection

I was just kind of aimlessly scrolling around making sure things worked right after having to restore from a mangled updated and I realized that this blog has been up for five years now. The first post I made was in September of 2010, and since then I have managed a whopping 102 posts over the course of those five years. Doing some napkin math that works out to about one post every 17 days if things were spaced out evenly, though I suspect its anything but. Kind of surprising to think that 5 years have passed since I puzzled together how to slap WordPress up onto a Digital Ocean droplet and start spouting off my random stupid thoughts. Most days I don’t even think about the blog, hell most days I try not to think at all if I can help it.

It is however amazing to think that I have this little slice of the internet to myself to use as a personal soap box and sometimes portfolio of my various attempts at programming something interesting or useful. Back in the day it was an Angelfire website I posted Duke Nukem 3d maps to which then evolved into teenage angst on Tripod as I learned a little more about things like HTML and CSS while perpetrating absolutely horrifying graphic laden designs that have thankfully been forgotten for the most part. Along the way I have managed to learn a few things, like how to fill my basement with loud computers that sometimes do what I tell them and give me a place to try out things that might otherwise bring down actual production systems at work. I can safely say that I can write terrible code in PHP and Python both, and I bet I could make some awesomely inefficient shit in Go given enough Wild Turkey. I can sometimes understand the difference between DELETE and SELECT when writing MySQL queries and I understand that Salt not only makes my heart die a little bit but also lets me ruin multiple VMs at once in my lab.

So I guess maybe I have learned a few things over the past few years, but most days it sure doesn’t feel like it; I’ve been told that is a sign of actual wisdom but I’m not convinced just yet. Its far more likely that I am just a very clever impostor who has somehow wormed his way up from renting movies in a dying video store to being allowed to assume the mantle of Technical Support Engineer and get paid far more than my pathetic knowledge and lack of skill is really worth. Most of the time I feel tired, confused and quite often way more stressed than a single 32 year old male with no kids or pets should be, and unfortunately I don’t think that is going to ever change no matter how much money I make or fancy titles I get.

Go find some prime numbers!

So a few friends keep bugging me that I need to learn their wonderful hipster language Go, finally I relented this evening and poked around in it for about 45 minutes to create my tried and true primes code that I can almost do in my sleep now. Its ugly and nowhere near as fast as I had it running in C++ back in the day but its kinda cool that I could get it done in about an hour from first writing a line of code in Go. I honestly don’t know if I will ever use the language as a main language in any projects but its the first time I have touched a compiled language in probably the better part of 5 years, these days I do about 105% of my things in Python or Bash when there are command line tools to do most of what I want.

The grass is NOT always greener.

I really can’t place what it is that bothers me so much, maybe it is the overall lack of oversight and overbearing micro-mangers that makes it hard for me to feel at home here. It could be from the clean and relatively new work-space, all that cleaner getting to my head or something like that. Heck it could even be that I don’t have to lug the computer with me everywhere yet (eventually I will have to participate in the on-call rotation) reminding me that I am basically a company’s property. That might seem like hyperbole but when you work for a Managed Service Provider you are the IT version of a prostitute, you answer to your Pimp and do what they say or you get curbed so fast your head spins at a solid 7200 RPMs. All I know for sure is that after a month and a half I still don’t feel like I belong here and I barely grasp any of the specialized things that I need to in order to carry out the job I have been hired to do.

Sure it might seem premature to be considering another move already, but the fact is that after my previous four years I can’t imagine spending several years in a place where I don’t even feel like part of the team. Rapid movements in the IT field often are looked down upon, but being miserable is a quick way to burn-out and depression and often end up completely ruining you as a person. At the end of my previous gig I found myself unable to care about much of anything and honestly considered just outright quitting without notice, when you reach that point you know something is seriously wrong. The only misgiving I had about outright quitting was the people I worked with; I at least wanted to say goodbye to the various friends I had made over the years
.
Even attempting to throw myself into projects to keep my skills sharp seems to be less than useful, I end up not having much time to spend on them during the week and on the weekends all I want to do is veg out and not think at all. I think that’s another part that bothers me, I had lots of leeway at the last job in that we oversaw the whole OS as opposed to these selective appliances at the new place that only do one task and our hands are largely tied because the development team controls it all. Not that I have anything against that kind of model on the whole, just that it makes for a very restrictive environment to adapt to coming from a place where we had full authority over servers right up to various software like Oracle where we would hand off to the DBA team.

The main thing I have learned over the past few months is that the grass might look green as hell on the other side of the fence but you can’t see all those sharp nails and shit buried underneath it. Don’t rush into changing jobs just because you don’t like the direction your current employer is taking because you might find yourself in a gilded prison of sorts, trapped by the money in a box made of very solid walls.

Four Years of Conditioning

So I just started a new job and its made me realize a few things. First is that I was at the previous gig for far too long, just over 4 years to be precise. That is an awful long time now that I actually sit down and think about it, four years of driving an hour each way to get paid enough to make ends meet and buy a house along the way. A whopping 49 months of dodging crazy drivers on the highway, sitting in traffic behind an accident and twitching at every deer on the side of the road at night.

Despite that long duration its taken only a few days at the new place to realize just how badly I have been messed up by the previous employer. Its not even that the direct supervisor or manager were bad people, to be honest their hands were mostly tied by the corporate structure in place that moved at the pace of drunken dinosaurs in tar. One of the biggest things is the change in lighting, the new office is so bright it sometimes bothers my eyes if I don’t look at something dull like a piece of paper or my matte black new Dell laptop. While I’m thinking about laptops let me contrast the previous with the new; HP Elitebook i5 w/ 4GB of RAM and Windows 7 x32 (with a flat out refusal to update to x64) versus a brand new Dell i7 w/ a 256GB SSD and 8GB of RAM and an x64 version of Windows. You would think over 4 years the hardware would have been updated but somewhere along the line a policy was put in place that you had to justify updated equipment, so instead of getting a new machine at 3 years I was told to suck it up.

Without going through every little difference the main point I am making is that I didn’t realize how bad I really had it at the previous job until I finally left. Sure I miss the people I worked with, they were probably the only reason I managed to make it to the four year mark. But now I can’t help but shake this feeling that the other shoe is waiting to drop at the new job, that some dark secret or terrible truth is waiting to spring free when I finally let my guard down and accept that not every employer is a monolithic behemoth of bureaucracy that that treats its employees more like prison inmates than actual free people doing a service for them. This of course is not healthy in the least bit, but it is what it is and I have to fight every day to not let that negative voice inside my head be the loudest.

Extended Regex and Bash variables

So it seems that lots of people have posted about how to use regex when invoking sed, however they forget that most of the good things are restricted to extended regular expressions, so here is a quick illustration of how to get extended regex and bash variables in the same line for sed.

The important part is that -r, which lets you use extended regex. Also by enclosing the pattern in double quotes instead of single you can use system variables which makes this very handy for doing replacements on incorrect config files that automation might have mangled.

Find RHN contract number on a live system

This only really works on systems utilizing subscription manager, but it works and its handy

[root@server1 ~]# subscription-manager list --consumed

+-------------------------------------------+
Consumed Product Subscriptions
+-------------------------------------------+

ProductName: Red Hat Enterprise Linux Server
ContractNumber: 1458961
SerialNumber: 171286550006020205
Active: True
Begins: 2009-01-01
Expires: 2011-12-31