Posted by: Dave | August 12, 2010

NAS for $50 + spare parts you probably have

Okay, “you probably have” if you’re a geek ;).

So one night my media center PC in my living room started to turn on and off all by itself. The system was old (866 mhz old) and had certainly seen much better days. The cost to replace the power supply ($20-$25 at the MicroCenter in Uptown Houston) just wasn’t worth it on this system.

But I liked the fact that I had file storage on my network without having to keep one of my laptops on 24/7.

Well, I decided to “violate my warranty” on my Wii (there’s some geek double-speak for ya) and get WiiMC installed on it. Excellent product, just don’t go beyond version 1.0.4, WiiMC seems to only go downhill from there; as of writing the current version is 1.0.6. Great, I got the “media” part of my old media center setup back, but what about downloading podcasts/vidcasts and networked drives?

Well, I decided to take a gamble. As with any gamble, I went to my local Wally World because of their excellent return policy. By “excellent” I mean they’ll take back stuff they don’t even sell, but I’m not *that* shady – I just violate warranties.

I got to thinking. A lot of routers now have a USB port, I wonder if I could put a powered USB hub on it and attach multiple devices. That’s the gamble, because I’m too cheap to just buy a bigger HD and move everything onto it when my existing drives are working just fine, with one of them provisioned just a couple months ago. Like I said, yay Wally World.

I got me the cheapest Belkin I could that had USB connectivity that explicitly stated I could attach hard drives, the Belkin Play. Nothing in the manuals said it could do multiple drives, but it didn’t say it couldn’t.

So here’s where we turn off the paved road of intended and documented functionality and go onto the dirt road of classical hacking (even if most of this stuff is painfully obvious to experienced Linux admins).

Looking at the router, I recognized the file paths it was referencing in the logs very clearly – it was some *nix variant, very likely some Linux variant. This means at a fundamental level (the kernel level) it should support hardware folks would commonly plug into USB that didn’t need drivers other than what you’d expect for USB hard drives and printers.

Plugged in a powered USB hub and viola, it worked! Now, I will say it took the router about 3 minutes to recognize the drive, but it eventually did it. Why did I use a powered hub? For reasons I don’t yet understand, my USB hard drive enclosures don’t fully function without power coming from the hub, despite the fact every enclosure I use has its own power supply. On a hardware level, this makes no sense, since there are 4 wires in a USB cable, 2 for power and 2 for data. Can there really be that much resistance in a combined total of 9 ft of USB cable? Maybe my friends more enlightened on the electronics side of things can give a pointer.

Now, there’s a damn good reason they don’t document this functionality. Problem is that every time you turn the router on and plug in anything to the USB (or power off/on again), all the SMB mountpoints are renamed! What that means in layman’s terms is you may have to reconfigure software (especially WiiMC) every time this happens. It’s an inconvenience I’m sure some support person in India doesn’t want to help a 75 year old with. The Belkin Play is pre-configured to reboot weekly, I strongly recommend disabling this option if attempting this setup.

I decided to make this NOT be my main router. Sorry, I love the Buffalo routers entirely too much to give them up – they work well and don’t need constant coddling to stay in peak condition. Unfortunately, like most people, I was configured to use the 192.168.1 subnet. This is a problem, since Belkin Play reserves the 192.168.1 subnet for wireless cafe mode, EVEN IF YOU DISABLE IT *argh*! Normally, this could be ignored, but if I want to remote into the router… well, it assumes you’re just some guest and never lets you in, even with root credentials. So, I had to leave Belkin on 192.168.2 and let it govern that subnet, give it a static IP in the low half of the 192.168.3 subnet and switch my Buffalo to the 192.168.3 subnet, with dynamic IPs in the higher half of that range. It’s all good, but that was 2 hours of tinkering I shouldn’t have had to do thanks to an always-on feature that I don’t want nor need of the Belkin Play.

I’m intrigued by the naming scheme used by the SMB mountpoints on the Belkin Play. For example, I have a Western Digital “My Book” so it would usually be shared as “MY_BOOK.” However, this Belkin Router does “MY_BOOK(A1)” or “MY_BOOK(B1)” or even the more bizarre “MY_BOOK(ZA1)”. I’m sure I’m missing something from Linux 101 here, so if you have any theories on why this happens, I’d just like to know why – not that I’m in much of a position to change it short of putting new firmware on the router.

