Posts by Category

Buttons

Pure New Zealand

This site is driven by Blosxom

T
his site was written in vi

SDF is driven by NetBSD

Subscribe to this sites RSS/XML feed

This site has a Tableless Stylesheet

Email me

Mar 30, 2004

New Concrete Allows Light to Pass

A new type of concrete called LitraCon uses embeded optical-fibre to allow light to pass through from one side to the other.

[/misc] | [permalink] | [2004.03.30-14:26.00]

Mar 29, 2004

Electronic Paper

First Generation Electronic Paper Device from Sony/Philips.

[/misc] | [permalink] | [2004.03.29-13:14.00]

Useful Forensic Tool

Australian Defence Department tool called FLAG lets you monitor ports and analyse disk datawhen undertaking forensic examinations of IT equipment. Page includes a link to a bootable Knoppix CD which includes the FLAG toolset.

[/tech/unix] | [permalink] | [2004.03.29-12:07.00]

How to Map Everything You Think About

Lion Kimbro has written about how to keep track of Everything You Think.

[/misc] | [permalink] | [2004.03.29-11:27.00]

Mar 14, 2004

Thursday Links

Create Giant Rasterised Posters with the fantastically monikered 'Rasterbator'

The Bovine Simulator Project

Why do the Japanese get the coolest (but ultimately useless) gadget-watches ?

A selection of tiny computers the Spider and GumStix

Neat Fabric Keyboards

Gadget to Bluetooth enable any serial device from SocketCom

[/links/2004] | [permalink] | [2004.03.14-10:30.00]

Domino Installation via Web Interface

Create a user and group to own the install (traditionally 'notes' for group and user).

Run install script to drop the files into the appropriate place (remember to install as root) via the usual install script.

Once the files are in place run the post install Domino setup script.

On a Unix system with a GUI you should get the java based GUI installer.

If you don't have a GUI but have a client machine with a web browser and java you can run a web based setup.

On the server run

/opt/lotus/bin/http httpsetup

Then point your web browser at the server. The output of the previous command will give you the port number.

[/tech/domino] | [permalink] | [2004.03.14-10:21.00]

Mar 10, 2004

O'Reillys Lotus Domino Administration in a Nutshell

The bulk of Chapter 13 is online - covers Server Tasks and Console Commands

[/tech/domino] | [permalink] | [2004.03.10-12:14.00]

Basic OpenFirmware

Check attached devices (in this case drives)

ok> probe-scsi

Use probe-ide on a non-scsi machine

To boot from the default device use

ok> boot

To boot from cdrom

ok> boot cdrom

To reset the system

ok> reset

To check current settings

ok> printenv

The two commands to switch to keyboard/screen are:

ok> setenv input-device keyboard

ok> setenv output-device screen

And the two commands for setting the serial console as the input/out are:

ok> setenv input-device ttya

ok> setenv output-device ttya

From the Sun OpenBoot Reference Manual

[/tech/unix/solaris] | [permalink] | [2004.03.10-10:32.00]

Mar 09, 2004

Rebuild the Directory Catalog

The Directory Catalog (dc.nsf) is a cut down version of the full Address Book (names.nsf). It is automatically generated and updated from the Address Book; when the update process breaks down you can force a rebuild -

load dircat dc.nsf -r

This is run on the (primary admin) server console.

Alternatively you can goto the Configuration Document for the server in the Admin Tool and use the Clear History button.

Taken from the Notes 6 Admin Guide

[/tech/domino] | [permalink] | [2004.03.09-15:01.00]

Mar 08, 2004

Enable root Login

Edit /etc/securettys to add extra terminals (other than the console).

Note that RedHat has a similar securetty setting.

Note that allowing root login is definitely a bad thing - login as a normal user and use su or sudo instead. On a Tru64 system remember to add the normal user to the appropriate group or you won't be able to su.

[/tech/unix/tru64] | [permalink] | [2004.03.08-13:31.00]

Prevent Halt When Keyboard is removed

This behaviour can be stopped by editing /etc/default/kbd and changing the value of KEYBOARD_ABORT to disable.

[/tech/unix/solaris] | [permalink] | [2004.03.08-12:54.00]

