Spawn a Styled xterm into Home and Disown It

First, I set up the styling (no scrollbar, font, font size, background, and foreground colors):

xterm +sb -fa monaco -fs 10 -bg black -fg white

Next, I redirected the output and backgrounded the process:

xterm +sb -fa monaco -fs 10 -bg black -fg white > /dev/null 2>&1 &

This worked well for quite a while, but when I spawn a shell in an arbitrary directory, I wanted my shell to start in home so I added:

eval $( cd ; xterm +sb -fa monaco -fs 10 -bg black -fg white > /dev/null 2>&1 & )

Finally, I wanted to fully disown the new xterm from the shell I spawned it from. Therefore, my .bash_aliases file now has:

alias term='eval $( cd ; xterm +sb -fa monaco -fs 10 -bg black -fg white > /dev/null 2>&1 & disown %1 )'

Now I can cleanly spawn a new terminal that sends no output to the existing shell.

How Nvidia Took the Fun Out of Dual Screen Xorg Configuration

Dual screen configuration used to be quite the hassle on Linux. However, Nvidia has made it incredibly easy with their nvidia-xconfig command. The “–no-logo” argument eliminates the Nvidia logo when X starts, and “–twinview” enables the second display.

nvidia-xconfig --no-logo --twinview

Now I can configure my systems for dual displays during an Ubuntu installation without the need for reinstalling an old hacked together xorg.conf file.

Adobe Flash 10 for 64-bit Ubuntu Linux

Since Ubuntu Hardy Heron, it has become much easier to install Flash on Ubuntu, but the included restricted packages always leave me a bit disappointed. Luckily, Adobe provides a proper 64-bit version of Flash for Linux called “Square”. Since I tend to automate my installations, I wrote a script to install the latest version of Flash on my computer:

#! /bin/bash

# Remove any installed Flash packages
aptitude remove --quiet --assume-yes flashplugin-installer flashplugin-nonfree

cd /tmp/
FLASH="flashplayer10_2_p3_64bit_linux_111710.tar.gz"
wget http://download.macromedia.com/pub/labs/flashplayer10/$FLASH
tar xzvf $FLASH
mv libflashplayer.so /usr/lib64/mozilla/plugins/
rm $FLASH

Now Flash runs properly, and with the switch to “Square,” it even seems to consume fewer resources on my machine.

MySQL Duplicate Key in Table Errors

Recently, I tried to dump data from a production database and import it locally in a development environment. I went through the normal process of dumping the data:

mysqldump database > database.sql

And importing it locally:

mysql database < database.sql

However, I quickly got a duplicate key error:

ERROR 1022 (23000) at line 1170: Can't write; duplicate key in table 'sys_tracking_archive'

After some looking, I discovered the “–insert-ignore” option:

mysqldump --insert-ignore > database.sql

The second attempt to import the data worked correctly. Alternatively, I could have replaced all instances of “INSERT” with “INSERT IGNORE” in the original SQL dump file.