Oh, and to protect my geek cred, I’ve lacked the imagination to rename the drive. I don’t often leave things on the defaults, but this one worked well for me.

So, after yet another rewiring of my walk-in closet, which is becoming more and more of a server room, we’ve got this nice rats nest:

Ghetto NAS

But this setup, as ghettotacular as it is, has its many downsides:

  • S.M.A.R.T. diagnostic information is never reported. This means I have no advance knowledge the drive will fail.
  • There’s no simple way to do drive maintenance like SpinRite or Chkdsk on these drives.
  • Power outages mean I need to reconfigure WiiMC, which can eventually become a pain.

Performance… it’s been great. Granted, I was sure to keep my electrical and data cables near right angles when they must cross, so that may help in an unmeasurably insignificant way. Though I must admit, even big videos buffer on WiiMC in about 10 seconds over the network and file transfers of 300 MB files take about 30 seconds. Not perfect, but I am running over 100mbit here, not gigabit.

But wait, what about downloading media? A long time ago I found a guide on how to have iTunes work with a networked drive on Windows on lifehacker, here it is for your convenience: http://lifehacker.com/230605/hack-attack-share-your-itunes-music-library-over-your-home-network. Oh, and skip all that stuff they mention about SyncToy, that’s just not needed.

If anyone knows a better podcatcher than iTunes, let me know. I feel like I’ve tried them all and they all suck in their own ways. At least iTunes sucks in being a resource hog but otherwise does most of what I want it to do.

Advertisements
Posted by: Dave | March 3, 2010

The “Privilege Equalization Exploit”

The longer I work in the software industry, the less I trust security websites — even the reputable ones. That’s saying a lot since I’ve been building software since 1998, doing it professionally since 2000.

My favorite gem to see on security websites nowadays is what I have heard referred to as the “Privilege Equalization Exploit.” This is a mockery of the term “Privilege Escalation Exploit” where a weakness in software can be exploited to grant you more privileges to a system than you’re supposed to have. The “Privilege Equalization Exploit” is a “dire security issue” which gives you exactly as much access to a system as you already have. These “security experts” express frustration that software vendors are doing absolutely nothing about such issues! OH MAI GAWD, YOUR SOFTWARE IS DOING EXACTLY WHAT IT IS SUPPOSED TO DO — EVERYBODY PANIC!!!!!

All these posts do is demonstrate 1) the “security expert” being completely unaware of basic system design (e.g. a Unix user being able to list the contents of /home), 2) how the contents of “security websites” lack curation by actual experts of information system security and 3) scare novices into thinking there are severe security problems when there are none. Combined, this does nothing more than slander and annoy those that work hard on software production, whether it is FLOSS, commercial software, or anywhere in between.

The bottom line, the next time someone freaks out about security issues, do what you would do for a medical situation: step away from the person saying “the sky is falling”, consult an expert, perhaps get a second opinion and make an independent but informed decision.

An example of “doing it right” with regards to security education is Steve Gibson and his show: Security Now! available for free at http://twit.tv/sn. He sorts through the noise, tests reports independently in his labs and avoids regurgitating every “Privilege Equalization Exploit” folks love spewing over the internet. He does this while conveying rational suggestions to his listeners in plain language.

Posted by: Dave | February 24, 2010

No, the sky isn’t falling with IPv4

What’s this IPv6 stuff about?

