UPS: Back to the future!

Uncategorized No Comments »

I ordered a D-Link DNS-323 NAS from Amazon yesterday with Super-Save shipping, which left me thinking I’d see a box next Tuesday or Wednesday.  So I was beyond geeked when I checked the status midday today and saw it as Delivered, right up until I looked more closely at the tracking…

Apparently UPS can ship so fast that they wind back time.  Which would be awesome, if only they got it to the right address (I like in Kentucky, not Missouri).

.NET: Referencing a 2.0 DLL from a 1.1 DLL

Tips, Uncategorized, Work No Comments »

*NOTE* This only works if your executable is running under the 2.0 Framework!

At work we are writing a .NET 2.0 application that has its roots back in 1.1.  Some ancillary applications were also written in 1.1, and shared some common libraries; so when it came time for this application to be upgraded to 2.0 some libraries had to be left behind for compatibility reasons.

One such library has the task of loading data from databases, and was designed to read from MS Access, SQL Server, or MSDE; however in the ongoing development of our application we are scraping the MS Access use in favor of SQL Compact Edition.  For those familiar with SQL CE, you’ll know it’s not compatible with the 1.1 framework–so we were faced with the issue of either duplicating the functionality of the 1.1 DLL in a 2.0 DLL, so that old applications could be left alone, or with doing massive work to overhaul the old applications and try to bring them all up to 2.0…  neither option was terribly appealing (although the first option was obviously preferable).

Our project architect put the task to me, and had a plan of attack that he figured would let us make the 1.1 DLL talk to the SQL CE database via a 2.0 DLL proxy–however you’ll know that 1.1 projects cannot reference 2.0 projects.  Here’s where a little trickery comes in…

For a quick recap we have: A Framework 2.0 application, which calls a 1.1 Library to retrieve data.  We need: A Framework 2.0 application to call the 1.1 Library to call a 2.0 Library to retrieve the data from SQL CE.

To achieve this we added an interface to the 1.1 Library, and implemented that interface in the new 2.0 library which uses the interface to fetch the needed data from the database.  The 1.1 library uses reflection to late-load the 2.0 library and instantiates it by its interface.

So the workflow is:

  • 2.0 Application makes a call to the 1.1 Library
    •  1.1 Library uses an Assembly.Load() call to late-load the new 2.0 Library and casts it to the 1.1’s interface definition.
    • 1.1 Library then can call the Interface member, which…
      • Talk through the 2.0 framework to our SQL CE database.

ThinkPad T61p: Converting drives from Compatibility-mode to AHCI

Uncategorized No Comments »

I formatted my T61 for the purpose of squeezing Vista down to a reasonable size, and so that I could ensure that I could get XP to install as C:\ (because (1) I will use it more, and (2) Vista will always show itself as residing on C:, even if it is really isn’t).

To install XP I had to convert my SATA controller to run under Compatibility-mode, which allows XP to recognize the drive without a 3rd party driver during installation. After installing XP, Vista, and Ubuntu Gutsy Gibbon on the drive in this mode I flipped the BIOS switch back to AHCI, and both versions of Windows crashed hard.

Here’s the path to recovery:

  1. Go to Lenovo\IBM’s site and lookup the driver-download page for your machine, this page is under Support.
  2. Find “Intel Storage Matrix” on the driver page and download it. Then run this file, which will extract other files.
  3. Open a command prompt, and go to C:\Drivers\Win\IMSM\Prepare (created by the above step). Then run “Install.cmd” which will install the Intel drivers.
  4. Reboot, flip the BIOS switch to AHCI, and you should be all set.

This works for both XP and Vista; although Ubuntu was happy without any work :-)

screen - a terminal encapsulator

Uncategorized No Comments »

My title might not be quite accurate, however screen is a great little utility that has a lot of leverage.  My main use for it is to start an application and allowing it to run on my remote machine while I disconnect my ssh connection.  Basically, just ssh into your remote machine and install screen.  Then start the program with the ’screen’ command.  Now start your task, maybe a torrent with btdownloadcurses.  Whenever you want to disconnect and leave the program to run press Ctrl-a d (Control and ‘a’ key, then ‘d’)  to detach.  Whenever you want to reattach to that session restart screen with the -r command, so ’screen -r’ and voila you’re back!

dmidecode

Uncategorized No Comments »

This is more a Post-it note to myself to remember one of my facorite new commands: dmidecode

dmidecode will output lots of details about your motherboard and the devices connected to it, including BIOS information as well as some upgradability info (usually).

Scott Adams must be a coworker

Comics, Life Hacks, Work No Comments »

An Uncanny Resemblance

Recovery from a dead FAT32 Windows drive

Data Recovery, Great Utilities, Linux, Tips, Ubuntu No Comments »

My landlord’s old PC has suffered several failures over the years, including several fans and power supplies and at least one hard drive. When I moved in a year ago they called me over to replace yet another PSU for them, and a few months later to figure out why the machine would not even begin to boot.

The suspect was immediately either the IDE controller or both of its drive. After transplanting the drives to a seperate machine and failing to find their partitions, and after trying a new drive in the machine it was looking as though possibly all were fried.

A couple months have passed and my landlord has had me build him a new computer and the day has come to try to recover his data… Below is the process I’ve used to diagnose and recover his files. Read the rest of this entry »

Determining / Recovering a Partition’s UUID (Univeral Unique Identifier)

Data Recovery, Linux, Tips, Ubuntu No Comments »

I made a boo-boo after reinstalling my base Ubuntu system, and accidently copied over the entirety of the fresh installation’s /etc/fstab file with my old /etc/fstab.

The UUIDs of my new installation were lost, so after a little Googling I found that there’s a helpful little utility called “vol_id” specifically for determining this type of info…

vol_id [partition]

and voila, I’ve got my fstab back in fine shape :-)

Penetration testing my apartment

Life Hacks, Security, Tips, Toy Helicopters Fuck with me so bad! No Comments »

Problem: It’s 1:00am, in a town where you don’t really know anyone, you’re locked out of your apartment, and the only things you have on you are a cell phone and a toy RC helicopter (it has LED’s that blink, I thought it would be cool to fly in the dark).

Objective: Gain entry to your dwelling without having to a) wake up the neighbor or b) explain to a cop that your ID is just behind the door you’re trying to jimmy. Read the rest of this entry »

Creating an encrypted volume

Encryption, Linux, Security, Tips No Comments »

I needed to meet my company’s required security policy for taking source code offsite: 256bit AES encryption.

Since the source code I had on my laptop was within a Virtual Machine, I thought it would be a good solution to make an encrypted filesystem big enough for the VM, and only mount it when I wanted to work.

Here’s my requirements:
- Encrypted FS that is (un)mountable whenever need be
- Passphrase to mount the filesystem
- 30GB of storage within the filesystem, to accomodate the 30GB VM disk. Read the rest of this entry »

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in