Auto Install CPAN Modules

Handle CPAN module installation -

perl -MCPAN -e 'install Bundle::libnet'

Will download and install the libnet perl module in the same way as a debian apt-get install or redhat up2date.

Searching CPAN will give you the appropriate module names.

First time you run it you'll need to answer some simple queries but once its setup it seems to work fine.

You can reconfigure the CPAN settings via

perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.59_54) ReadLine support available (try 'install Bundle::CPAN')

cpan> o conf init

[/tech/perl] | [permalink] | [2004.03.08-09:35.00]

Far Side Cartoons as Photoshop Contest Fodder

Check out the Worth1000 Far Side Galleries

History of Apples Operating Systems

From Apple DOS to OSX

[/links/2004] | [permalink] | [2004.03.08-08:47.00]

Useful Active Directory Links

Some Sample Code from O'Reillys Active Directory Cookbook

Two articles on using php and perl to access AD at Developer.com

Sample Code from Realmen Don't Click

[/tech/windows/activedir] | [permalink] | [2004.03.08-08:42.00]

Perpetual Motion

Take a look at the Museaum of Unworkable Devices

[/misc] | [permalink] | [2004.03.08-06:55.00]

Mar 05, 2004

Useful Find File Syntax (Because I can never remember . . .)

From O'Reillys OnLamp Series come two articles on using Unix find - one and two.

Useful examples

Find all pdfs and move them into a pdf folder

find . -name "*.pdf" -print | grep -v "^\./pdfs/" | xargs -J X mv X ./pdfs/

Find all files I haven't accessed in 7 days and they're larger than 10Mb in size

find . -atime +7 -size +20480 -print

[/tech/unix] | [permalink] | [2004.03.05-13:21.00]

Friday Links

Fantastic Windows Freeware

Art Rage

Download, install, use an existing image as tracing paper and then cut loose with the mouse.

Joel Spolsky on . . .

How to Run a Beta Test

For a super clean Unix Window Manager to make best use of screen realestate try the tabbed WM called ion

Ion

Useful Aramaic (if you've been following Mel Gibsons latest foray into movies . . .)

Aramaic Phrases

Useful for people with Kids and Wood varnish floors

FunSlides

Edit CSS Within Firefox with a sidebar addin

EditCSS

Useful XP Regedits

XP Registry Edits

[/links/2004] | [permalink] | [2004.03.05-13:07.00]

Mar 04, 2004

HP Utility for USB Drives

Will make any key drive bootable (USB 2.0 only).

[/tech/windows] | [permalink] | [2004.03.04-18:13.00]

Mar 03, 2004

Legacy Outliners and Games

Interesting look back at Mac Classic (pre-OS X) Outliners.

A great stash of old Mac Games at Mac Garden.

[/tech/mac] | [permalink] | [2004.03.03-21:13.00]

New Age Soldiering in Mongolia

From Jon Robbs blog comes a piece on An American Colonel in Mongolia.

[/misc] | [permalink] | [2004.03.03-15:06.00]

Mar 02, 2004

Useful Bash shortcuts.

From H. Joe

Basics:

  • Use up and down arrows to recall previous command
  • Use right and left arrows to make changes in current command line
  • After one or more letters of a command or filename, hit the Tab key for command or filename complete; if this is non-unique, hit the Tab key a second time for possible choices.

  • !gcc will repeat the previous command starting with 'gcc'
  • 'gvim !$' will apply the command 'gvim' to the last argument on the previous command line (in Unix, '$' is a symbol for last row, column or argument depending on the context)

Other useful methods for editing command line (includes the command line for interactive command based programs such as Splus [in emacs edit mode], R, maple, octave, mysql etc]) Most of these are the same as editing in emacs, so you can check the emacs on-line help for other quick-edit possibilities. The editing is based on the ctrl-key in combination with another key (usually a meaningful letter for a-z) or the esc-key followed by another key (from a-z)

