Category Archives: Computers

The Y2K Zero-Touch Schema: How ASCII Math Almost Saved the Database

In the late nineties, enterprise IT was gripped by a single, terrifying reality: the two-digit year. The panic wasn’t just about application logic; the true nightmare lived in the physical storage layer. Expanding a six-byte date (YYMMDD) to an eight-byte date (CCYYMMDD) in a massive mainframe environment meant taking systems offline, unloading millions of rows, expanding tablespaces, and reloading everything. It meant rebuilding indexes, shifting VSAM byte offsets, and praying the weekend batch window didn’t bleed into Monday morning.

As an engineer staring down the barrel of this brute-force approach, I realized that avoiding a database schema change was the absolute holy grail. We didn’t actually need more bytes on the disk. We just needed a wider alphabet in memory.

The ASCII Sliding Scale

The proposed dates were stored as six characters and mapped in COBOL as PIC 9(6). By dropping a simple 05 DATE-CHAR REDEFINES DATE-NUM PIC X(6) into the copybook, we could instruct the compiler to stop enforcing strict numeric validation on that specific memory address. The physical footprint on disk remained exactly six bytes, but now we could play with the data at the character level.

My idea was to use the decade character as an alphanumeric sliding scale based purely on the continuous ASCII table.

For historical data, the 1900s naturally used ASCII 48 through 57 to represent the characters '0' through '9'. The year 1999 was just 99. We wouldn’t have to touch a single existing row of historical data. The database was instantly compliant the moment the application logic was updated.

For the 2000s, we would just keep counting up the ASCII chart. ASCII 58 is a colon (:). So the year 2000 becomes :0. The year 2009 is :9. The 2010s shift to the semicolon (;), making 2015 evaluate as ;5. The 2020s use the less-than sign (<), meaning today sits around <6.

If we needed to go backward for dates prior to 1900, we simply stepped down the chart. ASCII 47 is a forward slash (/), meaning 1895 becomes /5. By utilizing printable ASCII, we gained almost a thousand years of addressable dates within the exact same two-byte decade footprint.

The Magic of Native Sorting

This wasn’t just a compression trick to avoid a S0C7 data exception; it was designed to respect the physical backbone of the entire batch processing window: the sort order.

In a COBOL ecosystem, sorting is everything. If the encoded dates didn’t sort naturally at the byte level, the cascading failures would have been monumental. JCL sorts, control breaks, and binary searches against in-memory tables would have broken completely. Indexed files built with the date as part of the primary key would have been destroyed.

But because ASCII < (decimal 60) naturally evaluates as greater than 9 (decimal 57) at the processor level, the CPU’s native compare instructions did all the heavy lifting. The character /5 (1895) naturally sorts before 99 (1999), which flawlessly sorts before :0 (2000). Every single index, DFSORT step, and binary search in the enterprise would have continued functioning as if nothing had changed.

The Reality of Enterprise Risk

It was a zero-migration, pure-logic solution that respected the physics of the legacy system.

Unfortunately, management had already made their decision. The mandate was to expand all dates to eight characters, initiating a massive, full-scale migration.

It is a classic enterprise IT dilemma: the triumph of brute force over elegant engineering. Expanding to a hardcoded CCYYMMDD was the industry habit. It was easy to explain to an auditor, even if it meant putting the database administrators through absolute hell. Some shops even went so far as to tack the century flag onto the very end of a 1,000-byte record just to preserve legacy byte offsets, forcing future generations of developers to stitch opposite ends of a record together just to write a query.

Sometimes clever doesn’t trump habit. But as I look at modern event-driven architecture and the complex CDC pipelines pulling data out of legacy Db2 systems today, I still see the archaeological artifacts of those late-90s brute-force migrations. It serves as a great reminder that the most elegant solutions are often the ones that leave the smallest footprint.

Down the SDR Rabbit Hole

I’ve always been intrigued by Amateur Radio.  I’m not specifically talking about HAM radio even though that is certainly part of it.

As a boy I traded a telescope for a OLD “world band” radio and spent a lot of time doing stupid stuff like setting the EXACT time on my watch to the WWVB signal.  Honestly, there wasn’t really much to listen to in North West Arkansas in the 70’s on a 50’s era radio, but I tried.  Keep in mind that we didn’t have the internet, so the only way you could find a station was to slowly tune through the bands listening for something that wasn’t static – which meant you had to tune over the station WHILE it was broadcasting (which can be a bit of a trick when only a few stations broadcast 24×7).  Of course you COULD buy a book or subscribe to a magazine that listed some frequencies to try out if you had the money to spend.

Later, I found a copy of an Amateur Radio Relay League (ARRL) book in a thrift store and spent hundreds of hours looking though it, dreaming about how cool it would be to be able to actually do the stuff they were talking about.  Unfortunately, the cost of getting into amateur radio was a deal breaker for me.

In high school I actually went “all in” and bought a CB radio with “significant” antenna and got my CB license (yes, they actually licensed that back in the day).  My call sign was KAKJ4409.

Since then I’ve always found an excuse NOT to get too involved in radio (yeah, I’ve bought a low end Radio Shack scanner, the not so occasional FRS and digital $35 world band receiver at Walmart, etc.  – but I’ve not gotten “into it”).  I’ve considered getting my ham license, but I’ve always found an excuse not to – I didn’t want to learn Morse code, the radios were too expensive, etc.

