<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEIARno-cCp7ImA9WhBUF0k.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181</id><updated>2013-05-05T10:35:47.458+01:00</updated><category term="ruby" /><category term="linux" /><category term="plus" /><category term="lxdm" /><category term="calendar" /><category term="flash" /><category term="math" /><category term="mirc" /><category term="english" /><category term="web" /><category term="apple" /><category term="webcam" /><category term="znc" /><category term="i3" /><category term="lisp" /><category term="rvm" /><category term="rhythmbox" /><category term="fermat" /><category term="supertuxkart" /><category term="workspace" /><category term="kde" /><category term="chrome" /><category term="xchat" /><category term="firefox" /><category term="Steve Jobs" /><category term="blogger" /><category term="xkcd" /><category term="css" /><category term="git" /><category term="python" /><category term="grep" /><category term="torrent" /><category term="mac" /><category term="devilspie" /><category term="open" /><category term="irc" /><category term="vim" /><category term="football" /><category term="c++" /><category term="vcs" /><category term="reader" /><category term="nvidia" /><category term="google" /><title>Ward Muylaert</title><subtitle type="html">A blog about the solving of problems in my computer life. (mostly)</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://b.wardje.eu/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://b.wardje.eu/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WardMuylaert" /><feedburner:info uri="wardmuylaert" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Ak8EQ38yfSp7ImA9WhBVFE0.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-3387067938833299987</id><published>2013-04-19T23:00:00.000+01:00</published><updated>2013-04-19T23:00:02.195+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-19T23:00:02.195+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="rvm" /><title>RVM on Arch Linux multilib and it's inability to find gcc and libtool</title><content type="html">&lt;p&gt;Arch repos recently &lt;a href="https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/ruby&amp;id=fde7d56464fbf89a3536e45d66cf747f4e3934a6" title="Arch updated Ruby to 2.0.0 on 2013-03-03"&gt;upped their ruby version to 2.0.0&lt;/a&gt;. A good thing in general, but it slightly messed up a &lt;a href="http://rubyonrails.org/" title="Ruby on Rails"&gt;rails&lt;/a&gt; &lt;a href="http://cursusdienst.net" title="Cursusdienst.net by Scientia Est Potentia"&gt;project&lt;/a&gt; I was working on. Suddenly a bunch of things were broken. A quick Google search later, it was clear that &lt;a href="https://rvm.io/" title="RVM: Ruby Version Manager"&gt;RVM&lt;/a&gt; was the solution to my problems. It was, however, not being very nice to me.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ rvm install ruby-1.9.3-p392
Searching for binary rubies, this might take some time.
No binary rubies available for: arch/libc-2.17/x86_64/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for arch, might require sudo password.
[...]
error: package 'gcc' was not found
error: package 'libtool' was not found
Installing required packages: gcc, libtool......
Error running 'requirements_arch_libs_install gcc libtool',
please read /home/ward/.rvm/log/ruby-1.9.3-p392/1366392891_package_install_gcc_libtool.log&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Essentially, it wasn't finding &lt;code&gt;gcc&lt;/code&gt;. Something I definitely have installed, though it is &lt;em&gt;provided by a different package&lt;/em&gt;, &lt;code&gt;gcc-multilib&lt;/code&gt;, since I am on 64 bit Arch and still need some of the programs that only have a 32 bit version. Luckily I came across &lt;a href="https://github.com/wayneeseguin/rvm/issues/1770" title="'autolibs': RVM install fails on Arch if gcc-multilib package is installed"&gt;this bug report&lt;/a&gt; describing my problem exactly as well as, more importantly, a fix to the issue at hand.&lt;/p&gt;

&lt;p&gt;The fix seems to be targeted for release in RVM 1.20, so there's a good chance all you need to do to fix your issue is &lt;a href="https://rvm.io/rvm/upgrading/" title="RVM: Ruby Version Manager - Upgrading RVM"&gt;update RVM&lt;/a&gt;. If that didn't work, we can go and apply &lt;a href="https://github.com/wayneeseguin/rvm/commit/949f2a1708fa99b389af7c72c8bfd4fd7ae17322" title="improved arch packages detection, fix #1770 · 949f2a1 · wayneeseguin/rvm"&gt;the commit&lt;/a&gt; ourselves already.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ cd ~/.rvm/
$ wget https://github.com/wayneeseguin/rvm/commit/949f2a1708fa99b389af7c72c8bfd4fd7ae17322.diff
$ patch -p1 &lt; 949f2a1708fa99b389af7c72c8bfd4fd7ae17322.diff&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;What this does is go into the RVM folder, download the commit from earlier as a diff file and finally apply it to our folder. Having done this, you should be able to install ruby versions without any problems as described in the RVM documentation.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/JA5xxRT0pGU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/3387067938833299987/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2013/04/rvm-on-arch-linux-multilib-and-its.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3387067938833299987?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3387067938833299987?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/JA5xxRT0pGU/rvm-on-arch-linux-multilib-and-its.html" title="RVM on Arch Linux multilib and it's inability to find gcc and libtool" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2013/04/rvm-on-arch-linux-multilib-and-its.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEAR3g6eyp7ImA9WhBVFEg.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-2337582116856579020</id><published>2013-02-17T21:11:00.000Z</published><updated>2013-04-20T11:10:46.613+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-20T11:10:46.613+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="lisp" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="workspace" /><category scheme="http://www.blogger.com/atom/ns#" term="devilspie" /><title>Default window manager properties using devilspie</title><content type="html">&lt;p&gt;I have two screens attached to my desktop and sometimes I like to pop open &lt;a href="http://xbmc.org/"&gt;XBMC&lt;/a&gt; on the second one to watch something. However, I have &lt;a href="http://b.wardje.eu/2012/08/nvidia-linux-overscan.html"&gt;some issues with overscan on that screen&lt;/a&gt; and trying to fullscreen XBMC on it does not have the intended effects. So I end up having to manually resize XBMC to nicely fit without me having to endure seeing edges or not seeing parts of what I watch.&lt;/p&gt;

&lt;p&gt;Doing this manually every time is a drag. Luckily I'm nerdy enough to look into automating it. I use &lt;a href="http://www.xfce.org/"&gt;Xfce&lt;/a&gt; these days on my desktop and from what I could tell xfwm, its window manager, does not have a built in way of resizing and positioning new windows as they are made. I first had a look into doing what I wanted with a &lt;code&gt;wmctrl&lt;/code&gt; script, but eventually switched out that idea in favour of using a nifty little program called &lt;a href="http://burtonini.com/blog/computers/devilspie"&gt;Devil's Pie&lt;/a&gt; (&lt;code&gt;devilspie&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Devil's Pie is exactly what I needed. It has simple &lt;a href="http://en.wikipedia.org/wiki/Lisp_%28programming_language%29"&gt;Lisp&lt;/a&gt;-based scripts and all the features that I wanted. To start using it, simply create a &lt;code&gt;.devilspie&lt;/code&gt; directory in your &lt;code&gt;$HOME&lt;/code&gt; folder and add &lt;code&gt;.ds&lt;/code&gt; scripts to it as you need them. For my XBMC needs, I added the following script as &lt;code&gt;xbmc.ds&lt;/code&gt;.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;(if
  (or
    (is (application_name) "xbmc.bin")
    (is (application_name) "XBMC Media Center")
  )
  (begin
    (unmaximize)
    (pin)
    (undecorate)
    (geometry "1830x1030+1722+24")
  )
)&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;If you know Lisp or one of its derivatives, you're probably hurrahing at the simplicity by now (and possibly booing at how much newlines I have thrown in) and can skip to the next paragraph. If not, never fear! (well, if you don't know anything whatsoever about programming: fear slightly) We'll quickly step through things. A quick thing to note is that you always want your parentheses matched up and that the first thing after an opening &lt;code&gt;(&lt;/code&gt; is a command or function name, the rest being parameters. The first line starts an if clause. This expects a condition and two branches: one if the condition is true, another if the condition is false. The second branch can be omitted (as is the case here). Our condition is split up in two by means of the or. In other words &lt;code&gt;(or ...)&lt;/code&gt; is the condition. If either part of the &lt;code&gt;(or ...)&lt;/code&gt; is true, the entire condition is met. The &lt;code&gt;(begin ...)&lt;/code&gt; group is our branch if the condition is true. The begin groups all the following commands, running them in order. With that basic knowledge, continue.&lt;/p&gt;

&lt;p&gt;Devil's Pie runs the script against every window, &lt;code&gt;(application_name)&lt;/code&gt; depends on the window currently comparing to and returns, you guessed it, the application name. Note that I compare to both xbmc.bin as XBMC Media Center as it often happens that the XBMC window does not have its proper name yet when Devil's Pie kicks into action. To see this "improper" name for a window you are trying to match, simply look at what Devil's Pie outputs right after you open the window.&lt;/p&gt;

&lt;p&gt;Next, I simply use Devil's Pie's provided commands to change the XBMC window to my liking. I unmaximize it, I pin it to every workspace, I remove the window decoration and finally adjust the size and position using geometry (&lt;code&gt;WIDTHxHEIGHT+X_OFFSET+Y_OFFSET&lt;/code&gt;). There's many more of these kinds of commands available, simply check &lt;code&gt;man devilspie&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To actually have Devil's Pie react to windows opening, it has obviously got to be running. The simplest and cleanest way it probably to just have it running at the start. Check your DE or distribution for your way of adding &lt;code&gt;devilspie&lt;/code&gt; to the start up items. If it wasn't running and you had already opened some windows with special rules, you can always run it as &lt;code&gt;devilspie -a&lt;/code&gt; to also apply things to all windows that are already open.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/WUAQyu-RpzI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/2337582116856579020/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2013/02/default-window-manager-properties-using.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/2337582116856579020?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/2337582116856579020?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/WUAQyu-RpzI/default-window-manager-properties-using.html" title="Default window manager properties using devilspie" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2013/02/default-window-manager-properties-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcEQ3c-fyp7ImA9WhNbGEQ.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-7960000361408022878</id><published>2013-01-22T22:00:00.000Z</published><updated>2013-01-22T22:00:02.957Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-22T22:00:02.957Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="i3" /><title>Randomizing Desktop Background</title><content type="html">&lt;p&gt;Sometimes you just have so many good pictures, that you don't know which one you want to use as your background. This burden of choice can simply be resolved by iterating over all the possibilities. The best of all worlds.&lt;/p&gt;

