Body of Knowledge

knowledge sharing - wiki brain

Archive for September, 2006

recommended firefox extensions

Here is a list of recommended firefox extensions:

  • Tab Mix Plus - enhances browsing capabilities, includes session manager;
  • NoScript - alows JavaScript for trusted domains with white list management;
No comments

Spam free solution for e-mail registration

This service www.mailinator.com allows you to have an instant mailbox for getting junk e-mail without entering your personal data.

No comments

basic shell scripts

  • sort with count by column x
cut -d " " -f 2 raw.file | sort | uniq -c | sort -nr > ordered_by_freq_file
  • ...

Links:http://www.watsys.unh.edu/Darlene/TechToolsFiles/LammersUNIXDemo/UNIX_Intro.html

No comments

install vmware tools on Ubuntu

  1. Install needed packages
  2. # sudo apt-get install gcc
    # sudo apt-get install linux-headers-$(uname -r)
  3. Create vmware tools package
  4. Use VMware window option VM -> Install VMware Tools to generate a virtual DVD-ROM with the package.

  5. Uncompress & Untar VMwareTools-x.x.x-xxxxx.tar.gz
  6. click the packge DVD-ROM and “extract to” Desktop the tar.gz file

  7. Run vmware-install.pl
  8. # sudo Desktop/vmware-tools-distrib/vmware-install.pl
No comments

mysql easy backup and restore

In essence in order to fully backup and restore a MySql database server, you just need to use two commands mysqldump and mysql. For a “small databases” scenario you can find at the end a simple script to send the backup by e-mail. In conjunction with crontab you can almost name it a backup policy.

  • MySQL backup>
  • # mysqldump -u <user> -p <passwd> --all-databases > <backup file>
  • MySQL restore>
  • # mysql -u <user> -p <passwd> < <backup file>
    # mysql --execute "update mysql.user set host='old' where host='host';"

Backup script example
#!/bin/bash
# This script runs nightly to back a MySQL database to a e-mail account

DATE1=`date +%D`
DATE2=`date +%Y%m%d%H%M`
# The email address that receives backups
ADDRESS=”alias@domain”
# Local temp directory
BACKUPDIR=”/tmp”
# MySQL username and password
MYSQLUSER=”user”
MYSQLPASS=”pass”
# MySQL database to backup (or –all-databases to backup everything)
DATABASE=”–all-databases”
# Name of backup file
FILENAME=”mysql_backup”

# Change to the backup directory
cd $BACKUPDIR

# Dump the MySQL databases to a plaintext file
mysqldump -u $MYSQLUSER -p $MYSQLPASS $DATABASE > $FILENAME_$DATE2

# Package (tar) and compress (gzip) the plaintext MySQL dump
tar czf $FILENAME_$DATE2.tar.gz $FILENAME_$DATE2

# Mail the resulting archive to our Gmail account
date | mutt -s “$FILENAME ($DATE1)” -a $FILENAME_$DATE2.tar.gz $ADDRESS

thanks to Bruno Rodrigues

2 comments

Next Page »