Thursday, June 09, 2005

misc notes on my recent experience with parallelknoppix, clusterknoppix, and fedora

This is far from complete, and could use a lot of detail such as links
to the web sites I mention in here, etc. Maybe I'll update it later
with that information.

- can't write to NTFS in Parallel Knoppix
- openmosix terminal server lets slave nodes boot from image stored on
master HD, but that requires:
- slave notes have network boot capability (PXE)
- may require BIOS flash upgrade
- may need to change options in BIOS setup
- enable network boot/PXE option
- change boot order to try network first
- master needs to load drivers for relevant NICs on slaves
- sometimes challenging to find which driver
- pcimodules
- dmesg
- lspci -v
- creative google searching
- drivers in other OSes on that machine may provide clues
as to exactly which model number/chipset/etc. a NIC is, so you can
then google those numbers in search of info on which driver to use in
knoppix.. check hardware properties in windows device manager, etc.,
and look at driver versions/details.
- checking all drivers in list requires much more disk space on master
- GUI driver checkbox list very slow
- i liked to just edit the terminal server startup script,
modifying the regular expression that checks certain checkboxes on the
list by default. but that was probably more trouble than it was worth
to try and tell someone else to do.
- if BIOS doesn't support PXE, download driver in a boot disk
image from the etherboot project, at http://rom-o-matic.net, then
write that image to a floppy with RAWRITE tool, and boot a slave from
that floppy.
- need to copy cd image to master HD for slaves to remote-mount
- plug master and slaves into one hub/switch, isolated from internet,
etc, and disable any network hardware that is not relevant. this may
not be required, but it simplifies things, so it's more likely to
work.
- couldn't get parallelknoppix to use my USB HD with FAT partition for
permanent storage for the terminal server. could use the drive
normally in parallelknoppix, but not for the main purpose i needed
non-NTFS storage for.
- machines with too little memory couldn't have a large enough ram
disk, so they didn't want to be master

- tried in vain to get clusterknoppix or parallelknoppix working on my
network at home, attempting with 6 different machines, in various
combinations, spending a total of probably 40 hours on this task. it
pains me to say that I never did get a useful cluster working at home.
luckily, our group was able to get one working between our 4 laptops,
in a matter of only about 4 hours, including recording a 30 minute
video of the process after somewhat perfecting it.

- when a master's terminal server is running and slaves are connected,
they mount a directory on the master, and they are able to read/write
files anywhere in that directory tree. supposedly this is not
designed to be secure, it's designed to be quick and easy and used in
environments that are as secure as they need to be.

- ClusterKnoppix
- hardware support nicer for me (such as mouse buttons)
- includes CaptiveNTFS for mounting NTFS partitions read/write
instead of read-only
- openmosix viewer seemed to automatically see other
ClusterKnoppix machines on the LAN, and automatically clustered them
and showed their processor usage in the one viewer window, but that
only worked for me two weeks ago. last week when I tried again, I
couldn't get any 2 machines in my house to recognize each other as
nodes to cluster.

- challenges I encountered with Fedora:
- tried to install fedora on several machines, but the only
install that really worked out well was on a machine that I dedicated
to fedora.
- I let fedora start with an empty hard disk and partition it
automatically, etc. that machine worked out fine, and that's what I
ended up doing my individual assignment on.
- was able to easily:
- use sendmail for local email
- create samba shares that my windows machines could mount
- read ntfs, and write ntfs as well after i played
with the mount command/options
- set up web server, vnc server, etc
- one machine took 7 hours to install from the 4 fedora CDs.
painful. then, it was not even able to start up after the install.
kept hanging during the fedora startup sequence.
- another machine had the same kind of hanging issue, but did
not take nearly as long to install initially.
- tried obsessively to get fedora to install and boot off of
an external USB hard drive.
- various discussion threads can be found by googling
which explain step-by-step how people have accomplished this.
- it was not simple/straightforward whatsoever, and I
never did get it to work, after spending probably 20+ hours on it over
the course of several days.
- getting it to install on the usb drive was the easy
part. getting it to boot from it was not.
- the main reason for trying to do this was because most
of my machines only have NTFS partitions, and fedora wasn't crazy
about that fact. so I wanted to be able to install it on FAT or ext3
partitions on the external HD, so I could avoid messing with my work
laptop's hard drive and stuff.
- managed to corrupt the MBR on my work laptop in the process
- found useful NT admin password resetter tool, which
allowed me to then boot from the windows XP setup CD and go into the
Recovery Console, where the FIXMBR command saved me.
- two other machines at home were disqualified by the fact
that they only had NTFS partitions.

Friday, June 03, 2005

miscellaneous search/replace regular expressions I've used recently in TextPad

Here are some miscellaneous search/replace regular expressions I've used recently, that seemed worth keeping (to me). I used these in TextPad with the option in Configure Preferences Editor, called "Use POSIX regular expression syntax", checked. Sometimes I find that TextPad's search/replace functionality is more useful to for a particular purpose than 'sed' in unix/cygwin. Other times I use sed and stuff. That's the beauty if cygwin, I can mix and match windows and unix whenever I want (as some previous and near future posts will show).

These are mostly presented in the format:
Line 1: short description of search/replace expressions
Line 2: regex to search for
Line 3: replacement expression

change from (myMaybeNullFunc().equals("myStaticString") to ("myStaticString".equals(myMaybeNullFunc())
([\(]*)([a-zA-Z\.\(\)]+).equals\("([^"]+)"\)
\1"\3".equals(\2)

change from (myMaybeNullVar.equals("myStaticString") to ("myStaticString".equals(myMaybeNullVar)
([^a-zA-Z])([a-zA-Z]+).equals\("([^"]+)"\)
\1"\3".equals(\2)

change from myResultSet.getString("foo") to myObject.getFoo()
myResultSet\.get[A-Z][a-z]+\("([^_"])([^_"]+)"\)
myObject.get\u\1\2()

change from myResultSet.getString("foo_bar") to myResultSet.getString("FooBar")
rs\.get([A-Z][a-z]+)\("([^_"])([^_"]*)_([^_"])
rs.get\1 ("\u\2\3\u\4

(run this one repeatedly until no more matches, then run the one above it)

change HTML start tags to upper case
<(\<[[:word:]]*\>)
<\U\1

change HTML end tags to upper case
</(\<[[:word:]]*\>)
</\U\1

TextPad 'tool' definition to open generated .java file based on currently open .jsp file

Set this up as a Tool in TextPad, and dropped the sed script (at the bottom of this post) into my cygwin home directory's bin directory (~/bin/), and now I easily open the .java file that tomcat generated when it last compiled the .jsp that I'm currently editing. This is helpful for debugging sometimes, when the compilation error message does not include the .jsp file line number, just the .java file line number.

Command:
c:\cygwin\bin\bash.exe

Parameters:
-c "'/cygdrive/c/Program Files/TextPad 4/textpad' \
`echo '$File' sed -f ~/bin/GeneratedJava.sed`"

Initial Folder:
c:\

Checked options:
Run minimized
Close DOS window on exit


~/bin/GeneratedJava.sed contents:
#!/usr/bin/sed -nf

s/path\\to\\my\\jsps/apache\\tomcat5\
\\work\\Catalina\\localhost\\mywebappname\
\\org\\apache\\jsp/

s/\.jsp/_jsp.java/