While cleaning up an old machine I was first using CCleaner from Windows to wipe some partitions because DBAN crashed for some reason on it. To clean some of the Linux partitions on the drive which Windows can’t access, I dropped them so I could re-add them as NTFS partitions for further wiping. Problem was I forgot those partitions where also hosting my master boot record, so when I rebooted to confirm my partition changes… I ended up with a unbootable system.
Now I had to find a way to wipe those disks from Linux, but first I still wanted to get access to my WinXP setup. I could have just nuked it from orbit (read: boot from a Linux Live CD and shred it) but I was just wondering if I would manage to get it to boot again, just in case I do this on a system that really matters some day. So I started browsing to the ISO’s available on the Universal USB Boot installer and ran into the awesome Trinity Rescue Kit.
I installed it on a very small USB drive (265MB) I had lying around and managed to rewrite me a Windows boot record with the tools supplied from the text-based menu. Nice! I also noticed that it has a bunch of disk rescue tools on board like a backup tool, full NTFS support, the Midnight Commander explorer for file recovery and a Windows password reset tool (hackedy-hack). On top of that it also has a virus scanner on board, ways to set up network file shares and good, detailed documentation.
This distro is certainly one that is getting a nice spot on my PC CPR tool belt. Without exploring all the goodness Trinity has to offer I’m sure it’s a huge time saver if you need to help out with a unbootable system or one seriously infected with trojans or virii. You can even use this to set up a headless file share server in no time if you want.
Photo by lilbambi01, cc-licensed.
Well if DBAN doesn’t cut it for some reason there’s always a more native Linux way to do this.
Step one is getting a Linux live CD, DVD or USB stick and boot from that. I used the Debian Live CD myself, which boots into character mode so you don’t end up with XServer not getting your video settings right.
Once you’re in a shell, you can use the shred command to wipe your HD’s data by overwriting it a number of times with random data. I found that out by reading a post by a lad named Jason on the topic which was a nice help. I only had to add the “sudo” call in front of the command to actually allow it to get write access to the disk on Debian.
First figure out what partition/drive you want to wipe by running:
Then, in my case, I had to run this to wipe sda:
sudo shred -fvz -n 6 /dev/sda
-fvz basically means, [f]orce write permissions, [v]erbose output so you can see the wiping progress and write [z]ero’s on the last run to hide the wiping.
-n 6 tells it to do 6 runs of random data writing.
Using DBAN is still the easier way to get this done, but if that’s causing you trouble you can use this as a backup wiping measure.
Photo by Hugo Chinaglia, cc-licensed.
If you’ve ever went to the trouble of setting up WordPress on a Windows machine yourself, going through a PHP, MySQL and phpMyAdmin installation, then sort through all the IIS crap you run into you’ll love TurnKey Linux virtual appliances (aka pre-installed virtual machine boxes).
You can for example download a WordPress appliance which has all the stuff mentioned above pre-installed, launch it in VMWare Player, go through a 5 minute config et voilà! You have your very own virtual Ubuntu box up and running with a fully functioning fresh WordPress install on it. You can even flex your 1337 Linux command line skillz through “Shell in a box” which simulates a shell window in your browser. Or you can use SFTP/SSH. Wickedness indeed.
There’s more fun to be had though. Lot’s of other cool appliance are available containing tons of Open Source Software to be messed with. There’s a LAMP stack, one for Drupal, Ruby (how hip!) etc. Not quite geeky enough for ya? Well alright, go ahead then, get one of those appliances and upload it to Amazon EC2 and be all “in the cloud”. Cause they can do that you know. Oh yeah.
Don’t know if it’s a good idea though. Security wise and all.
(*) If you have VMWare Player installed and already downloaded the zip file of course. :)
Photo by MissMaze, cc-licensed.
Pic by Felipe Morin, cc-licensed
For someone not accustomed to the Unix file system hierarchy you might have a hard time figuring out where the heck that package manager installed software you just selected. That is when it doesn’t occur automatically in your Ubuntu Application menu in the first place. Well there is a simply way to figure that out without having to look through all those mysterious usr, var and etc folders.
- Open up your Synaptic Package manager.
- Search and select the package you want to know the installation folder of.
- Right click it, and select Properties.
- Go to the Installed files tab of the property window.
- There you have it, all installed files and there location on your disk.
Now you can manually browse to it and run it by double clicking the binary.
If you want to add a shortcut or launcher to your Applications menu for the newly installed app, you can do this by right clicking the Applications menu, and selecting “Edit menus”.
Step by step details on how to add a new entry can be found on ubuntugeek.com.
Online file storage systems usually have the drawback that you have to install a proprietary piece of software on your PC before you can start uploading and downloading files easily. Recently however I came across who.hasfiles.com and it turned out to be ass-kicking. The reason why I tried it in the first place, even though it doesn’t over that much space (only 100 mb) is that is claims work as a native disk for Windows, Mac or Linux.
Now that’s the kind of talk geeks like to hear! It even gets better. I tried this thing out, and besides actually working as promised, it even works through firewalls (like at work), which makes it really super-handy-dandy!
On Windows there’s nothing more to it than mapping your online storage as a new network drive, and using a local drive letter to access it. Hell, you can even use the
net use command to map your drive, which means you can map or unmap it from batch scripts to do automated backups etc. Since the drive works like a native USB stick you hooked up to your system, you can access all your files easily through the explorer, using all your favourite software or even from the command line, and you won’t be able to tell the difference. Well, you might be able to guess since it’s going to be a tad slower than your local drives of course. You are connecting over teh interweb remember.
You can read how to map the drives for any OS on their site, and mapping it using the net use command to an X-drive goes like this:
net use x: http://yourname.hasfiles.com/storage/ /user:yourname yourpassword
The name servers are pointing to the new Linux machine from now on, and things are running smooth (so far).
The WordPress database issue was solved by upgrading to the latest 2.3.1 version, which required a DB upgrade anyway, and fixed the tables that where incorrect. I had manually fix the md5 hash codes for the passwords, but since only a few users have accounts here, that wasn’t a problem.
I have nice permalinks up again now, without that index.php thing in them even, so that’s even better than before. I’m using Dean’s Permalink Migration plugin to make sure old links from all over are still working, and not loose too much Google rank etc, though I doubt that all those http errors from the Windows machine did a lot of good for that.
While I’m at it, here’s a tip if you plan to migrate a WordPress installation any time soon. Then you’ve restored a database backup on a new system, the first thing to do is adjust the blog and site URL to the new location. While you’re at it, change the blog title as well.
WordPress has a habit of using those URLs a lot in redirects, and if you forgot to change those, you’ll end up being swung over to the site your backup is from. If you didn’t change your blog title there’s a big chance you won’t notice you’re now working on the live site, and might end up screwing things up.
Which ain’t fun.
You can find and change these parameters in your mySQL database in the
wp_options table with the values (
siteurl” and “
Finding freeware, or even better, open source applications can involve some serious Googling sometimes before you wade through the trial-ware programs listed as free in the search results. Luckily there are a number of websites that have nicely categorised free software so it becomes a piece of cake to find and download exactly what you need.
Here’s a list of sites that I use whenever I’m looking for something new to do all sorts of odd jobs:
- FileHippo : It doesn’t just have a funny hippo in the logo, no suree! It’s also a slick website with tons of good, solid free and open source applications listen in a ton of handy categories, making your search for the perfect piece of software like a walk in a really safe park without drug dealers and prostitutes or anything. Sweet! You can also get older versions there, which is very interesting if you have an old PC lying around that can’t run the latest and greatest version any more cause it’s too damn slow. You have to find out what’s open source and what not there yourself though.
- eConsultant dot com sounds like a money making blog, but it does have a huge list of open source apps listed per category. If you don’t find anything in there, there’s also a freeware list, equally huge again with the same handy categories.
- Sourceforge.net : Probably the biggest and most popular place where developers dump their open source projects for all to download and reap the benefits of. Be sure to set your search filters to include only stable projects if you are looking for stuff that works right out of the box. If you like to tinker with code, there’s plenty of stuff to be found in there to improve on, so feel free to geek out.
- the Free Software Directory: For geeks only really. Most of it is software for GNU *nix systems, so if you’re looking for something particular this might be a good place to look. Steer away from this one if you’re just looking for a setup.exe to run.
It got pretty geeky toward the end, but hey, if you’re reading this blog, there’s a big chance you’re one of those anyway, so go ahead an indulge yourself.
Free source code. Yummy.