Ctrl keys

  • ctrl-a: beginning of line

  • ctrl-e: end of line
  • ctrl-k: delete (kill) remainder of line
  • ctrl-u: delete entire command line
  • ctrl-w: delete previous word
  • ctrl-t: transpose 2 characters
  • ctrl-y: yank or recover previous deletion
  • ctrl-d: delete character at cursor; note distinction from the backspace key or ctrl-h: delete character before cursor
  • ctrl-f: forward one character (needed in 'emacs/Splus -e' because arrows keys don't work)
  • ctrl-b: backward one character (same comment as above)

Esc combinations

  • esc-d: delete word
  • esc-f: forward a word
  • esc-b: backward a word
  • esc-t: transpose two adjacent words

Note that some of the Ctrl-key combinations like ctrl-a, ctrl-e, ctrl-k, ctrl-u also may work in entry fields in X applications (an example is the web Location entry box in the netscape browser.

[/tech/unix] | [permalink] | [2004.03.02-09:55.00]

VI Keybindings

From Tom Fine

Complete key binding reference

KeyActionFollowed by
aenter insertion mode after current charactertext, ESC
bback word
cchange commandcursor motion command
ddelete commandcursor motion command
eend of word
ffind character after cursor in current linecharacter to find
gUNBOUND
hmove left one character
ienter insertion mode before current charactertext, ESC
jmove down one line
kmove up one line
lmove right one character
mmark current line and positionmark character tag (a-z)
nrepeat last search
oopen line below and enter insertion modetext, ESC
pput buffer after cursor
qUNBOUND
rreplace single character at cursorreplacement character expected
ssubstitute single character with new texttext, ESC
tsame as "f" but cursor moves to just before found charactercharacter to find
uundo
vUNBOUND
wmove foreward one word
xdelete single character
yyank commandcursor motion command
zposition current lineCR = top; "." = center; "-"=bottom
Aenter insertion mode after end of linetext, ESC
Bmove back one Word
Cchange to end of linetext, ESC
Ddelete to end of line
Emove to end of Word
Fbackwards version of "f"character to find
Ggoto line number prefixed, or goto end if none
Hhome cursor - goto first line on screen
Ienter insertion mode before first non-whitespace charactertext, ESC
Jjoin current line with next line
KUNBOUND
Lgoto last line on screen
Mgoto middle line on screen
Nrepeat last search, but in opposite direction of original search
Oopen line above and enter insertion modetext, ESC
Pput buffer before cursor
Qleave visual mode (go into "ex" mode)
Rreplace mode - replaces through end of current line, then insertstext, ESC
Ssubstitute entire line - deletes line, enters insertion modetext, ESC
Tbackwards version of "t"character to find
Urestores line to state when cursor was moved into it
VUNBOUND
Wforeward Word
Xdelete backwards single character
Yyank entire line
Zfirst half of quick save-and-exit"Z"
0move to column zero
1-9numeric precursor to other commands[additional numbers (0-9)] command
 (SPACE) move right one character
!shell command filtercursor motion command, shell command
@vi evalbuffer name (a-z)
#UNBOUND
$move to end of line
%match nearest [],(),{} on line, to its match (same line or others)
^move to first non-whitespace character of line
&repeat last ex substitution (":s ...") not including modifiers
*UNBOUND
(move to previous sentence
)move to next sentence
\UNBOUND
|move to column zero
-move to first non-whitespace of previous line
_similar to "^" but uses numeric prefix oddly
=UNBOUND
+move to first non-whitespace of next line
[move to previous "{...}" section"["
]move to next "{...}" section"]"
{move to previous blank-line separated section"{"
}move to next blank-line separated section"}"
;repeat last "f", "F", "t", or "T" command
'move to marked line, first non-whitespacecharacter tag (a-z)
`move to marked line, memorized columncharacter tag (a-z)
:ex-submodeex command
"access numbered buffer; load or access lettered buffer1-9,a-z
~reverse case of current character and move cursor forward
,reverse direction of last "f", "F", "t", or "T" command
.repeat last text-changing command
/search forwardsearch string, ESC or CR
<unindent commandcursor motion command
>indent commandcursor motion command
?search backwardsearch string, ESC or CR
^AUNBOUND
^Bback (up) one screen
^CUNBOUND
^Ddown half screen
^Escroll text up (cursor doesn't move unless it has to)
^Fforeward (down) one screen
^Gshow status
^Hbackspace
^I(TAB) UNBOUND
^Jline down
^KUNBOUND
^Lrefresh screen
^M(CR) move to first non-whitespace of next line
^Nmove down one line
^OUNBOUND
^Pmove up one line
^QXON
^Rdoes nothing (variants: redraw; multiple-redo)
^SXOFF
^Tgo to the file/code you were editing before the last tag jump
^Uup half screen
^VUNBOUND
^WUNBOUND
^XUNBOUND
^Yscroll text down (cursor doesn't move unless it has to)
^Zsuspend program
^[(ESC) cancel started command; otherwise UNBOUND
^\leave visual mode (go into "ex" mode)
^]use word at cursor to lookup function in tags file, edit that file/code
^^switch file buffers
^_UNBOUND
^?(DELETE) UNBOUND

Definitions

  • UNBOUND - this key is not normally bound to any vi command
  • word - a lower-case word ("w", "b", "e" commands) is defined by a consecutive string of letters, numbers, or underscore, or a consecutive string of characters that is not any of {letters, numbers, underscore, whitespace}
  • Word - an upper-case word ("W", "B", "E" commands) is a consecutive sequence of non-whitespace.

  • sentence
  • paragraph
  • cursor motion command - any command which positions the cursor is ok here, including the use of numeric prefixes. In addition, a repeat of the edit command usually means to apply to the entire current line. For example, "<<" means shift current line left; "cc" means replace entire current line; and "dd" means delete entire current line.

Key Bindings in Editing Modes

While in any edit mode (insert, replace, etc.) there are some keys that are used to adjust behaviour, rather than just to insert text.
  • ESC - leave edit mode, return to command mode
  • ^D - move line backwards one shiftwidth. shiftwidth must be set, and either the line must be newly added, or ^T must have been used.

  • ^T - move all after cursor forwards one shiftwidth
  • ^H - deletes text that was entered during the current edit mode. Most versions of vi do not allow deleting to previous line.
  • ^V - insert next character even if it is a editing character.

Repitition Counts

Most commands can be prefixed with a multidigit number, that influences the way the command works.
zposition nth line number
Ggoto nth line number
|goto nth column number
rreplace next n characters
ssubstitute for next n characters
<<shift n lines left one shiftwidth
^ignored?
_advance n-1 lines
Need to differentiate between such things as 5yj vs. y5j?

Multibuffer

Standard vi does have an ability to toggle between two different files. These will be the last two edited files (edit new files with :efilename) To switch files, use control-^.

These filenames can be reffered to in ex commands, and subshell filters, using two special characters: "%" refers to the current file, and "#" refers to the previous file. Here's some handy things you can do with this feature:

:map v :!chmod 644 %^[                make world-readable
:map q :!ci -l %^[                    RCS checkin
:map V :!diff # %^[                   compare previous and current files

Tags

Tags are cool, but I don't use them. Go figure. Maybe I'll write something up here someday.

Mappings and Abbreviations

:map lets you bind a list of keystrokes to a shortcut in command-mode. This shortcut can be a multiple-key sequence (with limitations), and the commands within can enter and exit edit-mode. Some examples of :map can be found above, in the multibuffer section. Below is a list of all the normally unbound keys in vi command-mode.

g q v K V # * \ = ^A ^C ^I ^K ^O ^V ^W ^X ^[ ^_
When you try to map multiple key sequences, you won't be able to start them with lower or upper case letters ("Too dangerous to map that"), but the punctuation and control characters are fair game. In addition, : can't be mapped, and sometimes a few other keys. Multiple key sequences can also be very useful with terminal-generated sequences, which is why the escape key is bindable. I have my xterm set to generate =f1 for function key one, and so on, so all the function keys are easier to use with bindings.

If you use multiple key shortcuts, you'll want to know about the timeout variable. With :se timeout, you have a limited time to generate the key sequence. This is useful if the key sequences are terminal generated. With :se notimeout, it just keeps waiting until the next character does or doesn't match any possible current sequences.

:map! lets you bind a list of keystrokes to a shortcut in edit-mode. This is useful for adding editing commands to edit mode. One popular trick is to bind the arrow keys to move up and down while (apparently) staying in edit-mode, as in the last four lines below.

:map! ^? ^H                         Make delete act like backspace
:map! ^[OA ^[ka                     xterm arrow sequences will 
:map! ^[OB ^[ja                       exit edit-mode, move the
:map! ^[OC ^[la                       cursor, and re-enter edit-mode.
:map! ^[OD ^[ha

If you use the above trick for arrow-keys in edit-mode, you'll want to set timeout, because otherwise you won't get beeps at all when you hit escape, only when you use the next keystroke. With timeout, you get the beep, but after the timeout. Since both of these are annoying, it may be a useful choice to avoid multikey sequences that involve escape, as a matter of taste. Also, many systems now set up command-mode arrow keys in vi by default, which also leads to the same problem.

:ab lets you bind a key sequence to an abbreviation, for use in edit-mode. Abbreviations don't fire until vi decides that you've typed the shortcut as a whole word. So if taf is a shortcut for Thomas A. Fine, and I type taffy, it won't substitute because I didn't enter taf as a word by itself. (If I'd used :map!, then taffy would do the replacement before I got to the second "f".)

Abbreviations are echoed normally until complete, therefore the abbreviation can't contain escape (you'd leave edit-mode before completing the abbreviation), but the replacement expression can contain escape, and can leave and return to edit-mode.

:ab teh the
:ab #d #define
:ab #i #include
:ab cmain main(argc,argv)^Mint argc;^Mchar **argv;^M{^M}^[O
:ab mmap(NULL,st.st_size,PROT_READ,MAP_SHARED,fd,0); mmap(NULL,st.st_size,PROT_READ,MAP_SHARED,fd,0);
:ab readsig ^[G:r ~/misc/sig^M
}
To keep a live abbreviation from going off in your hands, use ^V. For instance, if I want to type teh but have the the abbreviation above, I can let it "fix" it, then back up and unfix it; or I can type "teh^V..." and it won't expand the abbreviatoin.

vi macros document

Repeating with .

Commands can be repeated with the redo command, normally bound to ".", but I've found this to be occasionally unpredictable. If you use multiple key sequences in a macro, and vi is waiting to see if one of those sequences might complete, and you start a new command here, it won't be noticed by the redo. (Solaris, HPUX at least).

System Differences

  • Older versions of vi didn't automatically set up arrow-keys in command-mode; they didn't interfere with the beep. (Maybe multiple key bindings were new at the same time???)
  • Some versions of vi have encryption, some don't.
  • Options processing is handled differently from version to version. Solaris prefers -c command in place of +command, and -L instead of -r.

  • Differnt systems may have other keys besides : that are "Too dangerous to map that".
  • The size of macros (:map, etc.) are limited in different ways on different systems.
  • On some systems the environment variable EXINIT overrides .exrc files (Solaris, HPUX), other systems it enhances it (SunOS???, FreeBSD).
  • nvi allows backspace to previous line in edit-mode (if previous line was edited) (FreeBSD).
  • variants of vi that have multiple undo have different styles. One style (linux) uses u as undo, and control-R as redo. The other style (FreeBSD) u acts normally, but . continues on in the same direction as the last u (whether it was undo or redo). I prefer the latter because it doesn't interfere as much with traditional vi behaviour.

VI Reference Manual from the University of Michigan at Dearborn

Trick

I've seen various replacements for the fmt command that you can use to format paragraphs almost automatically. Mine's better:

:map v 0ma}b:'a,.j<ctrl-v><enter>070 ? *<Escape>dwi<ctrl-v><return><ctrl-v><escape>

It's better because you don't have to prejoin the paragraph by hitting J an arbitrary number of times. Just hit v (or whatever you've mapped it to) starting at the beginning or in the middle of the paragraph, and it joines the rest of the paragraph together, formats one line, and moves the cursor down again. Just keep hitting v and it will keep formatting. You have to stop one before the end or you'll end up with an extra short line. It also does not leave spaces at the end of the line.

[/tech/unix] | [permalink] | [2004.03.02-09:50.00]

Mar 01, 2004

Interesting stuff for today

From Howl comes Rondezvous for Windows and Linux.

Like MacDevCenter O'Reilly also have a WindowsDevCenter

[/links/2004] | [permalink] | [2004.03.01-15:34.00]

Links Backlog.

Links posted from main site

An excellent article on disk bottlenecks in Oracle databases and how to pinpoint performance problems

http://www.dbazine.com/burleson19.shtml

And there really is a BAARF (as mentioned in the article above)

http://www.baarf.com/ (Battle Against Any RAID Five)

Neat Origami Models

http://www.keconnect.co.uk/~rglynn/diags.htm

While we're putting Bioinformatics on hold theres a little known G5 cluster solution from Apple designed to do computations in this area

http://www.apple.com/xserve/cluster/wgcluster.html

Popular guide to Unix pronounciations (the etymology of some of the words towards the end is pretty interesting)

http://www.eeng.brad.ac.uk/help/.faq/.unix/.pronun.html

Have 3000000UKP burning a hole in your Pocket (small change for Sales people I'm sure . . .)

http://www.vladi-private-islands.de/sales_islands/sites/02_eilean.html

Power miniature devices via Vibrations

http://www.technologyreview.com/articles/prototype80204.asp

In the wake of recent viruses there is increasing anger at Joe Averages lack of basic IT skills

http://arstechnica.com/news/posts/1076047250.html

For people who enjoy the outdoors (or camping in their backyard) Camp stove from a Pepsi can

http://www.pcthiker.com/pages/gear/pepsiGstoveinstruct.shtml Finger Light

http://www.s-lite.com/FingerLite.htm

And of course 20 years on from 1984 we should all be doubleplus thankful for Big Brother

http://www.newspeakdictionary.com/

http://www.studentsfororwell.org/

Amusing Short Film (featured at the Sundance Film Festival) that puts lunch and wanting to get fired into an innovative new light (be sure to turn sound down!) :

http://www.eggwork.com/lunch/lunchpost.htm

Control electrical equipment in someone elses house and watch the results via webcam (slow but it works)

http://drivemeinsane.com/

Was on slashdot but if you missed it - run Linux as a cooperative task beside Windows

http://www.colinux.org/

Internet Maps

http://www.opte.org/maps/

Help find related artists with this music mapping tool

http://www.musicplasma.com/

Longish video stream of the Phillips rollable LCD (ie digital paper) in action

mms://Ntstream2.ddns.ehv.campus.philips.com/efi/86090/rollable_display/rollable_display_interv_long.wmv

Not quite as useful as fixing the f%#king product in the first place but still . . .

http://www.microsoft.com/education/?ID=SecurityPosters

Two useful Public Service tools

View website logins (eg for New York Times) for registered accounts so you don't have to

http://www.bugmenot.com/



Use once instant mail accounts to thwart spammers

http://www.mailinator.com/mailinator/Welcome.do

Mix up content of two different websites

http://www.topfx.com/cgi-bin/mixmaster.cgi

Like this

http://www.topfx.com/cgi-bin/mixmaster.cgi?layouturl=http%3A%2F%2Fwww.accelrys.com&contenturl=http%3A%2F%2Fwww.dilbert.com

Movies of the Honda Asimo robot in motion

http://world.honda.com/ASIMO/movies/

Virtual CD/DVD Emulator

http://www.daemon-tools.cc/portal/download.php?mode=ViewCategory&catid=5

Or a Microsoft gadget for XP to mount ISO's (its beta so be careful)

http://download.microsoft.com/download/7/b/6/7b6abd84-7841-4978-96f5-bd58df02efa2/winxpvirtualcdcontrolpanel_21.exe

Does what is says - enhance your corporate lingo -

http://www.dack.com/web/bullshit.html

Nice Flash Art

http://www.thethirdplace.com/espace/module8/

http://www.trevorvanmeter.com/flyguy/

Almost there with electronic paper

http://www.akibalive.com/archives/000515.html#more

A dock for PocketPC's and Palms to allow USB/Ethernet and Video Out - use your PDA as a desktop

http://www.synosphere.com/gallery.htm

The System Is Down - why this excuse is unacceptable

http://www.darwinmag.com/read/010104/down.html

On the same site - metrics for storage technology

http://guide.darwinmag.com/technology/infrastructure/storage/index.html#metrics

[/links/2004] | [permalink] | [2004.03.01-15:33.00]