&lt;p&gt;If you're using a more fleshed out window manager, this might be worked into the functionality already. If, like me, your laptop dates back from your high school days and if, like me, those are indeed long behind you, then you might be using a very simple setup to not strain your hardware. Or you just might prefer things simple. Like me.&lt;/p&gt;

&lt;p&gt;I'm an &lt;a href="http://i3wm.org/"&gt;i3&lt;/a&gt; user myself (on my laptop) and i3 does not even include background setting functionality, let alone iterating over a few of them. Of course, this need not be a problem in the Linux world. Indeed, there is a simple program called &lt;a href="http://feh.finalrewind.org/"&gt;feh&lt;/a&gt; which, beyond being able to be used as an image viewer, can also manage the background for you.&lt;/p&gt;

&lt;p&gt;feh does lack the ability to iterate automatically every so often, but that never stopped anyone. Since feh works from the command line, we can simply use &lt;code&gt;crontab&lt;/code&gt;. We'll also use &lt;code&gt;find&lt;/code&gt; to actually get the files. In my case, my background pictures are located in the folder &lt;code&gt;~/Dropbox/bg/&lt;/code&gt;. To list them I can use &lt;code&gt;find ~/Dropbox/bg/ -name '*.jpg' -o -name '*.png'&lt;/code&gt; and to get a random one out of that list, I can use &lt;code&gt;shuf&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Throwing everything together. Open crontab by issuing &lt;code&gt;crontab -e&lt;/code&gt;, then add the line&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;* * * * *  DISPLAY=:0.0 feh --bg-scale "$(find ~/Dropbox/bg/ -name '*.jpg' -o -name '*.png' | shuf -n1)"&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;This will change the background into something random from the designated folder every minute. The &lt;code&gt;DISPLAY=:0.0&lt;/code&gt; insures feh knows what screen to put the image on. The &lt;code&gt;*&lt;/code&gt; can be adjusted to your needs, see cron manual for precise work on that. Notice that since the find command returns a list of filepaths, you can just as easily create a textfile with all the paths to the pictures you want to use and run that through shuf instead of the find output.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/_oHjHEsf4KA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/7960000361408022878/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2013/01/randomizing-desktop-background.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7960000361408022878?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7960000361408022878?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/_oHjHEsf4KA/randomizing-desktop-background.html" title="Randomizing Desktop Background" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2013/01/randomizing-desktop-background.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEAGSXs_eSp7ImA9WhNWFko.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-4417515324185422234</id><published>2012-12-16T15:45:00.000Z</published><updated>2012-12-16T15:45:28.541Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-16T15:45:28.541Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="chrome" /><category scheme="http://www.blogger.com/atom/ns#" term="flash" /><title>Maximize flash videos on a second screen</title><content type="html">&lt;p&gt;I'm not a big fan of Flash. Linux support is crappy at best and I've never had that great experiences with it on other operating systems either. However, for the time being we're still stuck with it and I end up using it from time to time as well.&lt;/p&gt;

&lt;p&gt;One of those uses is watching videos and if they're any decent quality I tend to want them full screen on my second screen. Clicking provided buttons works ok, &lt;em&gt;unless if you click anywhere on your main screen&lt;/em&gt;. Doing so puts the full screeen flash video back to its regular size. In short: utterly useless.&lt;/p&gt;

&lt;p&gt;Luckily there's a quite simple solution. &lt;a href="https://chrome.google.com/webstore/detail/maximizeflash/lljjmflmcnaigbhnheldbdbplkbhngnl"&gt;MaximizeFlash&lt;/a&gt; is a &lt;a href="http://www.chromium.org/Home"&gt;Chromium&lt;/a&gt;/&lt;a href="https://www.google.com/intl/en/chrome/browser/"&gt;Google Chrome&lt;/a&gt; extension that allows you to &lt;q&gt;resize a webpage flash element to fit the Chrome window size, on the same page or in a new tab&lt;/q&gt;. From there on, it's a simple matter of pressing &lt;kbd&gt;F11&lt;/kbd&gt; to make the window itself go fullscreen. Note that to get back out of fullscreen, you'll most likely have to move your mouse to the center upper part of your screen since Flash is a little bastard that doesn't let your &lt;kbd&gt;F11&lt;/kbd&gt; press go through.&lt;/p&gt;

&lt;p&gt;Addendum: While I mostly use &lt;a href="http://www.mozilla.org/en-US/firefox/new/"&gt;Firefox&lt;/a&gt;, I have grown used to using Chromium for planned Flash usage. Don't shit where you eat.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/XbhU6eMNndY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/4417515324185422234/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/12/maximize-flash-videos-on-second-screen.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/4417515324185422234?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/4417515324185422234?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/XbhU6eMNndY/maximize-flash-videos-on-second-screen.html" title="Maximize flash videos on a second screen" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/12/maximize-flash-videos-on-second-screen.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8ERX8yeSp7ImA9WhNXFUs.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-3993060656348465981</id><published>2012-12-03T20:00:00.000Z</published><updated>2012-12-03T20:00:04.191Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-03T20:00:04.191Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title>Some git tips</title><content type="html">&lt;p&gt;Mostly so I remember them myself.&lt;/p&gt;

&lt;h3&gt;Tags&lt;/h3&gt;

&lt;p&gt;Tagging certain commits comes in handy when wanting to find back for example a certain release or some such. The tagging part is easy.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;# To tag the current HEAD
$ git tag -a v1.0
# To tag an older commit
$ git tag -a v1.0 THECHECKSUM
# For example
$ git log --pretty=oneline
d1a818878187ae8a01239821786ba65aba1ec5e1 math stat - handwritten tem p24
70a59dea8a11c93267996cce31f269287749440d math stat handwritten, one parameter exp family
$ git tag -a v1.0 70a59dea8a11c93267996cce31f269287749440d&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;The part I missed is that tags are not automatically pushed to your remote. For that you need to add &lt;code&gt;--tags&lt;/code&gt; to your push command, this will push all your local tags to the remote.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ git push --tags&lt;/pre&gt;&lt;/code&gt;

&lt;h3&gt;HTTPS Authentication&lt;/h3&gt;

