Cutting Image Background with ImageMagick

Here is a small sequence of commands to cut the image of background (given that background is a solid color):

ORIG_IMAGE_NAME=green.jpg;
NEW_IMAGE_NAME=green-trans.png;
TMP_COLOR=`convert $ORIG_IMAGE_NAME -crop 1x1+0+0 txt:- | sed -n 's/.*\(#\S\+\).*/\1/p'`;
convert $ORIG_IMAGE_NAME -bordercolor $TMP_COLOR -border 1x1 -alpha set -channel RGBA -fuzz 30% -fill none -floodfill +0+0 $TMP_COLOR -shave 1x1 $NEW_IMAGE_NAME

Just change the first to vars. You can also adjust the fuzz percentage if needed.

DNS wildcard observations

Had an interesting case with DNS wildcard records: if you have a wildcard (*) A record – it works pretty fine, but if you specify a CNAME record to point to non-existing A record (which would normally be satisfied by wildcard A record) it won’t work, at least in the case I had. So as an example if you have:

Zone file for domain1
* IN A 111.111.111.111

Zone file for domain2:
host1 IN CNAME host1.domain1.

Then any query for host1.domain1 will resolve with no problems, but when you will try to resolve the host1.domain2 – it will fail. For this case you need to explicitly specify the host1.domain1. as follows:

Zone file for domain1
host1 IN A 111.111.111.111
* IN A 111.111.111.111

Interesting case, just to remember for the next time…

GNOME3 Delete button in Nautilus

Just noticed that Delete button in Nautilus of GNOME3 does not delete a file. Either Shift+Delete should be used to delete file completely or Ctrl+Delete for normal removal to Trash.

If you use Nautilus a lot and would like to get normal (old-style) behaviour, check out these post: http://www.khattam.info/howto-enable-delete-key-in-nautilus-3-fedora-15-2011-06-01.html

Basically you need to enable accels key editing in Gnome with gsettings (or gconf-editor), then reassign a button you wish and then disable change of accels key back (unless you want to have it permanently on, which I don’t advice, otherwise you might mess a bit by accident),

 

 

 

 

 

September, vacations…

It’s been a long while since I’ve been on such good vacations. More than one week away from office traveling around Cyprus and having all sorts of fun. Just a short post with list of things done during these nice days:

15/09/2011:

  • Trip to Agia Napa to see Olga and Anatoly who came to visit us from Finland. Saw Cape Greko and sea caves (photos here)
  • Short stop at MacKenzie Beach in Larnaca to see landing airplanes (photos)
  • Some nice food at Lesheotiki Kebab place in Limassol. Guys offer buffet for EURO 7.90 only with unlimited food. Nice…
  • Trip to Germasogia Dam. Apparently it is almost empty (photos)
  • Wine festival. Promised to show it to the guys
  • Home. Wine. Guitar. Some nice mint liquor

16/09/2011:

  • Car broke in the morning. Took it to garage
  • Bus trip to Park Beach
  • Few beers to recover after hangover at a beach cafe (photos)
  • Borrowed Toyota IQ from a friend of mine to continue with nice vacations
  • Trip to Aphrodite Hills via old Paphos road and short stop at the top of the Kurium beach (photos)
  • Kebabs at my favorite place next to pentadromos.
  • Few beers and nice sea at the Kurium beach in the evening

17/09/2011:

  • Kurium archaeological stuff for the guys under hot Sun (photos)
  • Trip to mountains passing Platres, trout farm, Troodos, Olympus and way back (photos)
  • Short stop at the top of Monte Caputo parking for a nice view of Limassol at night

18/09/2011:

  • Trip to Agia Napa to bring guys back to their hotel and let them enjoy some more Sun and sea during their last day in Cyprus, while we were having some beers and kupa in the beach cafe (photos)

19/09/2011 – 20/09/2011:

  • Took car back from the garage, successfully fixed
  • Recovering and relaxing at home after that many events and trips with guys. Uploading photos, watching movies, sleeping…

21/09/2011:

  • Trip to Omodos village in the mountains (photos)
  • Trip to Foini village. Wanted to enjoy some nice stake but Augustos (owner of the tavern) was not there, so we just spent some time there taking pictures and left back to Limassol (photos)
  • Pork chops and Guiness in Moly Malones
  • Few billiard games with Sergey at Century Billiard Club
  • Few pitchers of Krombaher at Ship Inn

22/09/2011:

  • Relaxing at home with movies
  • Shopping
  • Few beers and guitar with Den at home

23/09/2011:

  • Trip to Kakopetria. Very nice village with tons of view for our camera (photos)
  • Short stop uphill from Limassol to enjoy nice view on a city (photos)

24/09/2011:

  • Trip to Akamas ending at the nice tavern in Latsi. Promised this trip to Yana for ages and finally did it. Like it a lot myself (photos)

25/09/2011:

  • Morning trip to Agia Napa with mam to let her enjoy the sea and the Sun. Ended with t-storm.
  • Nice food and movies on a sofa at home to finalize the vacations

There are also few random pics while Olga and Anatoly were in Limassol which I didn’t manage to put in different sets, so I created a separate one for them here.

I might miss some events in the above just because there were too many and I might forget something.

Finally, just wanted to mention that one week prior to vacations I had another guests coming to Agia Napa whom I managed to visit: Alexandra Negina and her sister. By some strange chance I had two of my classmates (Olga and Alexandra) visited me in one month, though I haven’t seen any of my classmates for years.