Thursday, September 21, 2006

What's the IP of $HOSTNAME


perl -MSocket -e 'print inet_ntoa((gethostbyname '$HOSTNAME')[4]), $/;'

Dumping a webpage in text...

$ lwp-request -o text http://www.aotea.org/john/

This will probably need a few CPAN modules added to work, but the layout is nice and clean - it doesn't line up table cells.

$ elinks -no-numbering -no-references -dump http://www.aotea.org/john/

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?