&lt;p&gt;I've been using the HTTPS link to use my &lt;a href="https://github.com/" title="Online project hosting using Git."&gt;github&lt;/a&gt; repo on my laptop, but it kept on asking me for my password on every single pull and push. Git can help you with that since version 1.7.10, by using the credential helper.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;# Turn it on
$ git config --global credential.helper cache
# Set a timeout in seconds (default is 15 minutes)
$ git config --global credential.helper 'cache --timeout=1800'&lt;/pre&gt;&lt;/code&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/5qEHWRkMWYs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/3993060656348465981/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/12/some-git-tips.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3993060656348465981?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3993060656348465981?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/5qEHWRkMWYs/some-git-tips.html" title="Some git tips" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/12/some-git-tips.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08DRXY9fyp7ImA9WhJUEUw.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-5000403432082232457</id><published>2012-09-08T14:44:00.000+01:00</published><updated>2012-09-08T14:44:34.867+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-08T14:44:34.867+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>Initialise python list to a length with default values</title><content type="html">&lt;p&gt;To create a list in python 3 and fill it with default values, you can simply issue&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; [False] * 5
[False, False, False, False, False]&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;This works fine for immutable objects, like a boolean, an int, ... but fails when you use a mutable object like a dictionary, then you should use something similar to (assuming &lt;code&gt;{}&lt;/code&gt; is your dictionary&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; [ {} for i in range(5) ]
[{}, {}, {}, {}, {}]&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Otherwise you get a list with 5 times the &lt;em&gt;same&lt;/em&gt; dictionary. Similarly, assuming you want a two dimensional matrix (5x5) and represent it as a list of lists with default values 0, then watch out with how you create it. To give an example of what can go wrong&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; from pprint import pprint
&amp;gt;&amp;gt;&amp;gt; matrix = [ [0] * 5 ] * 5
&amp;gt;&amp;gt;&amp;gt; pprint(matrix)
[[0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]
&amp;gt;&amp;gt;&amp;gt; matrix[1][1]
0
&amp;gt;&amp;gt;&amp;gt; matrix[1][1] = 1
&amp;gt;&amp;gt;&amp;gt; pprint(matrix)
[[0, 1, 0, 0, 0],
 [0, 1, 0, 0, 0],
 [0, 1, 0, 0, 0],
 [0, 1, 0, 0, 0],
 [0, 1, 0, 0, 0]]
&lt;/pre&gt;&lt;/code&gt;

The problem starts with the outer &lt;code&gt;* 5&lt;/code&gt; since we are at that point multiplying a list, a mutable object. So we get a list of 5 times our inner list and when wanting to change one particular value in our matrix, we actually change that one inner list, making it look like we changed the entire column! Instead use the same tactic as earlier with the dictionary.

&lt;code&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; from pprint import pprint
&amp;gt;&amp;gt;&amp;gt; matrix = [ ([0] * 5) for i in range(5) ]
&amp;gt;&amp;gt;&amp;gt; pprint(matrix)
[[0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]
&amp;gt;&amp;gt;&amp;gt; matrix[1][1] = 1
&amp;gt;&amp;gt;&amp;gt; pprint(matrix)
[[0, 0, 0, 0, 0],
 [0, 1, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0]]
&lt;/pre&gt;&lt;/code&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/AIksLdPIHdw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/5000403432082232457/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/09/initialise-python-list-to-length-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/5000403432082232457?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/5000403432082232457?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/AIksLdPIHdw/initialise-python-list-to-length-with.html" title="Initialise python list to a length with default values" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/09/initialise-python-list-to-length-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMNR3Y4fip7ImA9WhJVEEw.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-8295956348025449003</id><published>2012-08-26T22:18:00.003+01:00</published><updated>2012-08-26T23:01:36.836+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-26T23:01:36.836+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="nvidia" /><title>NVIDIA Linux Overscan</title><content type="html">&lt;p&gt;I was away for a few months and come back to find NVIDIA removed the option to calibrate "overscan" from their driver, in Linux at least, I don't know how things are in Windows land these days.&lt;/p&gt;

&lt;blockquote&gt;* Removed overscan compensation configurability from NV-CONTROL and nvidia-settings. This can be configured, with finer granularity, through the ViewPortIn and ViewPortOut MetaMode attributes. See "Configuring Multiple Display Devices on One X Screen" in the README for details.&lt;/blockquote&gt;

&lt;p&gt;Overscan was useful to fix an issue I have on my second screen. The image was going "beyond" the screen. I could put my mouse upwards and go completely outside of the view, maximized windows would have their titlebar completely out of view, etc. Older NVIDIA settings had an option called "Overscan" and a simple slidebar to adjust things.&lt;/p&gt;

&lt;p&gt;In the current version (304.34 on my ArchLinux box) this option has been removed from the GUI and the new command line options took me a few times to get right. In the end it's obvious, but you have to find it. Especially since the few things I found did not seem to take into account having a second screen.&lt;/p&gt;

&lt;p&gt;To sketch my situation: I have two screens, one is my main screen at 1680x1050, the other has a double use as my TV. NVIDIA reports it as 1920x1080, I keep it to the right of my main screen. It's this second screen that gives me troubles, having areas on all sides of it that are simply invisible. I used to set overscan to "100" and that would fix it for me. I had found the value "100" by simple trial-and-error.&lt;/p&gt;

&lt;p&gt;To adjust to this new method, you have to set the correct &lt;code&gt;MetaModes&lt;/code&gt; in your &lt;code&gt;xorg.conf&lt;/code&gt; file or adjust them on the fly with &lt;code&gt;nvidia-settings&lt;/code&gt;. I will show the solution with &lt;code&gt;nvidia-settings&lt;/code&gt;, though the edit to &lt;code&gt;xorg.conf&lt;/code&gt; should be simple enough to make out with the info provided here. We'll be using the command like this&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;nvidia-settings -a CurrentMetaMode="VALUE"&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Even though I only need to change options for the second screen, I also have to enter values for the first one. If not, NVIDIA will think you're ditching the first screen altogether. First off we need the names of our screens, this information I found in the NVIDIA X Server Settings GUI under the tab "X Server Display Configuration". For me, screen one is &lt;code&gt;DFP-0&lt;/code&gt; and screen two is &lt;code&gt;DFP-1&lt;/code&gt;. Updating our command with this info:&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;nvidia-settings -a CurrentMetaMode="DFP-0: VIEWINFO, DFP-1: VIEWINFO"&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;The &lt;code&gt;VIEWINFO&lt;/code&gt; is of the format &lt;code&gt;widthxheight+offset_width+offset_height&lt;/code&gt;, followed by optional attributes in curly braces. For the first screen, which I want to keep as-is, I make that the following: &lt;code&gt;1680x1050+0+0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For the second screen, I had to use the extra attributes as well. First off we mention the dimension as reported by NVIDIA, as well as the position in relation to the other screen. I wanted it to the right of the first one, so I added the width of the first one (1680) &lt;code&gt;1920x1080+1680+0&lt;/code&gt;. Now to make our overscan adjustment, we use the extra attribute &lt;code&gt;ViewPortOut&lt;/code&gt;. Too convert the earlier mentioned value 100, I assumed this was width pixels (and as far as I can tell now, that assumption was correct). So to adjust my screen, I had to subtract 100 width and 100/16*9=56.25 height, which I rounded to 58 ("/16*9" because the screen ratio is 16:9, rounded to even because of dividing by two further on). This makes for 1820x1022. Now I still had to adjust the screen position &lt;em&gt;within that monitor&lt;/em&gt;. My issue was on each side, so I divided the just calculated values in half to find the offset. That makes 50 and 29. Plugging all this info together gives for my second screen &lt;code&gt;1920x1080+1680+0 { ViewPortOut=1820x1022+50+29 }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Using the info for both our screens, the command to run becomes&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;nvidia-settings -a CurrentMetaMode="DFP-0: 1680x1050+0+0, DFP-1: 1920x1080+1680+0 { ViewPortOut=1820x1022+50+29 }"&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Your screens will briefly go blank after entering this, but should pop back correctly rather soon.&lt;/p&gt;

&lt;p&gt;Note: Some report that there are applications (like MythTV or XMBC) that have troubles with this approach. This trouble should be solved by also specifying &lt;code&gt;ViewPortIn&lt;/code&gt; as a special attribute for the second screen. For example adjusting the previous command (untested).&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;nvidia-settings -a CurrentMetaMode="DFP-0: 1680x1050+0+0, DFP-1: 1920x1080+1680+0 { ViewPortIn=1920x1080, ViewPortOut=1820x1022+50+29 }"&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Some sources and further reading&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://us.download.nvidia.com/XFree86/Linux-x86_64/302.17/README/xconfigoptions.html"&gt;Appendix B. X Config Options&lt;/a&gt;, NVIDIA&lt;/li&gt;
&lt;li&gt;&lt;a href="http://us.download.nvidia.com/XFree86/Linux-x86_64/302.17/README/configtwinview.html"&gt;Chapter 13. Configuring Multiple Display Devices on One X Screen&lt;/a&gt;, NVIDIA&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.pclinuxos.com/forum/index.php?topic=106650.0"&gt;New Nvidia driver - no overscan compensation?&lt;/a&gt;, PCLinuxOS&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.nvnews.net/vbulletin/showthread.php?t=180674"&gt;Removal of overscan options in 302.07...&lt;/a&gt;, nV News&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/HP5nfDk7_tk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/8295956348025449003/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/08/nvidia-linux-overscan.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/8295956348025449003?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/8295956348025449003?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/HP5nfDk7_tk/nvidia-linux-overscan.html" title="NVIDIA Linux Overscan" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://b.wardje.eu/2012/08/nvidia-linux-overscan.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAER3w9cCp7ImA9WhJSFk8.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-733525995610942320</id><published>2012-07-07T03:38:00.000+01:00</published><updated>2012-07-07T03:38:26.268+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-07T03:38:26.268+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="torrent" /><title>Register Protocol in Firefox</title><content type="html">&lt;code&gt;&lt;pre&gt;Firefox doesn't know how to open this address,
because the protocol (SOMETHING)
isn't associated with any program&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;&lt;code&gt;magnet:&lt;/code&gt; links weren't working in Firefox and it finally reached the point where I felt that it deserved fixing. Like most of the things I postpone, I realized I should've just done it sooner. Would've saved me the agony. I'll quickly describe what to do when you want to add the handler for a magnet link, but the procedure is the same for other protocols. Simply replace occurrences of &lt;code&gt;magnet&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Go to Firefox' good old &lt;a href="about:config"&gt;about:config&lt;/a&gt; and search for &lt;code&gt;network.protocol-handler&lt;/code&gt;, then check if the following two settings show. If they don't, add each by right-clicking and selecting &lt;code&gt;New &gt; Boolean&lt;/code&gt;.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;network.protocol-handler.expose.magnet&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Set this one to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;network.protocol-handler.external.magnet&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;And this one to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now next time you click a magnet link, a dialog will open up asking you how to open the link. Go to your favourite torrent client (Transmission, Deluge, rtorrent, ...) and select it. Example for Deluge on Linux: &lt;code&gt;/usr/bin/deluge&lt;/code&gt;. You can make the association permanent (so it doesn't ask you for confirmation every time), by going to Preferences &gt; Applications and selecting your choice.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/tonLndyu1k0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/733525995610942320/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/07/register-protocol-in-firefox.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/733525995610942320?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/733525995610942320?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/tonLndyu1k0/register-protocol-in-firefox.html" title="Register Protocol in Firefox" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/07/register-protocol-in-firefox.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcERHw9cSp7ImA9WhJTGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-6607914982938112944</id><published>2012-06-28T00:00:00.000+01:00</published><updated>2012-06-28T00:00:05.269+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-28T00:00:05.269+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="lxdm" /><category scheme="http://www.blogger.com/atom/ns#" term="i3" /><title>i3 logging and LXDM</title><content type="html">&lt;p&gt;I recently switched back to &lt;a href="http://i3wm.org/" title="i3 is a tiling window manager, the target platforms are GNU/Linux and BSD operating systems, the code is Free and Open Source Software (FOSS) under the BSD license."&gt;i3&lt;/a&gt;, having tried it out briefly (a day or two at most) in the past. In conjunction with that switch, I moved from &lt;a href="http://projects.gnome.org/gdm/" title="GNOME Display Manager"&gt;GDM&lt;/a&gt; to &lt;a href="http://wiki.lxde.org/en/LXDM" title="Lightweight Display Manager for LXDE"&gt;LXDM&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After encountering some issues and wanting to fix them, I noticed i3's &lt;code&gt;i3-dump-log&lt;/code&gt; wasn't actually working for me. Some searching later, I found i3's logs in &lt;code title="This is on Arch Linux, YMMV."&gt;/var/log/lxdm.log&lt;/code&gt;. However, I wanted them separate from other output generated by LXDM and what else that ended up in there.&lt;/p&gt;

&lt;p&gt;Checking &lt;a href="http://i3wm.org/docs/debugging-release-version.html" title="Debugging i3: How To (release version)"&gt;i3's debug page&lt;/a&gt; mentioned piping the output of i3 to your own file.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;i3 &amp;gt;~/i3log-$(date +'%F-%k-%M-%S') 2&amp;gt;&amp;amp;1&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Wanting to combine it with my new found knowledge of &lt;a href="http://b.wardje.eu/2012/06/editing-sessions-in-lxdm.html" title="Editing sessions in LXDM"&gt;LXDM sessions workings&lt;/a&gt; however proved to be unsuccessful. I don't think &lt;code&gt;.desktop&lt;/code&gt; files allow the piping around, or I was just doing it completely wrong.&lt;/p&gt;

&lt;p&gt;So instead I wrapped the starting up of i3 into a &lt;em&gt;very&lt;/em&gt; basic bash file. All it does, literally, is call up i3, but with output piping to the place I want. I've added a bunch of comments, in essence only the first and last line are needed. Also note that I changed the output file location to be in &lt;code&gt;~/.i3/logs/&lt;/code&gt; instead of straight in the &lt;code&gt;$HOME&lt;/code&gt; folder.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;#!/bin/sh

# Version 0.3 2012-06-26
# Change output to files in directory ~/.i3/logs/
# Version 0.2 2012-06-26
# Remove verbosity (-V) and -d all
# Version 0.1 2012-06-26

# A wrapper to put into /usr/share/xsessions/i3.desktop since I can't
# seem to do piping within the .desktop file.

# -V: verbose mode
# -d all: debug output with all logging
# &amp;gt;~/i3log-...: Redirect stdout into that file
# 2&amp;gt;&amp;amp;1: Redirect stderr to stdout (which then redirects to the file)
#i3 -V -d all &amp;gt;~/.i3/logs/i3log-$(date +'%F-%k-%M-%S') 2&amp;gt;&amp;amp;1
i3 &amp;gt;~/.i3/logs/i3log-$(date +'%F-%k-%M-%S') 2&amp;gt;&amp;amp;1&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Save that file where ever you like and mark it as being executable (&lt;code&gt;chmod +x FILE&lt;/code&gt;). Now edit or add your &lt;code&gt;.desktop&lt;/code&gt; file as explained in the &lt;a href="http://b.wardje.eu/2012/06/editing-sessions-in-lxdm.html" title="Editing Sessions in LXDM"&gt;previous blog post&lt;/a&gt;, putting the file you just made as the value for &lt;code&gt;Exec&lt;/code&gt;. For completeness sake, here is mine.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;[Desktop Entry]
Encoding=UTF-8
Name=i3
Comment=improved dynamic tiling window manager
Exec=/home/ward/bin/start_i3.sh
Type=XSession&lt;/pre&gt;&lt;/code&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/5lLxFoqlfiQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/6607914982938112944/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/06/i3-logging-and-lxdm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/6607914982938112944?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/6607914982938112944?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/5lLxFoqlfiQ/i3-logging-and-lxdm.html" title="i3 logging and LXDM" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/06/i3-logging-and-lxdm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYER3Y5cSp7ImA9WhJTF08.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-866638158557538343</id><published>2012-06-26T17:00:00.000+01:00</published><updated>2012-06-26T17:28:26.829+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-06-26T17:28:26.829+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="lxdm" /><title>Editing sessions in LXDM</title><content type="html">&lt;p&gt;After a recent switch to &lt;a href="http://wiki.lxde.org/en/LXDM" title="LXDM - Lightweight display manager for LXDE"&gt;LXDM&lt;/a&gt;, I wondered where LXDM read its sessions from and how to edit them or add my own. The solution wasn't nicely documented as far as I could tell, but easy enough in the end.&lt;/p&gt;

&lt;p&gt;LXDM finds what it needs in the &lt;a href="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html" title="Desktop Entry Specification"&gt;&lt;code&gt;.desktop&lt;/code&gt;&lt;/a&gt; files in the folder &lt;code title="This is on Arch Linux, YMMV."&gt;/usr/share/xsessions/&lt;/code&gt;. You can either add your own files in this folder or edit one of the ones present. Basic example of the structure of one of these files is as follows.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;[Desktop Entry]
Encoding=UTF-8
Name=i3
Comment=improved dynamic tiling window manager
Exec=i3
Type=XSession&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;i3 and Openbox both seem to use &lt;code&gt;XSession&lt;/code&gt; as the &lt;code&gt;Type&lt;/code&gt; here, while GNOME and XFCE both have &lt;code&gt;Application&lt;/code&gt;. The spec would suggest &lt;code&gt;Application&lt;/code&gt; is the correct thing to use. Not that GNOME or XFCE will have a much bigger file with translations and all that, but this seems to be enough to get going.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/T-wPFumx0EM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/866638158557538343/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/06/editing-sessions-in-lxdm.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/866638158557538343?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/866638158557538343?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/T-wPFumx0EM/editing-sessions-in-lxdm.html" title="Editing sessions in LXDM" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/06/editing-sessions-in-lxdm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAERnw-fyp7ImA9WhVWFkw.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-2804841194178841004</id><published>2012-04-28T14:11:00.000+01:00</published><updated>2012-04-28T14:11:47.257+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-28T14:11:47.257+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rhythmbox" /><title>Rhythmbox losing track of files after change in mount point</title><content type="html">&lt;p&gt;Ok, this one is &lt;em&gt;very&lt;/em&gt; specific, but if anyone out there has a similar problem, maybe they'll stumble upon this post. I am a &lt;a href="http://projects.gnome.org/rhythmbox/" title="Rhythmbox is an integrated music management application, originally inspired by Apple's iTunes. It is free software, designed to work well under the GNOME Desktop, and based on the powerful GStreamer media framework. "&gt;Rhythmbox&lt;/a&gt; user these days, having recently switched back to &lt;a href="http://www.gnome.org/"&gt;GNOME&lt;/a&gt; from &lt;a href="http://www.kde.org/"&gt;KDE&lt;/a&gt; (not to mention I never really liked &lt;a href="http://amarok.kde.org/"&gt;Amarok&lt;/a&gt;, KDE's default). Furthermore, one of the more recent updates (I believe a GNOME update), changed the mountpoint of my harddrives from &lt;code&gt;/media/DRIVE/&lt;/code&gt; to &lt;code&gt;/run/media/$USER/DRIVE/&lt;/code&gt;. This caused some annoyances for my Rhythmbox library. Let me elaborate.&lt;/p&gt;

&lt;p&gt;I have Rhythmbox watch my homefolder's &lt;code&gt;~/music&lt;/code&gt; for any audio files so they automatically get added without hassle on my end. (Save for bad metadata I guess, but let's keep that for another rant) I also have audio files in a folder on another harddrive however, so when I started to use Rhythmbox, I simply made a symlink to that folder inside &lt;code&gt;~/music&lt;/code&gt; and was done with it.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ ls -l ~/music
lrwxrwxrwx 1 ward users 32 Feb 15 10:33 warddisk -&gt; /media/warddisk/Muziek/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;As I mentioned earlier, suddenly the default mount point changed. Instead of my awesomely named &lt;code&gt;warddisk&lt;/code&gt; appearing in &lt;code&gt;/media/warddisk/&lt;/code&gt;, it now started getting mounted in &lt;code&gt;/run/media/ward/warddisk/&lt;/code&gt;. The problem seemed easy enough to fix, simply change the symlink and Rhythmbox should keep chugging along happily. Right?&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ ls -l ~/music
lrwxrwxrwx 1 ward users 32 Apr 26 17:56 warddisk -&gt; /run/media/ward/warddisk/Muziek/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Wrong! Rhythmbox reported all my files as missing and I was confused, to say the least. After some failures, I did end up finding a way to fix it. You see in the database file that Rhythmbox uses, which is located in &lt;code&gt;~/.local/share/rhythmbox&lt;/code&gt;, there is a mention of a mountpoint besides the obvious mention of a location.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;    &amp;lt;location&amp;gt;file:///home/ward/music/warddisk/Band/Album/song.mp3&amp;lt;/location&amp;gt;
    &amp;lt;mountpoint&amp;gt;file:///media/warddisk&amp;lt;/mountpoint&amp;gt;&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;That mountpoint was still pointing at the old mountpoint! So I simply replaced all occurrences of &lt;code&gt;file:///media/&lt;/code&gt; with &lt;code&gt;file:///run/media/ward/&lt;/code&gt; (just use your favourite text editor), saved my changes and started up Rhythmbox. It's a nice sight to finally see all the "missing files" stream back into your library.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/bA7U-sMjAw4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/2804841194178841004/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/04/rhythmbox-losing-track-of-files-after.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/2804841194178841004?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/2804841194178841004?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/bA7U-sMjAw4/rhythmbox-losing-track-of-files-after.html" title="Rhythmbox losing track of files after change in mount point" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/04/rhythmbox-losing-track-of-files-after.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMAQHczfCp7ImA9WhVXEEo.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-7716473845488119423</id><published>2012-04-10T18:19:00.000+01:00</published><updated>2012-04-10T18:20:41.984+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-10T18:20:41.984+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c++" /><category scheme="http://www.blogger.com/atom/ns#" term="vim" /><title>Vim and Ctags</title><content type="html">&lt;p&gt;While working on &lt;a href="http://supertuxkart.sourceforge.net/Main_Page" title="SuperTuxKart - Free 3D kart racing game, with many tracks, characters and items for you to try."&gt;SuperTuxKart&lt;/a&gt;, I tend to use &lt;a href="http://www.vim.org/"&gt;vim&lt;/a&gt;. Wonderful as it may be when you get into a good flow with your favourite editor, default vim is lacking in some ends. One of those is more easily navigating through bigger source files and projects.&lt;/p&gt;

&lt;p&gt;To solve this, just install &lt;a href="http://ctags.sourceforge.net/" title="Exuberant Ctags"&gt;Ctags&lt;/a&gt; using your favourite method. For example, in Arch Linux it's a simple &lt;code&gt;pacman -S ctags&lt;/code&gt;. This program goes through your source files and parses out functions, macros, ... which it then puts into a file called &lt;code&gt;tags&lt;/code&gt;. Vim can use this tags file to allow you to navigate through your project more easily.&lt;/p&gt;

&lt;p&gt;I'll show by example, using it on SuperTuxKart's &lt;code&gt;src/&lt;/code&gt; folder, which contains all the C++ files. Start out by generating the &lt;code&gt;tags&lt;/code&gt; file.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;ctags -R ./src/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Now we have a file &lt;code&gt;./tags&lt;/code&gt; that has all the info about our &lt;code&gt;./src/&lt;/code&gt; folder's files. However, vim has to still find the tags file. If we open &lt;code&gt;./src/karts/kart.hpp&lt;/code&gt;, then we want it to still use our generated tags file a few directories up. For this, we add the following lines to our &lt;code&gt;~/.vimrc&lt;/code&gt;&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;" Searches for tags file in current folder and works its way up to
" root looking for one.
set tags=./tags;/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Lines in &lt;code&gt;.vimrc&lt;/code&gt; starting with a &lt;code&gt;"&lt;/code&gt; are comments, be sure to keep them in so future you will still be sure what the line does.&lt;/p&gt;

&lt;p&gt;Now all that is done, we'll also want to actually use some of the features it provides. Here is a non-exhaustive list of handy keyboard shortcuts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;kbd&gt;CTRL&lt;/kbd&gt;+&lt;kbd&gt;]&lt;/kbd&gt; while the cursor is on a function, will bring you to the definition of that function.&lt;/li&gt;
&lt;li&gt;&lt;kbd&gt;CTRL&lt;/kbd&gt;+&lt;kbd&gt;T&lt;/kbd&gt; will take you back to where the function was called.&lt;/li&gt;
&lt;li&gt;&lt;kbd&gt;CTRL&lt;/kbd&gt;+&lt;kbd&gt;\&lt;/kbd&gt; opens the definition in a new tab.&lt;/li&gt;
&lt;li&gt;&lt;kbd&gt;ALT&lt;/kbd&gt;+&lt;kbd&gt;]&lt;/kbd&gt; opens the definition in a vertical split in the same window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're not done yet! Moving around like that is a start, but sometimes you want an overview of the functions in the file you're looking at. Fear not, you aren't alone and the functionality is a plugin away. Simply download &lt;a href="http://www.vim.org/scripts/script.php?script_id=273"&gt;taglist.vim&lt;/a&gt; and unzip the zip file you get into &lt;code&gt;~/.vim/&lt;/code&gt;. Now when using vim, you can open a left pane list of functions, macros, ... of the file you're working with. Simply type &lt;code&gt;:TlistOpen&lt;/code&gt; to open it up.&lt;/p&gt;