Well, without going too far into the technical details, everything on the internet is served from some address on the internet. These aren’t the internet addresses you may be familiar with (e.g. https://codergeek.wordpress.com) but rather numerical addresses like 72.233.2.59. When it comes to the infrastructure of the internet, these numerical addresses what infrastructure experts work with.

Over time, the internet has expanded from a few hundred, then to tens of thousands and now billions of possible addresses. Each time, a new version of the internet protocol (IP) needed to be released to accommodate more addresses. The current version of IP that we use is version 4, abbreviated as IPv4.

After IPv4 became widely used, an experimental IP version 5 was tested. However, the geeks involved with this basically halted work and thought: hey, this whole thing of coming out with a new IP version every few years just because we run out of addresses is getting repetitive. What is needed is the one addressing scheme to rule them all! *queue Lord of the Rings music*

So what if we had 1 possible address for approximately every 2 atoms in the known universe. This should be more than enough for the future of humanity! And so IPv5 was tossed out, and IPv6 was born.

This is great. In the late 20th century IPv6 began becoming implemented and very geeky folks started actually using it. In fact, they said that by 2002 we would be out of addresses in IPv4 and would be forced to switch to IPv6!

It’s 2010 and we’re still on IPv4. What happened? Well, different folks have different concepts of “running out.” The average person thinking that we’re running out of addresses means all possible addresses are in use and we’re about to no longer have more addresses to use. The folks pushing for IPv6 define “running out” as no more available ALLOCATIONS of addresses. What’s that even mean?

Analogy Time:

Let’s say I invited you and 10 of my friends over to my house. You all show up and see a dozen donuts in my kitchen. I give you all a donut, and I grab one for my self. A normal person would think this is cool, everyone got a donut – awesome! A person pushing for IPv6 would immediately freak out as soon as I gave the last donut away screaming about how there’s no donuts left in the house! We’d all just stare at him like he’s an idiot, since we all have uneaten donuts still in our hands, including the crazy IPv6 guy.

It’s all about allocation vs. actual use!

And that’s where the controversy of IPv6 begins. A study last year showed that 95% of all addresses on IPv4 remain unused: http://www.isi.edu/ant/address/. At the same time, we’re going to run out of IPv4 allocations before December 21, 2012: http://www.potaroo.net/tools/ipv4/index.html. Funny thing, this is not contradictory. Think about it, one study focuses on actual address use (donut consumption) and the other one focuses on allocations (how many donuts are left for me to give out). Organizations in charge of allocations are screaming that we should move to IPv6.

Think about that for a second, we’re out of allocations but we’ve barely used the possible addresses. Why wouldn’t they just draw more attention to the fact we have many unused addresses? Well, that would mean that organizations trusted to efficiently allocate those addresses have failed miserably. Why would these organizations admit their own failure at such a critical task?

Funny thing is, we’ve been told IP addresses would run out in 2002, 2004, 2006, 2007, 2008, 2009 and now 2011. Why the inaccuracy? It seems all these countdowns for IP allocations fail to account for new IP allocations becoming available. How can that happen, you may ask? Simple, when internet companies merge, those in charge of IP allocations force the merged company to give up all of their IP addresses in favor of a new, potentially more efficient, allocation. This means more IPs are available to allocate.

The problem is, IPv6 is not a panacea for this issue. Having 1 address for every 2 atoms in existence is worthless if those addresses are as inefficiently allocated on IPv6 as they were on IPv4! How dare we even consider such blasphemy, IPv6 is going to cure everything, even cancer! /sarcasm.

Sure, IPv6 has some awesome features built-in like multicasting, which could reduce network traffic in the long-term. I have no issue with moving to IPv6 for those reasons. However, to argue we need to all convert to IPv6 because the IPv4 sky is falling – well, that just makes no sense. Those allocating addresses are just as likely to be wasteful with IPv6 as they were with IPv4. Then, what are we going to do?

Oh, and since I get this question a lot, an IPv6 address looks like:

1050:0000:0000:0000:0005:0600:300c:326b

Instead of using base 10 digits (0-9) to represent the underlying binary that is an IP address, IPv6 uses base 16 digits (0-F). This allows us to represent 255 as FF, thus using fewer digits. The fewer digits is more useful as these addresses are longer. Why base 16? Well, geeks are already accustomed to base 16. Anyone who has done even basic HTML, even on a MySpace profile, probably knows this from the way colors are coded.

However, just like our current IP system, you shouldn’t need to memorize those addresses. Instead, you’ll just go to websites as usual like https://codergeek.wordpress.com and everything will automatically be handled for you.

Posted by: Dave | February 13, 2010

No, Linux Did Not Eat All Your RAM

This one is for my friends who are new to Linux System Administration: Linux (and whatever you have installed on Linux) is *not* eating all your RAM. Honestly, I can’t say it any more simply than this already existing website:

LinuxAteMyRam.com

Enjoy :).

Posted by: Dave | February 9, 2010

How Traditional Hard Drives Die

We all know hard drives die, but what does it mean that a hard drive will last 1 million hours? I’ve never known a hard drive to last 115 years! Heck, my podcasting hard drive died after just 4 years of abuse. What the heck is going on here?

Let’s first start by realizing there’s many ways for a hard drive to die. The one many folks have encountered is the “Click of Death.” The Click of Death is when you try to start up your computer and you hear a rythmic click. This click is caused by the hard drive being unable to read it’s programming to control its read heads.

Read heads?

