Pokazywanie postów oznaczonych etykietą ubuntu. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą ubuntu. Pokaż wszystkie posty

sobota, 11 maja 2013

How to crop an area in multiple images

I have run into this problem today. I wanted to cut out a specific area from a hundred pictures in one directory. I use Ubuntu as my desktop OS. As it usually happens with my beloved Linux, there is a handy way of doing this.

ImageMagick set of tools lets you do magic with images. There is a CLI (command line interface) set of commands available and one of them is convert, which helps you change a picture. To crop an area, you use -crop option. There is also mogrify command  to batch process the files. And the following command did the trick:

$ mogrify -crop 300x300+950+500 *jpg

It has cut out the area of 300 pixels x 300 pixels with the upper left corner located at the point 950 pixels to the right and 500 pixels down from the original upper left corner of the picture. It has processed all the images in the directory.

niedziela, 13 stycznia 2013

Using Garmin Forerunner 410 with Ubuntu 12.10

My wife loves running, so I bought a Garmin Forerunner 410 for her to assist her with the activity and get even more fun from it. As it usually happens no support has been offered from Garmin for Linux - and I, in turn, love Linux. So I googled all the necessary info and here it goes (the instruction is valid for clean install of Ubuntu 12.10 64bit):

1. sudo apt-get install python-setuptools
2. sudo easy_install ez_setup
3. sudo easy_install python-ant-downloader
4. sudo touch /etc/udev/rules.d/99-garmin.rules
5. edit /etc/udev/rules.d/99-garmin.rules with your favourite editor
6. Add this line to the file:

SUBSYSTEM=="usb", ATTR{idVendor}=="0fcf", ATTR{idProduct}=="1008", MODE="666"

Remember to finish it with empty line!!!

Next thing was to create file ~/.antd/antd.cfg, since it has not been created automatically. I had to fill it with configuration. I used the following example conf:

https://github.com/braiden/python-ant-downloader/blob/master/antd/antd.cfg

My version of this file, without comments and slightly modified is available here. Please change all the x's and y's in the Garmin Connect section with your username and password for the site.

All I had to do next was to insert the USB dongle into a slot and run:
ant-downloader
It synchronised with the device, downloaded data and transferred it to connect.garmin.com (I have entered my wife's credentials in antd.cfg file beforehand).