&lt;p&gt;No doubt there's much more that can be done with the mentioned plugin and ctags functionality, but this post was deliberately made to just give a quick intro to future me, as well as the random reader who happens onto my blog.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/ypBj3SlC-CE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/7716473845488119423/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/04/vim-and-ctags.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7716473845488119423?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7716473845488119423?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/ypBj3SlC-CE/vim-and-ctags.html" title="Vim and Ctags" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/04/vim-and-ctags.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcEQX89fip7ImA9WhVRFkU.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-1787159415452704031</id><published>2012-03-25T13:51:00.001+01:00</published><updated>2012-03-25T13:53:20.166+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-25T13:53:20.166+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="supertuxkart" /><title>GPs Against Time in SuperTuxKart</title><content type="html">&lt;p&gt;To win a Grand Prix in &lt;a href="http://supertuxkart.sourceforge.net/Main_Page" title="SuperTuxKart - a free 3D kart racing game"&gt;SuperTuxKart&lt;/a&gt;, you gather points based on your ending position over a few races. I felt like trying something different, by making your &lt;em&gt;time&lt;/em&gt; the most important and the points, in essence, irrelevant.&lt;/p&gt;

&lt;p&gt;You can do this easily enough by going to your SuperTuxKart data folder (depends on where you installed it etc, look around in the usual suspects for your operating system). In it, you will find the file &lt;code&gt;stk_config.xml&lt;/code&gt;. Open it in your favourite text editor and look for the following three lines.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;    &amp;lt;points from="1" to="2" points="3"/&amp;gt;
    &amp;lt;points from="3" to="4" points="2"/&amp;gt;
    &amp;lt;points from="5"        points="1"/&amp;gt;&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Change the &lt;code&gt;points="3"&lt;/code&gt; (and 2 and 1) to &lt;code&gt;points="0"&lt;/code&gt;. Save, start SuperTuxKart and play a Grand Prix to see the result.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/c9F_OYiiUcc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/1787159415452704031/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/03/gps-against-time-in-supertuxkart.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1787159415452704031?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1787159415452704031?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/c9F_OYiiUcc/gps-against-time-in-supertuxkart.html" title="GPs Against Time in SuperTuxKart" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/03/gps-against-time-in-supertuxkart.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMEQX4_fyp7ImA9WhVSGUo.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-323003704314594750</id><published>2012-03-17T10:00:00.000Z</published><updated>2012-03-17T10:00:00.047Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-17T10:00:00.047Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><title>Stop Firefox From Loading On Middle Click</title><content type="html">&lt;p&gt;I don't know if this is default behaviour on all platforms, but when middle clicking on a web page in &lt;a href="http://www.mozilla.org/en-US/firefox/fx/"&gt;Firefox&lt;/a&gt;, it will load the URL on the clipboard (if any). I find this pretty annoying, because I use middle clicking &lt;em&gt;a lot&lt;/em&gt; to open URLs in new tabs. Making a miss click potentially erases an entire form I had been filling out (you can guess I actually just had this happen). Luckily like just about everything in Firefox, you can customize this behaviour!&lt;/p&gt;