Read heads hover over spinning platters inside your hard drive to read information from your hard drive. Think of a record needle on a record player. For those of you who have no idea what a “record player” is, think of a CD and a laser, except the laser is a needle reading the CD by touching it rather than a laser light reading the CD.

If the hard drive cannot read its programming (ironically, stored on the hard drive), then it has no idea how to properly hover the read head over spinning platters within the hard drive. The result is the drive keeps trying to place heads over the platter, but keeps hitting the platter, readjusts and repeats this process. No data can be read from the hard drive and the machine may not even boot.

A trick to getting one last boot out of your hard drive is to freeze it. Freezing constricts all of the metal parts allowing just enough leeway for the programming, required for the hard drive to work, to be read. This will likely only work once or twice, so be sure to back up all data on the hard drive immediately.

By the way, if your hard drive overheats (for example, if it exceeds 200 degrees Celsius) , its metal components will expand to the point that the drive head crashes – making a similar clicking sound. By the way, if your hard drive exceeds 200 degrees Celsius, please don’t touch it with your bare hands. This should not happen when the hard drive is inside a computer, but can happen if the hard drive is being used externally but is lacking a fan or radiant cooler.

Other times, the platters simply wear out. You may ask, how can a solid piece of metal wear out? Well, let me try to explain this without getting into math.

As we all know, computers store data as 1s and 0s. Well… it’s not quite that simple. Individual “bits” of a hard drive are magnetized and demagnetized to represent 1 and 0. However, it’s not a perfect 0% magnetized or 100% magnetized, especially as that same bit is rewritten over and over again. Over time, magnetized may become 75% or 60% and demagnetized becomes 25% or 40%. Incredible software in the hard drive can estimate 1s and 0s from this. However, there comes a point where a hard drive cannot reliably tell 1 from 0 for a bunch of bits next to each other called a “sector.” Once this happens, your operating system will label such a sector as a “bad sector.”

Think of this as the technological equivalent of a bio-hazard zone. No longer is anything read from it nor written to it, it’s simply off-limits. If this was part of a file you were working on, that part of the file is now gone (or in geek terms, the file is corrupt). Unfortunately, this bad sector could wind up smack dab in the middle of your Operating System, causing it to no longer work.

Such situations though can be resolved using advanced data recovery tools such as SpinRite that, instead of relying on the Operating System to tell it that everything is bad, does the hard work of figuring out which parts are salvageable and salvaging data that the Operating System refuses to access.

As for 1 million hour guarantees? Well, like many things in technology, it’s a guess based on an ideal person’s typical use of a hard drive. Basically, it’s an estimate on how long it would take every bit on the hard drive to become bad, which is longer than when much of the hard drive would be labeled “bad sectors” much less succumb to the click of death.

There we go, a simplified guide to how traditional hard drives die. I didn’t go into solid-state or flash drives but the rewriting of data in the same place is a more prevalent issue with such devices as of writing.

Posted by: Dave | February 2, 2010

It’s a Miracle We Get Email

It really is a miracle we get any email at all. Let me explain why, right after I recap the explanation you’ve probably heard for how email works.

How we tell you email works

  1. You write an email message and click “send”
  2. This email message is sent as a text file to your internet provider’s email server
  3. Your internet provider’s email server looks up the internet protocol address of the domain after @ for each address you’re sending mail to
  4. The text file that is your email message is relayed to every mail server necessary to get the email to every intended recipient
  5. The server receiving the email looks at the email address the email is sent to and sends it to each user that exists on its server
  6. Viola, it’s that easy!

Lol, no.

Let’s walk through how it actually works!

1. You are using an email or webmail program that is fully functional.
Not everyone gets past this step.

2. You type your email and click “send.”

3. You now broadcast your email username and password to the internet, where hopefully the mail server you’re connecting to is functional. Hopefully there’s no hackers on the internet since you are broadcasting your username and password without any encryption.
If the mail server is offline, no mail is sent. If the mail server is under attack from hackers, automated defenses would likely block all connections, no mail is sent. Only if you optionally use TLS and your mail server supports TLS will your message, username and password be encrypted. Otherwise, it’s out there for everyone to read. This is why your bank wont just email you a new password to get into your account, because if you’re not sending using TLS, you’re probably not receiving email using TLS either.

Oh yeah, and the average person hasn’t got a clue what TLS is. To most people, this is just the lock icon in their web browser. TLS is better known by the name of its predecessor: SSL.

