Posts Tagged Linux

My Twitter Client Search – Ended

Okay, so as you may already know I’m a big fan of any software solution that does what I need in a portable and platform agnostic way, particularly if it does it “in the cloud“.

What you may not know, is that I’m addicted to Twitter and I’ve been going through desktop based Twitter clients faster than my Cadillac beer bongs fuel!  My affair with desktop clients started with TweetDeck, since it’s used by a lot of my friends on Twitter and it seemed to be a front runner.  The problem is that it’s in beta, and it’s a bit buggy still.  Worse yet, it doesn’t run on my linux box.  In fact, no decent Twitter client does work on my linux box.  I’ve also tried Twhirl, and DestroyTwitter.  Both of which lack all the features TweetDeck has, and none of which work “quite right” on my linux box.

And, as if to add insult to injury the company I work for has recently been acquired by a MUCH bigger company which is imposing a lot of new restrictions to the use of our desktop computers.  Meaning I’ll likely not be able to install a Twitter desktop app on my computer in about a month.

Enter TwitterGadget, pictured above.  It’s an iGoogle gadget so it runs in my browser, on windows or linux, without installing!  And it’s quite featureful too! It has built in URL shortening which is one of the features I miss most from other desktop apps.  The one feature I hope to be included soon is TweetShrink integration, but I’ll live without it.

Hopefully I won’t have to change Twitter clients for a while now!  :-)

, , , ,

2 Comments

Me and my iPhone

Well, I’m not exactly what you’d call an early adopter, and I’ve only recently rediscovered a place in my heart for Apple based computing devices.

That said, there was a lot of internal debate an struggle when it came time for me to upgrade from my Cingular 8525 HTC/Phone/PDA device. Initially, I was convinced that I wanted the newest HTC the Fuze, since it was a logical upgrade from what I had. But there was just soooo much hype about the iPhone, I had to give it a fair shake. Fortunately, my sister and brother-in-law each got one a few weeks before my wife and I were due to upgrade. I got a real good chance to check them out. After seeing the HUGE amount of apps, and overall support that existed for them, the choice was easy. Sign me up, I’m a lemming..

I’ve had my iPhone for two and a half weeks, and I’ve made a lot of changes, tweaked a lot of configuration, and jailbroke the device. The rest of this post will serve to document that for my own sake should I ever have to recover the device, but also to hopefully shed some light on why you might jailbreak your phone, and what apps a techie like me finds useful.

Read more after the break… Read the rest of this entry »

, ,

No Comments

Uploading to Flickr from Picasa on Linux

When I performed my search for the perfect photo sharing solution, I fell in love with the Picasa desktop application. I even discovered that there is a linux version. However, as you’d likely expect, it didn’t really play nice as far as uploading photos to any photo sharing site other than Google’s Picasa Web Albums.

On windows, there is a great solution called picasa2flickr which passes the desired photo’s to the windows Flickr Uploader. Again, for obvious reasons, this doesn’t work well on linux.

So, having determined that it wasn’t worth my time to pursue trying to get Flickr uploads working from Picasa on Linux, I started evaluating many of the other native options on linux, such as digikam and fspot. While these more easily uploaded to Flickr, and had open API’s, none of them worked quite the way I wanted, so I abandoned my search for a good solution.

Then, on a whim I did a Google search just a couple hours after Andy O’Neill made a blog post about a button he wrote to import photos to Flickr from the Linux version of Picasa, named picflick.

I eagerly (re)installed Picasa3 on my Gentoo box using a beta ebuild found here. Then installed his button.

After playing with it for a bit, I realized a few things didn’t quite jive for me.

1) The script automatically resizes the image before uploading it to Flickr. I prefer to upload all of my images at their original resolution, so this was a bit of a road block for me.

2) The script used a Perl module to upload to Flickr. For the life of me, I couldn’t seem to figure out how to get it authorized with my Flickr account to actually permit uploads. I’m sure if I spent a bit more time and read a few more manuals I could have gotten it right, but it didn’t quite work “out-of-the-box” for me.

3) I’d prefer to see the progress being made, rather than the beeps and tray notifications that Andy’s script provided.

So, I stole the key part of his script, the part which translates Windows paths to *nix ones, and broke down the rest to simply pass the photos on to my preferred linux Flickr uploader, KFlickr

Here’s the contents of my script, including the win2native function written by Andy.

#!/bin/bash

DEBUG=1     # debug to $LOG
LOG=/tmp/picflick.log
PICASA_WINE_DIR="$HOME/.google\/picasa\/3.0\/drive_c"  # Relative to $HOME
PICASA_WINE_DIR_NATIVE=`echo $PICASA_WINE_DIR |sed 's|\\\\||g'`

function debug() {
        if [ $DEBUG -eq 1 ]; then
                echo "$*" >> $LOG
        fi
}

# wine2native(): convert wine filename to native linux filenames
# Arguments: _name_ of variable which holds path
# Example: wine2native file  # not wine2native $file
function wine2native() {
        VAR=$1
        eval "VAL=\$$1"
        debug "Wine path: $VAL"
        # use '|' to delimit the paths
        VAL=`echo "$VAL" | \
                sed "s|C:|$PICASA_WINE_DIR|" | \
                sed 's|\\\\|/|g'`
        debug "Source file: $VAL"
        eval "$VAR=\$VAL"
}

# check we have the required dependencies
which kflickr > /dev/null || die "You need to install kflickr"