&lt;p&gt;Just go to good old &lt;a href="about:config"&gt;&lt;code&gt;about:config&lt;/code&gt;&lt;/a&gt; and change the value of &lt;code&gt;middlemouse.contentLoadURL&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; by double clicking on it. In a quick and easy fix as that, my clumsiness will no longer be punished dramatically.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/Dtq5bk6z0yM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/323003704314594750/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/03/stop-firefox-from-loading-on-middle.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/323003704314594750?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/323003704314594750?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/Dtq5bk6z0yM/stop-firefox-from-loading-on-middle.html" title="Stop Firefox From Loading On Middle Click" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/03/stop-firefox-from-loading-on-middle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYBQ3c-cSp7ImA9WhVSF08.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-1775375172961423812</id><published>2012-03-14T11:02:00.002Z</published><updated>2012-03-14T11:05:52.959Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-03-14T11:05:52.959Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="grep" /><title>Find line in files with grep</title><content type="html">&lt;p&gt;Probably one of them no brainers for a lot of people, but &lt;a href="http://www.gnu.org/software/grep/manual/"&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/a&gt; is pretty good at what it does. Finding text in files. Given the right options, you  can easily use it to find what you need in big batch of source files. An example.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;$ grep -RIn 'get(bool' src/
src/guiengine/widgets/label_widget.hpp:55:        LabelWidget(bool title=false, bool bright=false);
src/guiengine/widgets/label_widget.cpp:39:LabelWidget::LabelWidget(bool title, bool bright) : Widget(WTYPE_LABEL)
src/io/xml_node.cpp:363:}   // get(bool)&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Now if you've also set &lt;code&gt;--color=auto&lt;/code&gt; (always handy and definitely part of my &lt;a href="https://github.com/Wardje/dotfiles"&gt;.bashrc&lt;/a&gt;), then the different parts will get different colours which makes it even quicker to parse out the good stuff in your head. Ignoring that, as you can see you get the file the text was found in as well as the line number it was found at. What more do you need? For completeness, let me quote the &lt;code&gt;man&lt;/code&gt; pages about what every option does.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;       -I     Process a binary file as if it did not contain matching data; this is equivalent to the --binary-files=without-match option.
       -R, -r, --recursive
              Read all files under each directory, recursively; this is equivalent to the -d recurse option.
       -n, --line-number
              Prefix each line of output with the 1-based line number within its input file.  (-n is specified by POSIX.)&lt;/pre&gt;&lt;/code&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/A_UCihJSAdU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/1775375172961423812/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/03/find-line-in-files-with-grep.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1775375172961423812?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1775375172961423812?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/A_UCihJSAdU/find-line-in-files-with-grep.html" title="Find line in files with grep" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/03/find-line-in-files-with-grep.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08EQHs4eSp7ImA9WhRUGU4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-1369024869367123525</id><published>2012-01-30T13:37:00.000Z</published><updated>2012-01-30T16:10:01.531Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T16:10:01.531Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fermat" /><category scheme="http://www.blogger.com/atom/ns#" term="xkcd" /><category scheme="http://www.blogger.com/atom/ns#" term="english" /><category scheme="http://www.blogger.com/atom/ns#" term="math" /><title>Fermat Thread</title><content type="html">&lt;p&gt;Everyone knows &lt;a href="http://www.xkcd.com/" title="xkcd, A webcomic of romance, sarcasm, math, and language."&gt;xkcd&lt;/a&gt;, an entertaining comic that a lot of us (you know who you are) can relate to. Given its popularity, &lt;a href="http://www.reddit.com/"&gt;reddit&lt;/a&gt;'s users try their best to repost and repost and repost &lt;a href="http://www.reddit.com/search?q=site%3Axkcd.com&amp;restrict_sr=off&amp;sort=relevance"&gt;every single comic&lt;/a&gt; just to get some of that &lt;a href="http://www.reddit.com/r/AskReddit/comments/mqg9v/why_do_i_need_karma_newbie_to_reddit/" title="Heh."&gt;sweet, sweet karma&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of those reposts today was &lt;a href="http://xkcd.com/979/"&gt;xkcd 979&lt;/a&gt;, a comic describing a feeling which most of the people who have looked to the internet for the solution of their problems, have come across. You are stuck on something, you search for it online and come across a forum thread describing &lt;em&gt;exactly&lt;/em&gt; the problem you are experiencing. However, nobody ever answered it. Sometimes there's an even crueller variant where the &lt;abbr title="Original Poster, the topic starter, the guy who asked the question"&gt;OP&lt;/abbr&gt; just mentions "Never mind, I fixed it.".&lt;/p&gt;

&lt;p&gt;One redditor, &lt;a href="www.reddit.com/user/RedDyeNumber4"&gt;RedDyeNumber4&lt;/a&gt;, &lt;a href="http://www.reddit.com/r/linux/comments/p2gud/xpost_from_rcyberpunk/c3m05o9"&gt;mentions a name&lt;/a&gt; for these threads that I find particularly fitting. He uses the term &lt;strong&gt;Fermat Threads&lt;/strong&gt;. This is a joke/reference to &lt;a href="http://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem"&gt;Fermat's Last Theorem&lt;/a&gt;, a theorem conjectured by &lt;a href="http://en.wikipedia.org/wiki/Pierre_de_Fermat"&gt;Pierre de Fermat&lt;/a&gt;  in 1637. He wrote in the margin of a book that he had come up with a proof, but that the margin he had available was too small to write it down. It took mathematicians another &lt;em&gt;358 years&lt;/em&gt; to actually come up with a proof for this theorem. Fermat was, indeed, the predecessor of the forum thread mentioned earlier.&lt;/p&gt;

&lt;p&gt;As such, I hereby propose referring to this kind of thread as a &lt;strong&gt;Fermat Thread&lt;/strong&gt; from now until we manage to somehow get rid of every last one of them.&lt;/p&gt;

&lt;dl&gt;
&lt;dt&gt;Fermat Thread&lt;/dt&gt;
&lt;dd&gt;noun,&lt;br/&gt;
a term for every occurrence where someone in the past has written down the exact same problem as you are currently experiencing, without the problem ever having received a proper solution&lt;/dd&gt;
&lt;/dl&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/GFXzbKYZgUQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/1369024869367123525/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/01/fermat-tread.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1369024869367123525?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1369024869367123525?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/GFXzbKYZgUQ/fermat-tread.html" title="Fermat Thread" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/01/fermat-tread.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAMR34yeSp7ImA9WhRUFEQ.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-7838160327284566387</id><published>2012-01-25T13:04:00.002Z</published><updated>2012-01-25T13:06:26.091Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-25T13:06:26.091Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="irc" /><category scheme="http://www.blogger.com/atom/ns#" term="mirc" /><title>mIRC default colours</title><content type="html">&lt;p&gt;I was wanting to make &lt;a href="https://github.com/Wardje/xchat-scripts/blob/master/flag.py"&gt;some country flags&lt;/a&gt; in &lt;a href="http://xchat.org/"&gt;XChat&lt;/a&gt; and realized that the colours were looking slightly different than I remembered from &lt;a href="http://www.mirc.com/"&gt;mIRC&lt;/a&gt;. Given that in this case it is quite important to have some sort of default, I figured I'd look up mIRC's default colours so I could change the colours in XChat accordingly.&lt;/p&gt;

