Skip to main content

Posts

Showing posts from August, 2008

selective table restore from mysqldump

I recently had to restore a corrupted table that had resulted from a full disk. I had been using automysqlbackup as my backup script. Each database had a corresponding backup file. It would have been easy to use a text editor to edit out the tables that you didn't want to restore but this database had grown to 1G. STEP 1: Restore table structure If the table structure is corrupted, you need to retrieve the CREATE TABLE statements from the backup. To do this you can use grep: zcat backup.sql.gz | grep -A 20 'CREATE TABLE `tablename1`' > tablestructure.sql This command will create tablestructure.sql containing the CREATE TABLE statement and 20 lines after that. You may have to change the parameter from 20 to whatever to get the entire statement. Once tablestructure.sql had been edited to only contain the proper CREATE TABLE statement, you may now restore the table structure. mysql -u user -p dbname < tablestructure.sql STEP 2: Extract and restore the table data This co

Setting up Corporate Ubuntu Desktops

This guide has been updated for Ubuntu Hardy 8.04.1. The following is the official installation guide: https://help.ubuntu.com/8.04/installation-guide/i386/index.html The preseed method will enable a more automated install. You will want to enter the proxy a local apt-cacher server if you have one to speed up the updates and installs of new packages. Post Installation Tasks Updating and Installing Packages In Synaptic, configure proxy as needed. If you have an apt-cacher service running on the proxy server, it will make your updates much faster if the packages have already been downloaded by a prior machine. Click on Reload Click on Upgrade Install ubuntu-restricted-extras Install ttf-liberation Apply Configure Desktop to Remove Annoying Stuff In System -> Administration -> Login Window -> Accessibility, uncheck the sounds In System -> Preferences -> Sounds -> Sounds, uncheck Play System Sound to remove annoying sounds If you want to ch