jamesoff.net




9
Jul
2008
0

grepping the output of ccze

If you ever want to grep the output of ccze and found it didn’t work right, here’s the magic incantation to do it:

tail somefile | ccze -A -o noscroll | grep ...

-A makes ccze output ASCII sequences, and -o noscroll turns off the scroll option - whatever that is exactly. The man page says it’s a good idea to turn it off if you’re redirecting the output. Omitting it seems to make the output appear in lumps :)

For example, keep an eye on squid logs omitting all MSN crap:

tail -F access.log | ccze -A -C -o noscroll | grep -v gateway.dll

Permalink | Posted in FreeBSD Sysadmin and tagged  



11
Apr
2008
0

Delphi documentation

While writing some Delphi code at work, I spotted this in the documentation. Not sure if I want to call that function or not now…


Permalink | Posted in Coding Work and tagged  



10
Apr
2008
0

Irssi typing speed script

I have written an irssi script which measures how fast you type on IRC and reports both words per minute and characters per minute.

More details and download: WPM script.


Permalink | Posted in Coding my stuff and tagged  



1
Apr
2008
0

BBC News Stylish script

The new BBC News layout seems to be causing some people to stress out a bit - but then all new redesigns do until they get used to them. I quite like it, but for a friend I knocked this up quickly to get rid of the two banners across the top of the page.

You’ll need Stylish and then stick this in a userscript for it. You may need to adjust the domain (2nd line) if you don’t use news.bbc.co.uk to access the site.

(more…)


Permalink | Posted in Coding internets and tagged  



6
Mar
2008
0

vim as a man-page reader

Sure, why not :)

This goes in your zshrc:

  vman() {
    if [ $# -eq 0 ]; then
      /usr/bin/man
    else
      if man -w $* >/dev/null 2>/dev/null
      then
        /usr/bin/man $* | col -b | vim -c 'set ft=man nomod' -
      else
        echo No man page for $*
      fi
    fi
  }
  alias man='vman'

And this goes in your vimrc (in a suitable augroup):

  autocmd FileType man setlocal ro nonumber nolist fdm=indent fdn=2 sw=4 foldlevel=2 | nmap q :quit<CR>

Now you’ll get nicely highlighted man pages with folded sections, and you can hit q to quit just like less.

Vim as a manpage viewer


Permalink | Posted in FreeBSD Linux Sysadmin and tagged  



21
Feb
2008
4

irssi and ZNC

ZNC is an IRC bouncer with some pretty nice features. For a number of reasons I wanted to move my ircing from home to a shell, so I decided to give ZNC a try. ZNC isn’t in ports, but compiles fine using gmake.

The only problem I encountered was getting it set up to work with multiple networks in irssi. Configuring ZNC itself to put me on many networks was easy enough, and when I connected irssi to it for each network using /connect it worked fine. Using /server add to set up irssi’s server list didn’t work out so well.

Every time I tried to add another server (for connecting to another network), irssi would remove the first one. This is because irssi only considers a server’s hostname and port when trying to work out if it’s unique. When I added another server which differed from the first only by password and associated network, irssi assumed I was updating the existing one and changed it. Putting the required entries in irssi’s config by hand also didn’t work.

The solution was easy enough; one ZNC instance can listen on multiple ports, so I got it to listen on a selection of ports using multiple Listen directives in its config file, and then added each network’s server to irssi using a different port number.

Now I can take advantage of cool things like buffer replay and detaching from channels. Sorry, irssi-proxy - you don’t quite cut it now :)


Permalink | Posted in FreeBSD internets and tagged  



19
Feb
2008
0

bMotion wins again

Sometimes, NoTopic gets it just right :)