&lt;p&gt;Nobody really seemed to give a proper list anywhere, except for &lt;a href="http://www.mirc.net/forums.php?view=34457"&gt;this forum post&lt;/a&gt; from years ago that didn't seem to pop up quite high in my Google search results. To make a long story short, here are the RGB values of mIRC's default colours for my and your future reference.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;Code   Colour
----   ------
00    #FFFFFF
01    #000000
02    #00007F
03    #009300
04    #FF0000
05    #7F0000
06    #9C009C
07    #FC7F00
08    #FFFF00
09    #00FC00
10    #009393
11    #00FFFF
12    #0000FC
13    #FF00FF
14    #7F7F7F
15    #D2D2D2&lt;/pre&gt;&lt;/code&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/tmul2-gAK58" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/7838160327284566387/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/01/mirc-default-colours.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7838160327284566387?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7838160327284566387?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/tmul2-gAK58/mirc-default-colours.html" title="mIRC default colours" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/01/mirc-default-colours.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYAQ3s9fSp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-4957254499525646729</id><published>2012-01-17T21:01:00.005Z</published><updated>2012-01-17T21:02:22.565Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T21:02:22.565Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="irc" /><category scheme="http://www.blogger.com/atom/ns#" term="xchat" /><title>Spell Check for XChat in Linux</title><content type="html">&lt;p&gt;Back when I still used &lt;a href="http://www.ubuntu.com/"&gt;Ubuntu&lt;/a&gt;, &lt;a href="http://xchat.org/"&gt;XChat&lt;/a&gt; (an IRC client) had a nice working spell checker. You know the kind, wrinkly red lines under every misspelled word. As a non native English speaker an extra check of what you write is always nice, even if you have to still live with your broken grammar. However, in &lt;a href="http://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt; this behaviour was missing. Arch likes to &lt;a href="https://wiki.archlinux.org/index.php/The_Arch_Way"&gt;keep things simple&lt;/a&gt; and as such the right packages for XChat's spell checking weren't installed by default.&lt;/p&gt;

&lt;p&gt;That package was, according to the messages given while installing, called &lt;code&gt;enchant&lt;/code&gt;. Sadly enough, installing &lt;code&gt;enchant&lt;/code&gt; &lt;em&gt;didn't&lt;/em&gt; do the trick. You see, as it turns out, &lt;code&gt;enchant&lt;/code&gt; relies on four other packages.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;pacman -Qi enchant
[...]
Depends On     : aspell  dbus-glib  hunspell  hspell&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Yet in some weird twist of things making no sense, this &lt;em&gt;also&lt;/em&gt; wasn't enough. To get it working, you still needed to install the correct language package for &lt;code&gt;hunspell&lt;/code&gt;. Not an obvious thing to notice when it isn't mentioned whatsoever during the process. So issue a quick&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;pacman -Ss hunspell&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;and see which package it is that you need. In my case I just needed my English to be checked so I installed &lt;code&gt;hunspell-en&lt;/code&gt;, restarted XChat and was done with it. &lt;del&gt;No more&lt;/del&gt; Less faulty typing!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/HU4gbzkNTXU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/4957254499525646729/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/01/spell-check-for-xchat-in-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/4957254499525646729?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/4957254499525646729?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/HU4gbzkNTXU/spell-check-for-xchat-in-linux.html" title="Spell Check for XChat in Linux" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/01/spell-check-for-xchat-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QNQHYyeip7ImA9WhRVEEg.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-1967379196615517648</id><published>2012-01-08T20:41:00.000Z</published><updated>2012-01-08T20:43:11.892Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-08T20:43:11.892Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="kde" /><category scheme="http://www.blogger.com/atom/ns#" term="workspace" /><title>Moving Windows Across Virtual Desktops in KDE</title><content type="html">&lt;p&gt;If you're used to &lt;a href="http://www.gnome.org/"&gt;GNOME&lt;/a&gt;, then you're probably used to moving your window to a different Workspace (or Virtual Desktop) by using &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;Arrow key&lt;/kbd&gt;. In &lt;a href="http://www.kde.org/"&gt;KDE&lt;/a&gt;, this combination apparently &lt;em&gt;isn't&lt;/em&gt; part of the normal workflow. In fact, by default there isn't even a key assignment to switch your view to a different Workspace. That second problem I solved by going into System Settings &gt; Workspace Behavior &gt; Virtual Desktops &gt; Switching &gt; Shortcuts. At the time that seemed like the obvious place to look for a solution for both of my problems, but sadly that wasn't the case.&lt;/p&gt;

&lt;p&gt;The moving of windows is in fact hidden in another menu item. Opening System Settings again, we now pick Shortcuts and Gestures. In that window, pick the Global Keyboard Shortcuts tab and then switch the KDE component to KWin. Now there should be a long list of different options and most of them won't have any keys assigned to it. If you're up for even more customization, have a look at all the options, otherwise scroll down to Window One Desktop Down. This options and the three ones below it are the options that need changing to allow switching your windows across virtual desktops. You can choose your own, or just pick the ones that are also used in GNOME.&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;Window One Desktop Down - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;↓&lt;/kbd&gt;&lt;/li&gt;
    &lt;li&gt;Window One Desktop to the Left - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;←&lt;/kbd&gt;&lt;/li&gt;
    &lt;li&gt;Window One Desktop to the Right - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;→&lt;/kbd&gt;&lt;/li&gt;
    &lt;li&gt;Window One Desktop Up - &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Alt&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;↑&lt;/kbd&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In retrospect it &lt;em&gt;was&lt;/em&gt; in an obvious place, it just might be a bit confusing if you're new to KDE. For example, if you come across the switching desktops shortcuts in Workspace Behavior, you might also expect to find the moving of windows there and not expect to have to look for that elsewhere. All in all, it's not bad though. KDE is an amazing Desktop Environment, the myriad of options are more than welcome when you compare it to the recent evolution in Ubuntu's Unity and GNOME (though GNOME is at least trying). With that in mind, it's only expected all the options have to be divided and again divided into smaller categories.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/bENv7U0vgQw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/1967379196615517648/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/01/moving-windows-across-virtual-desktops.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1967379196615517648?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/1967379196615517648?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/bENv7U0vgQw/moving-windows-across-virtual-desktops.html" title="Moving Windows Across Virtual Desktops in KDE" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/01/moving-windows-across-virtual-desktops.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUER3czcSp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-8909128130928322742</id><published>2012-01-03T14:35:00.001Z</published><updated>2012-01-17T21:36:46.989Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T21:36:46.989Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="webcam" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><title>Webcam Shows a Black Screen in Linux</title><content type="html">&lt;p&gt;Ever since doing a clean install of &lt;a href="http://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt;, I've been having some troubles with my webcam randomly deciding to have a pitch black video feed. Sometimes I would show up normally on it, but on other times not even a shade of a shape was to be seen and the image was completly dark. I am using a &lt;a href="http://www.logitech.com/en-us/435/4267"&gt;Logitech Quickcam E 3500&lt;/a&gt;, but after looking around a bit for my issue, I've been led to believe that I'm by far not the only one with this black screen issue. In fact, a lot of people seemed to experience some sort of issue, but the answers they were given came in two categories.&lt;/p&gt;

&lt;p&gt;The first category of answers was mostly useless, they specified it had to do with auto exposure and that you had to turn it off, but didn't deem it important to specify how to turn it off. The second category did delve into specifics, but their answers seemed, to me, outdated and involved a tool that wasn't in my repositories from a website that has since died. Namingly, it had to do with the UVC drivers and tools, but those have since merged into the linux kernel and the tools must have been renamed or merged into something else as well, I would think.&lt;/p&gt;

&lt;p&gt;Mostly by accident, I stumbled upon what I needed in the terminal. As far as I am aware, I did not purposefully install this program at any point, so chances are you can just use it. Otherwise, you're probably best off searching your distribution's repositories for the correct package.&lt;/p&gt;

&lt;p&gt;So open up a terminal and let's going&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;v4l2-ctl -l&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;This should spew out a list of options each specifying min, max, steps, default and current values. The ones that always made sure your video was black, were the ones involved with exposure. More precisely, the option exposure_auto is like set to 3, which equals to it being turned on. Often this is the way you want it, but in our case it is overcompensating for whatever reason and ends up putting the exposure too low. To turn this automatic exposuring off, issue&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;v4l2-ctl --set-ctrl=exposure_auto=1&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Now that it's turned off, there's still the need to actually change the amount of exposure to use. As far as I could tell, there's no catch-all value for this so you might just have to experiment a bit till you find something to your liking. For example, to set it exposure on value 166, you use&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;v4l2-ctl --set-ctrl=exposure_absolute=166&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;then try out your webcam and see how it goes. It allows pretty high values, but the only ones I've had to use so far were in the 0-200s so go a bit at random there.&lt;/p&gt;

&lt;p&gt;I know this solution isn't perfect, you'll have to redo it every time the issue comes up again. The solution also came mostly through trial and error, so there's the likeliness I've missed some obvious answers. Sadly, the information available online was scarce, so this had to do. Regardless, seeing &lt;em&gt;anything&lt;/em&gt; is already a vast improvement.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/zgkoyOnOkqQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/8909128130928322742/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2012/01/webcam-shows-black-screen-in-linux.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/8909128130928322742?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/8909128130928322742?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/zgkoyOnOkqQ/webcam-shows-black-screen-in-linux.html" title="Webcam Shows a Black Screen in Linux" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2012/01/webcam-shows-black-screen-in-linux.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHQ3g8fSp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-3281664126972854294</id><published>2011-12-28T23:37:00.000Z</published><updated>2012-01-17T21:33:52.675Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T21:33:52.675Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="znc" /><category scheme="http://www.blogger.com/atom/ns#" term="irc" /><title>ZNC failing to connect</title><content type="html">&lt;p&gt;While setting up &lt;a href="http://wiki.znc.in/ZNC"&gt;ZNC&lt;/a&gt;, a &lt;a href="http://en.wikipedia.org/wiki/BNC_%28software%29"&gt;BNC&lt;/a&gt; for those who hadn't guessed, I ran into the following error&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;&amp;lt;*status&amp;gt; Cannot connect to IRC (Cannot assign requested address (Is your IRC server's host name valid?)). Retrying...&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Googling for the exact error didn't help much either, since most I got were pastebins with just that error repeated a few times. Quite useless. Next stop was the ZNC IRC channel on &lt;a href="http://www.efnet.org/"&gt;EFnet&lt;/a&gt;. Turns out I wasn't the first with this issue, the solution was right in the topic (newlines added by me)&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;* Topic for #znc is: Help on restoring www.znc.in is welcome | ZNC 0.202: http://tinyurl.com/znc-0202
 | Nightlies: www.znc.in/nightly | Don't PM @s
 | Try: /znc setbindhost 0.0.0.0&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Indeed, the last bit was meant for the likes of me. Issuing that command fixed the issues&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;/znc setbindhost 0.0.0.0
