After browsing the MySQL documentation and various how-tos, I've come up with this simple procedure to get up and running with MySQL replication on Ubuntu Server with as few steps as possible.
That means that no, you don't have to lock the master database for ages while you mess about with the command-line. Neither do you have to use SHOW MASTER STATUS; and write down the names of binlogs or their indexes. mysqldump can do that for you.
This guide assumes the reader is familiar with using the -u and -p switches to access the root MySQL user when running the mysql and mysqldump commands, and that the reader is able to use sudo to elevate their privileges appropriately.
MASTER
1. Create a user for replication:
mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'slave.domain' IDENTIFIED BY 'password'; mysql> FLUSH HOSTS; mysql> FLUSH PRIVILEGES;
[mysqld] bind-address=0.0.0.0 server-id=1 log_bin=/var/log/mysql/mysql-bin.log sync_binlog=1 innodb_flush_log_at_trx_commit=1
sudo /etc/init.d/mysql restart
shell> mysqldump -u root -p --databases db1 db2 --master-data --flush-logs --single-transaction > snap.db # Transfer the dump to the SLAVE shell> tar zcvf snap.tgz snap.db shell> sftp user@slave.domain put snap.tgz exit
[mysqld] server-id=2 replicate-do-db=db1 replicate-do-db=db2 binlog-ignore-db=mysql binlog-ignore-db=information_schema binlog-ignore-db=test
shell> sudo /etc/init.d/mysql restart
# Extract snap.db from gzipped tarball shell> tar zxvf snap.tgz # Finalise config, import data, start slave operations shell> mysql -u root mysql> SLAVE STOP; mysql> CHANGE MASTER TO MASTER_HOST='master.domain', MASTER_USER='repl', MASTER_PASSWORD='password'; mysql> SOURCE snap.db; mysql> SLAVE START;
I recently had cause to do this and ran into a few of these errors when trying to reinstall:
/var/lib/dpkg/info/mysql-server-5.0.postinst: line 143: /etc/mysql/conf.d/old_passwords.cnf: No such file or directory /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz /etc/init.d/mysql: line 122: /etc/mysql/debian-start: No such file or directory
sudo apt-get autoremove --purge mysql-server mysql-server-5.0 mysql-common sudo apt-get install mysql-server
sudo dpkg --purge mysql-server sudo apt-get autoremove sudo rm /var/lib/mysql -rf sudo rm /etc/mysql -rf
If you receive this message while trying to change your ColorSync profiles:
"The factory profile for the display could not be found."
Try resetting your PRAM. To do this:
1. Shut down your Mac.
2. Hold down the CMD, Option (or Alt for International keyboards), P and R keys.
3. Keep all these held down and press the power-button to start the Mac.
4. The grey screen will appear, and after a short moment the Mac will restart, at which point you can release the keys.
You're done.
Reference: http://support.apple.com/kb/HT1379
Use the following method if you have recently needed to reinstall your Windows partition on a dual-boot Ubuntu/Windows setup. (Note: These instructions are not limited to Ubuntu only. Most any flavour of Linux and dual/multi-boot configuration can be repaired with few or no tweaks to the procedure.)
1. Boot from a recent Ubuntu installation CD (or Live CD.) Choose to "Try Ubuntu" without installing it from the boot menu.
2. Open a terminal.
3. Determine where your Ubuntu partition is using fdisk:
sudo fdisk -l
sudo mkdir -p /media/ubuntu sudo mount /dev/sda6 /media/ubuntu
sudo grub-install --root-directory=/media/ubuntu /dev/sda
I recently had this problem trying to fix an old laptop running Windows XP Home. I found a solution here: http://www.pcmech.com/forum/showthread.php?t=139698 but I ran into a snag of my own when trying to run Task Manager.
The message Task Manager has been disabled by your administrator popped up when I tried to follow the guide. I suspect this is a curiosity of the XP Home disc, but it was easily fixed by running the Registry Editor and changing the appropriate flag.
The whole process is documented below for reference:
1. When stuck at 31/32 minutes, press SHIFT-F10 to bring up a command-prompt (yes, that one's news to me, too.)
2. Type taskmgr and press ENTER. If the Task Manager appears skip to step 3. If you get a warning, continue to 2a:
2a. Type regedit and press ENTER.
2b. Navigate to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System. You will see a value labeled DisableTaskMgr and its value will be set to 1. Double-click on it and change the value to 0.
2c. Close the Registry Editor and return to the Terminal window. Type taskmgr and the Task Manager should appear this time.
3. Look for the process(es) in the Processes tab that are hogging all the resources (ie, greater than 90% CPU, huge memory usage, etc.) and causing setup to freeze. If you don't see any, your setup may not have actually frozen yet. Patience, grasshopper!
4. Click "End Process" on each rogue process once you're sure they are causing problems. Setup should start making progress quickly after you've killed the right process.
5. Setup may freeze again at the 13 minute mark. If it does, simply repeat from step 1.
Do not be trigger-happy about loading Task Manager and killing processes. Ensure the that setup has frozen by waiting 30 minutes to 1 hour before acknowledging that yes, it really doesn't have 31/32/13 minutes to go!
A recent emerge --update --deep world performed an upgrade of gcc. This was fine in itself; the problems came after running emerge --depclean, which removed my old gcc version and invalidated my current gcc profile.
But I did not actually realise gcc was broken until I tried emerging something else, and even then I did not immediately look to my gcc configuration!
Solution
These are the steps you should take when faced with upgrading gcc:
1. Before installing a new version, check that your current gcc is configured correctly:
linux # gcc-config -l linux # gcc-config 1
# Manually: linux # unset GCC_SPECS linux # emerge gcc # Or through a world update: linux # emerge --update --deep world linux # emerge --depclean linux # revdep-rebuild
linux # source /etc/profilelinux # gcc
gcc: no input fileslinux # emerge geoip ... configure: error: C compiler cannot create executables See `config.log' for more details. !!! Please attach the following file when seeking support: !!! /var/tmp/portage/dev-libs/geoip-1.4.5/work/GeoIP-1.4.5/config.log * * ERROR: dev-libs/geoip-1.4.5 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 2627: Called econf '--enable-shared' * ebuild.sh, line 543: Called die * The specific snippet of code: * die "econf failed" * The die message: * econf failed * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/dev-libs/geoip-1.4.5/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/dev-libs/geoip-1.4.5/temp/environment'. *
linux # emerge --info !!! No gcc found. You probably need to 'source /etc/profile' !!! to update the environment of this terminal and possibly !!! other terminals also.
linux # gcc-config -l * gcc-config: Active gcc profile is invalid! [1] x86_64-pc-linux-gnu-4.3.2
* Switching native-compiler to x86_64-pc-linux-gnu-4.3.2 ... * Your gcc has a bug with GCC_SPECS. * Please re-emerge gcc. * http://bugs.gentoo.org/68395 >>> Regenerating /etc/ld.so.cache... [ ok ] * If you intend to use the gcc from the new profile in an already * running shell, please remember to do: * # source /etc/profile
linux # gcc gcc-config error: Could not run/locate "gcc"
Taken from elsewhere for my own notes:
1. Use "mdadm --manage /dev/md0 -r /dev/sdd" to remove the drive that was marked as faulty from the array.
2. Power down and replace the drive with a good drive.
3. Power up and set the partition table on the new drive to match those of the other drives in the array. Here we used "sfdisk -d /dev/sda | sfdisk /dev/sdd".
4. Add the proper partition on the new drive into the array, "mdadm --manage /dev/md0 -a /dev/sdd2"
5. Sit back and wait for the recovery to happen, you can "cat /proc/mdstat" to watch its progress; you should see something like:
Personalities : [raid5] md0 : active raid5 sdd2[4] sdc2[2] sdb2[1] sda2[0] 731985408 blocks level 5, 256k chunk, algorithm 2 [4/3] [UUU_] [===>.................] recovery = 19.7% (48253056/243995136) finish=59.1min speed=55184K/sec

Outcast is a PC video game from 1999 by the now bankrupt Appeal, and was distributed by Infrogrames. At the time it was Windows-only, but today you can get your retro-fix on Linux thanks to developments with WINE.
Here are instructions on how to get Outcast working in Ubuntu Hardy Heron, although you will not have too much trouble transferring them to other distros:
Installing WINE: You will need a patched version of WINE 1.1.0 in order to fix the mouse-look problem. This problem affects other games, too. Fortunately, the patch adds an optional ENV flag, so you will not affect your other WINE applications with it.
1. Install the build-dependencies and patching utility:
sudo apt-get build-dep wine sudo apt-get install patch
mkdir ~/wine-dev cd ~/wine-dev tar xvf ~/wine-1.1.0.tar.bz2 -C .
cd ~/wine-dev/wine-1.1.0 patch -p0 < ~/wine-force-mousewarp.patch
./configure make sudo make install
winecfg # Applications > Windows Version > Windows 98 # Graphics > Allow DirectX apps to stop the mouse leaving their window # Audio > OSS Driver # Drives > Autodetect... (make sure it picks up your CD-ROM drive!) # Press OK
# Terminal 1 # Install the game as normal (use the default settings) # Assumes D:\ is how WINE detected your CD-ROM drive wine "D:\Setup\SETUP.EXE" # Terminal 2 # Once the installer starts copying the game-files, run # this command to delete Uninst.isu when it exists. # The game takes a little while to install, so you should # not need to rush the process rm ~/.wine/drive_c/Program\ Files/Outcast/Uninst.isu
env WINEPREFIX="~/.wine" wine "C:\Program Files\Outcast\Outcast.exe"
env WINEFORCEMOUSEWARP="yes" WINEPREFIX="~/.wine" wine "C:\Program Files\Outcast\oc\loader.exe"
This article is a backup of a thread I posted elsewhere, and partially documents the installation of my Gentoo server.
Click "Comments" to see the whole thread.
Still on a retro-gaming bender, I reinstalled ZSNES recently only to find out why I abandoned it in the first place: Bad sound quality on my system.
After much digging I think I've finally stumbled on the solution, so here's the lowdown on getting ZSNES up-and-running from source: (This assumes you've already downloaded it from the ZSNES site and have extracted it to an appropriate place.)
# You'll need SDL if you don't have it: sudo apt-get install libsdl1.2-dev # Configure, make and install ZSNES ./configure --enable-libao --enable-release make && sudo make install
sudo apt-get install libsdl1.2debian-alsa sudo apt-get install libsdl1.2debian-oss sudo apt-get install libsdl1.2debian-esd