Manipulating meshes and lights is nice, but sometimes we want to manipulate the good old pixels, in particular for post-processing effects such as blur.
But how can we do that in OpenGL? In this new OpenGL wikibook tutorial, we'll explore a solution: render to a texture through a framebuffer object!
http://en.wikibooks.org/wiki/OpenGL_Programming/Post-Processing
For our first effect, we'll implement the wave system previewed a few days ago in the video capture tutorial.
Jean-Yves Lefort s link-monitor-applet, an applet for the GNOME panel, is a great tool for those with often-changing and possibly unreliable network connection. It allows me to see, at one glance, whether I can reach the router, the internet and/or my VPN. Furthermore, the latency display tells me whether there is a point in working over SSH right now. I often observe other people, e.g. on conferences, to stare for a while at a non-loading web page, then fire up a terminal window and run random ping commands, while I immediately see that the network is down and can relax.

Only ONE of us is the kind of person that goes up to guys with machine guns to ask what s happening. Me to Terah todayThey told me that it was the preparations for the opening ceremony for a global shooting contest, and also gave me directions to the bus stop.
It has been a while since I last
ranted about the Deutsche Bahn, our national train service
monopoly. Out of necessity, I ve since become one of their frequent
travellers. Together with the spiffy, silver card, I received a
pamphlet, in which the advantages of frequent travellers are
listed.
When I compare those advantages to
what was promised, I cannot help but notice quite a few
differences to my disadvantage. Since I refused to believe
that the Deutsche Bahn could be this stupid, I double-checked with
the service hotline, and I now have the information to report:
Last weekend Dennis M. Ritchie, creator of the C Programming Language, the UNIX Operating System, The Plan 9 Operating System and many other key contributions to computing, passed away due an extended illness. I learned about it yesterday trough Rob Pike, former dmr s colleague and friend.
I m writing this post to honor him and his legacy. While I ve seen people mourn his departure, I ve also noticed most technical people don t really understand why his work is important for today s computing, so I m here to give a refresh. Since I m good with visual tools (mindmaps) I ve made one to describe the extension of dmr s contribution to the world. You can get a glimpse of how this is important. The main topics are their key contributions, the sub-topics are the current technologies that were built upon dmr s work. Click on the image to see a larger resolution version.
The C Programming Language
Best said here Let not make the final statement and not a single newspaper cares " into a reality.
PS: Do check out Against Nostalgia, a great jab at Jobs.
In 1965, I was stationed at the Fleet Anti-Submarine Warfare Center in San Diego. I was a Radioman 2nd. Class in the USN, at the time. One evening, at our radio club station (W6DCM different license holder, now), I called CQ and got UA KKC (it s no longer around), with Ivan at the mic. After a time of the usual signal reports and such, we asked what each did in their lives I said that I was US Navy radio operator. He answered that HE ALSO was a Navy radio operator in the Soviet navy. Then we discovered that his station was at the SUBMARINE base at Vladivostok, and I of course was his DIRECT opponent. Yes we really DID laugh at that, and I shall never forget what he said (that I heartily agreed with): Thomas, isn t it shame that we re supposed to hate each other? Yes, Ivan, it is someday we ll share a vodka, da? Da , he replied.We re often told we should hate people. Messages I have heard on the media over the last 10 years have said we ought to hate illegal immigrants, CEOs, radical Muslims, the French, Iranians, Mexicans, presidents, UN diplomats, climate scientists, oil company employees, Chinese people, conservatives, liberals, religious people, atheists, and oh yes, still Russians. But I get to choose who to hate, and in fact, I choose NO HATE. Not only does it keep my stress level way lower, but it also lets me enjoy life more, and makes the world a better place. We can all talk to people in other countries and with other backgrounds and viewpoints so easily thanks to the Internet. Sadly we rarely have very deep online conversations to the point of getting to know people. For whatever reason, ham radio lends itself to that better. Even better: visit other places. I wonder how many people that say they hate some group of people have visited them and made an effort to make a connection? It is, after all, really hard to hate someone that is kind to you. Perhaps they re afraid to let go of their hate. Think also about this: for whom is it convenient if you hate people? There is usually a reason that hatred is stoked, and it doesn t usually lead to good things for individual people. Tom W0EAJ added:
I actually tried to locate him and the station, but both appear to have vanished. Ivan (his name was pronounced Eee-von) could have, it occured to me later, gotten into trouble for saying such things. I think both of us realized AT THE TIME, what an astounding counterpoint each of us was to the other. Proof that if it were left up to the simple little guys like us, and not to the politicians, we might actually pull off living in peace.
The issue
This morning (while I was running late for an appointement) I
had a very weird stuff happening on my Thinkpad T61 laptop. Since I
recently offered myself a shiny Thinkpad x201s, I have to admit I
don't use much my T61 anymore. But this morning I had to print a
page (for this appointement) and, as I didn't yet configured my
printer on the x201s, I went to the T61. But I noticed that the
network was down. I've tried quickly on wireless but, bad luck, my
current wifi setup selects the channel automatically and it prefers
choosing channels which aren't available in the US. Guess what, my
T61 comes from the US and has those channels completely disabled,
so no wireless available either.
The investigation
I first tried to
modprobe -r e1000e
modprobe e1000e
to see if it fixed the problem, but it didn't. Worse, the
interface disappeared and never reappeared. I tried to reboot but
it didn't fix the problem, the link was still down. Running really
late, I put the file on a usb key and printed it from the powerbook
and postponed the fix for later.
Now, this evening, I tried to investigate a bit more. Symptoms
weren't only that the nic wasn't working, but there was a high load
on the system (1-2 at idle), unresponsiveness every second or so,
and watching top I could see spikes of high cpu usage for the
kworker kernel thread. Typing that on google you can find a lot of
people running on this issue, usually starting around kernel 2.6.36
or 2.6.37. Now, I might have upgraded the kernel recently to
3.0.0-4, but that didn't look related since the problem first
appeared when the laptop was up and running. And I tried to reboot
under 2.6.39, 2.6.38 and even 2.6.32 and the problem was still
present. Each time, unloading the module would fix the problem, but
loading it again wouldn't make the interface reappear. People
advised to boot with pcie_ports=compat but that didn't do anything.
I tried to boot without intel_iommu=force (disable Intel Vt-d) and
pcie_aspm (Active State Power Management) but nothing either.
Considering a userland issue, I've tried to boot a grml live distro (always keep a grml.iso in
your /boot, extlinux-update will even put it in your menu
automatically), and the problem was still present. So not a Debian
kernel issue, not a userland issue, only thing left was the laptop.
I didn't update the Bios recently, so I wondered exactly what could
be the problem. I started to feel a little bad, since I still
really like that laptop, and that I already decided to lend it to
my sister since her own T61 is sitting with a dead system board in
my shelf. I know she might have some negative waves, but she was
not even landed when the problem first appear.
The fix
Then I had a flash. It's not mystery that I'm used to break network
cards, and I had the bright idea to shutdown the laptop,
disconnect AC and battery, then let it idle a bit. I even tried the
secret Thinkpad power button code but I think it's unrelated.
Then I re-plugged the battery, booted to grml and the issue was
gone. I rebooted on the standard Debian and the link was up,
network was working.
So what happenned?
The (tentative) explanation
My guess is that, somehow, the network card firmware has an
issue and choked on something (a network frame or an attack exactly
like the one we demonstrated on ASF firmware). In fact, no, I don't
think it's the e1000e firmware. My T61 comes with Intel vPro, which
includes AMT (Active Management Technology), a remote management
solution a bit like ASF but more advanced. As far as I know, AMT
firmware always runs, even when it's disabled, it's just completely
idle. Idle, but in this case I think it choked on something, and a
reboot isn't enough to restart the AMT firmware. But a real hard
reset without any power seems to do the trick.
What next?
Well, a part of me is pretty scared, but another is just bored.
I mean, we know about that, that's exactly the kind of issue we are
warning people of. I have no idea what exactly happened, and
there's no way I'll be able to reproduce that, but I'm pretty sure
it's something lying at a pretty low level in the platform, and
which can severely disable your workstation. Now if it happens
again I won't lose too much time on this.
TL;DR: helping other people
In case you came here because you searched on google terms like
kworker cpu usage , e1000e, interrupts, it might be a good idea to
first reboot on a live CD to eliminate installation issues, then
shutdown the laptop, remove the battery and let it few seconds
idle. This might be enough to reset something inside and fix the
situation.
Dear Lazyweb .
I ran into a very strange issue with MySQL authentication. The initial situation is as follows:
sven@a0 ~ > mysql -u sven -ptestpass -h a0.my.do.main
ERROR 1045 (28000): Access denied for user 'sven'@'a0.my.do.main' (using password: YES)
sven@a0 ~ > mysql -u sven -ptestpass -h a1.my.do.main
ERROR 1045 (28000): Access denied for user 'sven'@'a0.my.do.main' (using password: YES)
sven@a1 ~ > mysql -u sven -ptestpass -h a0.my.do.main
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.0.77-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> Bye
sven@a1 ~ > mysql -u sven -ptestpass -h a1.my.do.main
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 24
Server version: 5.0.77-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
All packages on both machines are up to date (CentOS5 with all updates available). The server variables shown with show variables also seem identical (except for the hostname and the server id). Besides, it looks more like a client problem to me than a server problem.
Last datapoint: If I define the mysql user sven with an explicit host (a0.my.do.main and a1.my.do.main) instead of a wildcard, everything works nicely, from and to both hosts.
So, dear lazyweb: Does anyone have an idea what might be causing this issue?
Update:
Due to some comments, let me add a few points of information:
Greetings real ale fans,
This most exciting time of year is almost upon us again. Yes,
it's the Nottingham Robin
Hood Beer Festival!
This year I have followed in the footsteps of Alex and Karen and
decided to trawl through the
list of over 900 beers so that I can best sample the delights
on offer. My selection is here. I'm attending on both the
Thursday and Saturday, so there's plenty of time for me to sample a
reasonable number of different ales.
Beer aficionados, I'd welcome suggestions for alternative beers
to try, if you'd recommend any of them. I promise to update the
list after. I might even be tempted by the ciders, perries and
wines. Generally I tend to prefer paler ales, but I also quite like
a mild given half the chance.
See you on the other side!
(Image by
Ant & Carrie
Coleman, cc-by-nd 2.0)
No, my blog isn't dead, and neither is me. It's just that way too many things happened since this year's debconf that got me a bit off tracks. I managed to do daily business like keeping my packages in shape and the backports queue low, and that was mostly it.
No clue if that will change anytime soon, but I guess I would like to keep you updated with an event where you can meet me next week: There will be the Global 2000 Birthday Party going on in the WUK on Thursday 20th, so if you happen to be in Vienna at that time, drop by and enjoy some great bands.
... which brings me to one of the local bands from Vienna: Heinz aus Wien. They are around for well over 10 years now and are still rocking quite well. Here are some examples of their songs, like always:
Poor Sarah. Cat dramas always
seem to befall us when she's in Australia.
It looks as if Smudge has managed to escape the house. Being at work all
day, it took me 24 hours to notice.
Our friend Helen came over on Sunday night. Smudge was definitely around
then, because she was climbing all over Liam. Helen used the downstairs
bathroom before she went home, and I remember her having to shoo Smudge
out because she was in there. I'm pretty sure she went home after that. If
my memory serves, she saw herself out and I was in the kitchen cleaning up,
so my current theory is that she escaped when Helen left.
On Monday night, I had a lengthy video call with Sarah, who was at my
parent's place setting up their new Mac Mini. I didn't realise until after
that, when I was about to go to bed, that I hadn't been harassed by Smudge
all evening. So I searched the house that night, and couldn't find her.
Liam had already gone to bed for the night, so I hoped she was stuck in his
room, and went to bed too.
This morning, Liam and I both searched the house, and the immediate
surrounds, without any luck. I called the Palo Alto Animal Services (I got
the dispatch because the shelter hadn't opened yet), emailed
the local neighbourhood
association, and went to work.
I called Palo Alto Animal Services again later in the day to report her
missing to the shelter itself, and Betty-Ann there recognised my accent and
name and asked me if I was Sarah's husband (Sarah used to volunteer there a
lot, and we adopted Smudge from there), so they're now keeping a look out.
Smudge is micro chipped, but wasn't wearing a collar. She's allowed in the
back yard, because it's totally enclosed and can't escape, so she shouldn't
be totally freaked out by being outdoors. Whenever she does escape out the
front door, she usually makes a beeline to the right, which is mostly
enclosed, but she can certainly get out of the complex. Unfortunately she
often doesn't come when called, so for all I know she's in some obscure
location 10 metres from the front door and I can't see her.
My main concerns are that we're only two blocks from Highway 101, so if she
does stray too far, she could get into serious trouble, and I'm also a bit
worried about raccoons giving her grief.
I spent some time tonight putting up posters in the immediate area and
poking around bushes. I've left the two humane cat traps that we have out by
the front door with some cat food in them, in the hope that she's roaming
around and will walk into one of them.
Oh and the other big concern I have is that Halloween is coming up.
Shelters tend not to adopt out black cats around Halloween because bad
things can happen to them.
So now we wait. I'm really hoping she turns up safe and sound, soon.