/msg *status jump&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;To make it permanent, I stopped ZNC and added the following line for every user in my configs/znc.conf&lt;/p&gt;

&lt;code&gt;&lt;pre&gt; BindHost   = 0.0.0.0&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Then just save and start up ZNC.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/qSr8jOhFwuE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/3281664126972854294/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2011/12/znc-failing-to-connect.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3281664126972854294?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/3281664126972854294?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/qSr8jOhFwuE/znc-failing-to-connect.html" title="ZNC failing to connect" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>5</thr:total><feedburner:origLink>http://b.wardje.eu/2011/12/znc-failing-to-connect.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMCRnY8eCp7ImA9WhRXFko.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-596206040105019563</id><published>2011-12-23T20:50:00.001Z</published><updated>2011-12-23T21:07:47.870Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-23T21:07:47.870Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="calendar" /><category scheme="http://www.blogger.com/atom/ns#" term="kde" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title>Add Google Calendar to KDE</title><content type="html">Recently I decided to use &lt;a href="http://www.kde.org/"&gt;KDE&lt;/a&gt; on my clean install of &lt;a href="http://www.archlinux.org/"&gt;Arch Linux&lt;/a&gt;. Though not minding &lt;a href="http://www.gnome.org/gnome-3/"&gt;Gnome 3&lt;/a&gt; on my laptop, it didn't seem like something I felt like using on the big dual monitor setup of my desktop.&lt;br /&gt;
&lt;br /&gt;
Venturing through KDE settings and discovering little tidbits, I came upon the Calendar widget. This is the widget that pops up when you click on the clock in the bottom right, but you can also place it on the desktop if you want. KDE is flexible like that. It seemed nice enough, but I manage all my calendar needs in &lt;a href="https://www.google.com/calendar"&gt;Google Calendar&lt;/a&gt; so &lt;i&gt;naturally&lt;/i&gt; I wanted the calendar widget to render my Google Calendar events.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;To do this, there's a little detour past another program in KDE. Akonadi is, to my understanding, a system that manages a whole lot of information in KDE making it easily available to all the other applications. For example, your name, your contacts, ... only have to be set in Akonadi and are from there on available to other programs. Akonadi was part of my base KDE install, so I can only assume that every KDE user has it installed.&lt;br /&gt;
&lt;div style="text-align: right;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: right;"&gt;
&lt;a href="http://2.bp.blogspot.com/-bOdCzrwyAyE/TvTocYuIqtI/AAAAAAAACsc/UWFn_wtHNBg/s1600/kdecaldav1.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="143" src="http://2.bp.blogspot.com/-bOdCzrwyAyE/TvTocYuIqtI/AAAAAAAACsc/UWFn_wtHNBg/s200/kdecaldav1.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol&gt;&lt;a href="http://1.bp.blogspot.com/-1XVoYpD-qf0/TvTodCmCfQI/AAAAAAAACsg/jMKA6y5_Cqc/s1600/kdecaldav2.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="153" src="http://1.bp.blogspot.com/-1XVoYpD-qf0/TvTodCmCfQI/AAAAAAAACsg/jMKA6y5_Cqc/s200/kdecaldav2.png" width="200" /&gt;&lt;/a&gt;
&lt;li&gt;Open up Akonadi Configuration.&lt;/li&gt;
&lt;li&gt;Choose "Add..." from the buttons on the right.&lt;/li&gt;
&lt;li&gt;In the screen that pops up, choose DAV groupware resource.&lt;/li&gt;
&lt;li&gt;You will be asked for login credentials, but Google won't be one of the options in the next screen so just click "Cancel".&lt;/li&gt;
&lt;li&gt;A general configuration screen will pop up, pick any display name that makes sense to you. I just wrote &lt;i&gt;Google Calendar&lt;/i&gt;. Adjust refresh rate to whatever you want, the default is every 5 minutes.&lt;/li&gt;
&lt;li&gt;Click the "Add" button after filling in the general details. You'll have to add every calendar you want to see one-by-one through this method.&lt;/li&gt;
&lt;li&gt;In the window that pops up, you'll need the CalDAV URL for your calendar. Follow these steps to find out your CalDAV URL.&lt;/li&gt;
&lt;ol&gt;&lt;a href="http://1.bp.blogspot.com/-AJ7xVyXKcrQ/TvTodliWaMI/AAAAAAAACso/In0kKdMRmkQ/s1600/kdecaldav3.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="200" src="http://1.bp.blogspot.com/-AJ7xVyXKcrQ/TvTodliWaMI/AAAAAAAACso/In0kKdMRmkQ/s200/kdecaldav3.png" width="188" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/-AJ7xVyXKcrQ/TvTodliWaMI/AAAAAAAACso/In0kKdMRmkQ/s1600/kdecaldav3.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/-ts09ph2t7lc/TvToemoQBuI/AAAAAAAACs0/bdU9vy20dYk/s1600/kdecaldav4.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-ts09ph2t7lc/TvToemoQBuI/AAAAAAAACs0/bdU9vy20dYk/s200/kdecaldav4.png" width="107" /&gt;&lt;/a&gt;
&lt;li&gt;Go to Google Calendar site and open the Calendar Settings.&lt;/li&gt;
&lt;li&gt;In the Calendar Details tab you will find your Calendar ID, this will look like an email address (and if it is your main calendar it &lt;i&gt;will&lt;/i&gt; be your email address).&lt;/li&gt;
&lt;li&gt;Insert it at the indicated place in this URL: https://www.google.com/calendar/dav/&lt;b&gt;ID&lt;/b&gt;/events. So for example if your ID is bla@example.com, then the URL will become https://www.google.com/calendar/dav/bla@example.com/events.&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Fill in the found URL at "Remote URL". In "Username" and "Password" come your Google username and password.&lt;/li&gt;
&lt;li&gt;With everything filled in, click fetch and it should fetch the calendar you fetched. Click "Ok".&lt;/li&gt;
&lt;li&gt;Repeat steps 6 to 9 for other calendars. Click "Ok" when you're done.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
After going through these steps, calendar-related applications should be able to read your calendars. More specifically, the little Calendar widget I mentioned earlier should now automatically get populated with your Google Calendar events.&lt;br /&gt;
&lt;br /&gt;
Sidenote, if you are making use of one of the Google features where your GMail contacts' birthday appear in your Google Calendar (it would appear as a calendar called &lt;i&gt;Contacts' birthdays and events&lt;/i&gt;), then the Calendar ID you will get is probably #contacts@group.v.calendar.google.com and it is probably giving you troubles. The solution is simple, change the # to %23, so it becomes %23contacts@group.v.calendar.google.com, use this ID as you would otherwise.&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/RZEE0TCrZ0s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/596206040105019563/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2011/12/add-google-calendar-to-kde.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/596206040105019563?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/596206040105019563?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/RZEE0TCrZ0s/add-google-calendar-to-kde.html" title="Add Google Calendar to KDE" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-bOdCzrwyAyE/TvTocYuIqtI/AAAAAAAACsc/UWFn_wtHNBg/s72-c/kdecaldav1.png" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://b.wardje.eu/2011/12/add-google-calendar-to-kde.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ICRXk_fCp7ImA9WhVWEks.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-238482592500908187</id><published>2011-12-02T19:48:00.001Z</published><updated>2012-04-24T10:59:24.744+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-04-24T10:59:24.744+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="football" /><category scheme="http://www.blogger.com/atom/ns#" term="calendar" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title>Google Calendar for UEFA Euro 2012 (http, xml, ical)</title><content type="html">&lt;p&gt;I added the UEFA Euro 2012 games to my Google Calendar and I figured at least some of you out there would be able to profit from it.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Links&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.google.com/calendar/embed?src=n29nq9o237lgglgaicdruthfbg%40group.calendar.google.com&amp;amp;ctz=Etc%2FGMT"&gt;http&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.google.com/calendar/feeds/n29nq9o237lgglgaicdruthfbg%40group.calendar.google.com/public/basic"&gt;xml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="webcal://www.google.com/calendar/ical/n29nq9o237lgglgaicdruthfbg%40group.calendar.google.com/public/basic.ics"&gt;ical&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Calendar&lt;/b&gt;&lt;/p&gt;
&lt;iframe frameborder="0" height="600" scrolling="no" src="https://www.google.com/calendar/embed?title=UEFA%20Euro%202012&amp;amp;showCalendars=0&amp;amp;height=600&amp;amp;wkst=2&amp;amp;bgcolor=%23FFFFFF&amp;amp;src=n29nq9o237lgglgaicdruthfbg%40group.calendar.google.com&amp;amp;color=%23711616&amp;amp;ctz=Etc%2FGMT" style="border-width: 0;" width="800"&gt;&lt;/iframe&gt;

&lt;em&gt;Feel free to mention corrections in the comments.&lt;/em&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/GWLtYIPhWZo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/238482592500908187/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2011/12/google-calendar-for-uefa-euro-2012-http.html#comment-form" title="32 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/238482592500908187?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/238482592500908187?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/GWLtYIPhWZo/google-calendar-for-uefa-euro-2012-http.html" title="Google Calendar for UEFA Euro 2012 (http, xml, ical)" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>32</thr:total><feedburner:origLink>http://b.wardje.eu/2011/12/google-calendar-for-uefa-euro-2012-http.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AHRngycSp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-6270330687972286167</id><published>2011-11-26T20:50:00.000Z</published><updated>2012-01-17T21:28:57.699Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T21:28:57.699Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plus" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><title>Analyzing +1 button on any page bookmarklet</title><content type="html">&lt;p&gt;I wanted something to &lt;a href="http://www.google.com/+1/button/"&gt;+1&lt;/a&gt; a page no matter if the page had put &lt;a href="http://www.google.com/webmasters/+1/button/index.html"&gt;Google's button&lt;/a&gt; on its page or not. A Firefox add-on seemed too over the top and it might have ended up giving extra requests on every page load. I couldn't be bothered with that.&lt;/p&gt;

