Thursday, September 21, 2006

hostname in localhost line in /etc/hosts

DON'T DO IT!

the /etc/hosts file in the Slackware installer image still has this in it:


# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server. Just add the names, addresses
# and any aliases to this file...
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#

# For loopbacking.
127.0.0.1 localhost
# This next entry is technically wrong, but good enough to get TCP/IP apps
# to quit complaining that they can't verify the hostname on a loopback-only
# Linux box.
127.0.0.1 slackware.example.net slackware

# End of hosts.


Brain-dead Red Hat does this when you install


127.0.0.1 hostname localhost.localdomain localhost


Eeagh! WRONG!

Tuesday, September 05, 2006

Printing to PDF

Either or both of these:

PrimoPDF

CutePDF

I have found that the printer driver you chose makes a massive difference to the finished product, some are OK, and some are really crap.

The best driver I have found so far on XP is the latest built-in HP Postscript driver, (HP color LaserJet 9500 PostScript driver) which you can download from here

It's 11MB though, and you can get a 3.1MB one from here

I tried the ones from here or here but they don't want to let you print to the virtual local ports - either LP1 or COM1 or network printers - nothing else - I don't know how to seperate the renderer from the printing interface. :o(

The others I tried were not as good, particularly the "QMS ColorScript 1000 Level 1" which I found suggested here was truly pants!

The "Apple Color LaserWriter 12/600" which was recommended in the CutePDF FAQ was OK, but not great, the main body text of the first page I wanted to print came out in a rusty brown, not in black.

If you are making your PDFs from Word documents and want a PDF which has clickable links (like the index and web links) I'd recommend installing Open Office and exporting to PDF from OOWriter.

Useful applications

Dia rocks...
(I've tried WinFIG and it sucks)

GIMP for Windows & GTK+

Bits for screen...

Bits for screen

http://aperiodic.net/screen/

http://www.gnu.org/software/screen/

http://www.kuro5hin.org/story/2004/3/9/16838/14935




Cygwin:

screen for Cygwin

http://dellelce.com/code/screen/

http://www.cygwin.com/ml/cygwin/2005-05/msg00797.html




davekaufman.net::.screenrc
Heaviliy tweaked and full of goodies.

Was this the same as this one or a newer copy?:
http://pastebin.com/m152f025b
http://airto.hosted.ats.ucla.edu/wiki/index.php/Using_Screen


apple.com::.screenrc
More vanilla.

http://www.guckes.net/setup/screenrc

http://www.aperiodic.net/phil/configs/screenrc

http://nion.modprobe.de/setup/screenrc

http://home.insightbb.com/~bmsims1/Scripts/Screenrc.html
http://cafim.sssup.it/~giulio/other/gb.screenrc

TODO: Things you might like to do, things you might not want to do...

Tuesday, August 29, 2006

Monday, August 21, 2006

Tahoma font legally...

As far as I remember reading, Tahoma font is not allowed to be distributed by itself so that you could use it in Linux like you can with some other Windows True Type fonts...

As far as I know if you already have Windows installed on your machine with Tahoma font in it (it's *CORE* in Windows XP) there's nothing against using the existing copy...


lrwxrwxrwx 1 root root 31 Apr 18 18:08 /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf -> /mnt/c/WINDOWS/Fonts/tahoma.ttf
lrwxrwxrwx 1 root root 10 Apr 18 18:16 /usr/share/fonts/truetype/msttcorefonts/tahoma.ttf -> Tahoma.ttf
lrwxrwxrwx 1 root root 15 Apr 18 18:17 /usr/share/fonts/truetype/msttcorefonts/tahomabd.ttf -> Tahoma_Bold.ttf
lrwxrwxrwx 1 root root 33 Apr 18 18:08 /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf -> /mnt/c/WINDOWS/Fonts/tahomabd.ttf
lrwxrwxrwx 1 root root 50 Apr 18 18:22 /var/lib/defoma/gs.d/dirs/fonts/Tahoma.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf
lrwxrwxrwx 1 root root 55 Apr 18 18:22 /var/lib/defoma/gs.d/dirs/fonts/Tahoma_Bold.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf
lrwxrwxrwx 1 root root 50 Apr 18 18:23 /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/Tahoma.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf
lrwxrwxrwx 1 root root 55 Apr 18 18:23 /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/Tahoma_Bold.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf



#!/bin/bash

WINDIR=/mnt/c/WINDOWS

# -rwxrwx--- 1 john john 355436 Jul 18 2004 /mnt/c/WINDOWS/Fonts/tahomabd.ttf
# -rwxrwx--- 1 john john 383140 Jul 18 2004 /mnt/c/WINDOWS/Fonts/tahoma.ttf
# -rwxrwx--- 1 john john 460728 Jul 18 2004 /mnt/c/WINDOWS/Fonts/micross.ttf

# lrwxrwxrwx 1 root root 31 Apr 18 18:08 /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf -> /mnt/c/WINDOWS/Fonts/tahoma.ttf
# lrwxrwxrwx 1 root root 10 Apr 18 18:16 /usr/share/fonts/truetype/msttcorefonts/tahoma.ttf -> Tahoma.ttf
# lrwxrwxrwx 1 root root 50 Apr 18 18:22 /var/lib/defoma/gs.d/dirs/fonts/Tahoma.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf
# lrwxrwxrwx 1 root root 50 Apr 18 18:23 /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/Tahoma.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma.ttf

# lrwxrwxrwx 1 root root 33 Apr 18 18:08 /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf -> /mnt/c/WINDOWS/Fonts/tahomabd.ttf
# lrwxrwxrwx 1 root root 15 Apr 18 18:17 /usr/share/fonts/truetype/msttcorefonts/tahomabd.ttf -> Tahoma_Bold.ttf
# lrwxrwxrwx 1 root root 55 Apr 18 18:22 /var/lib/defoma/gs.d/dirs/fonts/Tahoma_Bold.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf
# lrwxrwxrwx 1 root root 55 Apr 18 18:23 /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/Tahoma_Bold.ttf -> /usr/share/fonts/truetype/msttcorefonts/Tahoma_Bold.ttf

FONT=micross.ttf
UPPER=Micross.ttf

SOURCE=$WINDIR/Fonts/$FONT

MSTT_CORE_DIR=/usr/share/fonts/truetype/msttcorefonts

ln -sv $WINDIR/Fonts/$FONT $MSTT_CORE_DIR/$FONT
ln -sv $FONT $MSTT_CORE_DIR/$UPPER
ln -sv $MSTT_CORE_DIR/$FONT /var/lib/defoma/gs.d/dirs/fonts/$FONT
ln -sv $MSTT_CORE_DIR/$FONT /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/$FONT

fc-cache -fsv


Was that all?

Wednesday, July 12, 2006

Perl:: at's Debugger

ysth's post

At the top:


use constant DEBUG => $ENV{DEBUG};


or just:


use constant DEBUG => 1;


Then later:


printDebug("some message") if DEBUG;


or


DEBUG and printDebug("some message");


It's good if you want to hard wire the debug level by editing the script, but unfortunately this falls down when you want to use a variable to set it... say a command line flag... in this case, this will work:


use Getopt::Std;

getopts('v', \my %opts);

sub VERBOSE() { $opts{v} }

print "Message...\n" if VERBOSE;


Explanation and benchmark tests are in stefp's thread.

Sunday, July 09, 2006

Spyware

Two nasties I've had to deal with in the last few months, both of which installed registry hooks into the Windows startup and Explorer launch so that they required Windows to load dlls which then locked them as system files, and they would sit there watching the registry to make sure that they re-added any registry entry you deleted, so you couldn't turn them off or remove them.

The only way to get around them in the end was to boot off an XP install CD or some other boot image that can write to NTFS file systems and remove the offending files from C:\Windows\System32 - generally the newest files in that directory.
(From time to time there are a number of files of exactly the same size and different time stamps = the spyware making clones of itself)

The two I've removed (off two different machines) were WinFixer and SysProtect.
Nasty little buggers.

Must-have toolbox for dealing with nasties:

AdAware Anti-Spyware
SpyBot S&D Anti-Spyware
ewido anti-spyware Anti-Spyware
AVG Free Free Anti-Virus
Sysinternals Process Explorer Kill bad processes.
Sysinternals Autoruns Clean out start-up entries for bad processes.
RegSeeker Clean your registry afterwards.

If you need a boot CD:

Trinity Rescue Kit (85MB)

Paragon NTFS for Linux NTFS for Linux trial version (includes a self-burning .exe - only 26.3MB to download)

NTFS driver for DOS (could work from boot floppy if you have a floppy drive. (Haven't tested this)