Irssi tricks: navigating around

Irssi has many ways to navigate between windows, and within a window.

For this article, I am assuming that you do not use split windows. Also, whenever I mention the alt key, I mean alt, or meta, or option, or whatever works for you. There is a difference between them, but that’s beyond the scope of this post.

If the alt key does not work properly for you, you have two options:

  1. Configure your OS or terminal application to send alt to irssi instead of to the OS or application (for example, make sure that alt + f does not open the File menu, but is sent to irssi).
  2. Instead of pressing alt plus another key at the same time, you can press escape, followed by the other key. For example, pressing alt and a at the same time is equivalent to pressing escape, releasing, and then pressing a.

Navigating while typing

Let’s start by what you can do while typing. These keystrokes change only what happens on the input line (the line where you type stuff).

  • arrow left/right: move one character left or right.
  • ctrl + arrow left/right: move one word left or right.
  • ctrl + a or Home: move to start of line.
  • ctrl + e or End: move to end of line.
  • ctrl + w: remove from cursor to the beginning of the word the cursor is on.
  • ctrl + k: remove from cursor to end of line.
  • ctrl + u: remove the entire line.
  • arrow up/down: previous/next command you typed.

Navigating within a window

There are keystrokes and commands to navigate within a single window. The total amount of text inside a single window is called the buffer.

These are the keys:

  • page-down or alt + n: scroll down half a page.
  • page-up or alt + p: scroll up half a page.

And these are the commands:

  • /scrollback home: go to the first line of the buffer.
  • /scrollback end: go to the last line of the buffer.
  • /scrollback goto 13:05: scrolls back to 13:05.
  • /scrollback goto -100: scrolls back 100 lines.
  • /scrollback goto +50: scrolls forward 50 lines.

You can use /sb instead of /scrollback to save time typing.

Navigating between windows

The most important thing to know about navigating between windows is that alt + a sends you to the window with the most recent, most important activity. Pressing it consecutively will first lead you through all windows that are pink in your activity bar, then all windows that are white, and then the rest. This is not entirely correct, but if you are able to correct me on this, you don’t need this article in the first place :-)

Then there are alt + 1, alt + 2 , and so on. These take you directly to the window with that number. By default, the top 2 lines of your (qwerty) keyboard are bound that way, all the way up to alt + o, which takes you to window 19.

Going to the next or previous window can be done by pressing ctrl + p or ctrl + n.

Some commands to make your life easier:

  • /window last: go to the window you were in before this one.
  • /window goto <number>: go to the window with that number.
  • /window goto <nickname>: go to the window with the query with <nickname>.
  • /window goto <channel>: go to the window with the given channel.

Changing navigation

Personally, I like my home and end keys not to go to the beginning and end of the text line, but to the beginning and end of the buffer. I have accomplished this by doing the following:

  • /bind end command /sb end
  • /bind home command /sb home

Also, having alt + 1 through alt + 0 and alt + q through alt + p is great if you have “only” 20 windows, but if you have more, what then? I’ve added windows 21 to 40, like this:

  • /bind meta-a change_window 21
  • /bind meta-s change_window 22

