Archive for January, 2005

Bittorrent TV Show Download

January 21st, 2005 Tony 12 comments

I only watch one TV show (Lost) regularly but I really don’t want to miss any episodes. Earlier this week I did miss it because I was stuck at work due to the crazy traffic mess in the Triangle.


Bittorrent to the rescue! What a beautiful, simple, p2p application. If I desired to download the tv episode in perfect raw AVI I could probably could have downloaded it in around 4 hours. Of course I wouldn’t actually download this tv show because that would be illegal so I this is purely conjecture.

Some good sites for bittorrent TV episodes download:


I recently discovered the Azureus Bittorrent client. Install this bad boy and you have the ability to offer your existing library up for upload resulting in faster downloads on your new files!

Categories: Computers Tags:

Execute MySQL Script from Java

January 20th, 2005 Tony 6 comments

Ant is a great tool for deployment but I found that it simply wasn’t powerful enough to handle all my needs. So I’ve been developing some deployment tools to make it easier for me to deploy new code releases. One necessity was to be able to execute a MySQL script from Java. The following function will do the job. One note, this function requires that the location of the MySQL executable is in your machine’s path variable.

public static String executeScript (String dbname, String dbuser,
String dbpassword, String scriptpath, boolean verbose) {
String output = null;
try {
String[] cmd = new String[]{"mysql",
"--user=" + dbuser,
"--password=" + dbpassword,
"\"source " + scriptpath + "\""

System.err.println(cmd[0] + " " + cmd[1] + " " +
cmd[2] + " " + cmd[3] + " " +
cmd[4] + " " + cmd[5]);
Process proc = Runtime.getRuntime().exec(cmd);
if (verbose) {
InputStream inputstream = proc.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);

// read the output
String line;
while ((line = bufferedreader.readLine()) != null) {

// check for failure
try {
if (proc.waitFor() != 0) {
System.err.println("exit value = " +
catch (InterruptedException e) {
} catch (Exception e) {
return output;

Categories: Code Tags:

Change the Appearance of a Gallery Website Photo Album

January 4th, 2005 Tony No comments

If you want to change the appearance of a Gallery website photo album, navigate to the directory gallery/html_wrap (assuming gallery/ is the root folder of your Gallery installation). This folder contains header and footer files for all pages in Gallery.

Once you’ve found this folder its pretty easy to guess which files control the header and footer of particular pages. For instance:

gallery.header.default = HTML header for the main index page
album.header.default = HTML header for all albums
photo.footer.default = HTML footer for individual photo pages

For safety I create a backup of the file before changing it:

cp gallery.header.default gallery.header.default.BAK

Categories: Code Tags: