tag:blogger.com,1999:blog-85792327369839743992024-03-13T10:00:29.663-07:00The Blog of Paweł StołowskiLinux, programming, astronomy... stuff that matters.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.comBlogger109125tag:blogger.com,1999:blog-8579232736983974399.post-59359890298445607532016-10-13T07:10:00.002-07:002017-09-21T04:22:55.783-07:00Nieuczciwy deweloper<a href="https://2.bp.blogspot.com/-K7dXqowPnE4/V_-Vt5vO42I/AAAAAAAAdkw/UhxCpo5BFJkN5c0x6FMFwujfwmyr0Q72QCLcB/s1600/IMG_1805.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="183" src="https://2.bp.blogspot.com/-K7dXqowPnE4/V_-Vt5vO42I/AAAAAAAAdkw/UhxCpo5BFJkN5c0x6FMFwujfwmyr0Q72QCLcB/s320/IMG_1805.JPG" width="320" /></a>Nieco ponad dwa lata temu kupując mieszkanie w nowo budowanych blokach w Osielsku (mini-osiedle pod nazwą "Willa Tymiankowa") padłem ofiarą nieuczciwego dewelopera - firmy LM Lemar Deweloper z Bydgoszczy. Inwestycja miała ponad 2-letni poślizg z terminem zakończenia, deweloper wpadł w wielomilionowe długi, nie płacił podwykonawcom, księga wieczysta została obciążona przez hipoteki przymusowe na rzecz wierzycieli i całość o mały włos nie zakończyła się upadkiem i utratą mieszkań. Sytuację uratował jeden z wierzycieli, który w zamian za kilkanaście niesprzedanych mieszkań spłacił ówczesne długi oraz kredyty dewelopera. Pozwoliło to oczyścić hipotekę, wyodrębnić mieszkania i podpisać akty notarialne z dotychczasowymi nabywcami lokali. Zmianie uległa nazwa osiedla - z "Willa Tymiankowa" na "Aria Park". Niestety LM Lemar Deweloper pozostawił inwestycję w fatalnym stanie, z dużą ilością niedoróbek i wad, których usunięcie kosztować może nawet 300-400 tys. zł. Nie ma przy tym co liczyć na dewelopera. Cała sytuacja została dokładniej opisana na stronie <a href="http://www.osielsko-tymiankowa.info/" target="_blank">www.osielsko-tymiankowa.info</a><br />
<br />Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-30703741479570943802016-03-09T08:56:00.000-08:002016-03-09T08:57:28.460-08:00QComicBook website is back (kind of)I've finally managed to sort out the DNS and github-pages stuff and set <a href="http://qcomicbook.org/" target="_blank">qcomicbook.org</a> domain so that it's redirected to the <a href="https://github.com/stolowski/QComicBook" target="_blank">QComicBook GitHub project page</a>... That's the first step (and yes, GH pages are quite nice and easy to use) of bringing qcomicbook website back to the living. Now, I still need to think about how to "convert" the old Ruby-on-Rails web site to "static" web pages on GitHub, this will require some re-designing, re-writing and simplification - a good chance to finally learn some of the jQuery and bootstrap stuff maybe?Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-87530830691870462952015-11-30T03:14:00.003-08:002016-03-09T08:57:20.016-08:00QComicBook website is going downQComicBook website is going to be down as I decided not to renew my existing web hosting, due to costs (the donations I received would cover only a fraction of hosting cost). QComicBook will still be available via <a href="https://github.com/stolowski/QComicBook" target="_blank">GitHub repository</a>. I'll also work on migrating qcomicbook website to GitHub webpages (with limitations, as they are not hosting Rails webapps), which will hopefully mean it's going to be available via http://www.qcomicbook.org again soon.<br />
<br />
And no, QComicBook is NOT dead. It may look like it is since it hasn't been updated for a very long time, but I promise, I'm not giving up on it! Stay tuned!Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-17944666336554554372013-01-31T09:52:00.002-08:002013-01-31T09:52:09.296-08:00My first contribution to Stellarium approved!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-MdqBo6NBgQo/UQqq0BaFQJI/AAAAAAAADns/cZoL-a8JLxs/s1600/barlow1.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="173" src="http://1.bp.blogspot.com/-MdqBo6NBgQo/UQqq0BaFQJI/AAAAAAAADns/cZoL-a8JLxs/s320/barlow1.jpg" width="320" /></a></div>
My first contribution to the great, open-source astronomy application <a href="http://stellarium.org/">Stellarium</a> just got approved today! I was playing with its Oculars extension a bit and found out it was lacking support for Barlow lenses, so after some hacking I proposed it via this <a href="https://code.launchpad.net/~stolowski/stellarium/oculars-barlow-lens/+merge/145210">branch</a>. You can now find it in <a href="https://code.launchpad.net/~stellarium/stellarium/trunk">trunk</a>, but unfortunately my change came too late for inclusion in new Stellarium 0.12.0, so the only way to test it is to compile latest trunk code, or wait for next official release.<br />
<a href="http://4.bp.blogspot.com/-IP-Z6RXQJpU/UQqq2x2EXcI/AAAAAAAADn0/N-FHg2oUonE/s1600/barlow2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="173" src="http://4.bp.blogspot.com/-IP-Z6RXQJpU/UQqq2x2EXcI/AAAAAAAADn0/N-FHg2oUonE/s320/barlow2.jpg" width="320" /></a><br />
My barlow lenses enhancement allows for adding barlow definitions in the Oculars dialog. Just like in the real world, the multiplicity of barlow lens affects focal length of the telescope, and thus increases magnification and decreases field of view. You can of course achieve this by defining additional telescopes with respective focal lengths, but this enhancement makes it easy to play with different telescope - ocular - barlow combinations without much hassle and duplicating telescope definitions. Enjoy.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-7100713323336701942012-06-09T13:29:00.000-07:002012-06-09T13:29:55.822-07:00The power of built-in debugging and introspection<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-zaXR2ZMkw6M/T9OOll3b6gI/AAAAAAAADlU/8wWzcxzYqQ0/s1600/qcomicbook-debug.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="212" src="http://4.bp.blogspot.com/-zaXR2ZMkw6M/T9OOll3b6gI/AAAAAAAADlU/8wWzcxzYqQ0/s320/qcomicbook-debug.png" width="320" /></a></div>
I've recently started reading the excellent <a href="http://www.cc2e.com/">"Code Complete" by Steve McConnell</a> and - as is often the case when you encounter a good book - got inspired by some of its ideas. I was particularly enlightened by the idea of implementing advanced built-in debugging/introspection capabilities, only available if application was compiled with DEBUG flag.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-nG4OY_6pHgE/T9Or3N_rqXI/AAAAAAAADlg/iCMm-gdbN-4/s1600/qcomicbook-debug2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="245" src="http://2.bp.blogspot.com/-nG4OY_6pHgE/T9Or3N_rqXI/AAAAAAAADlg/iCMm-gdbN-4/s320/qcomicbook-debug2.png" width="320" /></a></div>
I found this idea very interesting for <a href="http://qcomicbook.org/">QComicBook</a> - it would be very cool to be able to check internal state of some more sophisticated widgets when debugging issues. QComicBook has fairly detailed tracing (if you compile it with -DCMAKE_BUILD_TYPE=Debug flag), but it's not very useful in debugging subtle issues (such as with drawing) as it simply produces too much text output to analyse.<br />
So, I started hacking it today. For starters I picked the most troublesome widget in QComicBook - ContinuousPageView, responsible for continuous view mode. This widget still has some minor issues that show up under specific circumstances, and they are very hard to debug. I implemented a simple Debug window, available via Debug > Continuous View menu option; it displays frames for all pages, showing their sizes, position on the QGraphicsScene and internal state. And it didn't take long as I spotted first potential problem: when rotation is applied, some sizes manifested by QGraphicsItem interface (blue boxes) don't match numbers used internally to handle continuous view logic; this seems to affect pages that use estimated sizes only (i.e. not loaded yet).<br />
I'm not sure yet if this can cause real problems, but certainly it looks suspicious. It also definitely shows the potential of built-in debugging tools and I'm going to add some more to QComicBook in the future. Frame View mode, job subsystem, memory usage are just a few top candidates for live introspection. Having them at hand, it will hopefully be much easier to prepare a rock solid QComicBook 1.0.0 :)Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-88718795716673096972012-06-05T09:49:00.000-07:002012-06-05T09:52:52.853-07:00QComicBook UI cleanup, quest for icons<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-sZdjHBcS66U/T841yzOq61I/AAAAAAAADlA/51-P7nsctNQ/s1600/qcomicbook-icons-1.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="138" src="http://2.bp.blogspot.com/-sZdjHBcS66U/T841yzOq61I/AAAAAAAADlA/51-P7nsctNQ/s320/qcomicbook-icons-1.png" width="320" /></a></div>
<a href="http://4.bp.blogspot.com/-crTMD4J-ews/T841zvr0e7I/AAAAAAAADlE/LoIt5HtIhK4/s1600/qcomicbook-icons-2.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="http://4.bp.blogspot.com/-crTMD4J-ews/T841zvr0e7I/AAAAAAAADlE/LoIt5HtIhK4/s200/qcomicbook-icons-2.png" width="180" /></a>As a part of the preparations for QComicBook 1.0.0 (yeah, it should eventually come - it's been 7 years already!) I've started working on UI cleanup. The goal is to make it simple and ditch some useless actions (is anyone using Page top/Page bottom or '5 pages forward'??); target #1 is to clean up the toolbar. Another goal is to make QComicBook UI look like the rest of the desktop, i.e. use system theme icons.<br />
Much to my delight I discovered that Qt supports standard <a href="http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html">desktop icons</a> (be it GNOME, KDE, XFCE...) from version <a href="http://qt-project.org/doc/qt-4.8/qicon.html#fromTheme">4.6</a>! This works well and I was able to quickly test it by replacing some icons with themed icons using Qt Designer. Unsurprisingly there are some icons that just don't exist in standard themes. For most menu actions it's OK to just get rid of them, but toolbar actions must have icons... That means 'Two pages mode', 'Manga mode' and 'Fit to width', 'Fit to height' and alike as a minimum (see first screenshot). Unfortunately existing QComicBook icons stand out too much from pretty much any desktop theme and I need to find or create replacements for them. Suggestions, ideas or contributions anyone?Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com2tag:blogger.com,1999:blog-8579232736983974399.post-76522720129519367692012-06-02T07:51:00.002-07:002012-06-02T07:51:40.271-07:00QComicBook 0.9.0 is availableThis release have seen a lot of delays, but it's finally available. It brings two notable internal changes:<br />
<ul>
<li>switch to Qt GraphicsView framework, leading to more lightweight and flexible page handling implementation. This opens up more possibilities for future tweaks and enhancements.</li>
<li>more robust image transformation code resulting in dramatic improvement
in responsiveness and performance whenever you scale main window, rotate
a page etc; this kind of operations are now performed in a separate thread. If you ever considered QComicBook to be a bit sluggish, give it another chance again and try version 0.9.0!</li>
</ul>
As usual, latest QComicBook releases can be found on <a href="http://qcomicbook.org/">it's home site.</a>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-76178495828755479502012-05-07T13:25:00.002-07:002012-05-07T13:29:02.179-07:00UDS in Oakland, CA has started<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="http://3.bp.blogspot.com/-1d44wx3CBb4/T6gtt45fZKI/AAAAAAAADeA/1y66hLWdLkE/s1600/uds1.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="150" src="http://3.bp.blogspot.com/-1d44wx3CBb4/T6gtt45fZKI/AAAAAAAADeA/1y66hLWdLkE/s200/uds1.jpg" width="200" /></a>Ubuntu Developer Summit has just started today at the City Center Marriott in Oakland, CA. OMG! Ubuntu guys seems to be covering the most important aspects of it <a href="http://www.omgubuntu.co.uk/tag/uds-q/">live</a>.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-62435251541251633952012-03-11T15:10:00.000-07:002012-03-11T15:10:45.650-07:00Playing with Unity Lens: Manual Pages Lens<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-r4hdlwv9CJY/T10fE0DS62I/AAAAAAAADG8/KqAy4Vi2MzM/s1600/manpages-lens-1.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="192" src="http://4.bp.blogspot.com/-r4hdlwv9CJY/T10fE0DS62I/AAAAAAAADG8/KqAy4Vi2MzM/s320/manpages-lens-1.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Unity dash - displaying matching man pages as you type</td></tr>
</tbody></table>
Lenses are in my opinion one of the best features of <a href="http://unity.ubuntu.com/">Unity</a> - they can speed up productivity by providing search functionality for common activities, such as launching applications or accessing recently opened files. Unity provides some lenses by default, but what's more interesting, it provides an <a href="http://developer.ubuntu.com/api/ubuntu-12.04/python/Unity-5.0.html">API</a> that can be used for implementing your own lenses, thus extending Unity's dash functionality.<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://3.bp.blogspot.com/-Qu00MTj7fHI/T10iJSgpgAI/AAAAAAAADHI/OKdcHVy999o/s1600/manpages-lens-2.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="257" src="http://3.bp.blogspot.com/-Qu00MTj7fHI/T10iJSgpgAI/AAAAAAAADHI/OKdcHVy999o/s320/manpages-lens-2.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Yelp displaying selected man page</td></tr>
</tbody></table>
I had been playing with that API a few months ago just for fun, but didn't have anything usable - not until now. I spent a few hours last weekend on adding some missing bits and here it is: <a href="https://launchpad.net/manpages-lens/">Manual Pages Lens</a>. This simple lens provides search functionality for manual pages, based on names and descriptions. It relies on 'apropos' command and provides a fast way for finding manual pages - particulalry useful for developers. Manuals are displayed with <a href="http://projects.gnome.org/yelp/">yelp</a> (standard help browser in Ubuntu), so they are nicely formatted and cross-linked.<br />
Manual Pages Lens package is available from my <a href="https://launchpad.net/~stolowski/+archive/ppa">PPA</a>. It can only be used in Ubuntu 11.10 at the moment since Ubuntu 12.04 (currently in beta) uses a slightly <a href="http://www.grillbar.org/wordpress/?p=585">changed API</a> and I haven't yet ported my lens to it.<br />
By the way, if you don't want to or can't use my lens, you can still open manual pages with Unity dash by hitting ALT+F2 and typing 'man:' followed by a name (e.g. 'man:printf'), and it will bring yelp. Very handy.<br />
<br />
<br />Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com1tag:blogger.com,1999:blog-8579232736983974399.post-44713541052309360502012-03-03T00:32:00.000-08:002012-03-03T00:32:35.262-08:00Joining Canonical<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-5Oc_ddw042Q/T1HW-KCuaXI/AAAAAAAADGw/Gu-taksxOO0/s1600/ubuntu_orange_hex_su.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="90" src="http://1.bp.blogspot.com/-5Oc_ddw042Q/T1HW-KCuaXI/AAAAAAAADGw/Gu-taksxOO0/s320/ubuntu_orange_hex_su.png" width="320" /></a></div>
I'm happy and proud to announce that March 1st marks an important day in my life & career as I've joined <a href="http://www.canonical.com/">Canonical</a> team to work on Unity project and surrounding applications. My main focus will be on Qt-based <a href="https://launchpad.net/unity-2d">Unity 2D</a>, meaning C++, Qt & QML as the primary technologies. Cool stuff. With recent announcements of Ubuntu TV and Ubuntu on Android, and upcoming Ubuntu 12.04 (LTS) it's really great time to join and it all looks very exciting! I'm very happy to work on opensource technologies and in fast-moving and growing project - something I've always dreamed about. It's almost too good to be true!Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-34253533459389787742012-01-31T02:54:00.000-08:002012-01-31T02:54:18.359-08:00Goodbye Ireland!<div style="text-align: left;">
</div>
<a href="http://1.bp.blogspot.com/-vgMGKgF1-Aw/TyfG9vO1v3I/AAAAAAAADD4/k3AfW8Tjlyo/s1600/dublin-1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="http://1.bp.blogspot.com/-vgMGKgF1-Aw/TyfG9vO1v3I/AAAAAAAADD4/k3AfW8Tjlyo/s200/dublin-1.jpg" width="200" /></a>Early in the January 2011 me and my family moved to Dublin and I took position as a Senior Software Engineer with AOL. This was a big decision for my family for lots of reasons, and not an easy one to undertake as you can imagine. Anyway, everything that has a beginning, has an end, and this time the end was not so distant... In late 2011 we decided to return to Poland for personal and family reasons. So, after 13 months I'm back at home in Poland.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Bg1YjUVJ5aE/TyfIA0ckItI/AAAAAAAADEI/y2YqXx-B6Z4/s1600/dublin-2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="http://2.bp.blogspot.com/-Bg1YjUVJ5aE/TyfIA0ckItI/AAAAAAAADEI/y2YqXx-B6Z4/s200/dublin-2.jpg" width="200" /></a></div>
<a href="http://2.bp.blogspot.com/-8wR2PDVz4wU/TyfHT_ujj5I/AAAAAAAADEA/yAnclP-l51s/s1600/dublin-6.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="150" src="http://2.bp.blogspot.com/-8wR2PDVz4wU/TyfHT_ujj5I/AAAAAAAADEA/yAnclP-l51s/s200/dublin-6.jpg" width="200" /></a>The decision of returning was almost equally difficult to that of leaving one year ago, and my last days in Ireland will be the most memorable ones - last night & last few pints with friends from AOL, lots of good words I heard from co-workers, last walk in the city centre etc. It's these moments you actually realise you're loosing something and leaving it behind...<br />
Anyway, it's time to move on. Let me try to summarize the last 13 months:<br />
<b><br /></b><br />
<b>Good things:</b><br />
<div>
<ul>
<li>working for AOL was good.</li>
<li>made a lot of friends at AOL - brilliant people and smart engineers. I'm going to miss you guys!</li>
<li>learned a lot of new technologies such as Erlang and got familiar with cool stuff such as ZeroMq, Thrift, Goole Protocol Buffers (protobuf), NodeJs and others.</li>
<li>worked on the backend of one of the biggest Ad-solutions (ADTECH) & learned how advertisement business on the internet works. This was completly new stuff for me.</li>
<li>Been to PyCon 2011 and listened some amazing talks and lectures from bright people such as Raymond Hettinger or Paul Barry.</li>
<li>Been to one of Google Techology Group monthly talks at Google HQ in Dublin.</li>
<li>Had two wonderful weeks of sunny holidays on Tenerfie / Canary Islands (you wouldn't think I was going to say 'in Ireland', would you? ;)) in the summer.</li>
<li>lived in a quiet and green area of Dublin, in Ashtown (north city), close to Phoenix Park, around 6 kms from cirty centre. Nice area.</li>
<li>Been to a few cost towns - Malahide, Howth, Dalkey to name a few. Very nice places with beautiful views.</li>
<li>improved my English - I think my understanding of English has improved, although some Irish people still give me trouble if they're mumbling ;).</li>
</ul>
<b>Bad things:</b><br />
<div>
<ul>
<li>I'm on the lookout for new job again.</li>
<li>Feeling a bit lost and confused. May take a few weeks to adjust to new (old) reality again ;)</li>
</ul>
</div>
<div>
</div>
That's it, not so many bad things to talk about. Attached are a few photos taken during my last walk in the city centre. Cheers!<b><br /></b></div>
<div>
</div>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com1tag:blogger.com,1999:blog-8579232736983974399.post-63740511085900763372011-12-18T03:38:00.000-08:002011-12-18T03:38:14.191-08:00QComicBook - new web hosting, new domainAfter two years with <a href="http://rootnode.net/">rootnode.net</a> and numerous issues with their hosting I finally made the effort of switching web hosting of QComicBook and my home site. QComicbook web site is now hosted on <a href="http://www.a2hosting.com/refer/31224">www.a2hosting.com</a> - by the way if you decide to buy hosting there, please consider using <a href="http://www.a2hosting.com/refer/31224">this referrer link</a> which will give me a credit for a2hosting services & renewal of QComicBook hosting.<br />Other then that, QComicBook web site is now available at much more friendly URL: <a href="http://www.qcomicbook.org/">www.qcomicbook.org</a>. The old URL (qcomicbook.linux-projects.net) is still valid, but I may remove it by the end of 2012, so if you maintain QComicBook packages or link to source tarballs for any other reason, I suggest you update your links with next QComicBook release.<br />
Finally, please be warned that there may be some disruptions to the qcomicbook.linux-projects.net website (and possibly qcomicbook.org) in the next few days due to DNS and configuration changes.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com1tag:blogger.com,1999:blog-8579232736983974399.post-46791999978298265922011-11-19T04:39:00.001-08:002011-11-19T05:01:31.735-08:00Erlang quick reference cardFor the last couple of months I've been learning <a href="http://www.erlang.org/">Erlang</a> and doing some Erlang programming for a new project at work. I couldn't find any good quick reference card for Erlang (aka cheatsheet), so decided to create something on my own. You can download it from my <a href="https://github.com/stolowski/Erlang-Quick-Reference-Card">github repository</a>.<br />
<br />
As I'm a newbie to Erlang and still learning, I'm sure it has some gaps and possibly errors, so any suggestions and corrections are welcome. Also, the document was created with OpenOffice Writer (plus it's available in PDF format for your convienience), which results in not-so-good look & formatting - my goal was to have something quickly, rather than spending weeks on creating formatting rules in a more suitable tool. My ultimate goal however is to migrate this cheatsheet to <a href="http://www.tug.org/">TeX</a> (<a href="http://www.latex-project.org/">LaTeX</a>) format or similar and find existing macros/rules suitable for quick reference card formating to give it more polished and professional look. If you know any such solutions, please comment.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-3216667255088393702011-09-30T11:59:00.000-07:002011-09-30T11:59:31.523-07:00I'm going to PyCon Ireland 2011!I seldomly do <a href="http://www.python.prg/">Python</a> programming, but when I do, I absolutely enjoy and love it. So I couldn't miss the opportunity to attend Python Conference in Dublin. <a href="http://python.ie/pycon/2011/">PyCon Ireland</a> is organised by Python enthusiasts from Ireland, and will be held here for the 2nd time. The <a href="http://python.ie/pycon/2011/conference/#schedule">schedule</a> looks pretty interesting, it looks like Oct 8-9 will be very fruitful 2 days!Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com2tag:blogger.com,1999:blog-8579232736983974399.post-45841657779991726122011-09-11T10:55:00.000-07:002011-09-11T10:57:12.622-07:00Installing latest Flash Player 11rc on Debian SqueezeHere is a little HOWTO about clean installation of the latest release candidate of Adobe Flash Player 11 on <a href="http://www.debian.org/">Debian</a> Squeeze. It should also work on Ubuntu and other derivatives of Debian.<br />
<br />
The method proposed here uses Debian's <a href="http://wiki.debian.org/DebianAlternatives">Alternatives System</a> which makes it possible to install latest Flash Player in a dedicated directory and switch between it or the default version installed from Debian repository (v10) if needed.<br />
<br />
<ol><li>Install flashplugin-nonfree (standard Debian repository) or flashplayer-mozilla (<a href="http://debian-multimedia.org/">debian-miultimedia</a> repository). This will install Flash Player 10.</li>
<li>Download latest Flash Player for Linux from <a href="http://labs.adobe.com/downloads/flashplayer11.html">Adobe</a>.</li>
<li>Unpack it to<span style="font-family: "Courier New",Courier,monospace;"> /opt/flashplayer-11rc1</span> (or any other directory of your choice).</li>
<li>Add entry for Flash Player 11 in the Alternatives System:<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo update-alternatives --install /usr/lib/mozilla/plugins/flash-mozilla.so flash-mozilla.so /opt/flashplayer-11rc1/libflashplayer.so 0</span></li>
<li>Switch between installed Flash Player versions (will launch interactive menu):<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo update-alternatives --config flash-mozilla.so</span></li>
</ol>Please note that Flash Player tarball contains a few other files that you may find interesting - such as <span style="font-family: "Courier New",Courier,monospace;">flash-player-properties</span> configuration tool. They won't be automatically picked by the above procedure, as <span style="font-family: "Courier New",Courier,monospace;">update-alternatives</span> for <span style="font-family: "Courier New",Courier,monospace;">flash-mozilla.so</span> maintains plugin symlink only. See man page for <span style="font-family: "Courier New",Courier,monospace;">update-alternatives</span> for more information.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com8tag:blogger.com,1999:blog-8579232736983974399.post-29607469573289599702011-08-24T15:16:00.000-07:002011-08-24T15:24:31.728-07:00Stack smashing protector accepted in Arch Linux!If you visit my blog you may recall <a href="http://stolowski.blogspot.com/2010/03/feature-request-enable-stack-smashing.html">I blogged</a> about feature request for enabling stack-smashing protection in Arch Linux. I had created <a href="https://bugs.archlinux.org/task/18864">feature request</a> in Arch Linux bug tracker in March 2010. As you can <a href="https://bugs.archlinux.org/task/18864#comments">see</a> this initiated some discussions and finally, after almost 1,5 year they decided to go for it! The default compilation flags have been changed to use stack protector and main toolchain packages were recompiled; other packages will follow with new releases. For now the change is in<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> [testing]</span> repo and should become available in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">[core]</span> in a few weeks.<br />
<br />
So, rejoice Arch users! Unfortunately me personally will not benefit from it since I stopped using Arch some time ago - GNOME 3.0 release (which <a href="http://stolowski.blogspot.com/2011/05/gnome-30-big-letdown.html">ruined</a> my desktop experience) and power-off issues caused by updates made me look for a more reliable system (which is Debian Squeeze at the moment). I must admit however that I miss Arch a lot, and the acceptance of stack protector reminds me of it...<br />
<br />
BTW, Debian still doesn't take advantage of GCC's stack protector, which is a pitty. Fortunately, Debian security team is aware of this and they plan to enable <a href="http://wiki.debian.org/Hardening">hardening features</a> in Debian Wheezy.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-48318738145126125902011-08-01T03:14:00.000-07:002011-08-01T03:14:18.469-07:00Support QComicBook - buy an ad!<span class="Apple-style-span" style="color: #666666; font-family: Verdana, Tahoma, arial, sans-serif; font-size: 11px; line-height: 16px;"><a href="http://qcomicbook.linux-projects.net/">QComicBook</a> is a free software that doesn't bring me any profits (well, except for fun of course) - actually it costs me money on web hosting. Here is a new way for you to support <a href="http://qcomicbook.linux-projects.net/">QComicBook website</a> & development: if you want to promote your business or a website on QComicBook website, buy a banner for as little as 5-10€ per month (non exclusive banner) or 50-100€/month (exclusive banner - always visible). <b style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Get your website advertised, and support opensource at the same time! </b>Please contact me directly for more details.</span>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com1tag:blogger.com,1999:blog-8579232736983974399.post-30996954498972068662011-07-29T13:07:00.000-07:002011-07-29T13:07:34.915-07:00My dotfiles are on GitHubSince I wanted to have consistent configuration across all the PCs I work on, I've created a git repo with most crucial dotfiles (such as vim config or openbox files). My dotfiles can be found <a href="https://github.com/stolowski/dotfiles">here</a>.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-18976133819593380612011-07-27T15:06:00.000-07:002011-07-28T01:10:24.990-07:00Finding your way in vim<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><a href="http://vim.sf.net/">Vim</a> is quite powerful programmer's editor, but has a very steep learning curve and it takes time to configure it properly. In this tutorial I'd like to share my experiences with configuring vim for efficient symbol, buffer and file navigation. In other words, I'm going to focus on finding these things easily in vim and ignore all other configuration aspects. Getting these things right seems to be the most confusing part for a lot of people who can otherwise use vim already. It's also the part that gives a big efficiency boost when programming or just browsing code, especially when it comes to finding symbol definitions quickly.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Preface</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b><br />
</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">This is by no means a definitive guide on the subject. It' just a bunch of things I learned over years when using vim. Vim evolves, new plugins get developed, so the methods I list here may not neccessarily be the best solutions. But they should work and they do the job for me. These methods should work for pretty much every popular programming language, such as C, C++, Java, Python, Ruby etc.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Looking for symbols</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">A word of caution first: there is no perfect symbol-based navigation for programming languages such as C++ or Java in vim, as vim doesn't perform any syntax analysis of the code. So, for example, it's not possible to go to the right definition of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">foo->bar()</span> in C++ code if there are multiple definitions of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bar() </span>method, because vim has no notion of foo's type.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Tags</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-WrRpvsbVgs4/TjCJ-ATf0OI/AAAAAAAAClk/n9LZ06Y2MrQ/s1600/jumptotag.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="187" src="http://4.bp.blogspot.com/-WrRpvsbVgs4/TjCJ-ATf0OI/AAAAAAAAClk/n9LZ06Y2MrQ/s320/jumptotag.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Jumping to tag with g CTRL-]</td></tr>
</tbody></table><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Vim has a built-in feature for looking for symbols based on so-called tags file. Tags file needs to be created first with ctags utility, e.g:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$ ctags -R /your/source/code</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">This will create tags file in your current directory. Add the following line to your .vimrc file to load tags automatically from current working directory as well as from specific path automatically:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:set tags=./tags,/home/user/your/source/code</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">From now on, you can jump to the first matching symbol definition by pressing CTRL-] over a symbol. CTRL-T will bring you back to where your search started. If there are several matching tags for a symbol (e.g. overloaded methods), you can use :tselect to choose the right one. Even better, if you know in advance there will be multiple matches, press "g CTRL-]" instead of CTRL-] over a keyword to bring the selection list right away. See :help tags for more information on how to use tags effectively.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-tzPV1S_v8ow/TjCJCPJbagI/AAAAAAAAClc/UExTbOn1nuI/s1600/tagbar.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="187" src="http://1.bp.blogspot.com/-tzPV1S_v8ow/TjCJCPJbagI/AAAAAAAAClc/UExTbOn1nuI/s320/tagbar.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Tagbar plugin window</td></tr>
</tbody></table><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Tags list</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">A very useful feature of most IDEs is the list of all classes/methods/symbols for all open files. This can easily be achieved in vim by installing a plugin such as <a href="http://www.vim.org/scripts/script.php?script_id=3465">Tagbar</a> or <a href="http://www.vim.org/scripts/script.php?script_id=273">Taglist</a>. Both have similar capabilites, but I tend to like Tagbar more, as it displays tags ordered by their scope and displays method signatures (unlike Taglist, which displays only names).</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Cscope-based navigation</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Cscope is similiar to ctags, only a bit more powerful since it's capable of searching for functions calling given function etc. To use this capabilities in vim you have to scan you source files with cscope first (e.g. 'cscope -R -b' in your source code directory). Cscope creates a cscope.out file that needs to be loaded in vim by :cscope add /path/to/cscope.out. A common idiom for doing this automatically on vim startup (taken from vim help - see :help cscope) is:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">if filereadable("cscope.out")</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> cs add cscope.out</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> " else add database pointed to by environment</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>elseif $CSCOPE_DB != ""</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span> cs add $CSCOPE_DB</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">endif</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Once loaded, cscope symbol database may be queried by issuing :cscope find with a query type and symbol name, e.g. to search for functions calling given function, type:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:cs find c foobar</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">This is not very convient to type, so you can define mappings for all cscope queries like this:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">nmap <C-\></span><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">c :cs find c <C-R>=expand("<cword>")<CR><CR</span>></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">... and so on.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">If you use tags and cscope at the same time, they are independent of each other, use different keyboard shortcuts and need to be queried separately. This can be solved by using :cstag for symbol defintion lookups: cstag searches both databases (by default cscope is searched first). And if you set cscopetag option, i.e.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:set cscopetag</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">then all tags queries (like CTRL-]) will use :cstag instead, so both databases will be searched. </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-QOuwjBObk_4/TjCJWYo1JII/AAAAAAAAClg/woEm4RGDFt4/s1600/grep.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="187" src="http://2.bp.blogspot.com/-QOuwjBObk_4/TjCJWYo1JII/AAAAAAAAClg/woEm4RGDFt4/s320/grep.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Grep search results</td></tr>
</tbody></table><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Grep-based searching</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Searching for symbols with grep doesn't sound too attractive, but it's actually quite powerful once combined with a handly shortcut key and as long as the symbol you're searching for is not too common.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">First off, I highly recommended installing ack-grep, which is a grep-like utility designed specifically for grepping source code files. Then configure vim to use it instead of regular grep - e.g. put this in your .vimrc:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">set grepprg=ack-grep\ --cpp\ --cc\ --perl\ --python\ --make</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Then define a shortcut key for grep, e.g.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:nmap _g :grep <C-R>=expand("<cword>")<CR><CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Pressing _g will grep source code files recursively, starting from the vim's current working directory, for the word under the cursor. Vim places grep results in so called 'quickfix' window, which you can bring up by calling :cwindow. You can navigate through quickfix entries by calling :cnext and :cprev. It's very usefull to map keys for them as well:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:map <F7> :botright cwindow<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:map <F5> :cprev<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:map <F6> :cnext<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">If grepping in the current directory is not what you want, then you may want to play with 'expand' macro to grep starting from current file's directory, or from a predefined directory and add new shortcuts for them -- here is how to create a Gvim menu entry for them:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:amenu Devel.Grep\ file\ dir :grep <C-R>=expand(expand("<cword>") . " " . expand("%:h"))<CR><CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:amenu Devel.Grep\ source\ dir :grep <C-R>=expand(expand("<cword>") . " " . expand("~/src"))<CR><CR</span>></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Buffer navigation</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Standard vim capabilities for navigating to opened files (buffers) are a bit limited when working with large number of files, so installing external plugin(s) is highly recommended. Just for the record, the standard commands for buffer navigation in vim are:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:ls</span> -- shows buffer list</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:buffers </span>-- same as above</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:bnext </span>-- go to next buffer</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:bprev</span> -- go to previous buffer</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:[N]b</span> -- edit Nth buffer</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">There are several plugins that simplify buffer navigation, but I recommend the following: <a href="http://www.vim.org/scripts/script.php?script_id=42">bufexplorer</a>, <a href="http://www.vim.org/scripts/script.php?script_id=3619">buffergator</a> and <a href="http://www.vim.org/scripts/script.php?script_id=1664">buftabs</a>. Bufexplorer provides a sorted list of all the buffers, which can easily be navigated with cursor keys; pressing ENTER over buffer name makes it active. By default buffers are sorted in MRU (most recently used first) order, but this can easily be changed by pressing 's' in the bufexplorer window. Bufexplorer can be activated by \be, \bv and \bs keyboard shortcuts, but since I use it a lot I prefer a simpler shortcut, e.g. F3 key alone:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:imap <F3> <ESC>:BufExplorer<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:map <F3> :BufExplorer<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Buffergator is similiar, but makes it easy to preview buffers without leaving list of buffers. Upon invocation with \b (or :BuffergatorToggle), a new vertical window with buffers list is opened. CTRL-N, CTRL-P and SPACE keys can be used to navigate the list and preview buffers. ENTER key over buffer name opens it for editing and closes buffer list. One problem buffergator has is its slow response time on invocation: for some reason it takes 1-2 seconds to bring the list of buffers up, whereas it's instantaneous with bufexplorer.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Buftabs is a littler helper addon that is worth installing alongside bufexplorer and/or buffergator. It provides a tabs-like list of buffers displayed in the bottom of the window which is very handy for switch buffers in a circular way, in particular if you map :bprev and :bnext to keys such as CTRL-Left and CTRL-Right:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:noremap <C-left> :bprev<CR> </span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:noremap <C-right> :bnext<CR></span> </div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>File navigation</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">The standard way for finding files is via :Explore [DIR] (or :edit [DIR] and :edit [FILE]). They both support filename completion with TAB key. Explore may be used to find files recursively, if you know only part of a file name, e.g:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:Explore **/*foo*</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">If you know complete file name, but not its path, you can use vim's built-in find command, e.g:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">:find foobar.cpp</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">This will search for the file in all paths listed in vim's 'path' variable, which is current directory and /usr/include by default. You may want to set to also include subdirectories of your sources directory, for example:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:set path=.,~/src/**,/usr/include,,</span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Vim's path variable has one more use: it allows for opening files whose name is under or after the cursor. A typical use case is opening an included file in C/C++ source code, by moving over file name in the #include directive, and pressing 'gf' (goto file). Quite handy.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">There are plugins which make finding files easier. One of the most useful is <a href="http://www.vim.org/scripts/script.php?script_id=1658">NERDTree</a>, which implements a nice filesystem explorer in the form of a tree structure. It's very fast (uses caching), configurable (screen position, list of file patterns to be ignored etc. can be adjusted) and smart (e.g. remembers last cursor position when toggling off and on). It's so useful that its worth having a dedicated keyboard shortut for it, e.g.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:imap <F4> <ESC>:NERDTreeToggle<CR></span></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:map <F4> :NERDTreeToggle<CR</span>></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Conclusion</b></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">The above tips should improve your day-to-day productivity a lot when programming. Go use it, learn it and improve. And let me know in the comments about your ideas and improvements!</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com14tag:blogger.com,1999:blog-8579232736983974399.post-69448941242834317942011-07-03T02:20:00.000-07:002011-07-03T02:27:19.564-07:00QComicBook 0.8.0 released, brings PDF support<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-XPaFxWuh9As/ThAz_3BEs9I/AAAAAAAACXI/Uf9jqgzkxcI/s1600/Screenshot-QComicBook+-+commentary_on_the_sixth_edition_unix.pdf.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="206" src="http://1.bp.blogspot.com/-XPaFxWuh9As/ThAz_3BEs9I/AAAAAAAACXI/Uf9jqgzkxcI/s320/Screenshot-QComicBook+-+commentary_on_the_sixth_edition_unix.pdf.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">QComicBook - reading PDF document</td><td class="tr-caption" style="text-align: center;"><br />
</td></tr>
</tbody></table>The new version of <a href="http://qcomicbook.linux-projects.net/">QComicBook</a> 0.8.0 has just been released! Due to limited time, real life and laziness I've decided to reduce the list of <a href="http://stolowski.blogspot.com/2010/12/work-on-qcomicbook-080.html">planned features</a> for this release to just one: PDF support. The main big feature - switching to <a href="http://doc.qt.nokia.com/4.6/graphicsview.html">Graphics View Framework</a> - has been postponed due to drawing bugs that still needs resolving. This stuff will be introduced later, so no worries!<br />
<br />
By the way, if you like QComicBook, you can show your appreciation by making small donation (e.g. a beer worth ;)) - it's really easy with <a href="http://flattr.com/thing/72360/QComicBook-project">Flattr</a>!Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com2tag:blogger.com,1999:blog-8579232736983974399.post-80962869836728252962011-06-16T14:28:00.000-07:002011-06-17T12:11:00.004-07:00Debian 6.0: encrypting /home partition after installation<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-7E33wBV_mgY/Tfp0HLFbIkI/AAAAAAAACWs/te5XT9w5t5Y/s1600/DSC07151.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="204" src="http://2.bp.blogspot.com/-7E33wBV_mgY/Tfp0HLFbIkI/AAAAAAAACWs/te5XT9w5t5Y/s320/DSC07151.JPG" width="320" /></a></div>Debian installer provides an easy way of creating encrypted disk volumes during installation, including encrypted root partition. However, if you skip this step and decide to encrypt a disk partition later, you need to perform manual setup. Fortunately, it's not too difficult. The following steps cover creating an encrypted /home, so you need to have a separate disk partition for it. Encrypting root filesystem is more sophisticated and it's not covered by this tutorial.<br />
<br />
<ol><li>Install cryptsetup: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">apt-get install cryptsetup</span></li>
<li>Backup current /home contents and unmount the partition.</li>
<li>Create encrypted <a href="http://code.google.com/p/cryptsetup/">LUKS</a> partition: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">cryptsetup luksFormat /dev/sda2</span> (replace sda2 with your partion name).</li>
<li>Open LUKS partition and map it to 'crhome' (this name can be arbitrary): <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">cryptsetup luksOpen /dev/sda2 crhome</span></li>
<li>Format encrypted partition, e.g.: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mkfs.ext4 /dev/mapper/crhome</span></li>
<li>Mount it: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mount /dev/mapper/crhome /home</span></li>
<li>Restore /home contents from the backup.</li>
<li>Recreate initrd: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">update-initramfs -u</span></li>
<li>Create /etc/crypttab entry for encrypted volume:<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"># <target name=""><span class="Apple-tab-span" style="white-space: pre;"> </span><source device=""></source><span class="Apple-tab-span" style="white-space: pre;"> </span><key file=""><span class="Apple-tab-span" style="white-space: pre;"> </span><options><br />
crhome /dev/sda2 none luks</options></key></target></span></li>
<li>Change /etc/fstab entry for /home, .e.g:<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/dev/mapper/crhome /home ext4 defaults 0 2</span></li>
<li>Reboot!</li>
</ol><div>During system startup you will be prompted for password to access LUKS volume. If you have <a href="http://www.freedesktop.org/wiki/Software/Plymouth">Plymouth</a> installed, you'll see a nice graphical password prompt - see the screenshot. For more documentation, including Debian-specific docs, got to /usr/share/doc/cryptsetup and cryptsetup/crypttab man pages.</div>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com6tag:blogger.com,1999:blog-8579232736983974399.post-11067630634290250632011-05-29T07:12:00.000-07:002011-05-29T07:15:29.759-07:00GNOME 3.0 = big letdown<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-QiwBjK44Wbc/TeJU64ojBnI/AAAAAAAACRU/iYqy3YN0z5Y/s1600/app_list.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="180" src="http://1.bp.blogspot.com/-QiwBjK44Wbc/TeJU64ojBnI/AAAAAAAACRU/iYqy3YN0z5Y/s320/app_list.png" width="320" /></a></div>The GNOME project has just released <a href="http://www.gnome.org/gnome-3/">GNOME 3</a> - a major overhaul of this popular desktop environment - which promises a new, beautiful and improved interface and a shift in the way users access their desktop. I've been using GNOME 2.x for a few years already and had really high hopes about the upcoming release. Unfortunately, all I got is a big letdown.<br />
<br />
The key features I loved about GNOME 2 were its simplicity, configurability, extensibility and <b>stability</b>. This is no longer the case with new GNOME. GNOME developers did what KDE developers did a few years ago, by replacing KDE 3.5 with KDE 4.0: they have rewritten their desktop and dropped tons of features to provide "new desktop experience". I don't mind GNOME Shell - in fact I find some of its aspects quite appealing - I just miss the freedom and flexibility of GNOME 2. In GNOME 3 configurable panels are gone, existing panel applets are gone (well, most of them - all the bonobo-based), apperance settings are gone, gdm settings are not configurable (GDM setup tool had been removed a long time ago, around gnome 2.28 and it is still not available). Not to mention that GNOME 3.0 in its current shape is not really stable and I found some irritating bugs in Gnome Shell after using it just for around one hour.<br />
<br />
<div>Some of the missing features will probably be provided by 3rd party tools that I'm sure will fill the vacuum sooner or later, but I'm afraid that reaching the functionality and stability offered by GNOME 2 may need a few development cycles. This makes me a little bit concerned about the state of Linux desktop in the next 1-2 years: with immature GNOME 3 and Ubuntu/Unity abandoning GNOME, the only viable option is to stick with a distribution that still supports GNOME 2, or move to <a href="http://xfce.org/">XFCE</a>. The current state of affairs may be a big chance for the latter, by the way.u<br />
<br />
After testing GNOME 3 & XFCE 4.8 in Arch Linux for a few days, I've sadly decided to abandon <a href="http://www.archlinux.org/">Arch Linux</a>... The disadvantage of running a rolling distro is that updates such as GNOME 3 are just rolled out and you either accept it or refuse them (and stop getting security updates at the same time)... And for all these reasons I decided to move to Debian 6.0 (Squeeze) and stick with it for a while... Let's see how GNOME 3 and Unity develop. Maybe by the time of next Debian stable GNOME 3 becomes really usable?</div>Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-81180659508381324002011-05-29T06:38:00.000-07:002011-05-29T06:39:19.724-07:00Fixing usb drives automount issue in Debian 6.0<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-0R9mNXByfxA/TeJLyY1JzvI/AAAAAAAACRI/tPGV65n3Fuo/s1600/debian-automount.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="176" src="http://3.bp.blogspot.com/-0R9mNXByfxA/TeJLyY1JzvI/AAAAAAAACRI/tPGV65n3Fuo/s320/debian-automount.png" width="320" /></a></div>If you happened to experience issues with auto-mounting of USB hard disks in <a href="http://www.debian.org/">Debian 6.0</a>, like the one on the attached screenshot, then read on as this is very easy to fix. The problem is caused by an improper entry in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/etc/fstab</span> created by Debian installer: if you've installed Debian from a USB disk, then a "cdrom" entry pointing to that drive could have been created in fstab, e.g.<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/dev/sdb1 /media/cdrom0 udf,iso9660 user,noauto 0 0</span><br />
<br />
Just remove such entry and you're done! Note: I experienced this issue when installing Debian 6.0 iso. Chances are this issue was corrected by Debian 6.0.1a (or later) iso, but I haven't verified this.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com2tag:blogger.com,1999:blog-8579232736983974399.post-85054721969936873852011-04-28T14:43:00.000-07:002011-04-28T14:50:02.810-07:00Protect your Linux box against fork-bomb and faulty apps DoSMany (most? all?) default Linux installations of popular distros are still vulnerable to fork-bombs, i.e. can easily be rendered unusable (until reboot) by spawning a large number of processes. You can easily test how your system behaves with well known fork-bomb for bash:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">:(){ :|: & };:</span><br />
<br />
Keep in mind that this problem can easily be triggered by a programming error or misusing an application. For example, I encountered it once when rebuilding a Makefile-based project while having CDPATH environment variable set in a way, that resulted in recursive calls to make program in an infinite loop. When that kind of problem happens, it may be hard to regain control and rebooting the system may be the only option.<br />
Fortunately, Linux has measures to protect against such problems and it's very easy to set up. The best way to go is to relay on pam_limits module, configured via /etc/security/limits.conf. It's probably installed by default by all popular Linux distributions (I've tested it on Arch Linux and Ubuntu). Limiting the number of processes to 240 for given user is as simple as:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">pawel hard nproc 240</span><br />
<br />
With such setting, logout and login back and verify it has been activated:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">[pawel@pc ~]$ ulimit -u</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">240</span><br />
<br />
Then run a fork bomb again. It should now reach the limit of concurrent processes very quickly while still leaving a lot of spare system resources, so that you can easily deal with the problem.<br />
<br />
Just a remark: set the nproc limit to a reasonable value, i.e. examine your typical desktop environment first to estimate typical loads and add a safe margin. For example, a typical GNOME desktop with a few applets can easily create around 50 processes, so keep this in mind.<br />
<br />
See 'man limits.conf' and 'man pam_limits' for more information.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com0tag:blogger.com,1999:blog-8579232736983974399.post-33671423659089467372011-04-10T02:31:00.000-07:002011-04-12T14:35:25.013-07:00QComicBook website is down (again...)QComicBook website (as well as my home page) are down due to web hosting issues... Did I say that <a href="http://rootnode.net/">http://rootnode.net</a> web hosting sucks? I'm going to switch to other web hosting this year. Any suggestions for cheap yet reliable web hosting for Django/Rails sites (low disk space usage, small DB, no traffic limits)?<br />
<br />
UPDATE: it's up again.Pawel Stolowskihttp://www.blogger.com/profile/13012148268146305913noreply@blogger.com1