By this point I bet you are wondering where this is going, well…  I’ve recently gone down the Software Defined Radio (SDR) rabbit hole and I want to document my decent.  For those of you who don’t know, SDR uses computer software to decode a digital version of the radio spectrum.  To do this, you need a device to receive the radio waves and convert them to digital.  Until fairly recently this piece of equipment was incredibly expensive and really only available to the military and research folks, but not any more.

Several years ago, several companies started producing hobby SDR cards.  Then a security researcher figured out that a USB TV tuner that costs about $15 can function as an SDR radio when paired with the right software.  This is the specific rabbit hole I’m headed down.

I’ll post follow up articles as I work my way though the jungle of open source SDR software and I’ll try to leave enough bread crumbs that you can follow my path if you find yourself so inclined.

Happy DX’ing.

Blocking Facebook Game Invites

So, you are tired of getting inundated with invites to Facebook games and want people to stop sending them to you…  Well, you have two options:  post a plea asking people to stop (sorry, it’s not going to work) or you can block the invites.

Unfortunately, Facebook has made it a bit harder than it used to be – but you can still do it.  Here’s how:

FB_Block_Step1

Step 1: you need to choose the “Lock” icon on the Facebook status bar.

Step 2: select “See More Settings” at the bottom of the “Lock” menu.

FB_Block_Step2Step 3: Choose the “Blocking” menu option on the left menu.

 

Step 4:  Block app invites from user

Once you block app invites from someone, you’ll automatically ignore future app requests from that friend. To block invites from a specific friend, click the “Ignore All Invites From This Friend” link under your latest request.FB_Block_Step4

Step 5: Block apps

Once you block an app, it can no longer contact you or get non-public information about you through Facebook.FB_Block_Step5

And that’s it!  I hope this helps someone!  🙂

Twitter spam may NOT be associated with Gawker

I’m sure that by now you’ve heard that the sudden spike in Twitter spam “appears to be due to the Gawker compromise”.  I’m not so sure.  I have a twitter account that has like 9 followers and it ended up with 2 outgoing spam messages on it.  However, I don’t have a Gawker account (nor any of the other web sites associated with it).  Yeah, I know I might have forgotten that I set one up on one of the many Gawker related sites, but when I enter my e-mail address (OK, addresses) I get a not found on all of them.  Add to this Gawkers assurance that the passwords were encrypted and the fact that my Twitter user ID is not the same as any of my other user ids, and I find it VERY suspicious.

So, if it wasn’t the Gawker leak that explains the Twitter storm today, what does?  My guess is that someone either hacked Twitters account system (or one of the software programs that posts Twitter messages for you) or there is a new way to send a Tweet that is attributable to someone else.  Who knows….

Why is Twitter blaming Gawker?  It could be as simple as “because they can”….

Cry from Laughter after watching this baby – Facebook Trojan

Well, it seems we have a new wave of Facebook Trojans loose on the internet. The one that I researched while writing this post, links to a cast.cc web site that is actually a phishing scheme that presents a FAKE Facebook login screen.  If you provide your Email and Password, it starts spamming your friends on Facebook with links to it. It appears that it also does the more typical thing and installs a Facebook application for you that will spam your friends with links to it (and sometimes other links).

If you fell for this (or a similar scam), the first thing to do is to change your Facebook password and then go to “Account / Privacy Settings / Applications and Websites / Applications You Use / Edit Settings” and remove everything you don’t recognize (watch the video below for step by step instructions on how to remove unwanted Facebook apps)!

I’ve also seen some posts that suggest that at least some of these links attempt to install the Koobface Virus, however I can’t confirm this.  The article I linked to implies that this virus is virulent across Windows, OS X and Linux.

If you are on Windows, it’s highly recommended that you have a good virus checker installed and current.  I personally recommend AVG Free, which (as the name implies) is free and quite good.

BTW, if you use Firefox, Chrome and / or Open DNS (Family Shield is free and awesome), you will be presented a warning page for this site that tells you it’s a phishing site BEFORE you get the login page.

Sophos has a good video on how to remove applications (like “Stop Txting Lk Ths”, “NFee”, etc.) that you have already set up (if you aren’t already a fan of Sophos, I would recommend doing it as they tend to notify you of Facebook scams pretty quickly and give good general security advice).  Here’s their video:

httpv://www.youtube.com/watch?v=Or-qR0Y300w

Oh, and in case you didn’t know, Facebook has stated clearly, that Facebook Profile Trackers DO NOT Exist!  If you installed one, you need to follow the suggestions in this article to remove the scam application that was installed.

Facebook post:  Funniest baby a live you must watch !!!   Cry from Laughter after watching this baby.  See all the funniest videos on the net in one place!!!  My gosh you have to see this baby its the funniest thing every!!!  Baby sitting on the toilet reading a newspaper. This American GUY must be Stoned to Death for doing this to a GIRL. 10 things every GIRL wants in a MAN! This Teen Killed Herself After her Dad Posted This On Her Facebook! OMG this father crashed and died after THIS message from is daughter on his blackberry! See Who Is Viewing Your Profile!

Ubuntu Dynamic DNS Update for OpenDNS

Let me start by saying that I’m a firm believer in both Ubuntu and OpenDNS.  The problem I had was getting OpenDNS setup to correctly identify the IP address assigned by my ISP.   I have a WiFi router that doesn’t automatically update OpenDNS, so I needed a way to keep OpenDNS updated when my IP address changes.   Keep in mind that in a configuration like this (pretty common) my computer’s IP address is NOT the IP address that OpenDNS needs to identify my computer so scripts running on the computer can’t easily identify the routers external address.  Continue reading Ubuntu Dynamic DNS Update for OpenDNS →