Friday, October 27, 2006

Background Halo in GIMP

Sooo easy!!!

Downloaded the Tux from here:

http://www.pc-freak.net/penguins/slide_34.html

Read this:

http://www.gimp-tutorials.com/tutorial/Drop-Shadow-in-gimp-138.html
( http://gug.sunsite.dk/tutorials/cmarshall2/ )

Reanamed Background Layer to Tux

Created a new "Background" layer and filled it with black.

Duplicated Tux layer

Moved "Tux copy" behind Tux

With Tux copy layer selected:

Did ^A changed fill to Whole Selection, filled with white.

Copied layer

Turned off "Keep Transparency"

Right-Click, and choose Filters->Blur->Gaussian Blur (IIR) (50x50)

Paste your white copy over it again.

Anchor pasted layer

Filters->Repeat Gaussian Blur

Paste white copy (rinse & repeat 4 or 5 times and the halo will grow)

If you do it without the paste the halo will not be so bright and will thin a bit.

Thursday, October 19, 2006

Bin the annoying blue junk & enjoy chatting at the Sametime...

UPDATE: This used to be about installing GAIM (later Pidgin) with Meanwhile support - Meanwhile (the Sametime plugin) is now built in to Pidgin so you don't need to install it seperately... so this is now about how to get spell checking with Pidgin.

Have to use Sametime at work and fed up with it crashing or closing windows and losing your conversation history with no log when you accidentally brush the [Esc] key???

Hey there chataholics, this could be just what you've been looking for!
Take a chunk of Pidgin (which you used to know as Gaim)
Mix in a good sized quantity of GTK+
Sprinkle with a small pinch of Aspell and presto, ready to serve!

Currently available for free from your local store:
pidgin 2.0.2
GTK+ 2.10.13 rev a
Aspell

NB: For Aspell this time I installed the full installer, then the English dictionary... it spell checks British spelling correctly.

GIMP pwnz j00!

This is the same image:

-rwx------ 1 gbr02703 mkpasswd 1823914 Oct 19 21:02 gimp.psd
-rwx------ 1 gbr02703 mkpasswd 983037 Oct 19 21:05 gimp.xcf

The XCF file is half the size of the PSD but still handles layers.
(I don't know what PSD can do that it can't - I'll have to read on that)

Irfanview did save the PSD as a smaller PNG than GIMP did...
but then when I opened the Irfanview PNG in GIMP and saved that as a new png
GIMP it made it even SMALLER than Irfanview had!

-rwx------ 1 gbr02703 mkpasswd 324875 Oct 19 21:02 gimp.png
-rwx------ 1 gbr02703 mkpasswd 299304 Oct 19 21:46 irfanview.png
-rwx------ 1 gbr02703 mkpasswd 299283 Oct 19 21:47 irfanview_gimp.png

Thursday, October 12, 2006

Adobe Reader offline installer

The Adobe Reader download page only offers you to download a 521Kb installer stub which downloads the rest of the installation off the net.

That isn't great if you're behind a proxy server that it won't authenticate with!

I found this page which says that a full installer can be downloaded from here:


Adobe Acrobat 7.0.8 Standalone Full Installer 20.3 MB

Wednesday, October 11, 2006

vim search highlighting



Don't you hate that when you do a search in vim and all the results are highlighted, but they're highlighted in such a colour scheme that you can't see what that text is anymore? (white on yellow anyone?) ...sometimes you want to turn it off in a hurry.

...toggling syntax highlighting:

I have this in my ~/.vimrc now:


:colorscheme johngh

"
" Have <F2> toggle search match highlighting and report the change:
"

nnoremap <F2> :set hls! hls?<CR>

"
" Define colors that are different enough to be noticeable
" and clear enough to be visible...
"
hi search guifg=LightBlue guibg=White " gvim
hi search ctermfg=LightBlue ctermbg=White " console/terminal vim


There are different ways to express this, I've used the shortest I've found here.
As far as I know they mean the same thing, but I've also seen/tried:


nnoremap \th :set invhls hls?<CR>


and...


map <F2> :set hlsearch!<CR>


I presume "!" is the same as "inv", and that it means "toggle/invert the value of..."

I presume "?" means "show the value of..."

Originally from TipID 14


" have \th ("toggle highlight") toggle highlighting of search matches, and
" report the change:
nnoremap \th :set invhls hls?<CR>


NB: the \th is entered literally as \+t+h

\(letters) is nice to use in vim for mapping things, because \ is not used otherwise.
It's nice to keep v free for on-the-fly mappings...
<F2> is free, so let's use that here :o)

Thursday, October 05, 2006

apt-get public key errors

If you get public key errors like this when you do apt-get update

# apt-get update
Get:1 http://debian.tu-bs.de sid Release.gpg [189B]
Hit http://debian.tu-bs.de sid Release
Err http://debian.tu-bs.de sid Release
Get:2 http://debian.tu-bs.de sid Release [24.3kB]
Ign http://debian.tu-bs.de sid Release
Ign http://debian.tu-bs.de sid/nx Packages/DiffIndex
Hit http://debian.tu-bs.de sid/nx Packages
Fetched 24.5kB in 0s (42.1kB/s)
Reading package lists... Done
W: GPG error: http://debian.tu-bs.de sid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FB1A399A71409CDF
W: You may want to run apt-get update to correct these problems

As root, using the key that it says is not available, do this:

# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys FB1A399A71409CDF
gpg: requesting key 71409CDF from hkp server wwwkeys.eu.pgp.net
gpg: key 71409CDF: public key "Stefan Lippers-Hollmann (http://www.kanotix.com) <s.l-h@gmx.de>" imported
gpg: Total number processed: 1
gpg:               imported: 1

This can be abbreviated:

# gpg --keyserver wwwkeys.eu.pgp.net --recv 71409CDF

# gpg --list-keys 71409CDF
pub   1024D/71409CDF 2004-11-11
uid                  Stefan Lippers-Hollmann (http://www.kanotix.com) <s.l-h@gmx.de>

# gpg --export 71409CDF > 71409CDF.gpg

# apt-key add ./71409CDF.gpg
OK

# apt-key list 71409CDF
/etc/apt/trusted.gpg
--------------------
pub   1024D/71409CDF 2004-11-11
uid                  Stefan Lippers-Hollmann (http://www.kanotix.com) <s.l-h@gmx.de>

The next time you run

# apt-get

the messages are gone.

Cleaning up...


You probably don't want to leave the key in your public keyring ( /root/.gnupg/pubring.gpg )
You can remove it like this:

# gpg --delete-key FB1A399A71409CDF
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


pub 1024D/71409CDF 2004-11-11 Stefan Lippers-Hollmann (http://www.kanotix.com) <s.l-h@gmx.de>

Delete this key from the keyring? (y/N) y


Also see this post.

If you want to be lazy you can use this as a shell script and call it with the ID of the key you want to import:


#!/bin/bash

if [ "$1" = "" ]
then
cat <<EOT >&1
Usage: $0 PUBKEY_ID_TO_IMPORT
Run apt-get update and copy the key ID from the error line like:
W: GPG error: http://www.debian.org etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0123456789ABCDEF
e.g.:
$0 0123456789ABCDEF
EOT
exit 1
fi
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys $1
gpg --list-keys $1
gpg --export $1 > $1.gpg
apt-key add ./$1.gpg
apt-key list
gpg --delete-key $1

Perl in-line edits...

If you'd like to be able to run a command like:

$ inline "TEXT TO REPLACE" "REPLACE WITH" filename

Make a shell script with this:

#!/bin/sh

MATCH_STRING=$1
REPLACE_WITH=$2
EDIT_FILE=$3

perl -pi.$$ -e "s{${MATCH_STRING}}{${REPLACE_WITH}}g" ${EDIT_FILE}

It will rename the files to the original filename with the current process ID on the back, and leave an edited copy in the new file.

Alternatively instead of the process ID, a timestamp (of the time now) might be more useful.

You could use:

DATE=$(date +'%Y%m%d%H%M%S')

perl -pi.${DATE} -e "s{${MATCH_STRING}}{${REPLACE_WITH}}g" ${EDIT_FILE}

or perhaps more usefully, for a timestamp based on the last modified time of the file before editing:

TIMESTAMP=$(date '+%Y%m%d%H%M%S' -r ${EDIT_FILE})

Like: 20061005151552

You might want the unix timestamp of the last modified time of the file:

TIMESTAMP=$(date +%s -r ${EDIT_FILE})

or

TIMESTAMP=$(stat -c %Y ${EDIT_FILE})

Both give: 1160057752

then:

perl -pi.${TIMESTAMP} -e "s{${MATCH_STRING}}{${REPLACE_WITH}}g" ${EDIT_FILE}


To just remove a line you can do this with the -n option:

perl -ni.$$ -e "print if !~ /^${MATCH_STRING}:/;" ${EDIT_FILE}


But this is shorter:


perl -pi.$$ -e "s/^${MATCH_STRING}:.*?\n//g;" ${EDIT_FILE}

Monday, October 02, 2006

NX on Etch

Sorry if this is a bit random... I'm tired! I'll try and fix it later.

From home before I left:

ssh -R 1234:localhost:22 mywebserver.net

and left something running that kept the session active (and therefore alive)


vi /etc/apt/sources.list

Added the text from here...

# In case you only want NX related packages,
# the following repository lines are sufficient:
deb http://debian.tu-bs.de/project/kanotix/unstable/ sid nx
deb-src http://debian.tu-bs.de/project/kanotix/unstable/ sid nx

then did:

apt-get update
apt-get upgrade

For good luck I did this, because I'd been messing around with it over the past 3-4 days:

apt-get remove --purge nxserver nxnode nxclient nxlibs nxlibs-dev nxdesktop nxagent nxagent-dev

Then I did:

apt-cache search NoMachine | less
apt-get install nxagent

And downloaded and installed the other .debs from nomachine.com

wget -N http://64.34.161.181/download/2.1.0/Linux/FE/nxserver_2.1.0-7_i386.deb
wget -N http://64.34.161.181/download/2.1.0/Linux/nxclient_2.1.0-6_i386.deb
wget -N http://64.34.161.181/download/2.1.0/Linux/nxmanager_2.1.0-5_i386.deb
wget -N http://64.34.161.181/download/2.1.0/Linux/nxnode_2.1.0-7_i386.deb
wget -N http://kanotix.com/files/debian/pool/main/f/freenx/freenx_0.4.4+0.4.5-4_all.deb

dpkg -i nxclient_2.1.0-6_i386.deb
dpkg -i nxnode_2.1.0-7_i386.deb
dpkg -i nxmanager_2.1.0-5_i386.deb
dpkg -i nxserver_2.1.0-7_i386.deb

less /usr/NX/var/log/install

/etc/init.d/nxserver start
apt-get install nxserver freenx
nxsetup --setup-nomachine-key
nxserver --status



# dpkg --list | grep nx
ii freenx 0.4.4+0.4.5-4 The FreeNX application/thin-client server ba
ii nxagent 1.4.92+1.5.0-11 NoMachine NX - nesting X server with roundtr
ii nxclient 2.1.0-6 NX Client
ii nxlibs 1.4.92+1.5.0-11 NoMachine NX - common agent libraries
ii nxmanager 2.1.0-5 NX Server Manager.
ii nxnode 2.1.0-7 NX Server Node
ii nxserver 2.1.0-7 NX Server


I run fluxbox:

# which fluxbox
/usr/bin/fluxbox

I did this in the client:

General tab:

Host: localhost
Port: 1234
Desktop:
Dropdowns: Unix [v] Custom [v]
[Settings]
Application
Run the following command: /usr/bin/fluxbox
Options
New virtual desktop
[OK]
ADSL
Display: Available area

Advanced tab:
[x]Enable SSL encryption of all traffic.

PuTTY:

Connection
SSH Tunnels
L1234:localhost:1234

Once you get NX working you may find this useful: How to setup international keyboard in X Window with Xmodmap and XKB