<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6458362026107583183</id><updated>2010-09-09T04:53:37.422+03:00</updated><title type='text'>Tech blog of Anton Keks</title><subtitle type='html'>For those loving freedom: Linux and Gnome related stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.azib.net/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default'/><link rel='alternate' type='text/html' href='http://blog.azib.net/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-4624204538889018516</id><published>2009-12-17T00:04:00.005+02:00</published><updated>2009-12-17T00:43:06.831+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='F-Spot'/><category scheme='http://www.blogger.com/atom/ns#' term='photos'/><category scheme='http://www.blogger.com/atom/ns#' term='freedesktop'/><category scheme='http://www.blogger.com/atom/ns#' term='thumbnails'/><title type='text'>Deleting thumbnails for inexisting photos</title><content type='html'>&lt;a href="http://freedesktop.org/"&gt;Freedesktop&lt;/a&gt; for some years already has a &lt;a href="http://jens.triq.net/thumbnail-spec/"&gt;spec on how applications should manage image thumbnails&lt;/a&gt; (use Next link there).  The spec is now followed by majority of Gnome and KDE applications, including F-Spot, which is one of the very few applications that uses large 256x256 thumbnails under &lt;span style="font-family:courier new;"&gt;~/.thumbails/large&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The spec specifies to store thumbnails in PNG format, naming the files after the MD5 sum of the original URLs of the original files, eg 81347ce6c37f75513c5e517e5b1895b8.png.&lt;br /&gt;&lt;br /&gt;The problem with the spec is that if you delete or move image files, thumbnails stay there and take space (for my 20000+ photos I have 1.4Gb of large thumbails).&lt;br /&gt;&lt;br /&gt;Fortunately, you can from time to time clean them by using simple command-line tricks, as the original URLs are stored inside of thumbnail files as &lt;span style="font-weight: bold;"&gt;Thumb:URI&lt;/span&gt; attributes. I don't recommend erasing all of your thumbnails, because regeneration will take time.&lt;br /&gt;&lt;br /&gt;In order to create a list of matching &lt;span style="font-style: italic;"&gt;thumbnail-original URL&lt;/span&gt; pairs, you can run the following in a terminal inside of either &lt;span style="font-weight: bold;"&gt;.thumbnails/large&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;.thumbnails/normal&lt;/span&gt; directories (it will take some time):&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote style="font-family: courier new;"&gt;for i in `ls *.png`; do&lt;br /&gt; identify -verbose "$i" | \&lt;br /&gt;   fgrep Thumb::URI | sed "s@.*Thumb::URI:@$i@" &gt;&gt; uris.txt;&lt;br /&gt;done&lt;/blockquote&gt;This will get you a uris.txt file, where each line looks like the following:&lt;br /&gt;&lt;blockquote&gt;f78c63184b17981fddce24741c7ebd06.png &lt;span style="font-style: italic;"&gt;file:///home/user/Photos/2009/IMG_5887.CR2&lt;/span&gt;&lt;/blockquote&gt;Note that the provided thumbnail filenames (first tokens) can also be generated the following way from the URLs (second tokens) using MD5 hashes:&lt;br /&gt;&lt;blockquote&gt;echo -n &lt;span style="font-style: italic;"&gt;file:///home/user/Photos/2009/IMG_5887.CR2&lt;/span&gt; | md5sum&lt;/blockquote&gt;After you have your &lt;span style="font-style: italic;"&gt;uris.txt&lt;/span&gt; file, it can be easily processed with any familiar command-line tools, like &lt;span style="font-weight: bold;"&gt;grep&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;sed&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;awk&lt;/span&gt;, etc.&lt;br /&gt;&lt;br /&gt;For example, in order to delete all thumbnails matching '&lt;span style="font-weight: bold;"&gt;Africa&lt;/span&gt;', use the following:&lt;br /&gt;&lt;blockquote&gt;for i in `cat uris.txt | fgrep &lt;span style="font-weight: bold;"&gt;Africa&lt;/span&gt;`; do rm $i &gt;/dev/null; done&lt;/blockquote&gt;So, as you can see, it is pretty simple to free a few hundred megabytes (depending on the number of thumbnails you are deleting).&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;With this kind of trick you can even rename the thumbnails of moved files if you use md5sum to generate the new filenames from the URLs, as shown above. This will save you regeneration time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-4624204538889018516?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/4624204538889018516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=4624204538889018516' title='103 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/4624204538889018516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/4624204538889018516'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/12/deleting-thumbnails-for-inexisting.html' title='Deleting thumbnails for inexisting photos'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>103</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-7223418500793401409</id><published>2009-08-26T22:55:00.007+03:00</published><updated>2009-08-27T18:19:02.976+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='F-Spot'/><category scheme='http://www.blogger.com/atom/ns#' term='photos'/><title type='text'>Announcing F-Spot Live Web Gallery extension</title><content type='html'>I am happy to announce a new extension for &lt;a href="http://f-spot.org/"&gt;F-Spot&lt;/a&gt;, the popular Linux photo management application - &lt;span style="font-weight: bold;"&gt;LiveWebGallery&lt;/span&gt;. Once installed, invoke it from the Tools menu in F-Spot's main window.&lt;br /&gt;&lt;div class="proposal"&gt;&lt;p&gt;The extension contains a minimal web server implementation that serves the user's gallery over HTTP and can be viewed with any web browser, even on Mac and Windows. So now you are able to easily share your photos with family, friends, colleagues no matter what operating system and software they use by doing just a few mouse clicks in F-Spot. The only requirement is that they have to be on the same network, or be able to access your machine's IP address  in some other way.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tgooL6eQrXk/SpWZ7JVWjxI/AAAAAAAAKSE/cw9RwdKUsmI/s1600-h/LiveWebGalleryUI.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 290px;" src="http://2.bp.blogspot.com/_tgooL6eQrXk/SpWZ7JVWjxI/AAAAAAAAKSE/cw9RwdKUsmI/s400/LiveWebGalleryUI.png" alt="" id="BLOGGER_PHOTO_ID_5374370971733364498" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As you can see in the screenshot, you can choose whether to share photos with a particular tag, current view in F-Spot (allows you to create an arbitrary query) or the currently selected photos. &lt;/p&gt;&lt;p&gt;To activate the gallery (start the embedded lightweight web server), just click activate button in the top-right corner. On activation, the URL of the web gallery will appear, allowing you either to open it yourself or copy the link and provide to other viewers.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_tgooL6eQrXk/SpWfvEoGmzI/AAAAAAAAKSM/VXDJHnqEp-A/s1600-h/LiveWebGalleryFirefox.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 354px;" src="http://2.bp.blogspot.com/_tgooL6eQrXk/SpWfvEoGmzI/AAAAAAAAKSM/VXDJHnqEp-A/s400/LiveWebGalleryFirefox.png" alt="" id="BLOGGER_PHOTO_ID_5374377361381169970" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;After that all the options can still be changed in the dialog and will affect all new viewers or those pressing the browser's reload button.&lt;/p&gt;&lt;p&gt;Most of us already know that many pictures are rarely viewed after they are made (&lt;a href="http://www.wired.com/wired/archive/12.10/photo.html"&gt;Point, Shoot, Kiss It Goodbye&lt;/a&gt;). F-Spot tries to fix this with its very powerful tagging features - tags make it much easier to find photos made long ago. This, however, is no magic - the possibilities of finding the right photos when needed depends on how well you tag. Now, this extension allows to make tagging even more useful, because other people can help you with the most difficult part - properly tagging can sometimes be a lot of work. With this extension, you can delegate some it to other people! The gallery is not read-only - if you choose so, an editable tag can be selected and viewers can add/remove this tag from photos (currently only in the full photo view). This is especially useful to let other people to tag themselves in your library. For security reasons, editing is disabled by default.&lt;/p&gt;&lt;p&gt;As time goes by, a lot more features can be added to Live Web Gallery extension, especially related to editing photo metadata (tagging, editing descriptions, flagging for deletion).&lt;/p&gt;  &lt;p&gt;As far as I know, being able to share your photos on the local network without any software or OS requirements is a unique feature of F-Spot now. No other photo management application can do this to date.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Downloading&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The source code is on Gitorious, &lt;a href="http://gitorious.org/%7Eangryziber/f-spot/antons-clone/commits/live_web_gallery/"&gt;live_web_gallery&lt;/a&gt; branch (until is has been merged to the mainline).&lt;/p&gt;&lt;p&gt;To install, use the &lt;span style="font-style: italic;"&gt;Edit-&gt;Manage Extensions&lt;/span&gt; menu in the F-Spot, click on &lt;span style="font-style: italic;"&gt;Install Add-ins&lt;/span&gt; and then &lt;span style="font-style: italic;"&gt;Refresh&lt;/span&gt;. After that LiveWebGallery should be available under the Tools category.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Or, alternatively, you can &lt;a href="http://srv2.azib.net/%7Eanton/LiveWebGallery.dll"&gt;download the precompiled binary&lt;/a&gt; and put it to:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;~/.config/f-spot/addins &lt;/span&gt;or&lt;span style="font-family:courier new;"&gt; /usr/lib/f-spot/extensions&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Note: &lt;span style="font-weight: bold;"&gt;F-Spot 0.6&lt;/span&gt; is required for it to work. You can already find deb/rpm packages for F-Spot 0.6 or 0.6.1 for most distributions and it will be included in the upcoming distro releases this autumn.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hopefully, the extension will later be distributed with newer versions of F-Spot by default.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Enjoy! Comments are welcome!&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-7223418500793401409?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/7223418500793401409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=7223418500793401409' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/7223418500793401409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/7223418500793401409'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/08/announcing-f-spot-live-web-gallery.html' title='Announcing F-Spot Live Web Gallery extension'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tgooL6eQrXk/SpWZ7JVWjxI/AAAAAAAAKSE/cw9RwdKUsmI/s72-c/LiveWebGalleryUI.png' height='72' width='72'/><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-4585037151285412239</id><published>2009-06-01T22:51:00.008+03:00</published><updated>2009-06-01T23:42:53.174+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Databases'/><category scheme='http://www.blogger.com/atom/ns#' term='Dinosaurs'/><category scheme='http://www.blogger.com/atom/ns#' term='Agile'/><title type='text'>Database Refactoring</title><content type='html'>A couple of months ago I have made a short keynote titled &lt;span style="font-weight: bold;"&gt;Dinosaur Strategies: How Can Data Professionals Still Prosper in Modern Organisations&lt;/span&gt;, inspired by &lt;a href="http://www.ambysoft.com/scottAmbler.html"&gt;Scott Ambler&lt;/a&gt;'s joke on the fictional &lt;a href="http://www.waterfall2006.com/"&gt;Waterfall 2006 conference website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://java.azib.net/2009/dinosaur_strategies.pdf"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 299px;" src="http://3.bp.blogspot.com/_tgooL6eQrXk/SiQ3RDNIkuI/AAAAAAAAEkA/pasvEkpulRY/s400/dinosaur_strategies.png" alt="Dinosaur Strategies" id="BLOGGER_PHOTO_ID_5342455824025948898" border="0" /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://java.azib.net/2009/dinosaur_strategies.pdf"&gt;(see the slides)&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I primarily deal with 'application' aspects of software development using Agile practices, so I have a hard time understanding how some Data Professionals can be so behind in their evolution, and not doing some basic things like iterative development, unit tests, continuous integration, etc.&lt;br /&gt;&lt;br /&gt;Last week I was asked to give a talk on &lt;span style="font-weight: bold;"&gt;Database Refactoring&lt;/span&gt;. The topic seemed challenging enough and as no Database Professionals cared to lead the topic, I decided to give it a try. The result is a motivational speech for both database developers as well as others in the software development process.&lt;br /&gt;&lt;br /&gt;I have discussed the cultural conflict of database and OOP developers, the problem of refactoring tools available to relational database developers lagging behind, and some solutions to these problems that can help before these tools become available:&lt;br /&gt;&lt;br /&gt;(1) Development Sandboxes&lt;br /&gt;(2) Regression Testing&lt;br /&gt;(3) Automatic Changelog, Delta scripts&lt;br /&gt;(4) Proper Versioning&lt;br /&gt;(5) Continuous integration&lt;br /&gt;(6) Teamwork &amp;amp; Cultural Changes&lt;br /&gt;&lt;br /&gt;Other discussed topics include Refactoring of Stored Code vs Database Schema, Agile Reality, Overspecialization (016n), Database not being under control, Database Smells, Fear of Change, Scenarios, Dealing with Coupling, Dealing with unknown applications, Proper versioning, Continuous Integration using sandboxes, and Delta Scripts (Migrations), which make evolutionary database schema possible.&lt;br /&gt;&lt;br /&gt;The dinosaurs below are the reminder of my previous keynote available above. They come from the very nice &lt;a href="http://www.youtube.com/watch?v=W0FOZ0-VpcU"&gt;Dinosaurs Song&lt;/a&gt;, available on YouTube, which I have actually played after the keynote itself.&lt;br /&gt;&lt;br /&gt;Below are full slides of the Database Refactoring talk.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://java.azib.net/2009/db_refactoring.pdf"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 301px;" src="http://4.bp.blogspot.com/_tgooL6eQrXk/SiQ2PP4JTpI/AAAAAAAAEj4/AEA15A3REfU/s400/db_refactoring.png" alt="" id="BLOGGER_PHOTO_ID_5342454693556211346" border="0" /&gt;&lt;/a&gt;&lt;a href="http://java.azib.net/2009/db_refactoring.pdf"&gt;(click for PDF slides)&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-4585037151285412239?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/4585037151285412239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=4585037151285412239' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/4585037151285412239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/4585037151285412239'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/06/database-refactoring.html' title='Database Refactoring'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tgooL6eQrXk/SiQ3RDNIkuI/AAAAAAAAEkA/pasvEkpulRY/s72-c/dinosaur_strategies.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-1567064209437802715</id><published>2009-05-17T17:02:00.006+03:00</published><updated>2009-05-17T18:21:16.242+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='CVS'/><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><title type='text'>Versioning your home directory or documents with Git</title><content type='html'>&lt;a style="font-weight: bold;" href="http://git-scm.com/"&gt;Git&lt;/a&gt; is a relatively new Version Control System, initially &lt;a href="http://www.youtube.com/watch?v=4XpnKHJAok8"&gt;started by Linus Torvalds&lt;/a&gt; in order to manage the source code of Linux Kernel.&lt;br /&gt;&lt;br /&gt;Although &lt;a href="http://www.youtube.com/watch?v=8dhZ9BXQgc4"&gt;Randal Schwartz has stated&lt;/a&gt; that Git was not designed to version your home directory, it seems that many people are now trying to do so :-)&lt;br /&gt;&lt;br /&gt;Some people have used &lt;span style="font-weight: bold;"&gt;CVS&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;Subversion&lt;/span&gt; for this purpose in the past, but to my mind, Git is suited better for this task for several reasons:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Git is &lt;span style="font-style: italic;"&gt;grep-friendly&lt;/span&gt; (only stores it's metadata in a single .git directory at the root of working copy)&lt;/li&gt;&lt;li&gt;It is very easy to work with a local repository (just do &lt;span style="font-style: italic;"&gt;git init&lt;/span&gt; and you're ready)&lt;/li&gt;&lt;li&gt;Git stores changes very efficiently (even binary files), so not much disk space is wasted, but don't forget to call &lt;span style="font-style: italic;"&gt;git gc&lt;/span&gt; from time to time&lt;/li&gt;&lt;li&gt;Git repository is always available on your computer, even when you are &lt;span style="font-style: italic;"&gt;offline&lt;/span&gt;, but on the other hand it is very easy to &lt;span style="font-style: italic;"&gt;push&lt;/span&gt; your changes to a remote repository as well&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;All these things are much worse with CVS, which spams all versioned directories with &lt;span style="font-style: italic;"&gt;CVS&lt;/span&gt; subdirs and stores each version of binary files fully. Subversion also requires more effort to setup, is less storage-efficient, and puts .svn subdirs everywhere.&lt;br /&gt;&lt;br /&gt;Having said that, my setup is &lt;span style="font-weight: bold;"&gt;ultra-simple&lt;/span&gt; compared to others on the net!&lt;br /&gt;&lt;br /&gt;To start versioning your home directory, just run this in the root of your home:&lt;br /&gt;&lt;blockquote&gt;git init&lt;br /&gt;&lt;/blockquote&gt;This will initialize an empty local Git repository in &lt;span style="font-weight: bold;"&gt;~/.git&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;/&lt;/span&gt; - this is the location that you can use when doing backups, but otherwise you shouldn't care about it anymore.&lt;br /&gt;&lt;br /&gt;Then you need to tell Git to track your important files:&lt;br /&gt;&lt;blockquote&gt;git add Documents&lt;br /&gt;git add bin&lt;br /&gt;git add &lt;span style="font-style: italic;"&gt;whatever else you want to version&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;whatever&gt;&lt;/whatever&gt;&lt;/span&gt;&lt;br /&gt;git commit -m "Adding initial files"&lt;br /&gt;&lt;/blockquote&gt;Then you can work normally with your tracked files and occasionally commit your changes to the repository with&lt;br /&gt;&lt;blockquote&gt;git commit -a "&lt;span style="font-style: italic;"&gt;description of changes you have done&lt;/span&gt;"&lt;br /&gt;&lt;/blockquote&gt;Note the &lt;span style="font-style: italic;"&gt;"-a"&lt;/span&gt; above, that means to commit any changes made to any previously tracked files, so you don't have to use &lt;span style="font-style: italic;"&gt;git add&lt;/span&gt; again. But don't forget to &lt;span style="font-style: italic;"&gt;git add&lt;/span&gt; any new files you create before committing.&lt;br /&gt;&lt;br /&gt;Use &lt;span style="font-style: italic;"&gt;git status&lt;/span&gt; to show what files were changed since your last commit. Unfortunately, it will also list all untracked files in your home directory, so you may need to create a &lt;span style="font-style: italic;"&gt;.gitignore&lt;/span&gt; file. You can get the initial version of this file using this command:&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;git status | awk '/#/ {sub("/$", ""); print $2}' &gt; .gitignore&lt;/blockquote&gt;then, edit it and possible replace some full names partly with '*'. Don't forget to &lt;span style="font-style: italic;"&gt;git add&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;git commit&lt;/span&gt; this file as well!&lt;br /&gt;&lt;br /&gt;That's, basically, it! You may also try some GUI tools provided by git, eg &lt;span style="font-style: italic;"&gt;gitk &lt;/span&gt;or &lt;span style="font-style: italic;"&gt;git gui&lt;/span&gt; to browse your changes and do some changes if you can't remember the commands.&lt;br /&gt;&lt;br /&gt;Moreover, I have some more ideas how to make all this more automatic that I am going to try laster:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Put &lt;span style="font-style: italic;"&gt;git commit -a&lt;/span&gt; to user's crontab in order to commit changes automatically, eg daily&lt;/li&gt;&lt;li&gt;Create a couple of nautlus scripts (located in ~/.gnome2/nautilus-scripts) to make adding, comitting and other actions available directly from Nautlilus file manager in Gnome.&lt;/li&gt;&lt;/ul&gt;Happy versioning! And read the Git tutorial with either &lt;span style="font-style: italic;"&gt;man gittutorial&lt;/span&gt; or &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html"&gt;on the official site&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-1567064209437802715?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/1567064209437802715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=1567064209437802715' title='42 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1567064209437802715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1567064209437802715'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/05/versioning-home-directory-with-git.html' title='Versioning your home directory or documents with Git'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>42</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-3714841052832918065</id><published>2009-04-26T15:00:00.004+03:00</published><updated>2009-04-26T15:50:49.917+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Excessive memory usage by Oracle driver solved</title><content type='html'>On my day job I deal with Internet banking. The &lt;a href="http://www.swedbank.ee/"&gt;Internet bank&lt;/a&gt; is a relatively large and high-load Java/Spring/Hibernate web application, which uses Oracle databases.&lt;br /&gt;&lt;br /&gt;During our recent transition from a centralized data accessor (&lt;a href="http://vjdbc.sourceforge.net/"&gt;VJDBC&lt;/a&gt;) to local JDBC connection pools to reduce data routrip times, we have started having issues with memory usage in our application servers: some requests started to allocate tens to hundreds of megabytes of memory. While Garbage Collector was successfully reclaiming all this memory afterwards (no memory leaks), it still posed a problem of high peak memory usage as well as too frequent collections, also affecting the overall performance.&lt;br /&gt;&lt;br /&gt;While profiling memory allocations with JProfiler, I have discovered that &lt;span style="font-weight: bold;"&gt;OracleStatement.prepareAccessors()&lt;/span&gt; is responsible for these monstrous allocations (up to 600 Mb at once, most in either &lt;span style="font-style: italic;"&gt;char&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;byte&lt;/span&gt; giant arrays). Google has pointed to this &lt;a href="http://blog.palantirtech.com/2007/02/23/oracles-jdbc-driver-garbage/"&gt;nice article on reducing the default prefetch size&lt;/a&gt;, describing a very similar situation, however these guys have had problems with queries returning LOBs. We haven't used any LOBs in our problematic queries and haven't modified the &lt;span style="font-weight: bold;"&gt;defaultRowPrefetch&lt;/span&gt; connection property knowingly.&lt;br /&gt;&lt;br /&gt;Further investigation led to the way we were using &lt;span style="font-weight: bold;"&gt;Hibernate&lt;/span&gt;: for some quesries that are expected to return large result sets, we were using the &lt;span style="font-weight: bold;"&gt;Query.setFetchSize()&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;Criteria.setFetchSize()&lt;/span&gt; methods with rather high values (eg 5000). This seemed reasonable, because we were also using the &lt;span style="font-style: italic;"&gt;setMaxResults()&lt;/span&gt; method with the same value to reduce the maximum length of the returned &lt;span style="font-style: italic;"&gt;ResultSet&lt;/span&gt;. However, after doing some upgrades of Java, Hibernate, and Oracle driver, this had started having these memory allocation side-effects. It seems that now Hibernate translates this &lt;span style="font-style: italic;"&gt;fetchSize&lt;/span&gt; parameter directly to OracleStatement's &lt;span style="font-style: italic;"&gt;rowPrefetch&lt;/span&gt; value, forcing it instantly allocate a &lt;span style="font-style: italic;"&gt;rowPrefetch&lt;/span&gt;&lt;span style="font-style: italic;"&gt;*expectedRowSize&lt;/span&gt; sized array even before it runs the actual query. This array can be ridicuosly large, even if the actual query returns only a few rows afterwards. Later investigation showed that also having the &lt;span style="font-weight: bold;"&gt;batch-size&lt;/span&gt; attribute in the Hibernate mapping files (hbm.xml) has exactly the same effect and also results in giant pre-allocations.&lt;br /&gt;&lt;br /&gt;As a result, we had to review all &lt;span style="font-weight: bold;"&gt;batch-size&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;setFetchSize()&lt;/span&gt; values that we were using with our Hibernate queries and mappings, in most cases reducing them significantly. This would reduce the worst-case performance of some long queries (they would require more roundtrips to the database), but would also reduce the overall amount of garbage accumulating in the heap and thus reduce the frequency of garbage collections, having a positive impact on CPU load. Shorter results would run equally fast, so it makes sense actually to rely on average statictics of the actual responses when chosing optimal &lt;span style="font-style: italic;"&gt;rowPrefetch &lt;/span&gt;values. The default value is 10, which is hardcoded in the Oracle driver.&lt;br /&gt;&lt;br /&gt;For longer queries, the abovementioned article has proposed an idea of geometrically increasing the &lt;span style="font-style: italic;"&gt;rowPrefetch &lt;/span&gt;(setting it twice as big for each subsequent fetch manually). This is a nice idea, but I wonder why Oracle driver can't do this automatically? This is how Java collections behave when they resize themselves. I haven't tried doing this with Hibernate yet, but I think it should be possible, especially if you use the &lt;span style="font-style: italic;"&gt;Query.scroll()&lt;/span&gt; instead of &lt;span style="font-style: italic;"&gt;Query.list()&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-3714841052832918065?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/3714841052832918065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=3714841052832918065' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/3714841052832918065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/3714841052832918065'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/04/excessive-memory-usage-by-oracle-driver.html' title='Excessive memory usage by Oracle driver solved'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-1622176749161553421</id><published>2009-03-08T19:20:00.004+02:00</published><updated>2009-03-08T20:35:13.789+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Evolution'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><category scheme='http://www.blogger.com/atom/ns#' term='Exchange'/><title type='text'>Exchange calendar sync to iPhone through Evolution</title><content type='html'>Finally, I have found an easy and transparent way of syncing my corporate calendar (on the evil MS Exchange server, of course) to my iPhone over-the-air, without involving any manual work.  The same recipe can actually work for other mobile phones as well, read on!&lt;br /&gt;&lt;br /&gt;Current syncing path is as follows:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Exchange → Evolution → &lt;/span&gt;(gcaldaemon)&lt;span style="font-weight: bold;"&gt; → Google Calendar → &lt;/span&gt;(Google Sync)&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;→ &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;iPhone&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If it looks long, don't worry - it is not so difficult in reality.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Exchange - this is where the calendar is stored, which very often is located behind a firewall, where it cannot be talked to directly from a mobile phone.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Exchange is accessed using Evolution Exchange connector (poor Outlook users may find &lt;a href="http://www.google.com/support/calendar/bin/answer.py?hl=en&amp;amp;answer=89955"&gt;this helpful&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;&lt;a href="http://gcaldaemon.sourceforge.net/"&gt;gcaldaemon&lt;/a&gt; is an open-source tool for doing various interesting tricks with Google Calendar, including syncing it with Evolution, see below for details.&lt;/li&gt;&lt;li&gt;&lt;a href="http://calendar.google.com/"&gt;Google Calendar&lt;/a&gt; is a full-featured web-based calendar, where you can store several calendars. It is especially convenient together with GMail, but doesn't require it.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.google.com/sync"&gt;Google Sync&lt;/a&gt; is a new service from Google that can sync your Google Calendar (and contacts from GMail) to various programs and mobile devices.&lt;/li&gt;&lt;li&gt;iPhone is where you get both your personal and corporate calendars, always with you :-)&lt;/li&gt;&lt;/ol&gt;So, actually the keyword here is Google Calendar. As it is quite popular, it is already supported by a lot of software, so you can use it as a middle man in various synching situations, not only the one described here.&lt;br /&gt;&lt;br /&gt;I have started testing the &lt;a href="http://www.google.com/mobile/apple/sync.html"&gt;Google Sync from Google Calendar to my iPhone&lt;/a&gt;. Google had a nice idea to implement Exchange ActiveSync protocol, which is already supported by iPhone (probably there are lots of Google employees using iPhones). Now you just need to setup an Exchange account in your phone and configure it to talk to &lt;span style="font-style: italic;"&gt;m.google.com&lt;/span&gt; instead of an Exchange server. This is another brilliant implementation after GMail started talking &lt;span style="font-style: italic;"&gt;IMAP&lt;/span&gt; natively. Follow the instructions on the Google website linked above. As a bonus, you will get 2-way syncing of GMail contacts as well if you want. And everything will work via &lt;span style="font-style: italic;"&gt;Push&lt;/span&gt;, so you will get almost instant updates when you change something on the either the phone or on the web. &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;Push&lt;/span&gt; syncing works on the iPhone by keeping &lt;span style="font-style: italic;"&gt;HTTP&lt;/span&gt; connections open for as long as possible by sending a request and waiting for a response as long as your mobile operator's infrastructure permits (can get up to several hours). During this time no traffic is moving between iPhone and Google, so unless something is changed, no need to pay for any data, which is actually better than polling of server every 10 minutes or so. When changes are available, the server stops blocking the connection and immediately &lt;span style="font-style: italic;"&gt;pushes&lt;/span&gt; data to the phone, hence the name.&lt;br /&gt;&lt;br /&gt;Tip: to select which calendars to sync with your phone, navigate to &lt;a href="http://www.google.com/sync"&gt;m.google.com/sync&lt;/a&gt; with you phone and select what is needed. I have at least 2 calendars there: personal and corporate one - you can conveniently see appointments in different colors.&lt;br /&gt;&lt;br /&gt;As soon as this works perfectly, all you need to do is get your Exchange (or any other) events to Google Calendar. This is very easy using the &lt;a href="http://gcaldaemon.sourceforge.net/usage.html"&gt;gcaldaemon&lt;/a&gt;. See their website for lots of usage scenarios. We are currently interested in file-based synchronization with Evolution. Note that Evolution now has native Google Calendar support as well, but this allows you viewing your exising Google Calendar in Evolution, but not syncing your corporate Exchange calendar to Google.&lt;br /&gt;&lt;br /&gt;Evolution, while talking to Exchange, caches your calendar data in a file called &lt;span style="font-style: italic;"&gt;cache.ics&lt;/span&gt;. You can find it in:&lt;br /&gt;&lt;blockquote&gt;~/.evolution/exchange/exchange___&lt;span style="font-style: italic;"&gt;username&lt;/span&gt;;auth=Basic@&lt;span style="font-style: italic;"&gt;server&lt;/span&gt;_;personal_Calendar/cache.ics&lt;br /&gt;&lt;/blockquote&gt;substitute your own &lt;span style="font-style: italic;"&gt;username&lt;/span&gt; name &lt;span style="font-style: italic;"&gt;server&lt;/span&gt; there.&lt;br /&gt;&lt;br /&gt;All you need is to &lt;a href="http://gcaldaemon.sourceforge.net/usage16.html#top"&gt;configure &lt;span style="font-style: italic;"&gt;gcaldaemon&lt;/span&gt; to monitor this file&lt;/a&gt; and send updates to Google Calendar, totally automatically. This way you will get one way sync from Exchange to Google, but this should be enough to not miss your all-important meetings at work, because then your phone will alert you whenever you are. I run &lt;span style="font-style: italic;"&gt;gcaldaemon&lt;/span&gt; right after Evolution from the same launcher, so I don't have to worry about syncing anymore. For that, I have created the &lt;span style="font-style: italic;"&gt;~/bin/evolution&lt;/span&gt; file (local &lt;span style="font-style: italic;"&gt;bin&lt;/span&gt; has priority in PATH, at least on Ubuntu), and this script on execution first runs &lt;span style="font-style: italic;"&gt;/usr/bin/evolution&lt;/span&gt;, sleeps several seconds and then starts &lt;span style="font-style: italic;"&gt;gcaldaemon.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Google sync actually supports syncing with many mobile devices, including the &lt;span style="font-weight: bold;"&gt;iPhone&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Android&lt;/span&gt; phones, Nokia Series60 phones with &lt;span style="font-weight: bold;"&gt;Symbian&lt;/span&gt; (contacts only for now), &lt;span style="font-weight: bold;"&gt;Blackberry&lt;/span&gt;, and the awkward &lt;span style="font-weight: bold;"&gt;Windows Mobile&lt;/span&gt;. But even &lt;span style="font-weight: bold;"&gt;if you cannot directly sync&lt;/span&gt; calendar to you phone, you can ask Google to alert you with &lt;span style="font-style: italic; font-weight: bold;"&gt;SMS&lt;/span&gt; before each meeting starts, which is almost as good, &lt;span style="font-style: italic;"&gt;gcaldaemon &lt;/span&gt;will ask Google to do this by default for each event it syncs, provided that Google knows your mobile number. Give this a try - lots of operators are supported worldwide, it's not only US anymore.&lt;br /&gt;&lt;br /&gt;The only thing that worries now that this just is another step towards Google taking over the World :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-1622176749161553421?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/1622176749161553421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=1622176749161553421' title='31 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1622176749161553421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1622176749161553421'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2009/03/exchange-calendar-sync-to-iphone.html' title='Exchange calendar sync to iPhone through Evolution'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>31</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-8899635439513336997</id><published>2008-12-29T23:55:00.005+02:00</published><updated>2008-12-30T00:58:17.745+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Usability'/><title type='text'>Human Interface Guidelines</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;This is the recent talk I gave at an internal Training Day for developers of &lt;a href="http://www.swedbank.ee/"&gt;Swedbank&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Although Swedbank Estonia (formely Hansabank) has the best Internet bank in the region &lt;a href="http://www.gfmag.com/index.php?idPage=743"&gt;according to Global Finance Magazine&lt;/a&gt;, we still strive to develop our usability and user interface skills.&lt;br /&gt;&lt;br /&gt;The talk was well received and was accompanied with some very nice slides, outlining the history of user interfaces, publicly available HIG documents, usability factors, comm0n design principles and other important points. Therefore it is worth reading for getting a compact introduction to the topic.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.azib.net/2008/human_interfaces.pdf"&gt;Human Interface Guidelines talk slides (PDF)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tgooL6eQrXk/SVlVTBTk--I/AAAAAAAAEc4/8IooWM4JMjI/s1600-h/usability.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 302px;" src="http://4.bp.blogspot.com/_tgooL6eQrXk/SVlVTBTk--I/AAAAAAAAEc4/8IooWM4JMjI/s400/usability.png" alt="" id="BLOGGER_PHOTO_ID_5285349422952414178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This time I tried using a minimalistic style for the slides without any (possibly) distracting backgrounds, inspired by &lt;a href="http://www.nealford.com/mypastconferences.htm"&gt;Neal Ford&lt;/a&gt;'s excellent talk "Ancient Philosophers &amp;amp; Blowhard Jamrobees" from the &lt;a href="http://www.agile2008.org/"&gt;Agile 2008 conference&lt;/a&gt;. Neal's slides are mostly back with some nice stock pictures and maybe a few words; they help him &lt;span style="font-weight: bold;"&gt;talk&lt;/span&gt; and not just read what is written on the screen. This helps the listeners to concentrate on the performance of the speaker instead of being distracted by reading, and pictures help to visualise the concept, greatly increasing the influence on the audience. Of course, this kind of presentations need lots of skills and rehearsal from the speaker.&lt;br /&gt;&lt;br /&gt;I haven't got as far with eliminating text (read: waste) from the slides, but to my mind this is anyway a great application of the simplicity principle I have talked about. Another principle I also tried to use in the slides (apart from the most important one - consistency) is the aesthetics -  people like things that are visually appealing, so consistent style and reasonable animations can make a lot of sense. And please don't use these bundled presentation templates ever again :-)&lt;br /&gt;&lt;br /&gt;Anyway, I hope that my slides will be useful and can at least spark some interest for researching this ultra important topic further. There are too many crappy user interfaces out there, so developers, keep this in mind!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-8899635439513336997?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/8899635439513336997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=8899635439513336997' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/8899635439513336997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/8899635439513336997'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2008/12/human-interface-guidelines.html' title='Human Interface Guidelines'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tgooL6eQrXk/SVlVTBTk--I/AAAAAAAAEc4/8IooWM4JMjI/s72-c/usability.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-1952787711350749850</id><published>2008-12-29T22:49:00.008+02:00</published><updated>2008-12-30T00:58:02.949+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Angry IP Scanner'/><title type='text'>Is the scanning of computer networks dangerous?</title><content type='html'>Looking through some presentations I have done during the last year, I have come upon a talk I gave at the&lt;span style="text-decoration: underline;"&gt; &lt;/span&gt;&lt;a href="http://cs.ioc.ee/balt2008/"&gt;Baltic DB&amp;amp;IS 2008 Conference&lt;/a&gt; in &lt;a href="http://www.tourism.tallinn.ee/eng"&gt;Tallinn, Estonia&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This bi-annual academic conference takes places usually in either Estonia, Latvia or Lithuania, but often involves speakers from other countries as well. This year it was convenient for me to participate and talk a little about my open-source networking tool &lt;a href="http://www.azib.net/"&gt;Angry IP Scanner&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The talk was quite successful, although not very academic, but it makes sense to post the slides to give some interesting information on Angry IP Scanner.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a style="font-weight: bold;" href="http://java.azib.net/2008/ipscan_balt2008.pdf"&gt;Baltic DB&amp;amp;IS 2008 - Is the scanning of computer networks dangerous? (PDF slides)&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://java.azib.net/2008/ipscan_balt2008.pdf"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_tgooL6eQrXk/SVk8mYlnogI/AAAAAAAAEcw/qPXDwb74aTw/s400/ipscan_db%26is.png" alt="" id="BLOGGER_PHOTO_ID_5285322267828920834" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(a nice picture of Tallinn's silhouette is a bonus)&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-1952787711350749850?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/1952787711350749850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=1952787711350749850' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1952787711350749850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1952787711350749850'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2008/12/is-scanning-of-computer-networks.html' title='Is the scanning of computer networks dangerous?'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tgooL6eQrXk/SVk8mYlnogI/AAAAAAAAEcw/qPXDwb74aTw/s72-c/ipscan_db%26is.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-1912030104372349738</id><published>2008-11-26T22:49:00.007+02:00</published><updated>2008-11-30T17:54:54.050+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='LightZone'/><category scheme='http://www.blogger.com/atom/ns#' term='F-Spot'/><category scheme='http://www.blogger.com/atom/ns#' term='photos'/><title type='text'>Use LightZone from F-Spot as external editor</title><content type='html'>In a &lt;a href="http://blog.azib.net/2008/11/opening-files-with-lightzone-from.html"&gt;previous post&lt;/a&gt; I have shown how to teach &lt;a href="http://www.lightcrafts.com/"&gt;LightZone&lt;/a&gt;, a non-destructive photo editor, to open files passed from the command-line (for some strange reason it doesn't do it out-of-the-box).&lt;br /&gt;&lt;br /&gt;Now, I want to be able to use LightZone as an external editor from &lt;a href="http://www.f-spot.org/"&gt;F-Spot&lt;/a&gt;, which I use for my photo workflow.&lt;br /&gt;&lt;br /&gt;F-Spot has a convenient &lt;i&gt;Open With&lt;/i&gt; menu when right-clicking on a photo, we just need to add LightZone to this menu. After some research, it appear that F-Spot uses the standard &lt;a href="http://standards.freedesktop.org/desktop-entry-spec/latest/"&gt;desktop entry specification&lt;/a&gt; files to populate this menu. These files can be located either in &lt;tt&gt;/usr/share/applications&lt;/tt&gt; or in user's home, &lt;tt&gt;~/.local/share/applications&lt;/tt&gt;. You can use either location, but I prefer the latter one, because I have unpacked LightZone into my home as well.&lt;br /&gt;&lt;br /&gt;Here is the working &lt;tt&gt;lightzone.desktop&lt;/tt&gt; file:&lt;blockquote&gt;&lt;pre&gt;[Desktop Entry]&lt;br /&gt;Version=1.0&lt;br /&gt;Type=Application&lt;br /&gt;Name=LightZone Photo Editor&lt;br /&gt;Exec=LightZone %u&lt;br /&gt;TryExec=LightZone&lt;br /&gt;Icon=/home/USERNAME/LightZone/LightZone_32.png&lt;br /&gt;Terminal=false&lt;br /&gt;Categories=Graphics;2DGraphics;Photography;RasterGraphics;GTK;&lt;br /&gt;StartupNotify=true&lt;br /&gt;MimeType=image/tiff;image/jpeg;image/x-canon-cr2;image/x-canon-crw;image/x-nikon-nef;image/x-pentax-pef;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;This file expects that you have followed the &lt;a href="http://blog.azib.net/2008/11/opening-files-with-lightzone-from.html"&gt;previous post&lt;/a&gt; and already have &lt;tt&gt;LightZone&lt;/tt&gt; in the &lt;tt&gt;PATH&lt;/tt&gt; which accepts a filename to open on the command-line.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Exec&lt;/b&gt; - this line specifies what command to run, &lt;tt&gt;%u&lt;/tt&gt; means to pass the selected file's URL on the command-line. For some reason with trial and error, I found that F-Spot is only able to pass URLs like this, specifying &lt;tt&gt;%f&lt;/tt&gt; doesn't work with F-Spot. But if you look at the LightZoneOpener.java source, you will see that it supports URLs as well as filenames.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Icon&lt;/b&gt; - change this one to the full path of LightZone's icon, it supplied in the original archive.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Categories&lt;/b&gt; - this specifies where LightZone will appear in the ''Applications'' menu.&lt;/li&gt;&lt;li&gt;&lt;b&gt;MimeType&lt;/b&gt; - here you must list all image mime types that you want LightZone to open. This is especially important for RAW files. As I own a Canon camera, I have most of my photos in CR2 format, so I need to be sure that &lt;b&gt;image/x-canon-cr2&lt;/b&gt; is in the list. I have also specified CRW, NEF and PEF mime types for older Canon, Nikon and Pentax cameras, respectively. These mime types are already registered in Ubuntu Intrepid (not sure about other distributions). Here is some info on &lt;a href="http://nathanrobertson.blogspot.com/2008/04/fix-f-spot-opening-gimp-for-raw-files.html"&gt;how to register new mime types in Gnome&lt;/a&gt;, in case your camera's format is not registered yet.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tgooL6eQrXk/SS3AJUr_u5I/AAAAAAAAEWA/L_UWy1ACrsg/s1600-h/OpenWithLightZone.png"&gt;&lt;img style="cursor: pointer; width: 400px; height: 295px; text-align: center;" src="http://4.bp.blogspot.com/_tgooL6eQrXk/SS3AJUr_u5I/AAAAAAAAEWA/L_UWy1ACrsg/s400/OpenWithLightZone.png" alt="" id="BLOGGER_PHOTO_ID_5273082005125315474" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After chosing the &lt;i&gt;Open With-&gt;LightZone&lt;/i&gt;, F-Spot will ask whether to create a new version for the file. Select 'No' - this won't work with RAW files and LightZone anyway, because LightZone saves files automatically with the &lt;i&gt;_lzn.jpg&lt;/i&gt; suffix and F-Spot doesn't know about it.&lt;br /&gt;&lt;br /&gt;Getting this right requires patching F-Spot (I am going to do that later). For now, you will have to import the saved file manually, if you want it to appear in F-Spot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-1912030104372349738?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/1912030104372349738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=1912030104372349738' title='238 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1912030104372349738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1912030104372349738'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2008/11/use-lightzone-from-f-spot-as-external.html' title='Use LightZone from F-Spot as external editor'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tgooL6eQrXk/SS3AJUr_u5I/AAAAAAAAEWA/L_UWy1ACrsg/s72-c/OpenWithLightZone.png' height='72' width='72'/><thr:total>238</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-3013584231965498735</id><published>2008-11-24T19:56:00.011+02:00</published><updated>2009-09-25T00:15:39.971+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='GConf'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP proxy'/><category scheme='http://www.blogger.com/atom/ns#' term='NetworkManager'/><title type='text'>Enable HTTP proxy in Gnome automatically</title><content type='html'>I have a laptop with Linux (currently Ubuntu) which I use both at home and at work. The corporate security policy requires everyone to use the &lt;b&gt;HTTP proxy server&lt;/b&gt; with authentication for web access, so when I come to work I had to manually enable it, and then disable again at home - not very convenient.&lt;br /&gt;&lt;br /&gt;As a side note, &lt;i&gt;Firefox 3&lt;/i&gt;+ is great in respecting the global or system-wide proxy configuration (&lt;i&gt;System-&gt;Preferences-&gt;Network proxy&lt;/i&gt; or &lt;i&gt;gnome-network-preferences&lt;/i&gt;) as well as &lt;i&gt;gnome-terminal&lt;/i&gt; is very nice to set the &lt;b&gt;http_proxy&lt;/b&gt; environment variable automatically when proxy is configured, making most command-line tools respect the global proxy setting as well, which is very cool.&lt;br /&gt;&lt;br /&gt;So, before network profiles have arrived to &lt;b&gt;Gnome&lt;/b&gt; or &lt;b&gt;NetworkManager&lt;/b&gt; (I have seen some related commits in Gnome SVN), I still want to enable the proxy automatically depending on my location. Thankfully, &lt;b&gt;NetworkManager&lt;/b&gt; supports execution of scripts when it brings interfaces up or down, so this is not difficult at all.&lt;br /&gt;&lt;br /&gt;At least on Ubuntu, &lt;b&gt;NetworkManager&lt;/b&gt; executes the scripts that are located in &lt;tt&gt;/etc/NetworkManager/dispatcher.d/&lt;/tt&gt; when it brings interfaces up. Inside of the script I can detect whether I am at work by checking the domain name in /etc/resolv.conf provided by the corporate &lt;span style="font-style: italic;"&gt;DHCP server&lt;/span&gt;, or the beginning of the assigned &lt;span style="font-style: italic;"&gt;IP address&lt;/span&gt; if domain can't be used for any reason.&lt;br /&gt;&lt;br /&gt;OK, here is the working script for &lt;b&gt;Ubuntu Karmic, Jaunty &lt;/b&gt;and&lt;b&gt; Intrepid&lt;/b&gt; (Gnome 2.24+), see notes below for older versions. I have this script in &lt;tt&gt;/etc/NetworkManager/dispatcher.d/02proxy&lt;/tt&gt;, because &lt;tt&gt;01ifupdown&lt;/tt&gt; already exists there.&lt;br /&gt;&lt;br /&gt;It is an updated version, attempting to make the script suitable for more general use, eg in our company we now provide it in a &lt;span style="font-style: italic;"&gt;.deb&lt;/span&gt; package for all Ubuntu-based laptops.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;# The script for automatically setting the proxy server depending on location.&lt;br /&gt;# Put it under &lt;span style="font-weight: bold;"&gt;/etc/NetworkManager/dispatcher.d/02proxy&lt;/span&gt;&lt;br /&gt;# Create also the &lt;span style="font-weight: bold;"&gt;/etc/NetworkManager/proxy_domains.conf&lt;/span&gt;, specifying the mapping of&lt;br /&gt;# DHCP domains to proxy server addresses, eg "example.com proxy.example.com:3128"&lt;br /&gt;# Written by Anton Keks&lt;br /&gt;&lt;br /&gt;PROXY_DOMAINS="/etc/NetworkManager/proxy_domains.conf"&lt;br /&gt;&lt;br /&gt;# provided by NetworkManager&lt;br /&gt;INTERFACE=$1&lt;br /&gt;COMMAND=$2&lt;br /&gt;&lt;br /&gt;function gconf() {&lt;br /&gt; sudo -E -u $USER gconftool-2 "$@"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function saveUserConfFile() {&lt;br /&gt; echo "DOMAIN_USER=$DOMAIN_USER" &gt; $CONF_FILE;&lt;br /&gt; echo "DOMAIN_PWD_BASE64="`echo $DOMAIN_PWD | base64` &gt;&gt; $CONF_FILE;&lt;br /&gt; echo "PROXY_HOST=$PROXY_HOST" &gt;&gt; $CONF_FILE;&lt;br /&gt; echo "PROXY_PORT=$PROXY_PORT" &gt;&gt; $CONF_FILE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function enableProxy() {&lt;br /&gt; PROXY_HOST=`cat $PROXY_DOMAINS | grep $DOMAIN | sed 's/.* \+//' | sed 's/:.*//'`&lt;br /&gt; PROXY_PORT=`cat $PROXY_DOMAINS | grep $DOMAIN | sed 's/.*://'`&lt;br /&gt;&lt;br /&gt; # check if authentication is required&lt;br /&gt; http_proxy=http://$PROXY_HOST:$PROXY_PORT/ wget com 2&gt;&amp;amp;1 | grep "ERROR 407"&lt;br /&gt; if [ $? -eq 0 ]; then&lt;br /&gt;   AUTH_REQUIRED="true"&lt;br /&gt;   CONF_FILE=$HOME/.proxy:$DOMAIN&lt;br /&gt;&lt;br /&gt;   if [ ! -e $CONF_FILE ]; then&lt;br /&gt;     DOMAIN_USER=`sudo -E -u $USER zenity --entry --text "Login name for domain $DOMAIN"`&lt;br /&gt;     DOMAIN_PWD=`sudo -E -u $USER zenity --entry --text "Password for domain $DOMAIN" --hide-text`&lt;br /&gt;     saveUserConfFile&lt;br /&gt;   fi&lt;br /&gt;&lt;br /&gt;   # load user proxy settings&lt;br /&gt;   . $CONF_FILE&lt;br /&gt;   # decode password&lt;br /&gt;   DOMAIN_PWD=`echo $DOMAIN_PWD_BASE64 | base64 -d`&lt;br /&gt;  &lt;br /&gt;   # get Kerberos ticket (if it's configured)&lt;br /&gt;   if echo $DOMAIN_PWD | sudo -E -u $USER kinit $DOMAIN_USER; then&lt;br /&gt;     KLIST_INFO=`sudo -E -u $USER klist | fgrep Default`&lt;br /&gt;     sudo -E -u $USER notify-send -i gtk-info "Domain login" "Kerberos ticket retrieved successfully: $KLIST_INFO"&lt;br /&gt;   fi&lt;br /&gt; else    &lt;br /&gt;   AUTH_REQUIRED="false"&lt;br /&gt; fi&lt;br /&gt;&lt;br /&gt; # setup proxy&lt;br /&gt; gconf --type string --set /system/proxy/mode "manual"&lt;br /&gt; gconf --type bool --set /system/http_proxy/use_http_proxy "true"&lt;br /&gt; gconf --type string --set /system/http_proxy/host $PROXY_HOST&lt;br /&gt; gconf --type int --set /system/http_proxy/port $PROXY_PORT&lt;br /&gt; gconf --type bool --set /system/http_proxy/use_same_proxy "true"  &lt;br /&gt; gconf --type bool --set /system/http_proxy/use_authentication $AUTH_REQUIRED&lt;br /&gt; gconf --type string --set /system/http_proxy/authentication_user $DOMAIN_USER&lt;br /&gt; gconf --type string --set /system/http_proxy/authentication_password $DOMAIN_PWD&lt;br /&gt;&lt;br /&gt; # notify&lt;br /&gt; sudo -E -u $USER notify-send -i gtk-info "Proxy configuration" "Your proxy settings have been set to: $DOMAIN_USER@$PROXY_HOST:$PROXY_PORT"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function disableProxy() {&lt;br /&gt; gconf --type string --set /system/proxy/mode "none"&lt;br /&gt; gconf --type bool --set /system/http_proxy/use_http_proxy "false"&lt;br /&gt; gconf --type string --set /system/http_proxy/host ""&lt;br /&gt; gconf --type bool --set /system/http_proxy/use_authentication "false"&lt;br /&gt; gconf --type string --set /system/http_proxy/authentication_user ""&lt;br /&gt; gconf --type string --set /system/http_proxy/authentication_password ""&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# wait for gnome-settings-daemon to appear, ie until user logs in&lt;br /&gt;for i in {1..100}; do&lt;br /&gt; if [ ! `pidof gnome-settings-daemon` ]; then&lt;br /&gt;   sleep 5;&lt;br /&gt;   echo "Waiting for gnome-settings-daemon to appear..."&lt;br /&gt; else&lt;br /&gt;   break  &lt;br /&gt; fi&lt;br /&gt;done&lt;br /&gt;if [ ! `pidof gnome-settings-daemon` ]; then&lt;br /&gt; echo "gnome-settings-daemon is not running. exiting."&lt;br /&gt; exit 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# steal environment from the current non-root user&lt;br /&gt;XENV=`xargs -n 1 -0 echo &amp;lt;/proc/$(pidof gnome-settings-daemon)/environ`&lt;br /&gt;# init DBUS connection string in order to reach gconfd&lt;br /&gt;eval export `echo "$XENV" | fgrep DBUS_SESSION_BUS_ADDRESS=`&lt;br /&gt;eval export `echo "$XENV" | fgrep USER=`&lt;br /&gt;eval export `echo "$XENV" | fgrep HOME=`&lt;br /&gt;eval export `echo "$XENV" | fgrep DISPLAY=`&lt;br /&gt;eval export `echo "$XENV" | fgrep XAUTHORITY=`&lt;br /&gt;&lt;br /&gt;if [ $COMMAND != 'up' ]; then&lt;br /&gt; disableProxy;&lt;br /&gt; exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;DOMAIN=`cat /etc/resolv.conf | grep domain | sed 's/domain \+//'`&lt;br /&gt;# check if we need to set proxy settings for this domain&lt;br /&gt;if [[ -e $PROXY_DOMAINS &amp;amp;&amp;amp; ! `cat $PROXY_DOMAINS | grep $DOMAIN` ]]; then&lt;br /&gt; echo "Proxy is not required for domain $DOMAIN"&lt;br /&gt; disableProxy&lt;br /&gt;else&lt;br /&gt; echo "Setting proxy for domain $DOMAIN"&lt;br /&gt; enableProxy&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Don't forget to:&lt;ul&gt;&lt;li&gt;give this script execute permissions&lt;/li&gt;&lt;li&gt;have &lt;i&gt;gconftool-2&lt;/i&gt;, &lt;span style="font-style: italic;"&gt;zenity&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;kinit&lt;/span&gt; installed (&lt;span style="font-weight: bold;"&gt;gconf2&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;zenity&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;krb5-user&lt;/span&gt; packages in Ubuntu). Install &lt;i&gt;gconf-editor&lt;/i&gt; as well for a graphical config editor.&lt;/li&gt;&lt;li&gt;create &lt;span style="font-weight: bold;"&gt;/etc/NetworkManager/proxy_domains.conf&lt;/span&gt;, specifying the mapping of DHCP domains to proxy server addresses, eg "example.com proxy.example.com:3128". Specify each domain on a new line.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The script doesn't need you to hardcode your username and the proxy password anymore - the script will ask you for these values on first run and then store them in &lt;span style="font-style: italic;"&gt;$HOME/.proxy:$DOMAIN&lt;/span&gt; file, so the script is now perfectly usable on multiuser machines and doens't bug you in case of 'unknown' domains.&lt;br /&gt;&lt;br /&gt;For more functionality, it even tries to retrieve the Kerberos ticket for you, if the kerberos is configured properly in &lt;span style="font-style: italic;"&gt;/etc/krb5.conf&lt;/span&gt;. You can check if this is the case by running this on the command-line:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;kinit your-user-name; klist&lt;/pre&gt;&lt;/blockquote&gt;This works very well for me and saves several mouse clicks every morning :-)&lt;br /&gt;&lt;br /&gt;Note to &lt;b&gt;Gnome 2.22&lt;/b&gt; and older users (&lt;b&gt;Ubuntu Hardy&lt;/b&gt;, etc): I had this script initially done in &lt;b&gt;Hardy&lt;/b&gt;, but after upgrading to &lt;b&gt;Intrepid (Gnome 2.24)&lt;/b&gt; it stopped working. The reason was that starting from &lt;b&gt;Gnome 2.24&lt;/b&gt;, the gconf setting of &lt;tt&gt;/system/http_proxy/use_http_proxy&lt;/tt&gt; is not the primary one and has been replaced by &lt;tt&gt;/system/proxy/mode&lt;/tt&gt;, which takes one of three values: 'auto', 'manual' and 'none'. In &lt;b&gt;Intrepid&lt;/b&gt;, if you set only &lt;tt&gt;/system/http_proxy/use_http_proxy&lt;/tt&gt; as before - it has no effect, you need to set &lt;tt&gt;/system/proxy/mode&lt;/tt&gt; to &lt;i&gt;manual&lt;/i&gt;, and this will set the value of the old setting to 'true' automatically.&lt;br /&gt;&lt;br /&gt;Another thing introduced with &lt;b&gt;Intrepid&lt;/b&gt; is the need to set the &lt;tt&gt;DBUS_SESSION_BUS_ADDRESS&lt;/tt&gt; environment variable (the script steals it from the &lt;tt&gt;x-session-manager&lt;/tt&gt; process) - this is because gconfd has switched to DBUS from CORBA for a communication protocol. If you have older Gnome, then you may omit these 2 lines involving DBUS.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-3013584231965498735?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/3013584231965498735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=3013584231965498735' title='162 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/3013584231965498735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/3013584231965498735'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2008/11/enable-http-proxy-in-gnome.html' title='Enable HTTP proxy in Gnome automatically'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>162</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-1785363709157449873</id><published>2008-11-12T23:29:00.005+02:00</published><updated>2008-11-26T22:44:19.014+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='command-line'/><category scheme='http://www.blogger.com/atom/ns#' term='LightZone'/><category scheme='http://www.blogger.com/atom/ns#' term='F-Spot'/><category scheme='http://www.blogger.com/atom/ns#' term='photos'/><title type='text'>Opening files with LightZone from command-line</title><content type='html'>&lt;a href="http://www.lightcrafts.com/"&gt;LightZone&lt;/a&gt; is a very useful commercial photo editor with some unique features like non-destructive and layer-based editing.  To my mind, the developers has taken a very clever approach to save resulting edits inside of smaller-size JPEG files (thumbnails), so that any program can be used for previewing the resulting image, but opening of the file in LightZone will load the original image and show all the edits again with the possibility to make any changes and export a full-resolution image. The cool thing here is that edited files are very small especially when compared to 10Mb+ source RAW photos, contain all the editing history and can be previewed quickly with any software. And all this runs on Linux (thanks to Java - write once, run almost anywhere).&lt;br /&gt;&lt;br /&gt;The only problem with LightZone (at least the Linux version) is that it doesn't accept filenames from the command-line! You have to start the program and select the file manually using the embedded file browser. Of course, this is not an option if you want to run LightZone from another application as an external editor, eg from &lt;a href="http://www.f-spot.org/"&gt;F-Spot&lt;/a&gt; (more on this in a later post).&lt;br /&gt;&lt;br /&gt;To make a long story short, I have written a small Java program that takes a filename on the command-line and then modifies LightZone preferences, so when you run it next time it will directly open the specified image.&lt;br /&gt;&lt;br /&gt;Here it is:&lt;blockquote&gt;&lt;pre&gt;import java.io.*;&lt;br /&gt;import java.net.*;&lt;br /&gt;import java.util.prefs.*;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * LightZoneOpener - will modify LightZone preferences to open the &lt;br /&gt; * specified file (image) on next startup.&lt;br /&gt; * This is useful to force LightZone to open a particular file from &lt;br /&gt; * the command-line, just run this code before starting LightZone. &lt;br /&gt; *&lt;br /&gt; * @author Anton Keks&lt;br /&gt; */&lt;br /&gt;public class LightZoneOpener {&lt;br /&gt;&lt;br /&gt;  public static void main(String[] args) throws Exception {&lt;br /&gt;    if (args.length != 1) {&lt;br /&gt;      System.err.println("Please specify filename to open in LightZone");&lt;br /&gt;      System.exit(1);&lt;br /&gt;    }&lt;br /&gt;    String filename = args[0];&lt;br /&gt;    if (filename.startsWith("file:"))&lt;br /&gt;      filename = new URI(filename).getPath();&lt;br /&gt;    File file = new File(filename).getCanonicalFile();&lt;br /&gt;    if (!file.exists()) {&lt;br /&gt;      System.err.println(file + " doesn't exist!");&lt;br /&gt;      System.exit(2);&lt;br /&gt;    }&lt;br /&gt;    File fileDir = file.getParentFile();&lt;br /&gt;    &lt;br /&gt;    // set image folder as current one&lt;br /&gt;    Preferences folderPrefs = Preferences.userRoot().node("com/lightcrafts/ui/browser/folders");&lt;br /&gt;    int i = 0; File dir = file;&lt;br /&gt;    while ((dir = dir.getParentFile()) != null) {&lt;br /&gt;      folderPrefs.put("BrowserTreePath" + i++, dir.getName().isEmpty() ? "/" : dir.getName());&lt;br /&gt;    }&lt;br /&gt;    folderPrefs.remove("BrowserTreePath" + i);&lt;br /&gt;    &lt;br /&gt;    // set selected image in the current folder&lt;br /&gt;    Preferences appPrefs = Preferences.userRoot().node("com/lightcrafts/app");&lt;br /&gt;    appPrefs.put("BrowserSelectionMemory" + fileDir.getPath().hashCode(), file.getPath());&lt;br /&gt;    // tell LightZone that last startup was OK just in case&lt;br /&gt;    appPrefs.put("StartupSuccessful", "true");&lt;br /&gt;    &lt;br /&gt;    System.out.println("LightZone is now ready to open " + file + " on next start");&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Here is what to do:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;save it to LightZoneOpener.java&lt;br /&gt;&lt;/li&gt;&lt;li&gt;compile with &lt;span style="color: rgb(153, 153, 153);"&gt;javac LightZoneOpener.java&lt;/span&gt;&lt;/li&gt;&lt;li&gt;run with &lt;span style="color: rgb(153, 153, 153);"&gt;java LightZoneOpener&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Then you can create a small script that will automate the stuff for you (save it to ~/bin/LightZone):&lt;blockquote&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;java -cp ~/bin LightZoneOpener "$@"&lt;br /&gt;~/LightZone/LightZone&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;This assumes that you have extracted LightZone to &lt;tt&gt;~/LightZone&lt;/tt&gt; (in your home dir) and have the following two files in the &lt;tt&gt;~/bin&lt;/tt&gt; dir: the compiled &lt;tt&gt;LightZoneOpener.class&lt;/tt&gt; and the script file LightZone (don't forget to set the execute permission with &lt;tt&gt;chmod a+x ~/bin/LightZone&lt;/tt&gt;)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://srv2.azib.net/~anton/LightZoneOpener.tar"&gt;Here is all this pre-compiled&lt;/a&gt;. Just extract the file directly in your home and it will put all needed files into the bin directory. After next login your local bin will be in $PATH, so you will be able to use it.&lt;br /&gt;&lt;br /&gt;Now you can run &lt;tt&gt;LightZone filename&lt;/tt&gt; on the command-line in Linux (or using &lt;i&gt;Alt+F2&lt;/i&gt;)! Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-1785363709157449873?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/1785363709157449873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=1785363709157449873' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1785363709157449873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/1785363709157449873'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2008/11/opening-files-with-lightzone-from.html' title='Opening files with LightZone from command-line'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6458362026107583183.post-9160926561105886072</id><published>2007-06-24T17:17:00.001+03:00</published><updated>2008-11-25T23:39:53.456+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Angry IP Scanner'/><category scheme='http://www.blogger.com/atom/ns#' term='Anti-Viruses'/><title type='text'>Anti-antivirus, someone?</title><content type='html'>Many years ago, in good old DOS days, I thought that antivirus software was great. In these days it was common for antiviruses to start on system startup and scan drives (thankfully, the drives weren't that large).&lt;br /&gt;&lt;br /&gt;In these days, most viruses could be considered a great work - most of them were technically difficult to write, were introducing very interesting tricks for infection and stealth techniques. However, after Windows OSs and the Internet became popular, a whole lot of new possibilities has appeared, how to break into computers. These times have brought trojans and worms to the attention of the public, which has mostly shaded viruses. Now, we receive a lot of email worms written by script-kiddies and call them 'viruses'.&lt;br /&gt;&lt;br /&gt;Of course, as &lt;a href="http://en.wikipedia.org/wiki/Malware"&gt;malware&lt;/a&gt; transformed, antivirus software&lt;br /&gt;needed to follow up: they started to detect a lot more things that can be potentially harmful to poor computer users. Moreover, as these computer users don't usually understand what are they doing and what is dangerous and what is not, antivitus software vendors has taken a new mission: to protect from everything.&lt;br /&gt;&lt;br /&gt;This is arguably a good mission, but IMHO it has started getting in the way too much. Nowadays, antivirus scanners have their hooks everywhere in the system: they monitor network traffic, they scan every opened and yet unopened file, they slow down the computer a whole lot. Sometimes it feels that we are back a few years in terms of computer performance - it is like &lt;a href="http://en.wikipedia.org/wiki/Moores_law"&gt;Moore's law&lt;/a&gt; seems to be broken.&lt;br /&gt;&lt;br /&gt;However, as everybody knows, nowadays the world is being controlled by money - so are the antivirus scanners. In order to make more profit, they tend to frighten the users by 'detecting' all kinds of stuff they may have on their computers and saying that it is dangerous. Moreover, this also has a side-effect of increasing the size of their 'virus' databases: "We detect 75,000 viruses, we are the greatest!". I wonder how many of these are REAL viruses! Even worse, now antivirus makers are close to controlling the world in some way - they tell users what they can use and what they cannot. They delete software without warnings.&lt;br /&gt;&lt;br /&gt;Recently, McAfee and then Symantec started 'detecting' my open-source tool &lt;a href="http://www.azib.net/ipscan/"&gt;Angry IP Scanner&lt;/a&gt;. McAfee was the first, but they even didn't give any explanations. After long email discussions with them they told me that this is a 'potentially unwanted program' for their users and therefore it must be deleted. No matter that it is open-source, no matter that it has no installers and is never distributed automatically (the only way is to download it manually) nor it somehow abuses the system. It is just a tiny little exe file. If a user doesn't want - they can just hit the Delete button - and it's gone! Later, the trend was followed by Symantec. They at least have provided some information and classified the program as 'hacktool'. See &lt;a href="http://securityresponse.symantec.com/security_response/writeup.jsp?docid=2003-092618-3023-99&amp;amp;tabid=1"&gt;their description here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Actually, they both have hit a lot of their customers. There are thousands of thankful users of Angry IP Scanner around the world, especially among network administrators. I have got a lot of emails asking me to 'fix' this problem, but unfortunately I can't: antivirus makers, seeking for their profits, just don't listen to me.&lt;br /&gt;&lt;br /&gt;So, if you are a user of antivirus software, please help to stop the evil: tell your vendors that they have gone too far. They are taking our freedom and ruining our computers.&lt;br /&gt;&lt;br /&gt;I hope that antiviruses will never become popular on Linux. Almost complete lack of malware dangerous to regular users as well as freedom make it an unbeatable choice. Happy switching and fighting for the freedom in this imperfect cruel world! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6458362026107583183-9160926561105886072?l=blog.azib.net' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.azib.net/feeds/9160926561105886072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6458362026107583183&amp;postID=9160926561105886072' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/9160926561105886072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6458362026107583183/posts/default/9160926561105886072'/><link rel='alternate' type='text/html' href='http://blog.azib.net/2007/06/anti-antivirus-someone.html' title='Anti-antivirus, someone?'/><author><name>Anton Keks</name><uri>http://www.blogger.com/profile/10287795376177313666</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='13267921139855939214'/></author><thr:total>5</thr:total></entry></feed>