Many times, you would like to record every work and commands in the terminal session. In the situations like checking the server’s status, testing new softwares, changing the configurations, fighting with crackers.. things like that.

In that moment, you don’t have time to take notes on every commands, but trying to get the system running. However, you will also want to check the log of the commands and outputs.

There is a very useful command named script (1) in the bsdutils packages. The software will help you make typescript of everything printed in the terminal, including your input. So, you can use this software to record your works, and review it later.

No only the things printed in your terminal, you can also save the timing data with ‘-t‘ option. The timing data will be outputted to standard error, you can save it by redirect the standard error to a file. Then you can play back the typescripts by scriptreplay (1).

Therefore, you could show how you get thing down to your friends/colleague by playing the typescript. Just like watch a movie.

For a easier usage, I wrote a small script. The script will help me save the typescript in the filename I assigned or time stamp.

Usage is very simple

$ ./script.sh # save the typescript as time stamp filename
$ ./script.sh mission-critical.log # save the typescript as mission-critical.log

This is a tip for Debian GNU/Linux.

Since the Slashdot (The website for nerds) lunched a new AJAX-style comment filtering system, it’s much easier to read the high-score-interesting-and-Insightful comments for stories.

If you look closer, you will find an arrow in the comments list of a story. The arrow is keyboard shortcuts indication just like gmail, which help you read the messages by using the keyboard.

But the keybindings are different with Gmail or other forum discussion system. You can learn the keybindings in Slashdot’s FAQ.

/* keys
prev comment: A, H
next comment: D, L
prev thread: W, J
next thread: S, K
prev comm chrono: Q
next comm chrono: E
next unread comm: F
reply to current comment: R
parent of current comment: P
history (modlog) of current comment: M
hide history: X
skip to end (last): V
skip to top (first): T
get more comments: G
lower top threshold: [
raise top threshold: ]
lower bottom threshold: ,
raise bottom threshold: .
toggle d2 widget: /
*/

Have you experienced that the useful ScribeFire (a nice WYSIWYG blog tool for firefox extenstion) crashed, and you lost the latest post which you just wrote for a few hours ?

If the answer is yes, and you are using ScribeFire 2.3.2 and restart the Firefox and visit this blog for searching how to recover your hard work.

I am sorry to tell you, it’s too late, your work is overwritten.

If you did not restart the browser and lunch the ScribeFire, then you got luck. Backup the performancing-notes.xml file in your firefox/profile/extensions as soon as possible, it’s your latest chance to save it.

The problem is because the ScribeFire editor does not save the editor state by autosave, when the firefox crashed. And it will use the old content in editor state to overwrote your latest ‘saved work‘.

This is a small but very annoying issue, which break your hard work. Hope it will be fixed very soon. You can find a workaround patch in Issue 714 of ScribeFire’s issue list system.

The software is updated at 2010/10/05.

It’s nice to see that people still like to use the small piece of software which been wrote for 20 months without updated. Thanks for feedback from

  • Uwe, g021030 (at) gmx.net
  • Keith Refson, K.Refson (at) rl.ac.uk

And the others how left the messages on the blog, especially patch from Hank Hampel and encouragement from Dick Dunbar. 😉

The new release is now handling in-line attachment as well, and it’s autotoolized and debianized.

You can download the tarball and deb file for Debian sid from

evolution-remove-attachments_0.0.2.tar.gz
evolution-remove-attachments_0.0.2_i386.deb
evolution-remove-attachments_0.0.2.dsc
evolution-remove-attachments_0.0.2_i386.changes

They are tested on Debian Sid with Evolution 2.22.

Once you have many Debian servers, maintenance would be a problem. I just counted that I have more then 30 etch servers running in several vserver machines. Sometimes, I would like to install Debian package in all of these servers. However, it takes too much time to ssh /vserver enter into every hosts, and answer the installation questions one by one.

Thanks for the debconf(1), it’s quite easy to do non-interactive installation, since debconf already provide a noninteractive frontend. All you need to do is set the configuration before you install the package. It can be done by debconf-set-selections.

First, you have to install the package in one hosts. It would be better if you install/test the package on the same distribution version and package version. Here is an example for install localepurge. localepurge is a software for superfluous locale data, that will save you some disk space. As a Chinese, I usually don’t need Spanish, Franch and any other hundreds of different locale data.

Once you install the localepurge, you can use debconf-get-selections to dump the configuration you did.  The debconf-get-selections is part of the debconf-utils. The command would look like

# debconf-get-selections |grep ^localepurge
localepurge	localepurge/quickndirtycalc	boolean	true
localepurge	localepurge/remove_no	note
localepurge	localepurge/mandelete	boolean	true
localepurge	localepurge/showfreedspace	boolean	true
localepurge	localepurge/verbose	boolean	false
localepurge	localepurge/nopurge	multiselect	en, en_US.UTF-8, zh, zh_TW, zh_TW.UTF-8
localepurge	localepurge/dontbothernew	boolean	false
localepurge	localepurge/none_selected	boolean	false

So, these are the questions the debconf will ask you. (Since the questions has different priorities, you might not be asked for all the questions) The localepurge/nopurge line is the locales data we want to keep, so we also want to let the other servers have the same settings. You can use debconf-set-selections to set the values in the other servers.

# echo "localepurge localepurge/nopurge multiselect en, en_US.UTF-8, zh, zh_TW, zh_TW.UTF-8"|debconf-set-selections

Then you can now install the package, it will use the default value you just gave. If you need to install many servser, and do not want to see the question dialogs. You can use noninteractive fronetend to bypas the questions.

# DEBIAN_FRONTEND=noninteractive dpkg-reconfigure localepurge

This is a Tips for Debian system.

Thanks clkao (高大師) for the great svn-mirror tool. I am using svn-mirror 0.68-3 on Debian Etch for mirror svn repository from the damn far and slow European svn server, so I can enjoy the super faster checkout and show the log messages on local server.

However, since the the svn server is slow and connection is not stable (otherwise I don’t need svn-mirror anyway). The connection might be dropped or the process could be killed by accident in the long mirroring process. The problem is once the program is killed (Ex: by Control+C), then it will run into a dead lock situation. You will keep seeing this messages, and never get the mirror work again.

Waiting for sync lock on /mirror/remote: openwrt:25221.

In order to fix the problem, I wrote a simple script svn-mirror-unlock.pl. It’s for clean the dead lock.

$ svn-mirror-unlock.pl
svn-mirror-unlock.pl: unlock SVMREPOS path
$ perl svn-mirror-unlock.pl unlock /home/svn mirror/remote

This is a tip for Debian.