Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

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.

Wednesday, August 17, 2016

Webcollage bug/irritation repair

So, I am enjoying my little Linux build with that little AMD APU detailed in my last post...  Something is missing...  YES!  A good screensaver.

Oh...  Yes it has been a while since my last post, so what?  I've been boating and working on the house and generally enjoying the outdoors while the weather is agreeable.  So...  pfft...

Anyway, I installed the XScreenSaver package with several additional screensaver packages.  One looked intriguing...  webcollage by Jamie Zawinski.  Webcollage uses dictionary files (just lists of words) to seed simple searches on several internet search engines.  When the screen saver is activated, a random image (or part of an image) from a random webpage from the results of searching a random word is placed on a the screen like a collage, one image over the other.

Needless to say there is a lot of online bitching about this because quite simply, it can display porn and other NSFW images.  OK, so some people don't like it.  Personally, I find it intriguing.  But...  occasionally the following text would show up on the screen...  sometimes several times before a screen redraw covered the text:

Use of uninitialized value $vals in index at /usr/share/perl5/HTTP/Headers.pm line 264
Use of uninitialized value $vals in concatenation(.) or string at /usr/share/perl5/HTTP/Headers.pm line 267

After trying a few repairs to the webcollage Perl source, I just went into Headers.pm and fixed it there.  Here's the repair:

sub as_string
{
    my($self, $endl) = @_;
    $endl = "\n" unless defined $endl;

    my @result = ();
    for my $key (@{ $self->_sorted_field_names }) {
next if index($key, '_') == 0;
my $vals = $self->{$key};
if ( ref($vals) eq 'ARRAY' ) {
   for my $val (@$vals) {
my $field = $standard_case{$key} || $self->{'::std_case'}{$key} || $key;
$field =~ s/^://;
if ( index($val, "\n") >= 0 ) {
   $val = _process_newline($val, $endl);
}
push @result, $field . ': ' . $val;
   }
}
else {
          if ( defined $vals ) {
   my $field = $standard_case{$key} || $self->{'::std_case'}{$key} || $key;
   $field =~ s/^://;
   if ( index($vals, "\n") >= 0 ) {
$vals = _process_newline($vals, $endl);
   }
   push @result, $field . ': ' . $vals;
          }
}
    }

    join($endl, @result, '');
}

My changes are in red.  Not sure if the bug is in webcollage or if it is in Headers.pm but here ya go.  This is the fix.  Damn, I love open source!

**Disclaimer:  I am NOT a Perl programmer, I only know enough to successfully poke around Perl source and figure things out.
**Suggestion: Anyone running webcollage might want to consider two things: 1) it uses internet resources to perform searches and retrieve images; 2) some of the images shown on the screen could really get a person in trouble at most companies, not to mention what might happen should certain significant others see certain images.

Wednesday, June 8, 2016

New Minimal Linux Box Up and Running

Long Time No Post

Quite a few things have happened since my last post.  One of the most important, of course, is the completion of my little new Linux box.  Here she is...

Silicon Power Slim 60 GB SATA3 SSD drive.  It is only 2.5 inches wide, offers SATA3 6Gbps connectivity, and very energy efficient.  I selected this SSD because it was inexpensive, fairly fast, and rated as quite energy efficient.  Formatted this as ext2 and used it as my OS and swap drive.  Spent $30.




Toshiba 500 GB 7200 RPM hard drive.  It is your basic 500 GB 7200 RPM SATA3 hard drive.  It offers SATA 3 6Gpbs connectivity and a 32 MB cache.  I selected this drive because it was inexpensive, had good reviews and was the right amount of storage for my needs.  Spent 45$



ASRock C70M1 Motherboard with AMD Dual Core Ontario C-70 APU.  This mini-ITX motherboard/CPU combo offers very low power consumption, no unneeded video capability (I only needed basic VGA), up to 16 GB RAM, 64 bit processor/data bus width, four SATA3 6Gbps connectors and a host of other things.  No, this is NOT a gaming or server mobo/CPU.  The C-70  APU is only dual core and runs at about 1GHz but this board is extremely quiet, energy efficient and seemed to fit my requirements.  Total price of this board was $40 - not bad for motherboard and CPU.

I added a couple of Mushkin 2GB DDR3 RAM sticks for $22 and a basic APEX 250 watt power supply for 19$.  I tied it all together in an old Dell computer case and installed Debian Jessy.  The only little issue I had was the fact my little USB WiFi dongel wasn't supported natively.  Really, it was a minor issue.  After some research, the driver source was located on GitHub, it was easily compiled and installed.

So, for a total of about $156 I have a new little Linux box.  ( had an old flat screen VGA monitor just wasting space so used that).  Pretty happy so far.