file=$1
wine2native file
DIR=`dirname "$file"`
EXT=${file##*.}
debug "START_UPLOAD"
for file in "$@"; do
        wine2native file
        KFLICKR="$KFLICKR $file"
done

debug "Launching kflickr with the following args $KFLICKR"
kflickr $KFLICKR

debug "Done"

Now when I click the “Flickr” button in Picasa, it brings up the KFlickr app with all the pictures I selected ready to upload. Thanks for the inspiration, and code bits to make this work Andy, I was too lazy to actually figure out what was necessary to pull the image paths from Picasa and use them.

, , , , , ,

6 Comments

My First 64bit PC

Time for the second installment of my worklog for my PC Upgrade.

Well, I actually received all the bits from UPS Monday (is it Thursday already? sheesh). I actually assembled the thing Monday afternoon/evening, and have been slowly installing software and getting it up to speed.

For the curious, and so I can brag a bit heres the parts list.

Now, this isn’t quite bleeding edge stuff but it certainly brings me up to date and I’m quite happy. Because I wanted just a ROCK SOLID setup and wasn’t intending to overclock, I went with an Intel motherboard. I didn’t want to regret not getting enough memory, so I maxxed it out with 8GB. I don’t really game so the video card is nothing special, but I did want enough horsepower to drive my big monitor and take advantage of Vista’s Aero theme and some of the cool linux eye candy that’s in KDE4 etc. I am NOT disappointed!

So far I’ve gotten Gentoo linux installed on the system. The speed of compiling is admirable though not mind blowing. One of the first things I installed though was Cinelerra and I loaded up some of my HDV source material. While I should have expected as much I was able to play, edit, and render the HD in realtime! WOO HOO!

I’m quite impressed with Gentoo, no hardware headaches, everything more-or-less worked out of the box. I haven’t quite got all my favorite apps installed and running but I trust it will be uneventful.

I’m in the process of moving my drives/data over from my old system. I had a software RAID1 setup using mdadm which I’ve been able to bring back up on the new box. Going to play with a RAID5 since I now have enough disks, and maybe simulate a failure to test recovery. This should get my confidence up for building a linux software based RAID5 NAS box which is the next project.

, , , , , ,

No Comments

Tools for updating an online image gallery

Not long ago I shared my bash script for creating thumbnails and manageable sized “big” images for an image gallery, or other image store. Well, today I had to update an existing gallery with a pretty significant number of new images. It occurred to me that I’d like to only convert new images rather than re-converting the whole lot. Then, I’d like to simply upload the new files to my server in some automated way.

So here’s the tools to do it. It assumes you have the same layout for your pictures on your local drive as I do, which is as follows.

  • RootDirectoryForGallery — This contains the full resolution pictures directly from your camera, and the following directories.
    • web — This is a sub directory of RootDirectoryForGallery which contains the “big” web version of your image, and the thumbnails directory described below.
      • thumbnails — This is a sub directory of web, and contains the thumbnail sized versions of the images.

The first step, is to copy your new pictures from the digital camera to your RootDirectoryForGallery. Then, we want to get a list of the files that are new, so we run the following from the RootDirectoryForGallery.

diff . web/ | grep 'Only in \.: d' | awk '{print $4}' | grep jpg >> 3-6-08_update.diff

This creates a file in the RootDirectoryForGallery named “3-6-08_update.diff” which contains a list of only the new pictures, one per line. Now, we want to use our image thumbnail script to convert only the new images to the “big” and thumbnail sized images. I discovered that I needed to make a change to my script in order to do this. Namely in the for loop I needed to enclose the command used to list files in “$()”. The modified script is shown below. Notice the “$($SEARCH)” where there was previously just “$SEARCH”.

#!/bin/bash

SEARCH=$1
SIZE=$2
DEST=$3

if [ $# -lt 3 ]
then
echo "You must pass three arguments 1) The search string (usually *.jpg) 2) The destination size I.E. 500x374 3) The destination directory"
exit 1
fi

for i in $($SEARCH)
do
        echo "Converting $i"
        convert -resize $SIZE $i -resize $SIZE +profile '*' $DEST$i
done

So with our edited script we convert the files.

/opt/imagethumbnail.sh "cat 3-6-08_update.diff" "800x600" "web/"
/opt/imagethumbnail.sh "cat 3-6-08_update.diff" "150×112 "web/_thb_"

Lastly, we want to upload just the changed files to our server. We’ll use rsync for this. The paths, server name, and user name have been changed to protect the innocent. ;-)

rsync -e ssh -av /path/to/local/copy/ yourusername@yourserver.com:/path/to/www/server/copy/

And there you have it, with just a few simple commands you’ve created thumbnails of all of your images, and uploaded just the new ones to your server. Easy!

, , ,

1 Comment

Image thumbnail generating script

I have often wished that I could easily convert several images to a smaller size simultaneously. This is useful for batch resizing images for thumbnails, galleries, or use on the web.

On a linux system with imageMagick installed, you can use the script at the end of this post to batch convert the images.

I use it to create thumbnails and scaled images for my online photo gallery using the following commands.
./imagethumbnail.sh “*.jpg” “800×600″ “web/”

./imagethumbnail.sh “*.jpg” “150×112″ “web/_thb_”

This creates a reasonable sized “large” image at 800×600 and a thumbnail at 150×112. Makes managing new images in my gallery much easier. Hopefully you’ll find it useful too.

Contents of imagethumbnail.sh

#!/bin/bash
SEARCH=$1
SIZE=$2
DEST=$3

if [ $# -lt 3 ]
then
echo "You must pass three arguments 1) The search string (usually *.jpg) 2) The destination size I.E. 500x374 3) The destination directory"
exit 1
fi

for i in $SEARCH
do
echo "Converting $i"
convert -resize $SIZE $i -resize $SIZE +profile '*' $DEST$i
done

, , , , ,

1 Comment