Mozilla Browser

Log SSL-Connections:

To log SSL-connections for imap-sessions enter

# export NSPR_LOG_FILE=/tmp/mozlog.txt
# export NSPR_LOG_MODULES=IMAP:5

and start mozilla.

Update: This does also work with thunderbird and firefox. See also Mozilla Wiki

Change user agent string:

In prefs.js:

user_pref("general.useragent.override", "my own useragent string");

Bash wraps long lines in the same line

http://thread.gmane.org/gmane.linux.gentoo.user/56979:

From: Thomas Achtemichuk  tomchuk.com>
 Subject: Re: anoying terminal
 Newsgroups: gmane.linux.gentoo.user
 Date: Thu, 04 Dec 2003 13:49:19 +0000
 
On 12/04/03 11:05:43, Helder Rossa wrote:
> my terminal in gnome when I'm writing a command bigger than the console
> size it wraps the text to the same line that i was witting on :-S .

By default bash doesn't check it's window size after every command. The  
good thing is that you can make it. Add "shopt -s checkwinsize" to your
~/.bashrc or /etc/profile. Works like a charm.

To reproduce the "error":
man bash
resize the window
quit, and type a long string at the prompt.

It will wrap at the window's original width and wrap onto the same line.
echo "shopt -s checkwinsize" >> ~/.bashrc (or /etc/profile)
source ~/.bashrc
try again

It works correctly!

In my opinion this is something (along with a decent PS1) that should be  
added to the default /etc/profile or /etc/skel/.bashrc and the user should  
never have to set by themselves.

-- 
Thanks,
Thomas Achtemichuk

Doubletten in Datenbank finden

Gegeben sei ein Tabelle t, die Doubletten in der Spalte s hat. Außerdem hat die Tabelle noch einen Primary Key in der Spalte id.

Folgender Code findet die Doubletten:

SELECT t1.s, t2.s FROM t AS t1, t as t2
WHERE ( (t1.s=t2.s) AND (t1.id < t2.id) );

Würde “t1.id<>t2.id” stehen, würden alle Doubletten zweimal auftauchen. Sollen Doubletten aus zwei verschiedenen Tabellen abgeglichen werden, hat man diese Probleme natürlich nicht.