More details and maybe a benchamark or two.

Wednesday, March 2, 2016

Oracle VM VirtualBox - Just a Misleading Error Message

Three weeks of fighting a "cold from hell" gave me time to think about my little project to automate a search for meteor photos.  Sure, I have a PINE64 on order.  Sure, it may be delivered later in March.  Sure, there may be a flavor of Linux available for it sometime soon.  Sure, I may be able to build ImageMagick and other tools I need for the Pine64.  Sure, the performance may be acceptable for my goal.  Crap, no planned PXE/net-boot planned.

What if...  Let's see...  a complete Pine64 compute node with 1GB Ram and the OS on an 8GB flash drive will cost roughly $35 accepting a lot of "maybe" assumptions.  Let's remove the assumptions and calculate the cost of a good old AMD or Intel processing node.  Looks like a 64 bit AMD based system with 4GB RAM, with PXE boot will run about $85.

So...  I decide to emulate a 32 bit Debian text-only install on an Orable VM Virtual box using 4GB Ram to sort-of emulate the AMD solution.  Which gives me an idea for a new word...

umulate - An emulation that is not exact; allowing certain differences for the sake of brevity or simplicity.  "I am going to umulate this Debian install; the real machine will not have a hard drive, but will boot from a flash drive."  But...  I digress...

BUT SMACK...  An error pops up from Oracle Virtualbox when I try starting the virtual machine...

Failed to open a session for the virtual machine DebianPNode.

Under "Details" it read...

VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)

Well, after some research and comparing this virtual machine with the operational virtual version of Debian, I arrived at a repair that seemingly has nothing to do with the error.  I changed the Base Memory for this Virtual machine to 3072 GB and SHAZAM.  No more error.  Keep in mind, my machine has 8 GB and runs a pretty lean install of 64 bit Windows 7.  Why this misleading message popped up, I have no idea...  but reducing the Virtual machine's Base RAM fixed the problem.

Monday, February 8, 2016

Adventures with a free PC and Linux

Many people do it...  In many parts of the world, dumpster diving is a profitable undertaking.  As a matter of fact, I knew someone in Los Angeles years ago who made some nice cash by simply checking out local dumpsters, cleaning her finds and selling them on Craig's List and E-bay.  Most of her finds were clothes, fashion items and artsy collectibles.  Me???  Back in my college days I could regularly be found snooping around dumpsters for electronics items.  Some of my best finds from years ago include an oscilloscope, several televisions and a shortwave radio receiver.

Well, even now when I see something interesting in the garbage, I simply can't help myself.  A few weeks ago my wife and I were driving to the local grocery store.  In the parking lot of the grocery store is the local community dumpster where people occasionally toss their unneeded electronic items.  The local waste disposal company hands that stuff off to an electronics recycling company...  Unless someone gets it first.  On that rainy cold January day I grabbed a soaked Dell Dimension E310, Dell monitor and an Epson printer.

"Sure, honey!  I bet I can get that stuff to work!"   She just looked at me sideways, smirked and nodded her head.

After a few weeks of drying, I cleaned everything up, applied electrical power and SHAZAM - up popped a Windows XP logo.  She Works!!!

Sort-of...  The installation of XP was messed up; likely due to malware.  It was SLOW, booted erratically and generally did not behave like a healthy computer.  What to do...  My wife wanted a computer to browse the internet and handle email; basically something to replace her laptop until we can afford a replacement laptop.  Me; well, I would like a separate computer to let me brush up on C.

This computer fit the bill.  It only has an 80GB hard drive, 512 MB RAM with an Intel Pentium 4 processor running at 2.8 GHz, but that should be able to handle these undemanding tasks, right?  Well...  It depends.

I didn't want to waste time repairing and/or reinstalling Windows XP, so I decided to install Linux. My first two choices were Ubuntu and Debian.  This wasn't because they were especially fast or known for performing well on older, under powered machines.  These were selected because they were mainstream distributions and...  I already had installation ISOs on my work computer from a previous project.

First up...  Ubuntu.

I burnt the Ubuntu 14.04.03 installation ISO to a flash drive and installed it flawlessly, albeit slowly to the Dell.  After install, the little TP-Link WiFi USB dongel worked easily.  Basically, the install worked but was SLOOOWWWW.  I was not used to the Ubuntu desktop and honestly is was not intuitive for me to navigate.  Where is the control panel?  The settings?  Fading windows and sliding controls aren't necessary here.  How the hell do I shut them off???

There was no desire in my blood to google every little question I might have about this installation.

So, not happy with the interface and performance provided by the default Ubuntu installation, I decided to try Debian Jessie (8.3.0).

