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

Monday, July 13, 2015

In scripto veritas*

The last few (work)days have been a blast back to my DOS past--at least in the sense of being very script-oriented.  (The similarities end there.  My first computer, an 8-bit Epson 8088, was powered by two 5.25" floppy drives and was certainly not networked.) I've had the luxury of a web-based interface to the MySQL database, but otherwise all interaction with this new server has been via SSH, SCP, and SFTP.  White text on the black background of a command-prompt, in other words.

Threading through the maze of branches of a file system (in the case of SFTP, on the client- as well as server-side) definitely requires a bit more presence of mind than a "windowed" UI.  Particularly when you need to make sure you're not uploading Beta code to a Production system...or vice-versa. Then there's the fact that misspelling anything will generate an error message.  And in a Unix-based system, that means even perfectly matching the capitalisation.

But oddly, the lack of a pretty UI over the top of those interactions is oddly reassuring.  When I launch a script via a command-line and collect its output from a log file, I feel like I can trust what it's telling me.  Ditto when keeping an eye on the system processes after a scheduled (a.k.a. "cron") job launches.  Maybe it's just that I was "raised" on the command-line.  Or maybe it's the fact that *nix doesn't try to protect its users from their own fumble-fingering or short attention spans.

Either way, I appreciate the straight-talk.  Normally, I distrust truth rendered in terms of black-and-white.  But this is definitely an exception.

- - - - -

* I'm riffing on the Latin "in vino veritas," which translates as, "In wine, [there is] truth." 

Wednesday, December 17, 2014

It takes a village to raise a programmer

Today I was at the computer repair shop, having a fried hard drive replaced in a laptop.  When a client arrives with the diagnosis already made, repair folks are only being smart when they question it.  I assured the gentleman at the front counter that I had booted into the laptop's BIOS and found no hard drive listing.  Also that I had also tried running two flavours of Linux off CDs/DVDs and both freaked out when they found no hard drive.

At that he took my word for it. and I walked out with a new hard drive installed in less than fifteen minutes.  (For the record, the laptop is now running Ubuntu with one PEBKAC* wireless issue since overcome.)

The gentleman seemed surprised at me being a Linux user, and asked what prompted me to use that operating system.  Not wanting to drag politics in it, I explained that it makes web programming in the PHP/MySQL space a little more seamless when work is promoted to a server.

It turns out that he's starting to learn web programming just now, but that it isn't always coming easy.  So I handed him my business card and told him that he was perfectly welcome to call on me for help when he was stuck.  Just as I was able to call upon my elders in my times of need.  (And, 's'matter'o'fact, still do.)

While I savour the few opportunities I've had to repay my elders for what they've taught me, it's equally delicious to be able to smooth the path for someone else.  Sometimes it's not even a matter of catching a logic-bug or pointing to a more appropriate API or anything even remotely technical.  Sometimes just knowing that someone won't consider your question "stupid" is more important than the answer itself.

I do hope to hear from him.  Because that means that another craftsman is joining the trade, and auto-didacts who aren't afraid to ask for help are an asset to the guild.

- - - - -

* "PEBKAC" == "Problem Exists Between Keyboard And Chair"

Monday, December 15, 2014

Unwelcome magic

I'm trying to rebuild an old-ish (and rather banged-up) personal computer with a new operating system.  Because, you know, friends don't let friends use Vista.  [insert trollface]

So far, it's Gremlins: 4, Me: 0.  (I've had to break out the paperclip--'nuff said.)  I'm starting to sympathise a bit with the sub-species of programmer who despises hardware.  In my case, I was less than amused to learn to realise that sometimes, the System Administrator has to deal with their own version of "syntactic sugar."

For non-coders, "syntactic sugar" is a shortcut in a programming language that has counter-intuitive (at least to a newbie) results or side-effects.  In the worst-case scenario, "it just works" despite seeming to miss critical input or function invocations.

Other coders--including my betters--will disagree, but I generally dislike that in a language.  It jacks up the slope in the learning curve, in my less-than-humble-opinion.  Arthur C. Clarke aside, the magic of "it just works" is antithetical to the scientific reasoning process that's supposed to govern computer programming (and debugging).

Outside of the coding sphere, I tripped over something suspiciously similar.   My Debian installation DVD didn't include a hardware driver compatible with the USB wifi stick I was using.  Fortunately, I was able to find them on the Debian website and copy them to a flash drive.   I plugged the drive into the back of the PC and continued.  From that point on, I had wireless access.

Convenient, right?  To me, it was actually kind of creepy.  First off, the installer never asked me to specify the location of the wifi driver.  Secondly, the driver was just one of many files bundled into a larger .DEB archive.

Magic.

Ugh.

I realise that there are times--particularly when it's not part of your core competency and the SysAdmin has already left for the day/week--when "stuff just working" is a good thing.  But it's unlikely that this is the last time this particular PC and I will tussle.  In which case "magic," however convenient, may actually be counter-productive in the long run.

That and I flatter myself that a programmer who isn't interested in pulling back the curtain on the controls is no programmer at all.

Monday, September 29, 2014

Shellshock, herd immunity, and the implications for the "Internet of Things"

Sometimes the analogies used for computer stuff can be a bit off-the-mark.  For instance, cordless computer "mice" aren't called "hamsters."  Computer "viruses," on the other hand, are a spot-on description.  Some are transmitted through a physical vector (historically, through a storage device such as a floppy drive or USB stick).  In other cases, transmission is seemingly airborne (such as via unencrypted wifi).

Continuing the analogy, UNIX-based systems such as Linux and Mac OSX have enjoyed the luxury of a certain "herd immunity."  In part because UNIX-based (a.k.a. "*nix") operating systems were designed to be networked, which meant that defences were baked in from the get-go.  Also, in the past, most everyone was running Windows.  And Windows users--typically but certainly not always--tend not to be the most tech-savvy.  Which, for anyone in the market for notoriety, put the virus-writing bulls-eye on Windows.

Which gave rise to a certain smugness among *nix users that ranged from a sighroll (When will you people learn?") to outright pointing-and-laughing whenever the latest Windows virus was making the rounds. 

Last week's "Shellshock" vulnerability may well have brought that smugness to an end...at least blunted it for the foreseeable future.   Mainly because the free ride of (perceived) "herd immunity" has come to an end.  Apple's OSX has definitely spread from the Graphics Department to other areas of business.  Also, the overwhelming majority of web servers are based on some flavour of Linux.  Additionally, embedded devices are increasingly based on Linux.

For programmers like myself who do the bulk of their work on Linux laptops or desktops, most of the distributions (e.g. Ubuntu, Red Hat) make it stupid-easy to install security updates.  Ubuntu, for one, definitely gets up in your grill about them.  (Plus, we generally know better than to ignore them for any longer than absolutely necessary.)  By contrast, an Android tablet (which is Linux-based) like my Nexus 7, can be more obsequious, like the velvet-footed, quasi-invisible Victorian butler.  (That tiny notification icon in the northwest corner of the screen murmurs, "Would Milady graciously condescend to update her tablet now, or after tea?  Very good, marm."  But no more than that.)  Which is dangerous from the standpoint that updates are easy to ignore, but it's the tablet that's more likely to connect to that coffee-shop wi-fi.

And the proverbial web-enabled toaster?  Fugeddabouddit.   Its manufacturer was too busy trying to squeeze half a cent off the unit cost (to appease Walmart's accounting goons) to worry about releasing software patches.  And that's precisely the problem with the Internet of Things.

And while I don't necessarily like to call for yet more regulation, I think any government that waits until after a catastrophic network attack to require patching is a reckless government.  The two major barriers to such a catastrophe are well on their way to becoming null and void.  Clearly, the industry cannot be trusted to police itself.

Cost was the first barrier.   Unlike Windows or OSX, Linux is free to use.  It is--just as importantly--also free to hack up and modify to suit your particular hardware.  Either factor is enough to make Linux a no-brainer for electronics manufacturers.  Which is fine for standalone gadgets.  But when they're exposed to a network (and by extension other devices), an evolving immune system is a non-negotiable.

There's another dimension to the cost factor, and that's in hardware.  Previously, only full-size PCs or laptops had the processing power and memory to support a full-blown operating system.  Not anymore, when the $40 Raspberry Pi runs off an SD card like the one you probably already have in your camera.  Eventually, the only limits on size will be imposed by the need to connect it to monitors and standard ports or peripherals (these days that means USB devices; who knows what hotness tomorrow will bring?).

All that, for a manufacturer, means that they don't have to spend the money and time to develop a custom operating system; they can go with a no-cost off-the-shelf platform.

The second roadblock, scarcity of always-on connectivity, is now disappearing, as public libraries and city buses and in some cases entire cities offer free wi-fi. 

The upshot is that we'll have an ubiquitous operating system that is less than likely to be immunised against the latest viruses.  And it will be living in the (metaphorical) Grand Central Station of the internet, exposed to any and all comers.  Pandemic is not a risk; it's a certainty.

I know that most people could care less if their cyber-toaster tells a black-hat hacker or the NSA or the CSEC that this morning's raisin bagel was (gasp!) not gluten-free.  But that's soooo emphatically not the point here.  Why?  Because hackers do not always want your data.  In many cases, they want to siphon your processing power and your bandwidth so they can use it to attack those who do have juicy credit card numbers or email addresses or passwords. or naked celebrity selfies or whatever.  Which ultimately means that when anyone's too lazy to keep up with patches, they're aiding and abetting the enemy.  And complacence, as we know from politics, is complicity.

Naturally, my Gentle Reader is too savvy and hip to be slovenly about such things.  They fully appreciate that even their Fitbit has orders of magnitude of computing and communications power beyond what put people on the moon.  And they, beyond question, have the instinctive class and sense of noblesse oblige to know that with great power comes great responsibility.

Of course they do.

Tuesday, June 14, 2011

Living in a three-party system

Dad wanted to review the photos on his camera's memory card. Dad's a Windows user, and I don't have an SD slot on my XP desktop. So the only option was to fire up the Ubuntu laptop, log in, and hope for the best.

Now. What you should understand about my Dad is he's Mister Fix Anything, thanks to being in medical maintenance since before I was born in the hospital that employed him. Plumbing. Electrical. Mechanical. HVAC. (Computer-controlled pneumatic tube systems seem to be his special joy. That and being privy to the more colorful antics of the staff and administration--such generally being a fringe benefit of working third shift.)

He's turned his attention on desktop and laptop computers as well, so I didn't think that the Linux thing would throw him off too much. (Heck, I've managed to pass off Mandrake as Windows...and that in 2004.) Wrong. It seems that whatever software's installed on his home computer opens the root of the SD card and ignores the folder-structure to present all photos in slide-show format. To Ubuntu, however, the card was just another drive--no different from a hard drive, CD, DVD, or USB device. (Of course, the fact that his camera apparently creates a new folder for each day--which can mean a folder containing a single .JPG file--doesn't make browsing any easier.)

We fumbled through it one way or another. But it was pretty obvious that Dad was convinced that having all photos at his fingertips was The Way It's Supposed To Work, Darnitalready. His software completely concealed the folder structure (and thus the complexity) from him.

It's anecdotes like those that make me suspect--and rejoice--that operating systems will always be a multi-party system. I know my preferences, and--I fondly hope--understand some of the values that drive them. But values in operating systems--as in politics--can be incompatible to the point where compromises, while possible, have a kludgey feel to them. I more or less type for a living, and fingerprints on my monitor, frankly, skeeve me the heck out. Which pretty much rules out any tablet that doesn't dock into a keyboard. My co-worker in the pod next door, by contrast, might not be acquitted of actually naming his iPad and sleeping with it on a pillow next to him. At least not in the court of public opinion. Much the same might be said for his Android phone. And more power to him.

Which brings us back around to the politics metaphor and the moral of the story: Knowing your core values (and the trade-offs they entail) always trumps finding justification for your allegiance to a particular system.

Thursday, July 15, 2010

Lemons -> Lemonade

Working in I/T seems to breed a paradox in expectations. On one side of that proverbial coin, it's a truism that developers underestimate--sometimes grossly--the amount of complexity, time and bugs will be involved in code they develop. On the flip-side, there's no small part of paranoia in trusting code not written by themselves or their most reliable colleagues.

Thus, although I've experienced the brilliance of the Ubuntu developers, testers and packagers time and again, I backed up all critical files before upgrading. As it turns out, hardware was ultimately the culprit, bringing to life the worse-case scenario of rebuilding and reconfiguring my workaday setup. "Worse-case," you'll note--not "worst case." (There's plenty more room on the darker end of the good-bad-ugly spectrum.)

Time I could have used for creating stuff is now irrevocably lost to the process of upgrading, debugging, reinstalling, and configuring--all bookended by schlepping files between internal and external hard drives. That's the "lemon" part. The "lemonade" payoff comes in terms of a cleaner computer, and a healthy triaging of applications and data. In other words, the evolution of Ubuntu Linux emphatically does not select for fatter pack-rats.

Understand that I'm not looking down on Windows or Mac users when I write this, but I wonder whether folks on those platforms wouldn't ultimately be happier with those systems if an upgrade (and a highly recommended backup prior to it) were available in a span of months rather than years.