4. You successfully login to the mail server and transmit the text file representing your email to the mail server.
If your mail provider thinks you’re sending too much mail, it will gladly accept your message and then either: send it a day or two from now, or delete it without bothering to deliver it. Don’t expect the mail server to let you know it’s decided your email wasn’t worthy of being delivered.

Address your message to what the mail server thinks is too many people? It will just bounce back to you!

5. The mail server attempts to turn the domains after the @ part of each address your message is being sent to into an internet protocol (IP) address, in preparation of sending your mail message to that server.
Ah, the process of taking a domain name and translating it into an IP address, what a brilliantly unverified process! If the system administrator of the destination server is incompetent and recently moved to a new mail server in the past 48 hours, well your message just got delivered successfully… to the wrong server, never to be read!

This is all assuming the one server hasn’t set up a firewall to block the other server. Then the server will keep trying unsuccessfully for 7 days, sending you several status updates about how this process has gone all kinds of FAIL.

6. The receiving server is suspicious of the server trying to send it mail.
A mail server sending mail, what a preposterous idea! This must be treated with extreme caution! Yep, that’s how it works.

So the inquisition begins. First, RBLs. Are you sending from an IP address that the internet rumor mills this server utilizes say is that of a spammer? Nope, we can proceed. If yes, drop the email message. DENIED! Oh yeah, you’ll never know about this either. Hopefully they listen to some good rumor mills, not ones that block everyone until they pay up.

DNS records. Do you have a made up DNS record that our company expects every server on the internet to have, because we said so? No? Well then you wont be reaching us here at AOL, Yahoo or Hotmail.

7. The Email Recipients Mail Filter
Hopefully the recipient isn’t running crappy spam filtering like Barracuda, otherwise they’ll never find your email regardless of how legitimate it is.

What about “smart” spam filters. If you use Google Mail and delete messages rather than archive them, well, you’ll just stop receiving those emails since Google has arbitrarily decided you don’t want those emails. Gotta love the power of Google!

8. Arrival in the inbox
Your email is then sent to the recipient’s inbox. However, if the mail server relies on the antiquated mbox format of storing mail, then this can fail due to hardware issues. Not too many folks use this really horrible format of storing mail, but it is still employed by those who don’t know any better, have other priorities or are resistant to change.

Now, hopefully your email’s subject line doesn’t trigger someone to just knee-jerk delete your email, otherwise all of this was a waste.

If you’re like me, you have a trusty and reliable IBM/Lexmark 4039 printer hanging around your home or office and still wish to use it while using Windows 7. This is certainly not a simple task as Lexmark does not make a driver for the 4039 series specifically for Windows 7. This is further complicated by Windows 7 not allowing the old 4039 drivers to be used on Windows 7!

The following is a less than ideal, crude but effective method of getting the Lexmark 4039 printer working on Windows 7. This guide is documentation of what I have done to get this working and includes some unorthodox techniques.

First, you’ll need to grab the universal print driver by HP (yes, HP, not Lexmark). Apparently the HP guys weren’t kidding when they said “universal.” This sounds great, until you realize that HP’s download links all point to an empty directory on their FTP servers. The file needed is:

If you’re on 32-bit: upd-5_0_1-ps_winxp-vista.exe
If you’re on 64-bit: upd-5_0_1-ps_winxp-vista-x64.exe

Luckily, with some internet searching, I was able to find these files available at: http://ftp.backschues.net/pub/driver/hp_clj1515n/driver/ – The file sizes are similar to what HP said they would be and Windows Defender didn’t turn up any malware notices so chances are these files are unmodified.

Next, run the executable. Considering how old the printer was, I was conservative and used the version 5.0 driver. On my system, it seemed this installation hung after a while. Turned out there was an Add Printer dialog hidden beneath other windows for me, Alt-Tabbing to that window then completing the wizard solved that problem.

If you are using a USB-to-Parallel converter (as I am using), have the converter installed first before doing this. Windows 7’s default drivers work perfectly for my converter. During the add printer wizard, just select which USB port you’ll be using for printing and go through the rest of the wizard as usual.

Once you’ve installed the driver, you’ll need to reconfigure it.

In the Printer Properties, disable the “Add Euro Currency Symbol to PostScript Fonts.” I don’t need the Euro symbol and felt the less my printer needed to do unnecessarily – the better.

In Printing Preferences, match your configuration to mine:

Viola, now you should have a working Lexmark 4039 printer on Windows 7. Thanks HP for universal drivers!

Categories