And so on. I had to re-bind alt + a of course, alt + [, which is to the right of the p on my keyboard:

  • /bind meta-[ active_window

If you want to scroll up or down a different amount that half a page when pressing page-up or page-down, change the setting scroll_page_count.

The command /window goto is very useful. However, it’s way too much typing. So, since I never use /w for /who, I’ve changed /w to /window goto:

  • /alias w /window goto

Finally, I got rather annoyed by how ctrl + z puts irssi in the background. I never ever want to do that. So, I wanted to bind ctrl + z to a useful command. There is a command that takes you to the window you were in before this one, so I bound that:

  • /bind ^Z command window last

This way, by pressing ctrl + z, I can keep toggling between two interesting windows.

I hope this helps you to navigate around irssi easier and faster!

Posted in irssi | Tagged , , , , , | Leave a comment

Terrible Websites 2

It’s time for another round of “interesting” websites. Thanks to those of you who sent me some links!

If you have a chain of stores that sell computer parts, I would assume you have some experience with the internet, including how to make a good website. Apparently my assumption is rather naive, as you can see at the site of MSY Australia. I especially like the “jobs” link at the bottom… that jobs page really inspires confidence!

I also found yet another pet-based website, this time about golden retrievers. This site isn’t even that bad, but still, using Comic Sans as the font on your entire website? Urgh. I don’t know why this is, but many websites about pets have a terrible design. Any idea why?

Another website that makes the Comic Sans error is that of Clare House Primary School in Bromley, UK. Since it’s the website of a primary school, you could argue that the website is mainly for children; but if you look at the contents, it’s more aimed at the parents. Bad idea.

Are you interested in the unity way of life? You can find out exactly what it is on the Unity Chapel site! I like how they didn’t even buy their own domain, but host their site on a subdomain of the website builder site they chose.

For the last page, make sure you turn down your volume, because it has sounds. A radio commercial, it seems. It’s the website of the super market chain Nettorama, in the Netherlands. My poor eyes, and my poor ears!

Do you know of any terrible websites? Please email them to me at terriblewebsites (at) garion (dot) org!

Posted in Terrible Websites | Tagged , , , | Leave a comment

AJIP 6 – $0.02 / $0.05 blinds cash game

It’s been ages since I’ve last posted about poker. That’s mainly because I haven’t been playing it much. I’m still interested though, and still want to learn this difficult game, and last weekend I played a couple of hands on a 6-handed table on PokerStars. The blinds were $0.02 / $0.05. Here are some of the hands that had me wonder what I could’ve done differently.

In this hand, I had K8s in the big blind. The small blind was a rather loose player, who had only been at the table for about 15 hands. After four folds, he decided to raise to $0.15, which I called. I was hoping to hit a King or 2 hearts on the flop, so I could get a lot of money from him. I was also in position.

The flop was AJ8. Bottom pair for me. Not exactly what I was hoping for, but still a pair, and if the turn would be a King, I would still like my hand. Mr. Loose bet $0.20 into the $0.30 pot. I hoped that if he had nothing, and this was just a continuation bet, he would shut down and stop betting on the turn and river. So I decided to call.

The turn was another Jack. Mr. Loose bet $0.30 now. I decided to stick with my original plan, and folded, believing that I did not have the best hand. Mr. Loose showed me his 73 of diamonds.

Many things I could’ve done differently here. What do you think of my thought process and conclusions?

A few hands later, I had AJ offsuit in the big blind. The UTG player limped in for $0.05. The cutoff raised to $0.15, which I thought could easily be a steal because of the early limp. The button and small blind folded, and I decided to reraise to $0.50. I would be happy if I could win the post then and there. The UTG limper called, and the cutoff called too.

So, I guess they had something after all. Maybe a pocket pair, or two face cards.

The flop was K66. Since I was first to act, I decided to check to see what the other two players would do. They both checked as well.

The turn was a 3. This was unlikely to help anyone, unless they had 2 spades of course. Would they have bet a hand with 2 spades? I checked again, and again the other two players checked too. I guess nobody had a King, and everyone was afraid to bet because… the other person might have a King? Hmmm.

A blank hit the river. Again, we all checked. I showed my AJ, and the cutoff raiser won the pot with 77.

How should I feel about this? Should I be happy that I lost the minimum? Should I have bet at some point, hoping my opponents would fold?

Poker looks so easy on TV, but it’s much harder if you have to make these decisions within a few seconds, not knowing the other players’ cards, and not having much experience!

Posted in A Journey Into Poker | Tagged , , , | Leave a comment

The many faces of Day[9]

Somewhere in 1999, one of my friends recommended that I try playing StarCraft. It was my first RTS game, and I loved it. I played it with friends and online, made new friends through it, and enjoyed it thoroughly (including the soundtrack – so good!).

Unfortunately, I was struggling a bit with RSI back then, so I couldn’t play very much; fortunately, I had gotten to know some of the top Dutch players, and they often let me watch their live games. This was during the 1.07 patch (remember, when the Spawning Pool cost only 150 minerals?),  so there were no replays yet.

I’ve always enjoyed watching good players play games that I like. I like watching Snooker on TV, as well as observing 2 good players duke it out in StarCraft.

Fast-forward about ten years. StarCraft 2 just got into the Beta stage. People began playing it, and videos started popping up everywhere. I found out that the Team Liquid website was still hot, and came across some live streams of good players there. One of the streams that made me giggle was Debo’s stream – his swearing during games was amusing. Two other good streams were Crota’s stream and  ShoutCraft by TotalBiscuit.

During that search, I also encountered Day[9]‘s stream, and his stream archive. Day[9] does a daily broadcast about StarCraft 2, each around 45 to 60 minutes long. Most of his shows consist of in-depth analysis of one or two games played by professional players.

Wow! This was exactly what I was looking for. I think I started watching just around SC2 release day, so the King of the Beta series was the first bit I saw of Day[9]‘s show. Day[9] provides excellent commentary, and it’s obvious that he has tons of experience with both SC1 and SC2. Plus, using his analytical mind, he gives us spot-on analysis.

Day[9] also goes to SC2 tournaments to provide live commentary of the matches being played. Some of this also gets uploaded to the interwebs for us to watch.

As you can see in the screenshots, Day[9] uses an overlay in the middle right of the screen. This overlay hides the replay timer, so the viewer cannot see how long the replay will last. I like it: not knowing when the current game will end makes it more exciting to watch. Day[9] loves his overlay too, as you can see below.

By now, Day[9] has done over 300 dailies. For episode 100, he did a special about his life as a StarCraft gamer. This was an extra long episode, called My Life of StarCraft, where Day[9] talks about how he got into StarCraft, why his family supported him, and how this game changed his life. It’s very much worth watching – even if you are not into StarCraft at all.

Soon after I started watching Day[9]‘s stream, he introduced Funday Monday, a weekly special, where viewers get to play with arbitrary, weird constraints (for example, “build a Carrier before expanding” or “build mass Queen”), and send replays of those games to Day[9]. Day[9] chooses the best and/or funniest games from the thousands of submissions, and shows them to the viewers.

One of my favourite episodes ever is “No Marines, Marauders or Tanks“, where Terrans get to build everything except those 3 core units. This leads to hilarious games with very funny commentary, which had me laughing non-stop.

Another classic is the series called “Team Monobattle“, where you play 3v3 or 4v4, and each member of your team has to announce publicly which single unit they will be making throughout the entire game. Some of the games that Day[9] has shown, have extremely weird (and crappy) combinations of units (for example: Raven/Brood Lord/Carrier/Immortal). Hilarity ensues.

Day[9] involves his audience in various interactive activities during the show, such as live polls via IRC (#day9tv on QuakeNet… and no, younger readers, that # is not a Twitter hashtag!).

He also talks to his computer.

However, the best thing about watching Day[9]‘s show is… the toilet break.

No, Day[9], not your toilet break: my toilet break.

Of course, when bio breaking, I pause whatever I’m watching. And somehow, when I pause the Day[9] daily, Day[9] always ends up with a funny face frozen on my screen.

So, the lesson from this story: if you like StarCraft, watch the Day[9] daily. And pause often.

For those of you who are already watching the Day[9] daily, here is a challenge: can you figure out which episodes these screenshots were taken from? Hint: they’re all from episodes 200 and later. I know that some of you are crazy enough to re-watch them all ;)

Posted in games, starcraft | Tagged , , , , , , , , , , | 2 Comments

Terrible Websites 1

This is going to be a new section with a recurring theme. There are some terrible, terrible websites out there. It amazes me again and again what some people seem to consider cool or usable websites. In this series, I’ll share some of the gems with you that I’ve encountered over the years.

A note in advance: I am by no means attacking the people behind the websites. I’m sure their intentions are good. It’s just that these intentions are sometimes expressed in… interesting ways :D

Let’s look at some examples.

http://www.zangerpetro.nl/ – a Dutch singer. The flaming background makes the page a hundred times more awesome.

http://detibetaanseterriernieuwssite.nl/ – a site about a certain kind of dog. The blue on blue text at the bottom isn’t very readable and the pictures give a rather chaotic impression. At the bottom, in the right, there’s a serious warning: it’s not allowed to link to this page except with express permission. The rest of the pages contain similar threatening texts.

http://www.welshcorgiclub.nl/ – more dogs. Note the wonderful message at the top about the ideal resolution. Also, the title doesn’t fit, so what do you do then? Yup, you use <marquee>!

http://www.applefly.nl/welkom_bij_applefly.htm – This is a graphic design company. Do I need to say more?

Have any other terrible pages I should post about? Feel free to comment them or email me about them!

Posted in Terrible Websites | Tagged , , | 2 Comments

Gmail, Google maps, Market: move to SD card

Dear Google,

please make it possible to use move to SD card for Gmail, Maps, and Market.

Kind regards,

a sad HTC Desire user who is always low on phone memory, even with not many apps installed.

Posted in smartphone | Tagged , , , , , , , , | Leave a comment

Using virt-manager on MacOSX with Dvorak keyboard layout

I have a hosted Ubuntu machine that runs KVM for virtualisation. I just created a new VM, and wanted to use virt-manager to get a graphical VNC connection to the machine.

So, I did the following on my macbook with Dvorak keyboard layout:

ssh -X kvm-host.mydomain.nl
sudo virt-manager -c qemu:///system

I double-clicked the new VM, and got the graphical screen with the login prompt. However, when I started typing my username, I quickly noticed that the letters that appeared in no way corresponded to the keyboard layout I use, Dvorak. It wasn’t even a Dvorak/Qwerty juxtaposition, but was utterly unusable. For example, the 8 key produced an Enter character.

Google helped me find a blog post which described the same issue. So I ran virsh edit my-vm-name and added keymap=’en-us’ to the <graphics> tag, restarted my vm, and restarted libvirt on the host. That improved things already – the 8 key produced an 8. But now I was stuck with Dvorak vs Qwerty problems.

Some more searching found me a blog post which contains a Dvorak keymap file for qemu. I put that in /usr/share/qemu/keymaps/en-dv and changed en-us to en-dv in the <graphics> tag.

I think it’s great that people write down problems like these and the solutions they found! Makes it much easier for others to solve similar problems. Hopefully, one day, someone will find this blog post and fix their problem because of it :-)

Posted in sysadmin | Tagged , , , , , , , , | 1 Comment

Deleting spam with postfix and SpamAssassin

For years, I’ve been using mutt as my main mail program. I love being able to use mutt in screen and thereby having access to my email from anywhere, with just ssh or PuTTY. Back when I first created this setup, all opensource webmail software then available was still very poor in functionality, which I why I didn’t use webmail for the “access from anywhere” part.

I have a hosted machine, and the MX records of my domains point to it. My mail is being handled by postfix, and spamfiltered by SpamAssassin. Procmail helps me sort mail into different folders upon arrival.

This setup has some disadvantages. Some spam leaks through, which is annoying – since I only receive a few emails every day, a relatively large portion of the mail I see is spam. Also, turning off or reinstalling my hosted machine means emails don’t arrive.

I recently got a smartphone, and wanted to be able to use it to read my email. I briefly considered installing dovecot on my hosted machine to provide IMAP, but decided to try Google Apps instead.

I followed the Google Apps setup document, and set the MX records of one of my domains to Google’s mailservers. That worked fine. Since the free version of Google Apps doesn’t support more than one domain, I then configured postfix on my hosted machine to forward mail sent to my other domains to gmail.

This turned out to have one big disadvantage: with that setup, all spam received by my hosted machine is sent to Google anyway. Sure, SpamAssassin puts spam score headers in the message, but the message is sent to Google whether it’s spam or not. This results in my hosted machine sending 90% spam and 10% real mail to Google.

I was afraid that Google might start seeing my hosted machine’s IP address as evil because of the relatively large amounts of spam, so I looked for a way to prevent most or all of the spam from being forwarded to Google.

This is what I found: http://www.akadia.com/services/postfix_spamassassin.html

See the section called “Create your own Content Filter“. This was exactly what I was looking for.

Steps 1, 3, 4 and 5 worked fine on my Ubuntu server, although there is a typo in the first step (“filer” instead of “filter”). Oh, and I decided to use /var/spamchk as sideline dir, so I created that dir and chowned it to the filter user. I changed the script in step 2 to the following:

#!/bin/sh
# -----------------------------------------------------------------
# File:        spamchk
#
# Purpose:     SPAMASSASIN shell-based filter
#
# Location:    /usr/local/bin
#
# Usage:       Call this script from master.cf (Postfix)
#
# Certified:   Ubuntu Linux, Spamassassin 3.3.x, Postfix 2.7.x
# -----------------------------------------------------------------
# Variables
SENDMAIL="/usr/sbin/sendmail -i"
EGREP=/bin/egrep
TMPFILE=/tmp/spamchk.$$
SIDELINE_DIR=/var/spamchk
# Number of *'s in X-Spam-level header needed to sideline message:
# (Eg. Score of 5.5 = "*****" )
SPAMLIMIT=10
# Clean up when done or when aborting.
trap "rm -f $TMPFILE" 0 1 2 3 15
# Pipe message to spamc and store in $TMPFILE
cat | /usr/bin/spamc -u filter | sed 's/^\.$/../' > $TMPFILE
# Are there more than $SPAMLIMIT stars in X-Spam-Level header?
if $EGREP -q "^X-Spam-Level: \*{$SPAMLIMIT,}" < $TMPFILE
then
  # Option 1: Move high scoring messages to sideline dir so
  # a human can look at them later:
  mv $TMPFILE $SIDELINE_DIR/`date +%Y-%m-%d_%R`-$$
  # Option 2: Divert to an alternate e-mail address:
  # $SENDMAIL xyz@xxxx.xx < $TMPFILE
  # Option 3: Delete the message
  # rm -f $TMPFILE
else
$SENDMAIL "$@" < $TMPFILE
fi
# Postfix returns the exit status of the Postfix sendmail command.
exit $?

I followed these steps and got what I wanted: 90% of the spam my mailserver receives has a score of 10+, and that’s now stored on my server instead of forwarded to Google!

Posted in sysadmin | Tagged , , , , , , | Leave a comment

Recipe: guild master’s pie

And now for something completely different.

I have played a lot of World of Warcraft over the past years. During The Burning Crusade, I was Guild Master of a raiding guild. We had a raiding schedule of 4 evenings per week, where we did 25-person events from 20:00 until midnight.

Being the Guild Master, there was often much to do before each raid started. This meant that I needed to make a fast meal between arriving home from work and 20:00. I don’t like to order food, and I actually like to cook, so I needed to come up with a few meals that require little preparation time.

This is one such recipe. It takes about 10-15 minutes of actual work to prepare (excluding the waiting time for defrosting), plus 30-35 minutes in the oven.

Ingredients (for 2-4 people)

  • 450 grams of spinach (frozen)
  • 2-3 eggs
  • 200 grams of mild grated cheese
  • 100-150 grams of diced bacon
  • 1 pack of puff pastry (400 – 500 grams)
  • 3 cloves of garlic
  • Herbs: oregano, basil, some mix of italian herbs
  • Optional: sesame seeds (to sprinkle on top)

Preparation

1. Defrost the puff pastry and the spinach.

2. Pre-heat the oven to 225 degrees.

3. Bake the bacon lightly. It should not become too crunchy.

4. Finely chop or press the garlic.

5. Stir in the spinach, grated cheese, eggs, and bacon. Add the herbs and garlic. Stir some more.

6. Grease up the oven dish and line it with puff pastry. Keep enough puff pastry to cover the top later on.

7. Put the mixture of spinach and other ingredients in the oven dish.

8. Cover the top of the mixture with puff pastry.

9. Optionally, smear the top with a tiny bit of water or milk, and sprinkle the sesame seeds on top.

10. Oven-cook for 30-35 minutes.

11. When the inside of the dish is solid and no longer liquid, the guild master spinach pie is ready for consumption.

12. Profit!

Posted in recipes | Tagged , , , , , | Leave a comment

Irssi tricks: ignores and hilights

I like the IRC client irssi a lot. I’ve been using it for many years now, and have learned many tricks about it. In these irssi blog entries, I’ll be sharing some tricks with you.

The /ignore command is quite powerful and can be used to remove lots of unwanted lines. If there is someone you don’t want to see in your channel, you can use it like this:

/ignore *!username@host.example.com ALL

to ignore all messages from this person, on channels and in private, as well as things like joins and topic changes.

But it gets better. If other people are talking to this person in the channel, using the standard “Nickname: text here” structure, you can ignore this as well:

/ignore -replies *!username@host.example.com ALL

Some channels have people who use expressions like “lol” and “rofl” a lot, including many variations like “lawl” and “rulf”. I don’t like it when such expressions appear as the only word on a line, and this ignore helps me avoid seeing them:

/ignore -regexp -pattern ^l[aoeui]+w?lz?|r[aoeui]+[lfk][lfk]z?$

With the -regexp flag, you indicate that this hilight is a regular expression. With regexps, you can match very specific strings. As you can see, you can just go wild with such regular expressions.

Sometimes, you’re on a channel with a lot of activity. All the joins, parts, and modes can really pollute the window. You can hide those lines with this command:

/ignore #channel JOINS PARTS QUITS TOPICS MODES
The irssi activity bar

The irssi activity bar

You might also not want that channel to show up in your activity bar. You can accomplish that with:

/set activity_hide_targets #channel #channel2 #channel3

Actually, why would you want a channel to show up in your activity bar when someone parts it? Or voices someone? I have the following setting in my irssi:

/set activity_hide_level QUITS JOINS PARTS KICKS MODES TOPIC NICKS

To get a list of all the existing message levels, type this:

/help levels

My friends are sometimes a bit creative with my nickname, Garion. To make sure that their creative versions are hilighted properly, I’ve done this:

/hilight -regexp ga+ri+o+n+
/hilight -regexp gaa+r(k|tj)e+
Gaaarioooon

This interesting version of my nickname hilights as well.

So, if someone calls me Gaaaarioon or gaaartjeeee, it will still hilight properly.

Hilighted text, by default, appears as a purple/red/pink (depending on your terminal and colour perception) number in your activity bar. I like to have different subjects trigger different hilight colours in my activity bar, for example:

/hilight -full -color %G -actcolor %Y tea

The -full flag makes sure that only the full word “tea” causes a hilight, and “steam” does not, even though it contains “tea”. The -color %G flag makes sure that the nickname of the hilighter is shown in green, instead of the default yellow. This flag also causes the activity number in your statusbar to turn green. The -actcolor %Y flag overrides this green-ness, and turns the activity number yellow instead.

I don’t think there is a way to manipulate the contents of messages themselves via built-in irssi commands. For example, you might want to remove “lol” from the end of sentences, or replace “god” by “flying spaghetti monster”.

If you want to modify messages, one option is to use Wouter Coekaerts‘s script trigger.pl, also available from the Irssi script archive.

Stay tuned for more irssi tricks!

Posted in irssi | Tagged , , , | 8 Comments