[@         Time] nt, do you have a job?
[@      NoTopic] but of "course"
[@         Time] nt, what is your job?
[@      NoTopic] I can't tell you that!
*      JamesOff . o O ( mi5 )
[@         Time] i was thinking six :(
[@         Time] nt, do you work for a secret government organisation?
[@      NoTopic] i do
[@      NoTopic] despite having no mouth
[@         Time] :--o
[@         Time] nt, mi5 or mi6?
[@     JamesOff] it's so secret they took away his mouth
*       NoTopic thinks
[@      NoTopic] Time: mi6.
[@         Time] rut roh
[@         Time] nt, are any of us under suspicion?
[@      NoTopic] i am not at liberty to discuss that
[@         Time] :-x
[@         Time] he's too clever for me

Permalink | Posted in Fun and tagged  



17
Feb
2008
0

GuardChan now bans

After a user request on IRC, my guardchan script can now actually ban as well as kicking when it detects an unauthorised user joining the channel.

(The page for the script incorrectly said that it kickbanned already, but that was an error due to me writing the script about a thousand years ago.)

Hope it’s of some use :)


Permalink | Posted in Coding and tagged  



8
Feb
2008
0

Wrong number again

O2 apparently recycled my phone number too quickly after its previous owner relinquished it, so ever since I’ve had it (a bit under a year now) I’ve been receiving phone calls and SMSes for “Debbie.” Generally I just explain that it’s not her phone any more and would they please go away. I felt sorry for the guy who had put a lot of effort into preparing a happy birthday MMS for her complete with attached birthday cake clip-art.

Last night as a birthday present for me, I got this message from a random number: (reproduced here exactly as it was received)

Sos 4 delay, yes we’d luv 2 come 4 sun lunch. Wot time? Hopn ur al wel,hav bin recoverin from an arse op!Very painful!Wil fil u in wen i c u.X

So I exercised enormous restraint and ignoring the bait replied “Think you’ve got the wrong number :)” to which I recevied:

Is that not u debbie?Txt was from nicola x

Nope, sorry. Hope the arse gets better though.


Permalink | Posted in Fun random and tagged  



3
Feb
2008
2

Old phones

While sorting out boxes of stuff hidden away in a cupboard (so I’d have less pointless stuff to carry around when we move house), I came across some of my old mobile phones.

Exactly why I kept them I’m not sure, but I tend to find it difficult to throw old hardware away in general. I have a whole drawer of old ISA cards that I need to sort out later.

About the only reason to keep stuff like this is to laugh at it years later:

Ericsson SH888

Ericsson SH888

My first mobile phone, which I got in late 1999/early 2000 I think. It’s definitely a ‘brick’ phone, being shaped exactly like one only slightly bigger and less useful for contacting your friends. It has a three-line block character display so the most graphical part of the menus was an arrow character indicating where you could scroll. I remember two things in particular about this phone: it was very very slow and the way the battery clipped on the back meant pulling it out of your pocket could cut the power (before it had saved a record of who the incoming call was from).

Nokia 7110

Nokia 7110 closed Nokia 7110 open

This was my second phone which I got in mid-2000. It’s a slide phone, a bit like the one used by Neo in The Matrix. It has a little silver button on the back which where your finger rests which makes the slide jump open. They were renowned for breaking, particularly if you let your friends play with them. The other gimmick of this phone was the roller control, which worked like a scroll wheel on a mouse. It was ok, although I think it was easy to accidentally scroll and select the item either side of what you actually wanted when you tried to click. There were a couple of scrollwheel-based games on it but nothing amazing. It was also a bit slow, but was my first phone with predictive text.

Nokia 6820

Nokia 6820 closed Nokia 6820 open

Skip forward a couple of handsets (a Nokia 6230 which was awesome and a Sony Z7 which was shit) and we arrive at the Nokia 6820. I could never actually remember this phone’s model number and even now found it so unmemorable that I had to look under the battery three times. It was a pretty neat phone though, which swung open (and rotated 90 degrees) to give a split QWERTY keyboard for writing texts. It was marketed as a business phone but the mobile browser on it was so rubbish I think they’d have been better sticking to branding it a phone for people who send a lot of SMSes. The QWERTY keyboard worked really well but the phone was let down by a display that was slow to update (very Dual scan) and was set about half a centimeter back from the plastic case which was a bit weird.

All these phones have finally been consigned to the bin having at last served the purpose I probably kept them for - nostalgia.


Permalink | Posted in Fun and tagged