Quick lesson here - when using the Universal USB Installer program from pendrivelinux.com, remember to format the flash drive before copying a new installation ISO over a previously copied installation ISO.  Not doing so caused all sorts of problems.  Debian wouldn't install and regularly complained about a missing kernal image or problems installing GRUB.  Subsequently trying the Ubuntu install caused both installs to get tangled; I saw some Debian install options on Ubuntu reinstall attempts!

At any rate, after finally, successfully installing Debian with the XFCE desktop,  all was almost good.   Performance was decent and XFCE navigation was intuitive and complete.  Supposedly my little TP-Link USB dongel should have worked but didn't.  So, after a little research I downloaded, built and installed a new driver and...  drum roll please...  After spending only $15 for power and VGA cables and a lazy Sunday afternoon, my wife has a temporary computer and I have something to mess around with and brush up on my C... with operational TP-Link WiFi.

Hurray for dumpster diving.!!!

Wednesday, July 8, 2015

8 Reasons for a New Operating System

Many years ago you could find me sitting in front of my computer wearing one of my well-worn Linux t-shirts or baseball caps, just programming my brains out, secretly wishing the universe of computers ran on one flavor of Linux or another.  Today, well, I am happy to simply have my Windows 7 machines humming along in front of me for at least a week without pause or crash.  Anyway...  over time I believe Linux has migrated from an OS that performed well & was fairly simple to install and operate, intended to make any computer geek giggle with delight, to something somewhat sloggy and overly complex that now give those same computer geeks headaches and the occasional nightmare.

Anyway, not that I have the technical ability in my current state, I would love to write a new operating system.  Why?  Here are eight reasons:

  1. Performance gains from increased hardware capabilities have been severely strangled by poorly performing code and the belief that the faster hardware will compensate for less than stellar code.  A new operating system should centrally focus on core performance at the expense of general purpose functionality.  
  2. Malware...  Viruses...  Keystroke Loggers... Spyware...  One of the key reasons this crap is proliferating is because we have the same-old operating systems and code and utilities.  A new operating system should have some basic security in mind when designing basic low-level functionality.  And, simply by nature, a new OS would be impervious to these nasties for a while.
  3. Current OSs are COMPLEX!!!  They try to be the do-all, know-all solution to everything.  Someone (or something) that tries to do everything will never do anything specific very well.  A new operating system should focus more on doing computery things, rather than everything under the sun.
  4. Developer environments and tools for Windows and Linux are fragmenting so badly, researching solutions and problems, depending on the situation, can be a near-futile exercise.  A new operating system could provide a new & clean slate.
  5. The windowing OS paradigm is dying.  Yes, I said it.  Don't get me wrong, the windowing paradigm will be around far longer than I.  However, it is my firm belief that virtual reality, tactile and audio human/computer interfacing will be the future.  A new operating system should have a low level text base interface for baseline operations, maintenance and debugging, and perhaps a windowing interface for coding, but should focus at these newer human/computer interfaces.  And, just as a note, all functions capable of being performed by the computer, should be allowed through the text interface.
  6. The Keep It Simple and Stupid concept has been, for the most part, thrown out by most modern operating systems and development tools.  A new operating system should embrace the KISS concept.
  7. Ever notice the slow access to directories with thousands of files?  OK, there may be solutions but it just peeves me off when I have 10,000 or 20,000 files in a directory and handling this many files is so slow (in both Windows and Linux) I can take an afternoon of coffee & smoke breaks.  A new operating system should minimally have the ability to support fast handling of large number of files.
  8. Provide a more rich computer eco-system.  Sometime I think Apple and Windows and Linux devs are getting lazy, just hunting for and polishing the low-hanging fruit.  A new operating system that performs well, has a vibrant development environment will place pressure on existing ecosystems and provide evolutionary pressure.
What are you waiting for???

Sunday, January 18, 2015

Making Glade run on Precise Puppy

Being a Crazy Old Programmer, there are times when Crazy Old Programmer Thoughts create little fires in far-flung reaches of my brain.  About a year ago I started collecting night sky images with the thought I would write a C# program to watch for odd things up in the heavens.

Specifically I wanted to look for meteorite trails and bolides.  It was not a success but not a failure.  The proof-of-concept was to make one second exposures and save 24 hours of these images.  Exposure time on day sky images would be adjusted accordingly.  That would yield about 86400 files for each 24 hour period.

Windows choked horribly.  Copying that many files from one directory to another required more than an hour of the computer's time.  Processing the images were slow, likely due to the file system and that C# doesn't compile to the hardware, rather to an intermediate CLI.

Anyway, I started looking and thought I would experiment with minimal Linux distributions.  First one up is Precise Puppy.  Install on my little HP mini was fairly painless and overall the OS is extremely responsive for such minimal hardware.

Next step is getting the DEVX package installed and running.