Posted by: adamkasza | June 9, 2009

William

My girlfriend’s family has a new dog. It is lovely. After long hesitation we decided to give it the majestic name ‘William’ (Vilmos in Hungarian). William is 6 weeks old by the time of writing and spends most of his time with sleeping and eating the flowers in the garden.

I don’t think I should waste more words on this, the photos below speak for themselves…

William - discovering the garden

William - discovering the garden

William - sitting like a prince

William - sitting like a prince

William

William

William

William

Posted by: adamkasza | April 10, 2009

Determining the parent directory from Bash

There must be a lot more straightforward way of doing this, but I failed to find it. Therefore I (re)invented a method of determining the parent directory from Bash:

#!/bin/sh
if [ x"$1" != x"" ]
then
  readlink -f $1 | tr '/' ' ' | gawk '
  {
     for (v=1;v < NF;v++)
       printf("/%s",$v)

     printf("\n")
  }'
fi

As I mentioned there must be an easier way… Anyway, I have this script a file called ‘parentname’.

Posted by: adamkasza | November 9, 2008

Intrepid Ibex + Skype sound

After updating to Intrepid Ibex Skype became ‘mute and deaf’.

We have the following setup: Skype 2.0.0.72., Logitech QuickCam Deluxe (microphone included). Under Skype’s ‘Sound options’ I have a lot of chioces for both input and output devices but neither of them worked.

The solution was to install PulseAudio and to create the /etc/asound.conf with the following content:

sudo apt-get install libasound2-plugins "pulseaudio-*" \
paman padevchooser paprefs pavucontrol pavumeter

/etc/asound.conf:

pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}
pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}

Under Skype’s ‘Sound devices’ I set everything to ‘pulse’ except  ‘Sound In’ which is set to the microphone of my Logitech Webcam:

Skype -> Options -> Sound devices

Skype -> Options -> Sound devices

Posted by: adamkasza | October 18, 2008

Resizing our photos

My girlfriend would  like to convert a number a photos (from my 6MP Canon camera) into a smaller size to send to some of her friends. I would like to apply some transformations to images (e.g. rotating, drawing a frame around it, etc.) automatically. It’s nice that usually we have the same thing in our minds, isn’t it? :-) Both ideas pointed to a command line tool that can accomplish this easily on plenty of images at once.

Well, I’m not really good at computer graphics and I don’t really know the tools available for this. To be honest I was not very keen on studying computer graphics in the university. So I had to look for a solution…

First I started with the one I found in the Applications menu of my Ubuntu: GIMP. I knew that it offers scripting capabilities (Script-Fu) and is extensible with plug-ins. When I searched for GIMP documentation somehow I found ImageMagick + jhead and fall in love. ;-)

So here’s what we can do.

Ensure that ImageMagick and jhead is installed:

$> apt-get install imagemagick
$>apt-get install jhead

Using jhead First rotate all the images based on their Orientation field in EXIF and add a comment to them with one command:

$> jhead -cl 'Rethymno | Santorini, Greece, 3-5 Sep 2008' -autorot ./*

Then resize the image using the Lanczos filter:

$> convert img_1623.jpg -filter Lanczos -resize 800 img_1623s.jpg

To apply this on a series of images I wrote a small shell script:

#!/bin/bash
if [ -z $1 ]
then
   echo "Usage: $0 width"
   exit -1
fi
SIZE=$1
IMGS=`find . -name '*.jpg' -print`
for img in $IMGS
do
    new_img_name=`echo $img | sed s/\.jpg/_small\.jpg/`
    echo -n "Resizing $img to $SIZE px -> $new_img_name "
    convert $img -filter Lanczos -resize $SIZE $new_img_name
    echo Done.
done
exit 0
Posted by: adamkasza | October 17, 2008

1st

Hi all,

This is my first post to my blog. Believe me I’m really excited about this!

One thing is completely clear: I won’t be the most frequent blogger on WordPress.com. However, I will use this place to store my ideas and findings. I don’t plan to break records in the number of visitors per day, however. That will be the next version. :-D If my friends, colleagues & relatives find it useful then I’ll be happy.

I plan to write a post once in every two weeks. So… subscribe with your RSS reader, becuase my posts are coming… ;-)

P.S.: I will try to improve the appearance of my blog gradually. Unfortunately I’m not an expert GIMPer, but I’ll try to do my best.

Categories