Suspend and resume output in terminal

March 3, 2005
6 comments Linux

To some people it's obvious but I just learnt this now. It's bugged me several times where I've accidently pressed Ctrl-S and the terminal freezes. I had no idea what to do so I had to close the window with Alt-F4. This is extra annoying if you have a ssh session open.

What Ctrl-S does it that it freezes the output on the terminal. Ctrl-Q resumes it again. I can't think of a real usage for me for this but it's good to know if you accidently "freeze" your terminal.

Encrypted files in Emacs

March 1, 2005
0 comments Linux, macOS

UPDATE (Jan 2019): Read this newer blog post instead https://www.peterbe.com/plog/encrypt-with-emacs-on-macos-ccrypt

With the ccrypt program for Linux and some Emacs settings you can achieve the following:

You create or open a file called passwords.cpt. Then Emacs asks you for a password. Once you've entered the password you can word with the file like any other file to for example write down all your passwords to various websites or bank accounts.

When you close Emacs and try to read the file with any other program you get the binary encrypted output which is useless. What's important to Emacs is that the filename ends in .cpt which is a bit clunky. In vi you can get the same effect simply by passing the -x option when opening a file. But I don't like vi.

File attachment widget with Javascript

February 25, 2005
9 comments Web development

The Gmail user interface has a good way of dealing with file attachments that I would like to incorporate into the IssueTrackerProduct Add Issue page to make it easier and more flexible to use.

Unlike Gmail, the IssueTrackerProduct can't rely on Javascript so this has to work equally well in Lynx, IE or Firefox. The Lynx people will have to do with the existing interface where you get a list of file attachment inputs. The people with Javascript support will get a hyperlink that when clicked shows a file input box.

Without further ado, please have a test

Truncated! Read the rest by clicking the link below.

BaconWhores ha!

February 23, 2005
0 comments Misc. links

BaconWhores website It's not the first time we see this. A whole "serious" website that is 100% fake. The photos are retouched and the information is full of lies. I'm not even sure if it's possible to order the cool t-shirts they claim to sell. Maybe that's what it's all about: the t-shirts.

Some questions on ethics and moral should be asked. How far can you push a joke in a medium where people are already very sceptic. I guess it don't matter much because there's little that can be done. It will never be possible to tell people what they can and can't publish on their websites as long as it doesn't violate any legal boundaries.

Anyway, reading BaconWhores made me laugh and made me think: maybe it's not a joke. Maybe one can order a bacon whore???

Audioscrobbler indexes your MP3 usage

February 21, 2005
0 comments Misc. links

What I did a long time ago was that I had a plugin in Winamp that transmitted all the music I played onto a server which I controlled. That server processed the information, got a thumbnail from Amazon.com with web services and uploaded it to this site onto MP3 I Play

To me it was very much an excuse to play around with the technology and familiarise myself with ID3 tagging in Python and the Amazon.com web services using pyAmazon.

With Audioscrobbler they've taken this whole thing seriously, done it much much better and opened it up to the public.

Truncated! Read the rest by clicking the link below.

Debian popular in Sweden

February 18, 2005
0 comments Sweden

This might to some be old news but at least it's news to me. Sweden has the most Debian developers in the world. ...per capita. In the US they have 283 developers compared to Sweden's 26 only, but Sweden is a much smaller country.

What does this tell us? Nothing much probably, but as a big Debian fan I take great pride in that my fellow countrymen- and women have chosen to work on such a great operating system.

And by the way, have a look at the United States picture. Cool diagram!

Optimize Plone.org with slimmer.py

February 15, 2005
13 comments Python

If you do a speed report on Plone.org you notice that the three biggest files it services are plone.css, plone_javascripts.js and index.html. If you run these through my little slimmer whitespace optimizing program in Python you get the following results:


$ python slimmer.py --test http://plone.org/plone.css
Took 0.016 seconds
Bytes before: 29355
Bytes after:  20265
Bytes saved:  9090  (69.0% of original size)

$ python slimmer.py --test http://plone.org/plone_javascripts.js
Took 0.057 seconds
Bytes before: 27251
Bytes after:  19974
Bytes saved:  7277  (73.0% of original size)

$ python slimmer.py --test http://plone.org/ 
Took 0.029 seconds
Bytes before: 37186
Bytes after:  26466
Bytes saved:  10720 (10K)  (71.0% of original size)

Truncated! Read the rest by clicking the link below.

Python optimization anecdote

February 11, 2005
4 comments Python

I've learned something today. The cPickle module in Python can be boosted with very little effort. I've also learnt that there's something even faster than a hotted 'cPickle': marshal.

The code in question is the CheckoutableTemplates which saves information about the state of templates in Zope to a file on the file system. The first thing I did was to insert a little timer which looked something like this:


def write2config(...):
    t0=time()
    result = _write2configPickle(...)
    t1=time()-t0
    debug("_write2configPickle() took %s seconds"%t1)
    return result

Truncated! Read the rest by clicking the link below.

Combining MOBi and EconoAccount

February 7, 2005
1 comment Zope

EconoAccount EconoAccount is an open source tool I wrote to keep track of my expenditures. It started as a Excel spreadsheet where I wrote down how much I spent on what and then grew into something much better.

MOBi MOBi is a mobile web service my company developed for the owners of MOBi (read more here). MOBi is to mobile phones and SMS as domain names are to www. On MOBi, I have registered the keyword peterbe (unsurprisingly) and set up the sub-word "ea *".

Now with a bit of tweaking I can write down all my expenses with my mobile phone when I don't have a computer with Internet available. Read on to find out how.

Truncated! Read the rest by clicking the link below.