2011

csplit command

Let’s say you have a single file (a mysql dump) containing the output of multiple database backups… and you want to split them out into individual files. Input fil: # MySQL dump 7.1 # # Host: localhost Database: Purchase_Tracking # … Lots of CREATE TABLE and INSERTS … # MySQL dump 7.1 # # Host: localhost Database: Test # … Lots of CREATE TABLE…

Using rarcrack on Ubuntu

Rarcrack is an open source rar file password cracker.  Use it when you’ve forgotten the password you put on a rar or zip file.  The current version (0.2) doesn’t work flawlessly on Ubuntu, so follow these steps. 1. Download the source: wget http://downloads.sourceforge.net/project/rarcrack/rarcrack-0.2/%5BUnnamed%20release%5D/rarcrack-0.2.tar.bz2 2. Un tar tar -xjf rarcrack-0.2.tar.bz2 3. Change directory cd rarcrack-0.2 4. Type make, hit enter.  You will likely receive an…

BASH script to remove numeric prefix from files downloaded from scribd

Scribd is a great service, offering PDF downloads of a variety of content.  Unfortunately there is an ugly 8 digit (random?) number prefixed on each file downloaded. 47432750-Book-Name-Whatever.pdf 47501680-Another-Book-Name.pdf 47502885-Yet-Another-Book-Name.pdf It’s not descriptive, and it makes alphabetic sorting of the files downloaded impossible.  Here’s a small BASH shell script that will remove the first 9 characters (8 digits and the – character) from all…