Archive for the 'Xubuntu' Category



Creating a Picture Resize Script

Facing the daunting task of resizing my recent photos to put on Flickr, I decided there must be a script out there to automate the process. I recall encountering one or two in the Ubuntu Forums.

Sure enough the information was there.

#!/bin/sh
# author: Bas Wenneker
# email: sabmann [ta] gmail [tod] com
# Use this script to batch resize all images in a folder.
# First open the folder and then use the script.
for file in `ls -l`
do
name=`echo $file | cut -f1 -d.`
convert -geometry 640×480 -quality 65 $file ${name}_640×480.jpg
done

The script is very straightforward, if you know a bit of bash dash (kudos: drone) scripting. I only know very little, but I think I’ve got this one down.

It simply loops through each file in the folder and removes the extension from the filename. It then uses the convert function to convert the file into a jpg of resolution 640×480 and quality 65, while renaming the file to include ‘_640×480′ at the end.

In the same thread on the Forums, some extra alterations were made to put the resized files in a sub folder, and to remove the EXIF information from the picture (if they are photos from your camera)

 

#!/bin/sh
# author: Bas Wenneker
# email: sabmann [ta] gmail [tod] com
# Use this script to batch resize all images in a folder.
# First open the folder and then use the script.
mkdir ./thumbnails
for file in `ls -l`
do
name=`echo $file | cut -f1 -d.`
convert -strip -geometry 800×600 -quality 80 $file ./thumbnails/${name}_800×600.jpg
done

I quite liked the ability to put the resized images in a subfolder (thumbnails), but not the removal of the EXIF information (-strip).

Another thing that I wasn’t interested in was that the script was a batch resize, which attempts to convert all the files in the folder, including videos. After chunking my computer up for some time on a large .AVI file, I decided that I would want this to be a once per file thing.

After changing these things and the changing the resolution/quality to what I wanted, I came up with this version of this script

 

#!/bin/sh
mkdir ./1024×768
for file
do
name=`echo $file | cut -f1 -d.`
convert -geometry 1024×768 -quality 100 $file ./1024×768/${name}_1024×768.jpg
done

I saved the script in a location, which will matter more later, and then applied execution permissions to it.

chmod +x resize1024×768

Once this was done I could run the script with the name of the photo as an argument (I guess you could call it that)

resize1024×768 img_0001.jpg

And hey presto, the photo is resized and placed in a sub folder 1024×768.

However this was only the starting point. The script was for designed to be accessed by Nautilus and the context (right-click) menu. I don’t have or want Nautilus, so …

While I could run the script straight from a bash prompt, I’d rather use it in conjunction with the Custom Actions in Thunar.

Stay tuned for that …

Somehow I got my wireless card working

And I really stress somehow.

My head was almost flattened from the proverbial brick wall, when suddenly I was connected to my router, through my D-Link DWL G510. This wasn’t my first choice of wireless card, but I was getting desparate and sick of using a ethernet cable through the apartment. I really should have researched before buying.

Getting it working was a drama, and I’m going to have to try doing it again on some fresh installs of Ubuntu/Xubuntu, or I will never be sure how I got it working. Windows was no better, but that’s another story altogether.

First stop was the Ubuntu Community Documentation (Wiki) for info on the Wireless cards. According to the Wireless Cards Supported page, my adapter should be using the RT61 drivers.

The instructions for the RT61 drivers were pretty straightforward. I was able to compile them without any problems.

Except that the card didn’t work after that.

I also found this great page in the documentation; Wireless Trouble Shooting Guide. There is a wealth of information and commands that can be used to determine the status f your card.

I could see the ra0 interface when I used the command iwconfig, yet it wasn’t getting an IP address. I tried turning of the Router WPA key, installing WiFi Radar,
GTK-WiFi, which look like great tools to have. But all no avail …

… until suddenly it just worked. Which is great, but I really want to know what I have to do to make it work next time, without going through hours of installing/uninstalling, re-configurating, etc.

I blog about Xubuntu

I was sifting through my feeds last night, when I read a post on the Ubuntu Blog. ubuntonista has asked people that blog about Ubuntu to write a post and pingback his original one.

I happen to I think this is a great idea; I’m always interested to read what other people think of Ubuntu, and what they try to do with it. This is such a simple way to compile a list of people who do this.

Check out the comments for some good Ubuntu blogs!

I’m looking forward to seeing a link page too.

Latest ramblings

Not much new on the Xubuntu front I am afraid to say at the moment. My life is in a bit of an upheaval, and will probably stay that way until the new year.

We had our work Christmas party last Friday, which was quite a nice night. A lot bigger this year than last year, which in turn was bigger than the year before, with 70 guests (we know have over 20 staff, compared with 12 last year, and 7 the year before). We ate and stayed at the Sebel hotel in the city, right under the bridge at Pier 1.

Spent all of the Friday morning assembling our exhaust fan prototype to display on the evening. It was a mad rush, and some bits were assembled quite haphazardly. It was annoying that in the end the display was hardly even noticed or used. I could have spent those hours writing some more VB.NET code.

Still we had an awesome seafood buffet and plenty of booze available. I even ‘borrowed’ one of the GPS units, that our service electricians use. Kat and I had plenty of fun using ‘Jason’ to direct us all over the city.

The rest of the weekend was spent assembling furniture for my new room. It’s starting to really look like an IKEA showroom now. I got a bed frame, work desk, wardrobe and chest of drawers. My hands are quite blistered from all the assembling. I should have ‘borrowed’ a power drill set from work too.

I’m planning to be moved out of the house by the weekend, all I really need to do is sort out my clothes and general crap, then finally move my computer … All I really need to do, is putting it quite blithely, it’s gonna be quite some task.

Hopefully all will go well. And I definitely have a Xubuntu project on the horizon; getting my wireless ethernet card to work.

How to run Xubuntu Edgy, AIGLX and Beryl with NVIDIA drivers

This is a cumulation and culmination of several posts now.

Beryl - Welcome to the Future

 

I recently was successful installing the latest NVIDIA drivers (v1.0.9269), which support AIGLX.
The next thing that must be done is an edit of the X.org configuration file to enable AIGLX. I have already done this once before.

One final adjustment is necessary for using AIGLX with the NVIDIA drivers. The following line needs to be added to the X.org configuration file in the “Screen” section.

Option “AddARGBGLXVisuals” “true”

Once that change has been made, you should be able to start an ordinary session (now using AIGLX) and then start Beryl. If you need to install Beryl as well, you can see how I did it a while ago.

You may need to stop the XFCE window manager (xfwm4) first, using these commands.

killall xfwm4
beryl-manager &

Enjoy!


« Previous PageNext Page »


My Photos

James getting dragged up the hill

Another insane run

img_0104

Insane run

More Photos

How many times has this site been visited?

  • 139,465 apparently

Site Stats