# apt-get install pcscd gnupg-agent gpgsmThe above command should install and start
pcscd and if all works well, you should be able to check the status of the smartcard using GnuPG.
# gpg --card-statusYou need to initialize the smartcard and generate a private key on it, again using GnuPG. If you trust GnuPG more than the smartcard to generate a good private key, you may generate the private key using GnuPG and then move it onto the smartcard (hint: use the
keytocard command). Make sure you don t leave a copy of the private key on the same machine!
# gpg --card-edit
gpg: detected reader Gemalto GemPC Key 00 00'
...
gpg/card> admin
Admin commands are allowed
gpg/card> name
Cardholder's surname:
Cardholder's given name: host.example.org
gpg: 3 Admin PIN attempts remaining before card is permanently locked
Please enter the Admin PIN
gpg: gpg-agent is not available in this session
gpg/card> lang
Language preferences: en
gpg/card> generate
Make off-card backup of encryption key? (Y/n) n
Please enter the PIN
What keysize do you want for the Signature key? (2048)
What keysize do you want for the Encryption key? (2048)
What keysize do you want for the Authentication key? (2048)
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: host.example.org
Email address:
Comment:
You selected this USER-ID:
"host.example.org"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
gpg: existing key will be replaced
gpg: please wait while key is being generated ...
gpg: key generation completed (33 seconds)
gpg: signatures created so far: 0
gpg: existing key will be replaced
gpg: please wait while key is being generated ...
gpg: key generation completed (18 seconds)
gpg: signatures created so far: 1
gpg: signatures created so far: 2
gpg: existing key will be replaced
gpg: please wait while key is being generated ...
gpg: key generation completed (23 seconds)
gpg: signatures created so far: 3
gpg: signatures created so far: 4
gpg: key 12345678 marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
pub 2048R/12345678 2011-09-19
Key fingerprint = 1234 5678 1234 5678 1234 5678 1234 5678 1234 5678
uid host.example.org
sub 2048R/23456789 2011-09-19
sub 2048R/34567890 2011-09-19
gpg/card> quit
#
Now for the interesting part. OpenSSH talks to an agent for private key handling, and GnuPG s gpg-agent supports this protocol when the --enable-ssh-support parameter is given. During startup, gpg-agent will print some environment variables that needs to be set when ssh is run. Normally gpg-agent is invoked by the Xsession.d login scripts, so that the environment variables are inherited by all your processes. However, for an unattended machine without any normal login process, we need to write a script to start gpg-agent. First do these manual steps, to confirm that everything works.
# gpg-agent --daemon --enable-ssh-support > /var/run/gpg-agent-info.env # . /var/run/gpg-agent-info.env # ssh-add -L ssh-rsa AAAAB3N... cardno:000500000BD8 #If the final step printed a SSH public id, the (sometimes) tricky part in getting the hardware to work is (hopefully) complete. What remains is to script things so that
gpg-agent is started on boot and to make sure that your backup scripts has the proper environment variables before launching whatever processes will launch ssh. Further, since we will be running unattended, we need a mechanism to unlock the smartcard using a PIN interactively once on each boot of the machine. I prefer manually entering the PIN on every boot over having the PIN stored in a file on the disk.
I will use the /etc/rc.local mechanism to start gpg-agent, like this:
# cat> /etc/rc.local
#!/bin/sh -e
exec gpg-agent --daemon --enable-ssh-support \
--pinentry-program /usr/local/sbin/pinentry-unattended \
--write-env-file /var/run/gpg-agent-info.env
^D
The astute reader will now ask what /usr/local/sbin/pinentry-unattended is and why it is needed. Now here is the situation. scdaemon will normally query the user for a PIN using a tool called pinentry which reads and write to the user s TTY directly. This won t work in unattended mode, so we want the scdaemon to signal failure here unless we are actually unlocking the smartcard manually. Here is the entire script:
#!/bin/sh
# /usr/local/sbin/pinentry-unattended -- by Simon Josefsson
if test x"$PINENTRY_USER_DATA" = xinteractive; then
exec pinentry "$@"
fi
exit 1
What remains is a script to unlock the smartcard by providing the PIN. This is typically invoked manually if the server has restarted for some reason. Don t worry, any ssh sessions invoked by cron until you have managed to unlock the smartcard will fail with an authentication error it won t hang waiting for a PIN to be entered.
#!/bin/sh
# /usr/local/sbin/unlock-smartcard -- by Simon Josefsson.
. /var/run/gpg-agent-info.env; export GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PID
gpg-connect-agent 'scd killscd' /bye > /dev/null
while ! gpg-connect-agent 'scd serialno' /bye grep -q SERIALNO; do
sleep 1
done
PINENTRY_USER_DATA=interactive
export PINENTRY_USER_DATA
checkpin
And the script checkpin is as follows:
#!/bin/sh # /usr/local/sbin/checkpin -- by Simon Josefsson. id= gpg-connect-agent 'scd serialno' /bye head -1 cut -d\ -f3 gpg-connect-agent "scd checkpin $id" /bye grep -q OKAt this point, you should have everything configured and installed. Don t forget to
chmod +x the scripts. The typical use-pattern is as follows. After the machine has been started, gpg-agent is running but the smartcard is not unlocked with the PIN. You need to manually login to the machine and run unlock-smartcard and enter the PIN. In the script that runs the backup jobs, invoked via cron, make sure that the first line of the scripts reads (assuming Bourne shell script syntax):
. /var/run/gpg-agent-info.env; export GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PIDTo avoid needlessly attempting ssh connections if the smartcard is not unlocked, your backup script can also call the
checkpin code and abort if it doesn t return true.
checkpin exit 1Some final words about debugging. A basic command to run to check that the GnuPG side is working is
gpg --card-status, it should print some information about the smartcard if successful. To check that the SSH agent part is working, use ssh-add -L. If you get error messages, try killing the scdaemon process by running killall -9 scdaemon and let gpg-agent respawn a new scdaemon process.
That s it! If you like my writeup, please flattr it.
Next.