Thursday, March 23, 2017

Implementing a Simple Weather ScreenSaver in Linux

Starting with that first real-life tornado experience as a seven year old, I have been intrigued with the weather.  Going back to my college days I would watch the Weather Channel for hours-on-end when not doing school work.  After my freshman year (1985 or 86 or 87; don't remember completely), I passed my ham radio Technician test and was able to participate as a weather spotter.

Wanting to watch the weather on my computer while at work, many years ago I wrote a little program that would rotate the Windows background image through several current weather maps downloaded from NOAA and NWS websites.  Honestly, it worked OK, but not stellar.

Living Las Vegas gave me very little drive to be informed with the weather; it was simply depressing.  Hot... Hot...  OMG Hot... WTF Hot... oh... one nice day.  meh...  FUUU HOT!  I did NOT like the weather there.

Now, living back in the mid-west, I have been gaining interest in watching the weather again.  Since watching any cable weather outlet while working is quite distracting, a weather screen saver is the next best thing.  In this post I will detail how to setup a desktop Linux distribution (Debian "Jessie" to be exact) to download maps and radar images from the NWS and have the screen saver cycle through the images.  Personally, this runs on my spare Linux box next to my work computer.

Friday, March 17, 2017

A Linux Mint Live USB With Persistent Storage - The EASY way

Honestly, Linux Mint is my favorite Linux distribution.  Every piece of hardware I have ever thrown at it has worked out-of-the box without additional drivers.  Linux Mint with Xfce is quite lightweight and responsive on the somewhat older and under powered hardware I have a tendency to accumulate and use.

Anyway, to add to my previous post, Linux Mint Saves the Day, I wrote that post immediately after setting up the Live USB and watching a few things from YouTube and Netflix.  Unfortunately it was not after I booted to the flash drive a second time.  You see, the Linux Mint Live USB does NOT have persistent storage.  What I had initially done to setup the machine for watching Netflix was completely gone, thrown into the bit-bucket, fed to the monster of system confusion.  In short, making changes to a Linux Mint Live USB installation will NOT be saved for the next time you start a computer from that Live USB.

So, first thing I did was order a cheap little 250GB drive from NewEgg.  Cost only about $20 I think.  Anyway, while waiting for delivery, I researched the problem.  Oh, there are many interesting looking instructions on how to create a Linux Mint Live USB with persistent storage.  Unfortunately most of these solutions looked to be a bit complex and involved and even somewhat confusing.

Then, I thought of it...  Another flash drive...  Just install Linux Mint from the Live CD to the empty flash drive!  Now...  this is SLOW.  I sat there for nearly two hours while it installed.  And the resulting Linux Mint install on the USB is equally slow but does work.

So...   the solution: install from Linux Mint Live USB to an empty USB.   My recommendation: spend a little more than the cost of a USB drive, buy an inexpensive hard drive and install there.

** BASIC DISCLAIMER 
Don't know if this solution will work in all cases.
I used Linux Mint 18.1 "Serena".
My computer had USB 2, not 3 or some other faster, better interface.
Some other things I can't think of at the moment.

Wednesday, March 8, 2017

Linux Mint Saves the Day

So, there my wife and I were...  Just sitting in front of our television, preparing to continue our binging of Jessica Jones when, for some presently unknown reason our media computer would not boot.  After a bit of investigation I determined that the six year old Seagate hard drive had ceased working properly.  At times the BIOS would see the drive and Windows would partially boot but inevitably lock.  Other times, the BIOS saw no hard drive.

So...  No Netflix, no Winamp, no YouTube, no Hulu...  Nothing but on-the-air broadcasts.  We live in a rather rural area that is only covered by Iowa PBS, and affiliate stations for ABC, CBS, NBC and Fox.

Last night I thought, rather than buy a new hard drive for this old computer, why not just run Linux Mint from a live flash drive?  And there it was...  Just that easy.  Well...  almost...

After getting Linux Mint running on a 16GB USB flash drive, I tried Netflix using Firefox.  Netflix complained that the browser wouldn't handle it.  OK, I download, install and try Chromium.  Nope...  Same thing.  After 30 minutes I discovered the solution...

If you want to watch Netflix on Linux without doing a lot of tweeking, use the Google Chrome browser.  Just install and use. No tweeking or adjusting.  It just works.

Many thanks to the Linux Mint and Google Chrome folks!

Friday, February 10, 2017

Anyone Else Tired???

So, this is my "on-call week" for week.  That means I need to be available constantly from 8AM Monday through 8AM on the next Monday to fix things at work.  Usually not much breaks; us programmers don't like to piss-off the other programmers when they are on-call by writing shit code.  And...  none of us want to get 'the call' from any of our bosses.  Seriously, we are all professional and most of us have worked where I am employed for the last fifteen years.  Personally, I am at nineteen years later this year.

Anyway, being on-call occasionally requires waking up at any hour of the night to fix something that is broken.  Two nights ago something little broke at about 5AM.  It was a simple repair but I couldn't go back to sleep.  Last night I had trouble falling asleep and this morning had to wake up at 4AM to assist with a software roll-out.

I'm tired.

Over the years I have created a list of activities that are verboten on days such as these.  This list includes: buying things online; bidding on items in online auctions; signing anything important; investing; handling power tools; motorcycle riding (or bicycle riding for that matter); boating; building bon-fires and working on the household electrical system.

This morning I added another item to my list of verboten activities...  updating computer operating systems.

I foolishly thought updating my Debian Linux machine would be a no-brainer...  Log on as root and apt-get update and then apt-get upgrade.  Several packages did indeed update.  Even saw a few comments about a kernel upgrade.  No biggie.  I just sat back, focusing on my coffee and the software rollout, allowing the upgrade to continue.

Coffee break.  I check the upgrade and YEA, it is complete.  I then start  my backup script; just a mount and then a call to unison.   BBBZZZTTTTTT!!!!!!!  I see an error...

mount error: cifs filesystem not supported by the system

You see...  I have a Verbatim NAS I use as a hot backup for all my PCs.  My Linux backup script simply uses mount to connect to the NAS and unison to perform the backup.  After the update/install it was just not going to work!  I scrambled...  My Windows machines could connect to the NAS.  My other Linux computers could connect as well.  I was pissed.  I searched and poked and tried different things for hours.

Then...  after several coffee's and a few ef-bombs, something occurred to me...  I hadn't rebooted the machine.  Shit!  I rebooted and SHAZAM, all is good in my Debian Linux world.  Nap time... that's allowed.

Friday, February 3, 2017

What to do with all that speed???

So, computers based on quantum physics are already being planned, designed and in some cases even being created.  The electronics used in quantum computing do not rely on relatively slow semiconductors; they use near instantaneous quantum technology.  No, I don't know the details, but I do know that once some developers get access, there will be abstractions upon abstractions upon abstractions built, to the point where a quantum computer will perform about as well as a 80386 running OS/2.

Monday, November 14, 2016

A Base-64 Decoder That Works!

Let's face it...  debugging ASP.NET production websites can be challenging.  HTML sessions are 'stateless', meaning from one post to the next, the server has no idea what post came first.   For example, let's say there is a website that prompts the user for their name on one page, and on the subsequent page the user is prompted for their address.  Well, the server has no intrinsic way to join the data together from those two pages to save it all in a table somewhere.

Web scripting language use various methods to store this state information.  Some use cookies to store the data from one page to another.  Some use a unique key, placed into a cookie, or in the URL as a parameter to retrieve the data from an internal 'session store' on the server.  ASP.NET can save the session state several ways.  One way to save part of the session state is in something called a ViewState.  This is basically the state of a page; just part of the entire session state.

Well, this ViewState is stored right in the web page as a 64 bit encoded string.  It's not encoded but definitely looks that way.  It's unreadable without a decoder.  Anyway...  If something is stored in the ViewState, programmers can have a bitch of a time trying to pull it apart and see the data.  But...  This information can be invaluable to debugging a production problem.   There are varied ViewState tools on the web for decoding this gobeldygook into something that is somewhat coherent.  I use Base64 decoder and encoder at motobit.  It's simple and works.

Wednesday, November 9, 2016

So, Trump Is Our President

What the hell is this company coming to???  Think I will create a series of these...  Share as you wish.  Some may not be safe for work; you have been warned!