&lt;p&gt;Instead, I had a quick peek for a bookmarklet to help my cause. To follow the masses, I simply went with the &lt;a href="http://www.labnol.org/internet/google-plus-one-bookmarklet/19474/"&gt;first Google result&lt;/a&gt;. It seemed nice enough, making a box in the upper right corner of my browsing window, a close button and of course the +1 button itself. These days when clicking +1 though, a little popup appears to share the page to your &lt;a href="https://plus.google.com/"&gt;Google Plus&lt;/a&gt; stream. The bookmarklet had made the encapsulating box too small, effectively hiding the pop up to share the page. Fixing that seemed easy enough, edit some code in the bookmarklet to make a bigger box and tadaaa.&lt;/p&gt;

&lt;p&gt;Except it wasn't. Here's the code for the bookmarklet, spaced out better for your convenience.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;javascript:
(function() {
  var%20c;
  c=document.createElement("script");
  c.type="text/javascript";
  c.src="http://www.ctrlq.org/plusone/index.js?r="+Math.random();
  document.body.appendChild(c);
})();&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;Indeed, all it does is inject some &lt;em&gt;remote&lt;/em&gt; JavaScript into the page. I don't use bookmarklets a lot, dare I say never, so I don't know if this is common practice, but this annoys me for three reasons.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I have to rely on this other website to not go down.&lt;/li&gt;
&lt;li&gt;I have to trust these people to not change their code to something to their liking in the future.&lt;/li&gt;
&lt;li&gt;I can't make a small notification without effectively having to rehost the modified code myself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ignoring these annoyances, I continued checking how the script worked out of curiosity. The included script page was the obvious next step.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;(function(){
  var iframe_url = "http://ctrlq.org/plusone/" + "?u=" + encodeURIComponent(document.location.href);
  var div = document.createElement("div");
  div.id = "labnol_plusone";
var str = "&amp;lt;style&amp;gt;#labnol_plusone{position: fixed; top: 10px; right: 20px; width: 150px; height: 90px;z-index: 9999;background: #f4f4f4;padding: 10px;border: thin solid #999;}#ex small {font:Verdana, Geneva, sans-serif;font-size:9px;float:right;display:block}&amp;lt;/style&amp;gt;&amp;lt;div id='ex'&amp;gt;&amp;lt;small&amp;gt;&amp;lt;a href='#' onClick=\"document.getElementById('labnol_plusone').style.display='none'; return false;\" title='Click to close this window'&amp;gt;Close&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;iframe frameborder='0' scrolling='no' src='" + iframe_url + "' width='120px' height='75px' style='backgroundColor: white;'&amp;gt;&amp;lt;/iframe&amp;gt;&amp;lt;/div&amp;gt;";
  div.innerHTML = str;
  document.body.insertBefore(div, document.body.firstChild);
})()&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;A div element is created, some styling added, as well as a close button and an iframe containing the +1 button. Another extra request to this site beyond our control, in other words. Also note that to solve my original problem, the styling defined there is what would need editing. However, let's continue, we're going good now. This iframe's source is as follows.&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;&amp;lt;&lt;span class="start-tag"&gt;html&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;title&lt;/span&gt;&amp;gt;Google +1&amp;lt;/&lt;span class="end-tag"&gt;title&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;link&lt;/span&gt;&lt;span class="attribute-name"&gt; rel&lt;/span&gt;=&lt;span class="attribute-value"&gt;"canonical" &lt;/span&gt;&lt;span class="attribute-name"&gt;href&lt;/span&gt;="http://www.labnol.org/" &lt;span class="error"&gt;&lt;span class="attribute-name"&gt;/&lt;/span&gt;&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;script&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"text/javascript" &lt;/span&gt;&lt;span class="attribute-name"&gt;src&lt;/span&gt;="https://apis.google.com/js/plusone.js"&amp;gt;    &amp;lt;/&lt;span class="end-tag"&gt;script&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="end-tag"&gt;head&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;style&lt;/span&gt;&amp;gt;body {padding:20px; background-color:#f4f4f4}&amp;lt;/&lt;span class="end-tag"&gt;style&lt;/span&gt;&amp;gt;
&amp;lt;&lt;span class="start-tag"&gt;g:plusone&lt;/span&gt;&lt;span class="attribute-name"&gt; size&lt;/span&gt;=&lt;span class="attribute-value"&gt;"standard" &lt;/span&gt;&lt;span class="attribute-name"&gt;count&lt;/span&gt;=&lt;span class="attribute-value"&gt;"true" &lt;/span&gt;&lt;span class="attribute-name"&gt;href&lt;/span&gt;="http://b.wardje.eu/"&amp;gt;&amp;lt;/&lt;span class="end-tag"&gt;g:plusone&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="end-tag"&gt;body&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="end-tag"&gt;html&lt;/span&gt;&amp;gt;&amp;nbsp;&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Finally the good part! This is more-or-less code as you would put in your own webpage when &lt;a href="http://www.google.com/webmasters/+1/button/index.html"&gt;adding the button to your own website&lt;/a&gt;. So to summarize what all is done just to &lt;em&gt;present&lt;/em&gt; the button to you.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You click the bookmarklet, this step can obviously not be skipped.&lt;/li&gt;
&lt;li&gt;Some remote JavaScript gets injected into the page you are on.&lt;/li&gt;
&lt;li&gt;This remote JavaScript created a div element and adds an iframe to it.&lt;/li&gt;
&lt;li&gt;The iframe has the code that Google tells you to add to your pages to get a +1 button.&lt;/li&gt;
&lt;li&gt;That code includes a call to Google's server for a JavaScript file that does the rest, this step can also not be avoided.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ideally, in my eyes anyway, steps two, three and four should be skipped.&lt;/p&gt;

&lt;p&gt;So I quickly threw the following together&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;(function() {
 var a,b;
 a=document.createElement('script');
 a.type='text/javascript';
 a.async=true;
 a.src='https://apis.google.com/js/plusone.js';
 b=document.createElement('div');
 b.id='ward_plusone';
 b.style.position='fixed';
 b.style.top='10px';
 b.style.right='10px';
 b.style.padding='10px';
 b.style.zIndex=99999;
 b.style.background='#FFFFFF';
 b.style.border='1px solid #000000';
 b.innerHTML='&amp;lt;g:plusone&amp;gt;&amp;lt;/g:plusone&amp;gt;';
 document.body.insertBefore(b, document.body.firstChild);
 document.body.insertBefore(a, document.body.firstChild);
})();&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;&lt;a href="https://gist.github.com/1396284"&gt;&lt;i&gt;Source&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No need for any extra remote calls and it works as far as my first tests tell me. Only downside (for now?) is the lack of a close button.&lt;/p&gt;

&lt;p&gt;And finally, here is the link for you to bookmark: &lt;a href="javascript:%20(function(){var%20a,b;a=document.createElement('script');a.type='text/javascript';a.async=true;a.src='https://apis.google.com/js/plusone.js';b=document.createElement('div');b.id='ward_plusone';b.style.position='fixed';b.style.top='10px';b.style.right='10px';b.style.padding='10px';b.style.zIndex=99999;b.style.background='#FFFFFF';b.style.border='1px%20solid%20#000000';b.innerHTML='&amp;lt;g:plusone&amp;gt;&amp;lt;/g:plusone&amp;gt;';document.body.insertBefore(b,document.body.firstChild);document.body.insertBefore(a,document.body.firstChild)})();"&gt;Bookmarklet&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/KWVprSiPIis" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/6270330687972286167/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2011/11/analyzing-1-button-on-any-page.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/6270330687972286167?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/6270330687972286167?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/KWVprSiPIis/analyzing-1-button-on-any-page.html" title="Analyzing +1 button on any page bookmarklet" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2011/11/analyzing-1-button-on-any-page.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QEQnozeSp7ImA9WhRVGE4.&quot;"><id>tag:blogger.com,1999:blog-7840971200052989181.post-7947329263476996461</id><published>2011-11-15T00:15:00.000Z</published><updated>2012-01-17T21:21:43.481Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-17T21:21:43.481Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plus" /><category scheme="http://www.blogger.com/atom/ns#" term="reader" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title>Google Reader's +1</title><content type="html">&lt;p&gt;Google has been trying to push its &lt;a href="http://www.google.com/+1/button/" target="_blank"&gt;+1 button&lt;/a&gt; and who can blame them, it only makes sense to try self-promotion whenever possible. (As I found out while checking some info, there are some complainers, but that's not to be avoided I guess) So when &lt;a href="http://www.google.com/reader" target="_blank"&gt;Google Reader&lt;/a&gt;, one of my favourite parts of Google, &lt;a href="http://googlereader.blogspot.com/2011/10/new-in-reader-fresh-design-and-google.html" target="_blank"&gt;updated their look&lt;/a&gt; two weeks ago, it was expected that the old Google Reader "Like" button would end up being replaced by Google Plus' +1.&lt;/p&gt;

&lt;p&gt;So far, so good... if it wasn't broken. More specifically, the incorrect page gets +1'd. When I'm reading &lt;a href="http://www.lefthandedtoons.com/1122/" target="_blank"&gt;a comic&lt;/a&gt; in Google Reader and end up clicking +1, the page that I want to give my +1 to is, quite obviously,&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;http://www.lefthandedtoons.com/1122/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Instead, the page that ends up appearing in my +1 list is&lt;/p&gt;

&lt;code&gt;&lt;pre&gt;http://feedproxy.google.com/~r/lefthandedtoons/awesome/~3/sVdTlgfETrE/&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;Sure, that redirects to the page I intended, but it's obviously not what I wanted it to do.&lt;/p&gt;

&lt;p&gt;Now, since I don't see a "Send feedback" in Google Reader, I guess I'll report it on Google Plus?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/WardMuylaert/~4/MWeRdYVWeHE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://b.wardje.eu/feeds/7947329263476996461/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://b.wardje.eu/2011/11/google-readers-1.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7947329263476996461?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7840971200052989181/posts/default/7947329263476996461?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WardMuylaert/~3/MWeRdYVWeHE/google-readers-1.html" title="Google Reader's +1" /><author><name>Ward Muylaert</name><uri>https://plus.google.com/104669630327539668127</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-3TuNZeSsEDM/AAAAAAAAAAI/AAAAAAAAGSs/Xq1orR8LJQ0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://b.wardje.eu/2011/11/google-readers-1.html</feedburner:origLink></entry></feed>
