Contents


Contents


1. Bob's personal stuff


Contents


2. general


Contents


2.1 36 Baroona St


$339, settled 1/12/2003, 

36 Baroona St, Rochedale South, 4/2/2 + ensuite + office, rumpus
downstairs, pool, cathedral ceilings, 614 sqm, polished floors, 2
storey, Jackie, Pestana Realty, 0421903093, 3340 4200
http://www.realestate.com.au/cgi-bin/rsearch?a=o&id=101103836&cu=&ag=

Polished floors $1800
Aircon          $8000?
Blinds          $500
Bathroom        $9000?
Water tank      $2000

Contents


2.1.1 Neighbours


Back - 9 Circle COurt - Victor 6/5/04 suggested we remove the fig
tree

Contents


2.2 44 Greenfield Rd


Security alarm - Ness Westinghouse
"NoMoreGaps" or paintable silicon on gaps in Hardiplank
Sand back & paint pergola where bolts have rusted
For habitation, shed needs storm drain, underslab poison,
drawings, engineer certificate of frame, drain for kitchen
Cornice cement/plaster to repair gyprock
Pool heater
Bell/intercom
Clear out rumpus bar etc. Partition?
Hang pictures
Make bench store tools
Sofas for family room
Fix gate remote
New gate number
Flyscreen on music room
Roller door motors - $429 ea

Contents


2.2.1 Mower

MTD Yardman X694G 15HP 42" cut

Drive belt: 754-0441
Blade belt: 754-0371A

Contents


2.3 Back pain


Autumn 1994 Chronic lowerback pain for 3-4 years. Episodes of
traumatic pain & sciatica. Main pain is in left sacro iliac joint.
Worst in the morning but never free from pain. Xrays show some
degradation Arthritis, spurs on L5, diminshed disc S1L5. Great
difficulty in bending or drawing up legs eg putting on pants or
washing feet. Made worse by lying on the floor. Soothed by sitting
particulary in lumbar support chair eg the car. Sneezing can be
very painful unless I crouch. 

Present strategies include: exercises I have evolved eg rotation &
drawing up legs; sitting; lifting with legs; not stooping;
swimming. Standing (leaning to right ease the pain) & walking
tires me quickly - need to sit or lie down, then OK for a while.

Feb 97 Cannot stand without pain. After 15mins need to lie down.
Walking is easier. Working at floor level is very hard. Stiff &
sore on waking. Jan Dekkers excercises help sciatica but not back
pain. Big toe still numb. Swimming helps loosen but still cannot
work below waist. Effectively restricted to sitting or lying for
work or at home. 20 min journey on MRT is limit of endurance.

May 97 After 2 months out of office, little pain. After 1 week in
office, pain is returning. Chair?

Sep 02 Nowhere near the above level of pain. Ride-on mower seems
to help.

Oct 02 Tried Chinese herbal anti-inflammatory cararthron.
Possibly less pain.

Contents


2.4 Backpacking Checklist


tent - 2/3 man
sleeping bags & liners
sleeping mat
rucksac
al foil emergency blanket
hats - sunhat & beanie
sunglasses
poncho or raincoat
socks - 3 pairs
shirt + spare
spare trousers
sweater
gloves
undershirt + spare
compass
penknife / leatherman
water - 3l pp/day - camel-back bags?

suntan cream
maps

soap
insect repellent
insect spray

cooking utencils:
	stove + spare gas ***
	pan ***
	matches
	spoons 2
	plastic plates 2 ***
	mugs (plastic) 2 ***
	corkscrew & can opener
	waste bags

food:
	day 1 lunch - sandwiches
	day 1 dinner - pasta meals, steaks?
	day 2 breakfast - pancake mix
	day 2 lunch - soups, cheese, vitawheat
	in car for day 2 - buns?
	dehydrated food - pasta, soups
	meat and vegetables
	snacks - muesli/muffin bars, dried apricots, biltong, pringles
	condensed milk, tea, coffee
	salt & sugar
	port
	gum

torches
spare batteries
ground sheets
swimming gear?
tooth paste and tooth brush

first aid kit & medications
	anthisan
	dettol cream
	bandages & gauze
	iodine

cameras & film
latrine spade, toilet paper
deoderant

ankle brace

Contents


2.5 Beer & wine


Contents


2.5.1 19981102 Bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
dextrose. fermented to 1006 in 5 days. Left extra 2 days for 1
week total, mainly at 24-28 degrees. 3 drops hop extract added 1
day before bottling. Bottled with 1 tspn cane sugar (too fizzy).

16 Nov. Pretty foul at 2 weeks  old.
14 Dec. Pretty damn nice after 6 weeks.
13 Feb. Clean if a little thin. Seems to cope with the high co2 -
more like a northern beer.
9 May. Has good body. Bitter taste but little aroma.
19 Nov. ditto above but smoooth. Slight Newky Brown tones? Fizzy
but little head retention.

Contents


2.5.2 19981122 Bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
dextrose. First yeast failed. Added beer-makers after 24hrs.
Bottled with 0.5 tspn of dextrose. Pretty foul at 2 weeks (29th
Nov).

15 Feb - Better now (actually since mid January) but still has a
strong yeast bite. Careful pouring is required.

Contents


2.5.3 19990107 Pale Ale

Black Rock East India Pale Ale, 1kg dextrose

Boil 1 ltr water, add 1.5 tsps Golden Cluster & 1.5 tspns
Hal/aroma. Stir boil 2 (to 3) minutes. Strain & cool. Add to wort.
Cool as close as poss to 20 centigrade. Add Safale yeast. Keep as
cool as possible (for 3 days down to 1008, put into fridge for
last day or 2 down to 1006 until it clears). 12 th Jan - Bottled
with 0.5 tsp dextrose.

7 Feb - flat and foul. Leave a while.
23 Feb - light, fruity, could have more head. Clean taste.

Contents


2.5.4 19990202 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
dextrose. Boil 1 ltr water, add 1.5 tsps Golden Cluster & 1.5
tspns Hal/aroma. Stir boil 10 secs. Add to wort without straining.
Add 1l ice - cooled to 24 degrees. Add safale. Fermenting at 26
degrees.

980209 SG1006, bottled with 0.75 tspns dextrose. 

Mar 2 tasting - smooth, clean, not very fizzy, hop aftertaste but little aroma.

20010114 tasting - clean, dark slightly nutty undertaste. Little
aroma, very bitter but no length of taste.

Contents


2.5.5 19990219 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Add safale. Fermenting at 28 degrees.

Feb 23 - Boiled a little water, add 1.5 tsps Golden Cluster & 1.5
tspns Hal/aroma. Stir boil 10 secs. Add to wort without
straining.
Feb 28 SG is still 1013. 
Mar 3 SG is 1010, tastes OK. Still at about 28 degrees - too
hot=slow ferment?
Mar 7. SG is 1008, tastes OK. Still at 28 degrees. Bottled with
small measure dextrose (1 tspn) (two bottles with sugar).
Mar 27 Bloody lovely! Smooth, full bodied. Still lacks hop aroma &
taste but nice long taste. Could use a bit more fizz.
Apr 10: subtle hop taste & aroma.

Contents


2.5.6 19990309 Pale Ale

Black Rock East India Pale Ale, Brewcraft #40 beer kit converter
(malt extract, corn syrup, malted barley & dextrose, hops),
safale. Initial SG=1033. 26 degrees. 

Mar 15: SG1008. 
Mar 19 SG1007. Added 10 drops of Cascade hop oil. 
Mar 20 SG1007. Bottled with 1tsp dextrose and 3 drops Cascade hop
oil!
Apr 16: Lacks fizz, quite bitter, not wonderful nor foul. Where's
the hops?

Contents


2.5.7 19990410 winter bitter

Munton's Connoisseur Range Traditional Bitter and 1 kg Morgan's
Dark Crystal Malt (Master Blend) boiled with 2l water and 2 tspn
Golden Cluster Hops. 2 tspn Hal aroma added at end of boil. Cooled
& made to 23l. Safale added. Fermenting at 24 degrees. 

Apr 19:	SG1015 added 30 drops Cascade hop extract. 
Apr 24: SG1014? bottled	with 1 tspn sugar.

Contents


2.5.8 19990508 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Hal/aroma & 1 tspns
Golden Cluster. Stir boil 10 secs. Add to wort without straining.
Add safale. Fermenting at 24 degrees.

May 23: SG1006. Bottled with 1 heaped tspn sugar and 3 drops of
Cascade hop oil.

19990704 very fizzy but goes flat quickly. Good bitter taste and
some hop aroma. Very nearly there.

19990711 no reservations - the best yet. Almost like a Green King-
very hoppy & long bitter taste. Will it improve with keeping?
it's already a great beer.

19990806 only 6 bottles left - still wonderful - it keeps its head
now.

Contents


2.5.9 19990605 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add safale.
Fermenting at 23 degrees.

19990612 bottled smells & tastes great already!

19990711 tastes great already - a little raw and will improve.
Lots of hop aroma and bitterness.

Contents


2.5.10 19990704 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
dry malt. Boiled a little water, add 25g (6 tspns) Cascade hops.
Stir boil 10 secs. Add to wort without straining. Add safale.
Fermenting at 22 degrees. OG=1041.

19990711 SG=1010. 19970718 SG=1006 bottled with 1 tspn sugar & 3
drops Cascade hop oil per bottle.

Contents


2.5.11 19990809 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, activated for 48 hours with 3 tbls dextrose. Fermenting at
20 degrees.

19990822 bottled with 1 tspn sugar. Lees put into 4 bottles with
1tspn sugar in fridge.

Contents


2.5.12 19990914 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Goldings hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 2nd generation.

19990927 bottled with 1 tspn sugar. Lees put into 3 bottles with
1tspn sugar in fridge.
20000425 almost gone. This is pretty much my standard flavour now,
but too much fizz.

Contents


2.5.13 19990927 Light bitter

Munton's Connoisseur Range Traditional Bitter made to 25, 1/2 kg
dextrose and 1/2 kg malt. Boiled a little water, add 25g (6 tspns)
Goldings hops. Stir boil 10 secs. Add to wort without straining.
Add Peet's London Ale yeast, 3rd generation.

20000425 has been drinking consistently for some months. Very
light, a bit home brewish. Drinkable if not really worth
repeating.

Contents


2.5.14 19991113 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Goldings hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

19991120 bottled with 1/2 tspn sugar. 
20000425 very fizzy - must have been some residual sugar in
ferment despite only 1/2 tspn sugar in bottle. Nice flavour as
usual.

Contents


2.5.15 20000109 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

20000123 bottled with 1/2 tspn sugar.
20000521 still a little too fizzy - rather too much head although
beer is almost flat enough. Nice rounded taste, but not
terribly hoppy. A little sweetness left.
20001119 not at all fizzy. Just nice.

Contents


2.5.16 20000416 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

20000425 bottled with 1/2 tspn sugar.

Contents


2.5.17 20000515 bitter

Munton's Connoisseur Range Traditional Bitter and 1 kg malt made
to 24l. Boiled a little water, add 25g (6 tspns) Cascade hops.
Stir boil 10 secs. Add to wort without straining. Added a grated
knob of ginger. Add Peet's London Ale yeast, 2nd generation.
Fermented at 20 deg.

20000521 SG 1010 a little high, bubbling every 60secs, so worried
about overgassing. Bottled with 1 tspn dextrose.
20000806 - can't taste ginger. Too fizzy. Taste OK, very bitter.

Contents


2.5.18 20000827 Ginger Beer

Dissolve 3lbs sugar in a couple of litre of water. Take off the
boil & add 6oz grated ginger root, juice 1 lemon, 1tsp baking
powder (instead of Cream of Tartar). Made up to 23l and yeast
added. SG 1020.

Contents


2.5.19 20000917 bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

20001001 bottled with 1/2 tspn sugar & 4 drops hop oil.

Contents


2.5.20 20001004 Strawberry wine

Recipe calls for total 8kg sugar/20l - mistake, should have been 6kgs!!

2kgs strawberries, hulled added to 1.5kgs sugar, 1 camden tablet
for 24 hours. 1 tspn pectinase added, leave another 24 hours. Add
yeast, leave 24 hours. Strain into fermenter.

20001007 Another 6kgs strawberries hulled, add 1 camden tab & 1
tspn pectinase & water to 3/4 fill bucket, left for 30 hours.
20001008 Pulp strained into fermenter with original must. 1Kg
sugar added (2.5kg total). Water to 20l added. SG=1028. (this
is odd - 2.5kg sugar equals SG1050 - perhaps this initial
reading is in error)
20001015 SG1000, 2kg sugar added (4.5 total), racked SG 1036
20001022 SG1025
20001028 SG1018
20001104 SG1008 add 2kgs sugar (total 6.5kg) racked SG1040
20001111 SG 1040 stuck! Added new champagne yeast
20001118 SG 1034 add 1tspn nutrient salt in desperation
20001126 SG 1030
20001216 SG 1022 bottled without metabisulphite

SG drops

1028-1000 28=3.5%
1036-1008 28=56 total = 7% 
1040-1022 18=74 total = 

Working from 6.5kgs = SG1128
SG1034=93 drop = 12.7%
SG1022=106 drop = 14.36%

In 20l:

1.0kg = SG20 = 2.66%
1.2kg = SG23.6 = 3%
5.6kg  = SG110 = 14.9%
6.5kg = SG128 = 16% !

Contents


2.5.21 20001105 Extra bitter

Munton's Connoisseur Range Traditional Bitter made to 23l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

20001119 SG1008, bottled with 1/2 tspn sugar & 4 drops cascade hop
oil.

Contents


2.5.22 20001119 light bitter

Munton's Connoisseur Range Traditional Bitter made to 25l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 4th generation (lees from last lot).

20001216 SG1006 bottled with 2 drops plain hop oil & 1/2 tspn
sugar

20010311 nice and flat

Contents


2.5.23 20001231 bitter

Munton's Connoisseur Range Traditional Bitter made to 25l and 1 kg
malt. Boiled a little water, add 25g (6 tspns) Cascade hops. Stir
boil 10 secs. Add to wort without straining. Add Peet's London Ale
yeast, 3rd generation.

Add 40? drops hop oil
20010114 - Decanted, 5 dstspn sugar added. bottled sg 1004
20010902 - nectar. Just about perfect. Head without fizz. Loooong
bitter taste.

Contents


2.5.24 20010303 Brown Ale

Munton's Connoisseur Range Brown Ale made to 30l, about 1lb
dextrose and 1 kg dark dry malt. Boiled a little water, add 25g (6
tspns) Fuggles hops. Stir boil 10 secs. Add to wort without
straining. Add Peet's London Ale yeast, 2nd generation.

20010318 bottled 1/2 tsp sugar

Contents


2.5.25 20010506 Bitter

2kg (Munton's?) Amber Dry malt boiled in water until dissolved,
add 25g Fuggles hops at the end. Make up to 30l water. Add Peet's
London Ale yeast, 3rd generation.

20010513 add 2kg dry malt.
20010529 bottled with 1/2 tsp sugar SG=1004
20010815 - a faint sulfurous taste? Leave a bit longer.
20030127 - still a chemical taste, slightly nasty.

DON'T EVER EVER EVER MAKE THIS AGAIN - NO MORE DRY MALT!!!

Contents


2.5.26 20010624 Bitter


Munton's Connoisseur Range Traditional Bitter made to 27l, 1 kg
dry malt. Boiled a little water, add 25g (6 tspns) Fuggles hops.
Stir boil 10 secs. Add to wort without straining. Add Peet's
London Ale yeast, 3rd generation.

20010722 SG 1006 very sour. Bottled with 1/2 tsp sugar.

Contents


2.5.27 20010902 Bitter


Munton's Connoisseur Range Traditional Bitter made to 27l, 1 kg
dry amber malt, 100g lactose. Boiled a little water, add 25g (6
tspns) Fuggles hops. Stir boil 10 secs. Add to wort without
straining. Add Peet's London Ale yeast, 1st generation (Aug 99).
40 drop hop oil added.

20010924 SG1005 bottled w/ 1/2 tsp sugar

2002-11-03 Superb taste, colour if a bit too fizzy at first.
Retains head wuite well.

Contents


2.5.28 20021102 Bitter


Munton's Connoisseur Range Traditional Bitter made to 23l, 1 kg
malt, 100g lactose. Boiled a little water, add 25g (6 tspns)
Cascade hops. Stir boil 10 secs. Add to wort without straining.
Add Safale yeast.

20021116 bottled with 1/4 tsn sugar
20020127 bloody excellent, probably the best yet after only 3 months in the bottle. This is the one - I don't think I can improve on this.

Contents


2.5.29 20030201 Peach Wine


10Kg pulped fruit, 5l water, 2 tspn pectinase, leave for 24 hours

Add 3kg sugar in ?l water for total volume ?l
Add Gervale #2 wine yeast, sg = 1???

Plan on a total of about 6kg sugar to 20l (some recipes call for
6.8kg to 19l) - plan on adding sugar until SG doesn't drop & then
make it sweet, maybe finish at 1.025-30 for an almost-dessert
wine.

20030206 2lb sugar added (total 3.9kg)

20030209 Strained; SG=1005; 1lb 8.5oz sugar added (total 4.6kg)
probably took SG to about 1025

20030210 SG=1010; 2lb sugar added (total 5.51kg); volume is 19l

20030216 SG=1005; 1kg sugar added (total 6.51kg); SG=1025 in 20l

20030308 SG=1020; racked, nicely sweet

Contents


2.5.30 20030209 Bitter


Munton's Connoisseur Range Traditional Bitter made to 23l, 1 kg
malt, 100g lactose. Boiled a little water, add 25g (6 tspns)
Fuggles hops. Stir boil 10 secs. Add to wort without straining.
Add Safale yeast - 2nd generation.

20031104 - bloody gorgeous. Bitter, low head. Gorgeous!

Contents


2.5.31 20030316 Bitter


Munton's Connoisseur Range Traditional Bitter made to 23l, 1 kg
malt, 100g lactose. Boiled a little water, add 25g (6 tspns)
Fuggles hops. Stir boil 10 secs. Add to wort without straining.
Add Safale yeast - 2nd generation.

20031103 - bloody gorgeous. Bitter, low head. Gorgeous!

Contents


2.5.32 200402??

Made with Alex to 'normal' recipe

Contents


2.5.33 200408??

Made with Simon using a different kit - ?

Contents


2.5.34 200503??

Munton's with 1kg brewing suger

Contents


2.5.35 20050515 Plum Wine


20050515 About 5-8 kg not very ripe plums, stoned & quartered and
put into water with some pectinase.

20050519 Fermentation has started. Crushed plums a bit and added
2kg sugar in hot water and then a wine yeast. About 15l volume.

20050531 Added 2 Kg sugar

20050605 Added 2 Kg sugar
2005-12-10 SG 1.10 bottled

Contents


2.5.36 2005-09-11 Strawberry Wine


12l strawberries (approx 6kg) washed & mashed with pectinase to
15l water. Maybe I should have hulled them.

2005-09-13 4kg sugar in 5l water added. Lanvin yeast added.
2005-10-02 2kg sugar added. Now 23l.
2005-12-10 SG 0.982 1kg sugar added SG 1.006 18litres
2007-01-06 bottled (!)

Contents


2.5.37 2007-01-01 Peach & Nectarine


5 kg sugar added???

Contents


2.5.38 General


1oz (1.5 dstspn) per 2.5 iitres water - metabisulphate or
alkaline salts

Ferment until sg is 1006-1010 or 2 minutes between bubbles.

Malt instead of dextrose or sugar or other additives gives higher
final SG

Sucrose gives better head. 1/2 tspn enough if ferment is really
complete - seems to need 2 weeks.

Lactose sweetens without being fermented.

Sugar -> alcohol is: 
%alc = (final-initial)/7.36
grams/litre sugar = (final - initial) * 2.713

Initial		Alcohol			Grams/litre
SG

1020		 2.7%			 55
1035		 4.4%			 95
1090		12.9%			240

Sweetness	SG
Dry		<1000
Medium dry	1000-1010
Medium sweet	1010-1020
Sweet		1020-1030
Dessert		1030-1040

Contents


2.6 Bike lock

6243

Contents


2.7 Bike sizes


Bob
    Inside leg = 88 (*.65=57)
    Saddle height = 75

Simon
    Inside leg = 75 (*.65=49)
    Yellow Apollo:
    Saddle height = 78.5
    Frame = 52.5
    Top post 54

Track Bike (Cecil Walker)
    Frame 52
    Saddle 70.5
    Top post 53.5

Alex
    Inside leg 85 (03/02/02) (*.65=55)
    Red Apollo:
    Frame (along seat post) 57
    top post 57.5
    saddle height 79.5
    crank 170mm

Track bike (black hiway)
    Frame 57
    top 57.5
    saddle height 79.5
    crank 170mm

Contents


2.8 Booklist


Mathematics: Queen and servant of science, ET Bell

Turing Omnibus: 61 excursions in computer science

Zero: the biography of a dangerous idea, Charles Seife

The Big Questions, Paul Davies&Philip Adams	

About Time, Paul Davies	

The Fifth Miracle, Paul Davies

Keeper of Genesis, Robert Bauval&Graham Hancock	

Einstein, a life, Denis Brian

Would-be worlds, John Casti

England: Travels through an unwrecked landscape, Candida Lycett-Green

Wizard, Mark Seifer, bio of Tesla

Einstein, Albert Fosling

Natural Acts - a sidelong view of science & nature - David Quammen

Ian Tatersall - Becoming human

The sixth extinction - Richard Leakey

An anthropologist on mars, The island of the colourblind - Oliver Sacks

The year 1000 - Robert Lacey, Danny Danziger

Gods secret formula peter glitchka

Galileo's Finger - Peter Atkin

Contents


2.9 Buses


Capalaba to City
Redland Bay Rd 45 mins approx.. $4.40, $38/10, $130/month
7:17, 7:44, 7:50, 8:27
4:55, 5:10, 5:25, 5:40, 6:15, 7:10

Contents


2.10 Buses


Route for court is: $5.60
NBC 9 @ 7:15am to MtCotton Rd/Broadwater Rd,
walk  Upper Tingalpa Creek Bridge
MGB 6 City @ 7:47am arr Elizabeth St @ 8:40am

Alternative is: 
NBC 9 @ 7:15am to Ney & Redland Bay Rd @ 7:32am
NBC 1 @ 7:43am to Elizabeth St @ 8:25am $4.10

Alternative: $3.90 + 10km drive
drive 10km to Capalaba Shopping Centre & park
NBC 2 @ 8:05am Capalaba Nab stop to City @ 8:50am

Alternative: $3.40 + $??? + 10km drive
drive 10km to Capalaba Shopping Centre & park
NBC 14 @ 8:00am Capalaba Bus Interchange to Garden City J @ 8:20am $???
walk 280m
138 @ 8:29am Upper Mt Gravatt Busway to Parliament @ 8:44am $3.40

Contents


2.10.1 NBC 1 - Capalaba-city


Capalaba (Moreton Bay Rd)
7:08am
7:48am
8:13am

City Elizabeth St
7:50am
8:25am
8:45am

Contents


2.10.2 NBC 9 - Sheldon Loop


Capalaba Mt Cotton/ Ney Rd/ Ney Rd &  Pioneer  Avalon  Greenacres
I'change Killarney  School  Mt Cotton & Summit & Emu   Mt Cotton Rd
10:00am  10:04am    10:10am 10:16am            10:20am 10:29am
12:00pm  12:04pm    12:10pm 12:16pm            12:20pm 12:29pm
1:00pm   1:04pm     1:10pm  1:16pm             1:20pm  1:29pm
3:20pm   3:24pm                       3:44pm   3:50pm  3:55pm
4:20pm   4:24pm     4:26pm  4:31pm    4:34pm   4:40pm  4:45pm
5:10pm   5:20pm     5:26pm  5:32pm    5:36pm   5:45pm  5:50pm
6:10pm   6:20pm     6:26pm  6:32pm    6:36pm   6:45pm  6:50pm

Greenacres  Avalon  Pioneer  Ney Rd/ Mt Cotton/ Capalaba Bus 
Mt Cotton   & Emu   & Summit School  Killarney  Interchange      
6:15am      6:20am  6:27am   6:33am  6:43am     6:47am         
7:15am      7:20am  7:27am   7:33am  7:43am     7:47am         
10:35am     10:40am 10:47am  10:53am 10:57am    10:59am            
12:35pm     12:40pm 12:47pm  12:53pm 12:57pm    12:59pm            
1:35pm      1:40pm  1:47pm   1:53pm  1:57pm     1:59pm         
3:45pm      3:50pm  3:57pm   4:03pm  4:07pm     4:10pm        
			            

Contents


2.10.3 NBC 14 - Capalaba-Garden City - Griffiths

Griffith Uni
Nathan Campus Garden City Capalaba Bus Interchange
8:15am		  8:25am	  8:45am					 
9:15am		  9:25am	  9:45am					 
10:15am		  10:25am	  10:45am					 
11:15am		  11:25am	  11:45am					 
12:15pm		  12:25pm	  12:45pm					 
1:15pm		  1:25pm	  1:45pm					 
2:15pm            2:25pm      2:45pm
3:15pm		  3:25pm	  3:45pm
4:15pm		  4:25pm	  4:45pm
5:15pm		  5:25pm	  5:45pm
6:15pm		  6:25pm	  6:45pm

Capalaba Bus Garden City Griffith Uni  
Interchange	 'J'		 Nathan Campus 	
7:15am		 7:35am		 7:45am		  
8:00am		 8:20am		 8:30am		  
9:15am		 9:35am		 9:45am		  
10:15am		 10:35am	 10:45am		  	
11:15am		 11:35am	 11:45am		  	
12:15pm		 12:35pm	 12:45pm		  
1:15pm           1:35pm      1:45pm
2:15pm		 2:35pm		 2:45pm
3:15pm		 3:35pm		 3:45pm
4:15pm		 4:35pm		 4:45pm
5:15pm		 5:35pm		 5:45pm

Contents


2.10.4 MGB 6 Capalaba - GU - City


Capalaba Central Interchange   7:38am  9:25am 2:35pm 4:20pm 5:25pm
Capalaba State Primary School  7:42am  9:29am 2:39pm 4:24pm 5:29pm
Redlands Police Youth Club     7:44am  9:31am 2:41pm 4:26pm 5:31pm
Upper Tingalpa Creek Bridge    7:47am  9:34am 2:44pm 4:29pm 5:34pm
Alperton Rd & Mt Cotton Rd     7:51am  9:38am 2:48pm 4:33pm 5:38pm
Moxon Rd, 
Mt Cotton Rd Interchange       7:52am  9:39am 2:49pm 4:34pm 5:39pm
Gateway Baptist, 
MtGravattCapalabaRd            7:55am  9:42am 2:52pm 4:37pm 5:42pm
Mt Petrie State Primary School 7:58am  9:45am 2:54pm 4:39pm 5:44pm
Gainsborough Park              8:00am  9:47am        4:40pm
Gardner Rd & Prebble St        8:05am
Eight Mile Plains - Busway     8:10am
Upper Mt Gravatt - Busway      8:15am
Garden City 'E'                        9:59am 3:02pm 4:52pm 5:56pm
Griffith Uni - Busway          8:25am 10:09am 3:07pm 5:02pm
Holland Park West - Busway     8:27am
Greenslopes - Busway           8:29am
Buranda - Busway               8:31am
Woolloongabba - Busway         8:33am
City Elizabeth St              8:40am
 
City Elizabeth St                               5:10pm  
Woolloongabba - Busway                          5:17pm
Buranda - Busway                                5:19pm  
Greenslopes - Busway                            5:21pm
Holland Park West - Busway                      5:23pm
Griffith Uni - Busway                   1:35pm  5:25pm  
Upper Mt Gravatt - Busway                       5:35pm  
Garden City 'E'                 7:15am  1:45pm      
Eight Mile Plains - Busway                      5:40pm  
Gardner Rd & Prebble St                         5:45pm  
Gainsborough Park                       1:58pm  5:50pm  
Mt Petrie State Primary School  7:23am  2:01pm  5:52pm  
Gateway Baptist, 
Mt Gravatt Capalaba Rd          7:25am  2:03pm  5:54pm  
Moxon Rd, 
Mt Cotton Rd Interchange        7:28am  2:06pm  5:57pm  
Alperton Rd & Mt Cotton Rd      7:29am  2:07pm  5:58pm  
Upper Tingalpa Creek Bridge     7:31am  2:09pm  6:00pm  
Redlands Police Youth Club              2:12pm  6:03pm  
Capalaba State Primary School           2:14pm  6:05pm  
Capalaba Central Interchange            2:18pm  6:09pm  
Windemere Rd & Redland Bay Rd           2:21pm      
Moreton Bay College Of Tafe             2:23pm      
Capalaba Bowls Club, 113 Ney Rd 7:35am          
Moreton Bay College Of Tafe     7:40am       

Contents


2.10.5 MGB 5 Capalaba - Garden City


Contents


2.11 Camping Checklist


bird book
clothes pegs
washing line
washing-up bowl
spare lilo plugs
soap
insect repelent
insect spray
cooking utenclls
	tongs
	fish slice
	cooking knife
	chopping board
	cooking plate or portable BBQ
soap dish
knives 
forks
spoons
picnic plates
mugs (plastic)
plastic glasses
corkscrew & can opener
wooden mallet
gas lamp
gas cooker
pillows
small milk bottle~ screw top
dish cloth
sleeping bags & liners
big bottle of water
chairs
water bottles
rucksacs
hats
sun tancream
                    food
butter
wok
onions
potatoes
salt & sugar
meat and vegetables
cheese and ham
bread & rolls
gravy
beer & wine
snacks - crisps, cakes

torches
spare batteries
waste bags
ground sheets
baked beans
more bake beans
fire extinguisher
swimming gear
fishing gear
sunglasses
sun tops
spare gas cans
fruit juices
tooth paste and tooth brush
flask of hot water
first aid kit & medications
	anthisan
	dettol cream
	bandages & gauze
	iodine
trailer
flysheet & poles for canopy - rainproof
rain gear
cameras & film
hatchet & spade
silver foil
water bottle per person

Contents


2.12 Cars


Contents


2.12.1 Astra


685HMM
07 3884 9444

Contents


2.12.2 Hyundai

Radio/CD pin 3522
Key number T0823
043 GOZ

Contents


2.12.3 TR4


handbrake adjust
clutch fade
accelarator return
reversing lights
passenger door?
temp guage
headlight cuts out - dip switch

Contents


2.12.4 Festiva

102 FCY

Contents


2.13 Cataracts

Surgery - recovery period? Any restrictions on heavy lifting?
1 week no lifting at all. Bending OK.
4 weeks no heavy lifting eg 50kg

Surgery method used - Phacoemulsification ? yes. Stiches? probably not.

In the USA, Presbyopia-Correcting IOLs are being offered eg
http://www.allaboutvision.com/faq/presbyopia-iols.htm AcrySof® ReSTOR®
IOL. When are they likely to be available in Australia? Are they any
good? Not really - severe halos at night. Not for young men like me.
How much extra?

Are there new treatments anticipated eg allowing the lens to
acoomodate. Nothing known. Would I be able to upgrade later? Probably
not - not worth the risk of damaging the lens capsule for the sake of
a reduction in one pair of glasses.

Presumably I would have zero accomodation afterwards. Do I have any at
all now? Yes - a little. None after the op. 

It was suggested that I be left with a 2-3 diopter shortsigtedness.
What sort of depth of field will I have? Depending on the
illumination, close sight should be OK 30-60 cms. Distance glasses
needed for TV and driving.

I would need glasses for distance certainly. What about watching TV at
2-3 metres away? Computer screen or book at 30-60 cms?

How many such ops has he done? 400 / year for 15 years.

Success rate?

I would need an A-scan by Dr Ohlrich personally before the op.

4 weeks between ops.

Would be done at Eye-Tech, Upper Mt Gravatt (near Garden City).

Cost without insurance would be about $1600/$2600 in public/private
hospital plus anaesthetist. Is covered by GU Health (but excluded by
the cheaper plan).

Contents


2.14 Christmas list

Everex 7" CloudBook CE1200V Ultra-Portable Laptop w/ VIA C7-M Processor ULV
http://www.walmart.com/catalog/product.do?product_id=8245470

Everex 15.4" gBook VA1501V Laptop PC w/ VIA C7-M Processor
http://www.walmart.com/catalog/product.do?product_id=10227034

Contents


2.15 Computers

wifi code: 64 65 61 64 62 == deadb

Contents


2.15.1 raita - Bob's


3GHz Pentium-4 512Mb with hyperthreading
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 6009.20

m/b: dfi PS83-BL Socket 478 w/FSB800, DDR-400, AGP-8X, Audio, lan, Intel 865PE chipset

00:00.0 Host bridge: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)
00:01.0 PCI bridge: Intel Corporation 82865G/PE/P PCI to AGP Controller (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)
00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 440 AGP 8x] (rev a2)
02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
02:04.0 FireWire (IEEE 1394): Agere Systems FW323 (rev 04)
02:09.0 SCSI storage controller: Advanced System Products, Inc ABP940-U / ABP960-U (rev 03)
02:0a.0 Multimedia audio controller: Ensoniq 5880 AudioPCI (rev 02)
02:0c.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

00:00.0 Host bridge: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)
        Subsystem: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface
        Flags: bus master, fast devsel, latency 0
        Memory at d0000000 (32-bit, prefetchable) [size=256M]
        Capabilities: [e4] Vendor Specific Information
        Capabilities: [a0] AGP version 3.0

00:01.0 PCI bridge: Intel Corporation 82865G/PE/P PCI to AGP Controller (rev 02) (prog-if 00 [Normal decode])
        Flags: bus master, 66MHz, fast devsel, latency 64
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
        Memory behind bridge: ec000000-edffffff
        Prefetchable memory behind bridge: e8000000-ebffffff

00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02) (prog-if 00 [UHCI])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 16
        I/O ports at bc00 [size=32]

00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02) (prog-if 00 [UHCI])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 19
        I/O ports at b000 [size=32]

00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02) (prog-if 00 [UHCI])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 18
        I/O ports at b400 [size=32]

00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02) (prog-if 00 [UHCI])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 16
        I/O ports at b800 [size=32]

00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02) (prog-if 20 [EHCI])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 23
        Memory at f0000000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [50] Power Management version 2

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=32
        I/O behind bridge: 0000a000-0000afff
        Memory behind bridge: ee000000-efffffff
        Prefetchable memory behind bridge: 20000000-200fffff

00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
        Flags: bus master, medium devsel, latency 0

00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02) (prog-if 8a [Master SecP PriP])
        Subsystem: DFI Inc Unknown device 1008
        Flags: bus master, medium devsel, latency 0, IRQ 18
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at f000 [size=16]
        Memory at 20100000 (32-bit, non-prefetchable) [size=1K]

00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
        Subsystem: DFI Inc Unknown device 1007
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 18
        I/O ports at c000 [size=8]
        I/O ports at c400 [size=4]
        I/O ports at c800 [size=8]
        I/O ports at cc00 [size=4]
        I/O ports at d000 [size=16]

00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
        Subsystem: DFI Inc Unknown device 1008
        Flags: medium devsel, IRQ 17
        I/O ports at 0500 [size=32]

00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
        Subsystem: DFI Inc Unknown device 1001
        Flags: bus master, medium devsel, latency 0, IRQ 17
        I/O ports at d800 [size=256]
        I/O ports at dc00 [size=64]
        Memory at f0001000 (32-bit, non-prefetchable) [size=512]
        Memory at f0002000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2

01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 440 AGP 8x] (rev a2) (prog-if 00 [VGA])
        Subsystem: LeadTek Research Inc. Unknown device 2924
        Flags: bus master, 66MHz, medium devsel, latency 248, IRQ 16
        Memory at ec000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e8000000 (32-bit, prefetchable) [size=64M]
        [virtual] Expansion ROM at ed000000 [disabled] [size=128K]
        Capabilities: [60] Power Management version 2
        Capabilities: [44] AGP version 3.0

02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
        Subsystem: DFI Inc Unknown device 1003
        Flags: bus master, medium devsel, latency 32, IRQ 17
        I/O ports at a000 [size=256]
        Memory at ef011000 (32-bit, non-prefetchable) [size=256]
        Capabilities: [50] Power Management version 2

02:04.0 FireWire (IEEE 1394): Agere Systems FW323 (rev 04) (prog-if 10 [OHCI])
        Subsystem: Agere Systems FW323
        Flags: bus master, medium devsel, latency 32, IRQ 16
        Memory at ef012000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [44] Power Management version 2

02:09.0 SCSI storage controller: Advanced System Products, Inc ABP940-U / ABP960-U (rev 03)
        Subsystem: Advanced System Products, Inc ASC1300 SCSI Adapter
        Flags: bus master, medium devsel, latency 32, IRQ 17
        I/O ports at a400 [size=256]
        Memory at ef010000 (32-bit, non-prefetchable) [size=256]
        [virtual] Expansion ROM at 20000000 [disabled] [size=64K]

02:0a.0 Multimedia audio controller: Ensoniq 5880 AudioPCI (rev 02)
        Subsystem: Ensoniq Creative SoundBlaster AudioPCI 128
        Flags: bus master, slow devsel, latency 32, IRQ 18
        I/O ports at a800 [size=64]
        Capabilities: [dc] Power Management version 1

02:0c.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)
        Subsystem: Netgear Netgear WG311T Wireless PCI Adapter
        Flags: bus master, fast Back2Back, medium devsel, latency 128, IRQ 16
        Memory at ef000000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [44] Power Management version 

Contents


2.15.2 nina


AMD Athlon XP 2000+
m/b: A7N8X-VM/400

nVidia Corporation NV18 [GeForce4 MX - nForce GPU]

XP installation:
Remove netgear card
Install XP
Install ASUS drivers for Nvidia nForce components
Install Netgear version 4.0 driver
Power off & install netgear card

Contents


2.15.3 grass - Old Raita (now Simon's)

IP 192.168.254.100

Video NVIDIA Vanta
Network NE2K clone PCI - ne2k-pci & 8390
CDROM - SONY CD-RW CRX160E IDE
SCSI - aha1542 ISA IRQ 9 DMA 5 

ASUS P3V133 motherboard with VIA Apollo Pro133 chipset VT82C693A
system controller, VIA VT82C596B PCI to ISA bridge; slot 1
66-150MHz bus

Celeron 600MHz (Coppermine) 128kb cache, 1200 bogoMips

USB UHCI (Intel-type) - lspci -v returns "I/O Ports" at rather
than "Memory at" for USB info

Dynabolic live cd works fine after:
	modprobe 3c509
	pump -i eth0

Contents


2.15.4 athlon - Alex's


AMD Athlon 1800+ XP series 8
256Mb RAM
30Gb disc

ASUS A7N266-VM/LAN/WOSPDIF&USB-UAY motherboard 
with GEForce 220D video, lan, audio
Drivers are nvidia graphics and nforce LAN & audio

Contents


2.16 Dubai


K-Porte Inn Dubai, Dubai , United Arab Emirates A$95, pool, Al-Riqqa road (webjet)
Claridge Hotel, £148.41 3 nights, 1 km to Deira city centre, pool, opodo.co.uk 
Admiral Plaza Hotel, £126.72, 2km to city in Bur Dubai near heritage village, indoor ppol, popda.co.uk
St George Hotel, US$90.77 incl b/f, 1km gold suq, no pool
Holiday Inn Downtown, £211.86 3 nights, 0.4km city centre, pool
al Arraf, 1 star in gold souk, http://yp.theemiratesnetwork.com/biz/United_Arab_Emirates/Dubai/Al_Arraf_Hotel_19741.html http://www.emiratesresidence.com/dubai/hotels/al-arraf-hotel/detail.html 
http://www.dubaicityguide.com/tourism/budget.asp
Dream Palace Hotel, DEira, US$52/night but pool closed, works in progress - prob OK in Sept

Contents


2.17 Finder


ABN 53 083 750 396
Tax File #: 42 508 437

Contents


2.18 Fotki


To upload:
Make album on fotki site (ncftpput -m option fails)
ncftpput -u bhepple -p raffles ftp.fotki.com public/bob/2008/`today` *.jpg

Private directories are: private/bob/1997-2003/1998-carshow

Contents


2.19 Grand United

http://www.guhealth.com.au
1800 249 966

Contents


2.20 High Pines Sizes


Living rm: 13x7	
BR1 us:_7x7 + b.r.	
BR2 kids:_7x7 + b.r.	
Master BR:_14x8 
upstairs	Dining__10x8	
Hall__12x8	
Upper hall_7x7_
Kitchen

Contents


2.21 HK Restaurants


Yung Kee - goose, duck, 32 Wellington St, Central, 2522-1624, (HK$200)
Sze Chuan Lau, Causeway Bay
Great Shanghai
Yunan Garden
Peking  Garden 
Shanghai Garden
Mandarin Grill - closed
Gaddi's
JoJo Mess
Islands - Lamma Hilton
Bull & Bear - closed?
Le Tire Bouchon
Pine & Bamboo, Causeway Bay
Cinta J
Ghengis Khan
Macao - BV, Fernandos, Cockerel
City Hall or Admiralty Dim Sum or Maxims Causeway Bay (HK$100)
The American Restaurant, Wanchai

Lok Yu Tea House, 24 Stanley St, Central, 2523-5464, (HK$150)
German bar in Lan Kwai Fong

Shui Hu Ju - Shanghai to Szechuan, 68 Peel St, Central, 2869-6927 (HK$400)
Mum Chau's, spicy home cooking, booking ess., 5B Winner Bldg, 37 D'Aguilar St, Lan Kwai Fong, (HK$200)
Da Ping Huo, 2 sittings / eve, Lower Ground Hilltop Plaza, 49 Hollywood Rd, Central, 2559-1317 (HK$250)

Contents


2.22 Ironies


Contents


2.22.1 Eracom


Contents


2.22.1.1 Greedy

Greedy:

no pay rises and any excuse will do, it just changes from year to
year. Last year it was "not reaching target" whatever that might have
been. After all we only grew by 50% and made X millions in profit,
but no, we won't give out pay increases. This year we made no profit
"in Australia". What about worldwide and "profits" shipped overseas
to minimize tax. No reply.

Arrogant:

to compel us to take 1 weeks leave when it suits them - with only
2 months notice.

to compel us to take Gold Coast show day instead of Brisbane - they
clearly couldn't card less about our families - and what difference
would it make to them what day I take anyway!!

to think we'd believe their lies. 

to say "we're going to be completely open and honest about this"
and to then not answer our questions.

to never ask "how's it going?"

Dishonest:

lying about our financial statement to justify no pay rises

Demotivating:

All the above plus:

If it takes a long time you're clearly stupid or lazy.  If you do
it quickly it was obviously easy.

If you say it will take a week and it takes a month you are clearly
a bad engineer.

If you say it will take a month and you do it in a week, you're
clearly no good at estimating and were obviously lying in the first
place. Whatever - you're a bad engineer.

If you estimate a month and it takes a month - clearly there's
something fishy going on. You probably did it in a week and goofed
off for three. Clearly you're a bad engineer.

Do your job quietly and diligently and no-one cares. Sit in the
Project Manager's office day in and out and they think you're great.

There is no way on earth that I would ever be told "well done". For
goodness sake, if they did that we might actually expect a rise!

For years I put in extra hours and truly hauled-ass. It resulted
in nothing more than "that's what we expect". So now I coast. I do
a little more than the required 37.5 hours but no more. If there's
an opportunity to contribute something I don't bother. I just do
what I'm told. Fuck them all.

Contents


2.22.1.2 Skype

"You must all implement skype" Fine but - 

Where are the headphones? - 50 x $50 each = $2500
Headphones have no bell - use computer speaker? Nasty.

Why can't we use the existing phones? eg with a VOIP gateway - much easier.

What about SkypeOut? - we need a corporate account.

But then, SkypeOut to Australia sucks.

No-one has thought this through at all!

Contents


2.22.1.3 Device Drivers

There are "Device Driver problems that need resolving" instead of
"supporting new operating systems and platforms". But other products
are "enhanced".

Contents


2.22.1.4 Bonus

"We couldn't decide who deserved a bonus this year so you might as
well have it anyway so we don't have any arguments"

Sheesh, well thanks so much, I feel so much better now, I must have
really deserved that. Are they just dumb or what? They actually
had an opportunity to make us all feel really good for once and
decided to blow it completely.

Contents


2.22.2 Gaia


Why do the greenies think humans are evil? We ourselves are part of Gaia - looks like gaia created us to fend off yet another bloody ice age.

And don't believe the climate modellers - it's just too vast and complex a problem to make any kind of sensible prediction. Any one who thinks they are accurate is either a simpleton or a knave.

Contents


2.22.3 Oz


Contents


2.22.3.1 Medical

A GP in Oz can do nothing beyond handing out antibiotics. Anything
else needs a specialist. That means a 3-6 month wait just to be
told what the GP should have told you in the first place.

Why can't billing be finished at the surgery? You pay the
doctor. Then you go to Medicare to make a claim. Then you go to
Medibank to claim again. It's so bloody stupid!!!!

I'm terrified of needing serious medical care in Oz. The
Patel-effect is doubtless more common than Dr Death himself. Surgeons
eager to operate on any phantom condition just to bump up their
quotas. Beancounters running hospitals and happy to promote doctors
on their quota-performance. Not just scary - terrifying.

Contents


2.22.4 gnome


Bloat.

/etc/gconf is 33Mb!!!
A. it doesn't belong in /etc
B. most of it is LOTE - and you can't remove unused languages!!

No man pages and html docs are mere descriptions of
dialog/menu/button items. eg. "The Open button opens a frugle"
but what's a frugle?

No -geometry options so no scriptability

Contents


2.22.5 Genetics


Science is an approximation. We get better with every decade but the
very best we have is still an approximation to the real world. Even
in a hundred years we will still be working with approximations.

We get better - Newtonian mechanics was better than ancient
greek. Einstein improved on that. One day, someone will improve
on Einstein.

Our understanding of many fields is so good that we start to get
arrogant and think we have something better than an appoximation.

It's probably understandable that in the area of medicine, people
want certainties not approximations - immediately we leave the
domain of science and enter the world of faith. They want to be sure
their doctor knows what they are doing. Before modern medecine,
we had shamans and witch doctors and almost the only thing they
offered was certainty and the power of belief is still something
we underestimate. It's natural that today's doctors would want to
continue to take advantage of this - often, but not exclusively,
for the benefit of their patients.

If a patient believes strongly enough they often will get better
- it's the placebo effect plus. Anyway, in most cases it's the
patient's own body that heals itself, and a medical intervention is
just an aid, a prop, an accelerant. 

So, to generate this faith doctors must be omnipotent - they like
to play god, their patients want it.

Genetics and climate science share at least one (maybe only one)
thing - immense complexity. In genetics, the complexity comes not
just from the large number of data points - the human genome is a
mere 30,000 genes - but from the ways these components interact
with each other and with their environment. The genome exists in
a soup of proteins - mostly immense molecules themselves, each of
them with distinct properties and interactions based not just on
their own component atoms but how they are arranged. Proteins fold
and they can fold in different ways depending (in turn) on their
own environment and history.

Each protein must be produced using the genome as a blueprint by
other proteins acting as copying machines. How many thousands of
proteins are there? Hundreds, thousands maybe millions.

A tiny change in the way one of them is made can make the difference
between blue and green eyes. Healthy lungs and cistic fibrosis.

Do we understand this? Only in a superficial manner. We're getting
better but there's no computer on the planet can calculate all the
possible proteins, their folding and interaction with each other
and with the genome. We don't even know how we'd program such a
machine let alone find sufficiently powerful hardware.

For a researcher to say "let's insert this viomycin-resistant gene
into E.Coli as a marker" is just insane. Do they know even half what
they are doing - no way. It's too complex.

As for climate - the climate scientists want us to modify our
behaviour on the basis of their "models". Ask an honest climate
scientist what climate we "ought" to have and he'll say we're well
overdue for an ice age. Can we calculate the effect of pollutants
on the climate - not at all. We know the simple things, that CO2
cause warmth and dust int he air reduces it.

Contents


2.22.6 Countryside


People in the country walk less than city-slickers.

Fresh fruit & vegies is harder to get in the country and maybe
more expensive.

Even locally produced stuff can be harder to get - try & get a
crayfish in Geraldton - the only thing available when I visited
was frozen, the fresh is all sent off to town and overseas.

Contents


2.22.7 10 politically-incorrect truths!!


http://www.psychologytoday.com/articles/pto-20070622-000002.xml

Contents


2.22.8 The new Unix


What do I remember of the old Unix? Was it really so well documented with
a man page for everything? Was everything a file? Was every tool small
and sharp, specialising in just one task and so easy to pipe together to
form new functionalities undreamt of by the original authors? If something
failed to work, could you reliably turn to diagnostics and log files to
deduce what was wrong? Was source code available for everything? When emacs
was a big program. When the usenet was inhabited by civilised hackers who
responded politely to questions about software they had contributed to
the public commons.

Perhaps it was not quite as rosy as nostalgia paints it but boy oh boy,
isn't the new Unix going the wrong way?

I wonder what Kernighan, Thompson and Ritchie think of the new wave. 

Monsters like 'evolution'. 

Behemoths of bloat like Gnome and KDE. 

Baroque obscurities of twisted configurations like udev.

Arrogancies (can that possibly be a word?) like freedesktop.org where
documentation is a rude word, please don't scare the horses.

Enigmas of configuration like 'hal'.

Do you know that as long as you can edit /etc/fstab effectively, you can
do away with hal and dbus completely. They are not essential parts of
Unix. Yet. I wonder how long before they are a mandatory part of Linux -
it will be around the time I jump ship to another simpler Unix.

Yet perhaps all is not so black as I fear. Jumping into dbus' page of
compliant applications, I see a very small number after all this time -
what is it? 3 years since dbus was first boosted as the latest cool tool? I
suppose that other developers are not so stupid after all - they are avoiding
it like the plague that it has become because the documentation is just so
pathetic. dbus and hal are supposed to make Linux "Just Work'. Unfortunately,
it doesn't always and then you find that tracking down the problem is a
nightmare ride through enigmatic XML configuration and log files without
decent documentation.

All of that old fashioned Unix openness, clarity and simplicity is being
sacrificed on the altar of winning the desktop war against you know
who. We're abandoning what first attracted us to Unix so that mum and dad
and auntie ethel can use it. Unfortunately, such a crappy job is being
done that poor old auntie ethel is completely confused, confounded and lost.

I think we should just face the simple fact that Linux will never be for
the hapless and hopeless, the entity in the street.

My advice - if you like those old values, get rid of hal and dbus. Eliminate
gnome and KDE. Run fluxbox or something similar. Read the man pages. Stop
trolling through menus and sharpen up your vi skills.

Contents


2.23 Kids Books


Letters to Uncle Albert, Russell Stannard

101 Optical Illusions, Terry Jennings

Milton's teeth and Ovid's Umbrella, Michael Omert

Wonderful Life, Stephen Jay Gould

The Hidden Landscape, Life: an Unauthorised Biography, Richard Fortey

www.gleebooks.com.au

Contents


2.24 Mansfield Rd Flat sizes


total area 1500 sq ft		
Living rm:_26x14 (8x4.3)	
BR1 us:_14.5x14 + 6.5x9 incl. fitted wardrobes (4.4x4.3 + 2x2.8)	
BR2 study:_11x14 (3.4x4.3)	
BR3 kids:_15x12 + f.w.r. (4.6x3.7)	
Bath__9x6 (2.8x1.8)	
Dry room_9x6 (2.8x1.8)	
Hall__37x4.5 (11.3x1.4)_
Kitchen_17x9 (5.2x2.8)_
Back balcy_14x9 (4.3x2.8)_
Amah__11x6 (3.4x1.8)_
Laundry_11x5 (3.4x1.5)_
Front balc_14x7 (4.3x2.1)

Contents


2.25 Medication


Sporanox - 2 daily for fungal ear Kenacomb - Waxy antibotic,
antifungal & steroid. 

Otodex Steroid & anti-b. Ear.
Fucidin - antibiotic cream. General. Augmentin - mild antibiotic.
Erythromycin - stronger antibiotic. Chloramphenicol- eye
antibiotic Ciprobay - antibiotic.
Stoxil - cold sores.
Medodermone - eczema steroid.
Daktacort - athletes foot anti-fungal with hydrocortisone for itch
Dormicon - sleeping tablets - side effects!
Advanta - jock itch
Nexium (esomeprazole magnesium) from AstraZeneca) - development of
omeprazole. May be better than losec?

Dermovate (temovate in USA, also Tenovate, Dermoval, Dermoxin)
The active ingredient in Dermovate is Clobetasol 17-propionate
0.05%

Contents


2.26 Melbourne


Antipodes Greek Rest. 195 Lonsdale Rd
Old Kingdom, 197 Smith St, Fitzroy, Peking Duck & Timor/Portuguese
food. Simon Lay.
Alasya Turkish Rest 163 & 555 Sydney rd, Brunswick
Lopez Bar, Spanish Rest, 102 Kedron Brook Rd, Wilston, Qld
Casa Iberica, 25 Johnston st Fitzroy, 9419 4420

Contents


2.27 Music


http://ogg.tv-radio.fr:1441/encoderfip.ogg
http://www.virginradio.co.uk/thestation/listen/index.html
http://magnatune.com/
http://search.singingfish.com

That album:

TRIPLE M NEW STUFF VOL 4:
   November 25, 2002

Without you-Silverchair (Diorama)
Breaking up the girl-Garbage- (Beautiful Garbage)
Evolution-Crashpalace- (Crashpalace)
Are you in-Incubus- (Morning View)
Hero-Chad Kroeger- (Hero)
I'm just a kid-Simple Plan - (I'm just a kid)
Creepin' up slowly-Taxiride - (Garage Mahal)
Boom-P.O.D. - (Satellite)
Shortskirt/long jacket-Cake - crap
Drift & die-Puddle of Mudd
Fall for you-The Whitlams -
Betterman-John Butler Trio -
Seein' red-      Unwritten Law - (Elva)
Green-Alex Lloyd -
Points of Authority-Linkin Park -
Here is gone-Goo Goo Dolls - (Here is gone)
Prayer-Disturbed -
New Technology-Waikiki -     
Lines- Pete Murray (Feeler)

Contents


2.28 Paddy's Market


Contents


2.28.1 ACN ABN TFN


Name: Nina and Co. Pty. Ltd.
Trading as Paddy's Market
12/1177 Wynnum Rd
Cannon Hill
Qld 4170
ph/fax: (07) 3348 8966

ACN:  121556998
ABN:  40121556698
TFN:  

Business card printer: http://www.clickbusinesscards.com.au
Rubber Stamps: http://swiftrubberstamps.com.au/

BOQ
Account #: 20352920
BSB: 124-005
Merchant number: 1613298

EFTPOS 22c /tx
CREDIT 0.899% eg on $10 fee is 9c

Contents


2.28.2 Chesterton


Polly Lamond
100 Wharf St (cnr Ann St)
Brisbane QLD 4000

T: (07) 3222 3000
F: (07) 3832 2001

Contents


2.28.3 St Vincent de Paul


Gerard Briody
48 Bridgenorth St
Carindale
Qld 4152
07 3391 6411

Contents


2.28.4 Telco Blue


1-300-835262
Scientology Bldg
1/F 100 Brunswick St
Fortitude Valley

Contents


2.28.5 National foods (Milk)


PO Box 505 Mulgrave VIC 3170
1800 353 410
fx: 03 8544 3484

EFT Westpac, National Foods Finance
BSB 033 000
a/c 198 636

ref 46015787

fax rem advice to 1800 813 419
or email ar@natfoods.com.au

Contents


2.28.6 Conga foods

07 3714 6888

Ian 0407628756

Spaghetti, linguine etc 65c
Penne etc 75c

Contents


2.28.7 CGU Insurance


Policy 15T 2046744 01

Claim contact is Gavin Wilson 03 9601 8790 fax: 03 9601 8101 - no long valid
Switchboard is 1300 550 193 fax: 1300 737 965
Michael St. John 03 9601 8671

2008-05-28 claim form & write fax'd to Gavin Wilson 1300 737
           965. Called and G. Wilson confirmed receipt.

2008-06-17 fax sent re Chesterton request for Certificate of Currency
           Michael St John rang to say they had no claim form. Send
           tomorrow!  Solicitor and loss adjuster will contact us
           to arrange site visit.  Gave Michael my fax and mobile
           numbers

2008-06-18 Sent all claim papers to 03 9601 8101 attn: M. St
           John. Called and G. Wilson confirmed receipt.

2008-06-20 Peter Dovolil of Carter Newell called - he is appointed
           to defend CGU. pdovoli@carternewell.com 3000 8323 fx:
           3000 8455. Sent him photos of the shop. He needs the
           lease. Promised it for Monday.

2008-06-23 Sent lease to P. Dovolil

2008-08-20 Talked to Michael St John michael.stjohn@cgu.com.au re
           policy for Chesterton. Told me to talk to Ray White as
           the underwriters 1-800-678-379.

2008-09-05 Fax sent to Ray White 1-300-382-431 to cancel policy

Contents


2.29 Places

Cape Town
Observatory area - cafe?
Mt Nelson Hotel for food

Contents


2.29.1 Brisbane


Centro on James??

Fortitude Valley
    McWhirter's, Brunswick St
    King of Kings is expensive, try opposite
    Storey Bridge - take Old Cleveland Road, Ipswich Rd, turn right. Over the bridge take the airport turning, down dip underpass, 1st left, park at rear for $3 (refunded), big place for ingredients
    The Vietnamese Restaurant, 194 Wickham St, 3252 4112, lunch & dinner
    Lucky's Trattoria 3252 2353, 683 Anne St
    Spanish Bar, 455 Brunswick Street, Fortitude Valley, 3257 3138 (Portuguese too)
    Thai-wi Rat, 20-28 Duncan St, Fortitude Valley (Chinatown Mall), 3257 0884

New Farm/East Brisbane
    Miro's Spanish Restaurant, 154 Merthyr Road, New Farm, 3254 0788 (Portuguese too)

West End/South Brisbane
    Green Papaya Vietnamese 898 Stanley St, 3217 3599 - pork & prawn rolls (Goi Cuon), veg. pillow cakes, soups, dinner only, Closed Monday
    Huong's Restautant Vietnamese, 83 Vulture St, West End, lunh & dinner 3844 6701
    Cafe Babylon, Boundary St
    The Three Monkeys Coffee and Tea House, 58 Mollison St, West End (on the roundabout) 3844 6045, Greek
    Qan Heng Vietnamese
    King Ahiram (Lebanese) Vulture/Boundary St
    Greek Club next to Mowbray Park
    Lefkas Tavern, Hargrave Rd, West End.
    Yianni's, 898 Stanley St, East Brisbane, 3217 3599, dinner,
    Khan's Kitchen, 75 Hargrave St, Pakistani
    Venus Hellas Deli, 78 Vulture St, WE
    Pennisi Deli, 17 Balaclava St W'gabba
    Sol Breads, 27 Vulture St, West End
    Hooked on bread, 4/661 Oxley Rd, Corinda
    Jocelyn's Provisions, Centro on James
    The Flour Shop, Barker St, New Farm
    The Tango Portuguese/Brasilian, 126 Boundary Rd, WE
    Otello's Bulimba - Tony Chand's reco
    Bombay Dhaba - Boundary St, West End

South Suburbs
    Thai Emerald Restaurant, 61 Cambridge Drive Alex Hills 3824-1226
    Pine & Bamboo, 968 Wynnum Rd, Cannon Hill, Peking Duck
    Landmark, Sunnybank Hills for lunchtime dimsum ***
    Marigold, Sunnybank Hills for lunchtime dimsum ***
    Vietnamese inside Sunnybank Plaza nearest cinema ***
    Blue Bistro(?), Welli Point **
    new Indian Place cnr Old Cleveland/Birkdale Rd - naan! **
    Lighthouse, Cleveland Pt (fish'n'chips or Black Rose Rest) **
    Russki Way, 423 Irswich Road, ANNERLEY

CITY
    A Kabab, 227 Albert St - kebabs
    Irish Club, 175 Elizabeth
    Korea House, Elizabeth Arcade Charlotte St (SW of Myers), small arcade, & Japanese Rest
    Augutine's, The Mansions, 40 George St, Chinese owner, Euro food
    Shingle Inn, 254 Edward St, sand crab sandwiches, since WWII
    Satay Club Cafe, 66 Charlotte St, Char kway Chow
    Red Cross Tea Rooms, basement, City Hall
    Figueiredo's Portuguese, Annerley
    Spanish Centre 	Sports Complex, 244 Mortimer Road, Acacia Ridge, 3277 1612 (Portuguese too)

Paddington
    Gambaro's, Caxton & Petrie Tce - seafood, esp. Thai Chilli Mud Crab

Others
    McGill's technical bookshop, 201 Elizabeth
    Dymock's, 239 Albert St
    Portuguese shop - main road to hospital in Annerley???
    The Grecian, Ascot.
    Sausages: Heinz Domine, 611 Stanley St, W'gabba
    All India Foods, 31 Balaclava, W'gabba
    The Malaysian Experience, 80 Jephson St, Toowong, (Legal & General Bldg) noodles,seafood, laksa,curry, claypot
    Inn on th Park - Malaysian
    Medium Rare, 102 Kedron Rd, N.Wilston, bouillabaisse
    Cedar The Unique Continental Lebanese Confectionery & Food,  466a Ipswich Rd, Annerley, 3848 7945
Filipino
    Bella Gregas, Sunnybank Hills, 3272 3324
    True Filipino Restaurant, 74 High Street, Toowong, 3371 4444
    Aurora Valderrama, Tennyson, 3892 1035

Gold Coast
    Gold Coast Brewing Co, No. 1 Main Wharf, Sanctuary Cove
    Prasanth Restaurant, 410 Gold Coast Springbrook Rd,
    Mudgeeraba, 5530-4950 Wed-Sun from 5.30pm
    Prasanth Foods, 9 Manuka Rd, Mudgeeraba, 5530-7443,
    www.mudgeerabaspices.com.au
    Raj Palace on the spit - David Middleton's recomendation for naan & lamb sagwala
    Thai Lanna - David Middleton's recomendation

Cheese
    Roc'n'Roll Fruit & Deli, 500 Logan Rd, Greenslopes - Australian
    Palatable Partners, Unit 2 77 Riverside Place, Morningside - imported
    Black Pearl Caviar, 36 Baxter St, Fort Valley - French
    Tognini's, Milton Shopping Village, Baroona Rd, Milton - imported
    Fresco - Burleigh

Sunshine Coast
    Finger limes, dragon fruit, white mulberry, barbados cherry,
    jaboticaba -  What started as an root-rot-free avocado nursery
    in 1978 is now Birdwood Nursery, run by Peter and his wife
    Sandra at Woombye, south of Nambour.

Contents


2.29.1.1 Skating places

Wynnum Beach
Boondall Beach - Sandgate Track - 26km! (nr Aberdeen Parade)
Minnippi Parklands - at the end of Stanton Rd West
SouthBank
Forest Lake Blvd & Government Rd
Botanical Gardens - but crap paths
West End riverside
New Farm riverside
Coronation Drive, Toowong & Auchenflower.

Contents


2.29.2 London

Brilliant Restaurant, 72-74 Western Road, Southall,020 85741928 www.brilliantrestaurant.com

Tamarind, 20 Queen Street, Mayfair, London W1J 5PR (020 76293561; www.tamarindrestaurant.com)

Contents


2.29.3 Days out


Hot air balloons, Laidley (3?)5466-5066 $150pp
Mary Cairncross Park, Mountinview Rd, Maleny. Views of Glass House mtn, 55m from Brisbane.
Lake Bardon, north Maleny Rd, alen, 7km north of village, turn right at ANZ bank. 1hr Brisbane.
Kondalilla Falls, Montville-Mapleton Rd, 4 km N of Montville, 2.1km walk to waterfall, 75 mins Brisbane.
Bulcock Beach, Caloundra Headland, Shelly Beach, The Esplanade Caloundra, 60 mins Brisbane.
La Balsa Park, Harbour Parade, Buddina, banks of river, beach. 70 mins Brisbane.
Mt Barney, 2hr SW Brisbane, views, walks, SW of Rathdowney on Mt Lindsay Hwy, Mt Barney Lodge, Upper Logan Rd run eco tours 5544 3233
Caboonbah house, Esk-Somerset Dam Rd, 19th century homestead.
Main Range national park & Condamine Gorge, 14km south of Boonah

Canyon Lookout Lodge, Springbrook - lovely old cottage near the start of 17km Twin Falls bush walk. Stay overnight, meals etc
Mt Mee - Birches restaurant

Canoeing, Oxley Creek, Nadine Street, Graceville, Brisbane, QLD 4075, Tel: +61 7 3403 8888

Fort Lytton National Park, Lytton Road, Lytton, Brisbane, QLD 4178, Tel: +61 7 3393 4647

North Pine Historical Village, Dayboro Road, Petrie, Brisbane, QLD 4502, Tel: +61 7 3285 3138

Rosewood Railway Museum, Freeman Road, Kunkala, Rosewood, QLD 4074, Tel: +61 7 3371 4231, http://www.arhs-qld.org.au

Tiger Moth Open Cockpit Joy Rides, Carrara Airfield, Broadbeach-Nerang Road, Carrara, Gold Coast, QLD 4211, Tel: +61 7 5502 7855, info@tigermothjoyrides.com.au, http://www.tigermothjoyrides.com.au

Lots of walks around Maiala picnis area, The Gap (GPS 1850 Mount Glorious Road, Mount Glorious)

Contents


2.30 Pool


Always turn pump off before moving valve
Always bleed air from filter.
Vacuum (every week)
Fill hose with water. Skim box cover should be impossible to
remove with pump running.
Also clear skimmer basket.
Clean Cell (4 weeks):
	Pump off
	Valve to CLOSE
	Undo backnuts (green ring) nder cell housing. Turn upside down.
	Add 8-1 mixture of water/acid for approx 10 mins or until calcium
    done. Empty into bucket & dispose on weeds etc
	Reconnect cell housing
	Turn valve to filter
Backwash (6-8 weeks):
	Do before dial goes into yellow portion.
	Pump off
	Rotate valve to backwash, run pump for 2-3 mins until vial is clear.
	Turn off pump, valve to rinse & run for 0.5-1 min or until vial is clear.
	Turn off pump, valve to filter & run. Adjust knob to 9.
	Add 1.5kg of DE (3x 2lt ice cream bucket) actually label on filter
    says 1.36Kg=3 pounds=7-8 x measuring jug (500ml)
	Reset chlorinator to pump.
Clear pump basket (4 weeks):
	Undo pump knobs
	Empty basket
	Check 'O' ring
Lower level
	To 1" below top of skimmer
	Use WASTE setting on pump
Spa
	3 way valve
	Never point arrow to red caution marker
	Pool is 3am
	Open jet venturies (by steps)
	Spa is 6am
General
	Winter auto pump at salt level 5 for 6 hours/day 5-8am and 5-8pm. 
	Summer at level 9 for 4 hours 5-9am and 5-9pm.
	Shock dose (4 weeks also before parties etc) = 4 times normal.
	Once a month take a sample for salt testing. Take from deep
	end at elbow depth.
	A simple test is that chlorinator can go over 10.
	Redlands pool service 3820 6182 041 964 7847
	Chlorinator is Surechlor 2000 HC200
	Filter is Poolrite XL60

Contents


2.31 Radio


http://www.adonline.id.au/radio/qld.htm
http://www.wordiq.com/definition/List_of_Australian_radio_stations

87.6 4TAB (Sports)
88 RADIO FM 88 Sport?
90.3 4SCR ABC COAST FM (Classic Hits)
92.1 FAMILY RADIO
92.7 MIX FM
93.3 4SBSFM RADIO
94.9 4MIX River 94.9 (New Music - Ipswich)
96.1 NOOSA
96.5 4FRB 96Five (Christian)
97.3 4BFM (Community)
98.1 4EB (Community)
98.9 4AAA TRIPLE A
99.7 99.7 FM
100.3 4BAY (Community)
101.1 4CBL 101FM (Community)
101.5 4OUR-FM
102.1 4ZZZ (Classical)
102.7 4DDB
103.7 4MBS (Classic)
104.5 4MMM TRIPLE M
105.3 4BBB B105 (New music)
106.1 4ABCFM ABC CLASSIC FM
106.9 Radio Nova
107.7 4JJJ TRIPLE J (New music)

558 4GY
612 4QR
693 4KQ (Classic Hits)
792 4RN RADIO NATIONAL
864 4GR ????
882 4BH (Easy Music)
936 4PB ABC NEWS
963 4WK ???
972 RADIO 97 ???
1008 4TAB ???
1053 4EB (Ethnic Broadcasting)
1071 CLASSIC GOLD ???
1116 4BC (News & Talk) 
1197 4BI (Community)
1242 4AK Music ???
1296 4RPH
1363 4WK ???
1701 4BV Brisvani (Indian) ???

Gold Coast:
88.5 4ABCFM ABC Classics
89.3 4CRB Community
90.1 4ABCRN Radio National
90.9 4SEA sea-fm New Music
91.7 4ABCRR ABC COAST FM
92.5 GOLD FM Classic Hits
94.1 4RHI Radio Hope Island
95.7 4PNN ABC Radio News
97.7 4JJJ TripleJ
102.9 4HTB Hot Tomato
104.1 Radio97 Easy Listening
105.7 4MET Metro Community
107.3 Life FM

Contents


2.32 Recipes


Contents


2.32.1 Mum's chocolate pudding


3oz (85g) butter/marg 3oz (85g) sugar 4oz (113g) SR flour 2 table
spoons cocoa 1 teaspoon baking powder 2 eggs

Mix with enough water to make it soft - fairly runny. Put into
deep dish and microwave on full for 5 1/2 mins.

Sauce:
1 pint milk
1 heaped tablespoon cornflour
1 tablespoon sugar
1 tablespoon cocoa (or more if darker wanted)

Whisk together microwave for 4 minutes, whisking half way
through.

Contents


2.32.2 Chilli crab


One swimmer (blue manna) crab per person - unless you're serving
other dishes, in which case one per two people.
Ginger - finely julienned.
Garlic - 3-4 cloves, finely chopped
Chilli - finely chopped; qty to your taste
1/2 Onion or some scallions - finely chopped
1 tblsp cornflour mixed with water to a paste
Tomato paste - 2 tblsp
1 egg
1 tblsp vinegar
1 tblsp sugar (if needed)
Oil to fry - maybe 1/2-1 cup, preferably peanut oil.
Fish or chicken Stock - 500ml, or water
Bunch of coriander.

Clean crabs. Break claws, bodies into 2 - don't lose the liquid
(save with stock). Fry till red. Remove into a saucepan.

In the oil fry the onions 2mins, then ginger & garlic 1 min, then
chilli 1min.

Add chopped coriander root, stock, tomato paste, vinegar, salt to
taste (do taste it as the crab are already salty). Bring to a
boil & simmer for a few minutes. Thicken with the cornflour (not
too thick - the egg will thicken it more). Add sugar if desired.
Pour over the crab (or add the crab back to the wok) cover and
simmer for 15 minutes. Add chopped coriander leaves and beaten
egg - stir in and serve. Top with some coriander.

Contents


2.32.3 Roast meat time:

Oven Roasting:Gas mark 4-5, 180-190°C, 350-375°F

Beef

Rare: 20mins per 450g (1lb) +20 mins
Internal temp approx 60°C
Medium: 25mins per 450g (1lb) +25 mins
Internal temp approx 70°C
Well-done: 30mins per 450g (1lb)+30 mins
Internal temp approx 80°C

Lamb

Medium: 25mins per 450g (1lb) +25 mins
Internal temp 70-75°C
Well-done: 30mins per 450g (1lb)+30 mins
Internal temp approx 75-80°C

Contents


2.33 Russia


Contents


2.33.1 Places


Moscow - Gorbushka market, a jumble of kiosks selling DVDs, CD-ROMs
and an array of gadgetry in an old factory west of downtown.

Contents


2.33.2 Cyrillic keyboard (transliterated)


я в е р т y u и о п
а с д ф г х й к л ; ь
з х ц в б н м

Я тэбя люблю, я вас люблю

 а a
 б b
 г g 
 д d
 е e 
 ж zh
 з z
 и i
 к k
 л l
 м m
 н n
 о o
 п p
 р r
 с s
 т t
 у u
 ф f
 х x or h
 ц c
 ч ch
 ш sh
 щ sj or shch
 э e'
 ю yu
 я q
 ь ' (soft sign)
 Ь '' (big soft sign)
 ы y
 ё yo
 ї yi
 й j
 ъ ~ (hard sign)
 Ъ ~~ (big hard sign)

Contents


2.33.3 Russia trip


http://www.euroscape.com.au/booking/gate.asp

Contents


2.34 Seiko World Watch


  A
     Crown
  B

Main time	crown x 2 & turn
Date		crown x 1 & turn
Alarm base	crown x 2 & B or A for 2 secs -> ciry or A for 2 secs -> local time
Alarm		crown x 1 & B

Contents


2.35 Singapore Food


Newton Circus Food Centre - casual, outdoor, marketplace - but watch out
for aggressive & expensive seafood touts. Murtabek (Indian pizza) is good.
Sit anywhere, talk to locals, avoid the loo. Try to find stingray with
blachan grilled in banana leaf. Also Roti Canay (Indian bread with lamb
curry gravy). Popiah (unfreid spring rolls, sort of). Can get there by MRT
& ask the way.

East Coast parkway Seafood centre - chilli crab, pepper mud crab,
deep-fried baby octopus, oyster omelette. Beer by the pitcher. Walk it off
along the parkway. Try Jumbo or Ponggol Restaurant? Get there by taxi (or
MRT?).

Singapore Riverside - Boat Quay adjacent to Raffles Place (great place for
a beer at 5pm) and at Clark Quay (many restaurants). Satay Club at Clarke
Quay is good.

Lau Pau Sat Market - near Raffles Place - food centre in ornate Victorian
building. Hot and busy at lunch.

If you can find it Samy's curry restaurant at the Civil Service club in
Dempsy Road (down Holland Road) http://www.makantime.com/indexnote.html is
a great place - you don't need to be a member and they bring out the food
in buckets (literally). Pay for what you eat - mainly curries/tandoori.

Vegetarian Indian is a good bet - Woodlands Rest. nr Serangoon Rd. The
best place of all is Komala Villas, 76 Serangoon Road. Go upstairs and get
a banana leaf. Food delivered by bucket! All you can eat. You can ask for
a fork if you want to wimp it, otherwise copy the locals. Very casual.
Bombay Woodlands Restaurant - 19, Tanglin Road #B1-01, Tanglin Shopping
Centre is also good for Indian vegetarian.

Indian meat - go to Racecourse Road, there's a whole strip of restaurants
there. Take your pick. Also Serangoon Road - while there, check out the
Hindoo temple, it's great.

Gotta eat Curry Laksa - curry soup with prawns & things - almost anywhere.
Penang Laksa is similar but sour - tamarind.

Kambing soup (lamb soup) is great.

Fine western dining - any 5 star hotel. Too easy. Too boring. Too
expensive. But Raffles Grill is very posh and good French cuisine. Also,
the courtyard in the Raffles Hotel is atmospheric colonial and has good
food at a more reasonable price. Sometimes a show or band too. It's
outside so dress cool.

Shopping - dunno really, depends what you want. For 5 floors of consumer
electronics including computers don't miss Sim Lim Towers (10 Jalan
Besar).

http://www.visitsingapore.com/main.htm
http://www.makantime.com/

Contents


2.36 Stomach


From BBC:

Good digestion depends on several factors including chewing and
saliva production, levels of digestive enzymes in the stomach and
good functioning of the liver, gall bladder, spleen / pancreas
and intestines. Chewing and digestive enzymes

Chewing food well in the mouth is vital to generate saliva, which
in turn stimulates the production of digestive enzymes in the
stomach. Levels of digestive enzymes may be lowered as a result
of taking the contraceptive pill or other medication, poor eating
habits or aging. They can be boosted naturally by consuming
enzyme-rich foods, such as papaya or pineapple, or by taking a
digestive enzyme supplement before each meal. Liver and gall
bladder function

The liver stores fats, sugars and protein and produces bile,
which is stored in the gall bladder and aids digestion,
especially the breaking down of fats. Regular exercise,
diaphragmatic breathing and daily intake of leafy greens and
wholegrains, rich in B vitamins and minerals, Vitamin C (see A-Z
of Remedies for food sources and RDAs) and essential fatty acids
all help healthy liver and gall bladder function.

Losing weight if overweight, taking regular meals, especially
breakfast, and limiting intake of fatty, sugary foods also helps.
The herbs dandelion and sylimarin (milk thistle) are also
effective liver tonics. Pancreas

The pancreas produces digestive enzymes, to aid the breakdown of
fats, and the hormone, insulin, which helps regulate blood sugar
levels. For healthy pancreatic function it is best to avoid
excessive consumption of sweets, biscuits, cakes and other sweet
foods and refined carbohydrates and to limit alcohol intake and
smoking. Eat little and often and avoid very fatty foods. Ensure
adequate intake of vitamins A, C and D and the minerals chromium,
selenium and zinc.

Intestines


In the small intestine foods are broken down into fats, proteins
and carbohydrates and absorbed along with their nutrients into
the bloodstream.

In the large intestine water from food is absorbed and the waste
products are then passed into the rectum as faeces.

Healthy intestinal function relates to adequate roughage,
essential fatty acids and adequate water in the diet as well as a
good balance of digestive enzymes and intestinal bacteria and
regular bowel movements. Good eating habits and daily intake of
fresh vegetables and fruit and whole grains all help intestinal
function as does regular exercise, diaphragmatic breathing,
relaxation and stress management.

The balance of intestinal bacteria may be upset by poor diet,
stress or the intake of antibiotics or other medication. Under
such conditions the fungal organism, Candida albicans, may thrive
causing symptoms of bloating, wind, discharge, fatigue and mood
swings. To prevent spread of candida eat live yoghurt or take a
probiotic supplement containing Lactobacillus acidophilus and
bifido bacteria. These 'friendly' bacteria are essential for
healthy bowel function.

Aloe vera juice and the amino acid L-glutamine help heal the
lining of the intestines and linseed oil, psyllium husks, chicory
and slippery elm can help maintain regular bowel movements. Food
intolerances can cause inflammation of the intestinal walls and
it may be worth testing for them or trying exclusion diets.

Naturopaths recommend following a cleansing programme, or short
fast, a couple of times a year, preferably in spring and in
autumn, in order to cleanse and strengthen the digestive system.
Please check with a qualified practitioner for further advice.

Contents


2.37 ToDo


Contents


2.37.1 gjots


Catch signals and close down - including unlock_file()

Make dirty_flag into a subroutine & check writability?

Backwards search (& replace)

Save page location & tree open status before leaving & restore on
startup

NextPage at end of page to go to next page

Autosave

Save should preserve file ownership and permission flags - maybe
"cp j j~" then re-use file j.

Why does top toolbar hide but the docking thingy doesn't?

Contents


2.38 Volumes


sphere = 4pi.r3/3
dome = pi.h2(3r-h)/3
cone = pi.2rh/3
pot = pi.h(R3-r3)/3(R-r) truncated cone

Contents


2.39 Years

2009 Feb 25 Had left eye cataract removed
2009 Jan 28 Had right eye cataract removed
2009 Jan 22 PSA 1.5; cholesterol 6.5; liver OK
2009 Jan 17 Simon back in Brisbane
2008 Nov 27 Alex to Mt Isa (3 day road trip) till Feb 20th
2008 Nov 24 Nina started at Vasco
2008 Nov 17 To Tassie for 1 week
2008 Nov 15 Married Nina
2008 Nov ?? Dad's 2nd knee operation
2008 Sep 13-15 O'Reilly's, Lamington Nat Park
2008 Sep 13 Simon in Greece
2008 Aug 31st leave Paddy's market
2008 Jun 26th Nina had appendicitis
2008 Apr 6th started at Promptu Systems Corp, Robina
2008 Mar 13th shares now worth $259k
2008 Mar 1st Simon leaves for HK, UK, France
2008 Feb 28th dinner at Cha Cha Char with Nina, Tiia, Simon for Alex's 21st
2008 Feb 24th Alex back from Mt Isa
2008 Feb 21st made redundant at RSA with $21k final payment
2008 Feb 18th diagnosed with cataract disease Dr Steven Ohlrich.
2008 Jan?? Nina's Mum in hospital
2007 Dec ?? Alex off to Mt Isa with Exstrata
2007 July stocks now worth $300k
2007 March 16th-June 16th I work at Paddy's market - to little effect, really
2007 February Simon started QUT in Microbiology, working at Good Guys
2007 February Alex in 2nd year Geology, working at GHD
2006 Nov 17th Simon's graduation (&off to schoolies)
2006 Oct Nina & I buy Paddy's market; miss Mum's birthday, dammit
2006 Sep Alex started at Good Guys; Simon at Perisher
2006 July Stocks now worth $275K (incl remnant on deposit). Sold MAP to pay next years interest. Gross profit about $50K for $8K cost.
2006 Jun 30 RSA announced selling to EMC2
2006 Jun 15 PSA 1.3; Cholesterol 6.0; ggv? 75; BP 120/75
2006 Feb 28th Alex (re)started at QUT in geology
2006 Feb 1st started as engineer at RSA Security Inc., Brisbane
2005 Nov 17 Eracom announced sold to SafeNet - TSC group all believe redundant!! POI group are OK. 28th - given notice of termination on 31st Dec. $39k payout.
2005 Nov 5 M&D arrive; 11 to Canberra & Melb by car
2005 July Borrowed $226K to buy stock ($16 interest negative geared, so really about $8k expense).
2005 June 11 Engaged to Nina
2005 House valued at $360k ($2k floors $10k a/c)
2005 June 4 Divorce Decree Nisi finalised
2005 April 5 - PSA level is 1.5 (below 3 is good); Cholesterol 5.9 (below 7 is OK, below 5 is better); blood pressure 120/70
2005 29 March - Prostate lump
2005 March - 3 days at Rydges Resort, Caloundra with Nina
2005 1 March - Alex started at QUT doing Elect Eng & Business degrees
2005 Feb - Simon started at KFC & Alex at Thaniel's
2004 Sep 22-Oct 21 Moscow, St Petersburg, London, Bangkok with Nina
2004 May 15th Greenfield Rd sold at auction for $846,000
2003 Dec 1st - Settlement date on 36 Baroona St, Rochedale S. $339k. Nina moved in with me.
2003 May 6th Move into unit 80, Cornhill Gdns, 134 Hill Rd, Runcorn
2003 April 21st Nina contacted me. 28th met. 
     31st May I told Erika about Nina - she told me to leave. 
     June 2? - July 19th Erika, Alex & Simon in Europe.
2002 Sept 22 M&D came out
2002 June 17 Alex knocked off bike
2002 April? Sold Jaguar, bought Hyundai Elantra
2002 Left Nina 2nd Jan. 
2001 Nina arrived at Eracom 8th Aug. 
     Left Erika for Nina 28th Dec.
2001 Jan Alex Y9 Feb 9 left QAS. 
     Simon Y7 Ormiston Mrs Sandra Jamieson. 
2000 Jan Alex Y8 
     Oct? Alex started QAS. 
     Simon Y6 Ormiston
1999 Jan Alex Y7 Ormiston Mrs Sandra Jamieson 
     Simon Y5 Sheldon.
     May - joined Eracom, Burleigh Heads - Chris Curtis, Mark
     Goodall, Brian Franklin, Bernard Leach, David Middleton, 
     Ross Green, Simon McMahon. Tony Chand. 
     Bought Jaguar S-Type.
1998 Jan Alex Y6 Entered Ormiston Mrs Sandra Jamieson, Mr Hoskins.
     Simon Y4 Entered Sheldon. 
     May - bought 44 Greenfield Rd $420k
     June? - moved in. 
     Apr? bought TR4.
1997 Sold Cavendish Court S$1.14m 
     Sep Alex started Y6 Simon Y4 OFS. 
     Dec 13 left Singapore for Sydney
1996 Alex Y5 Simon Y4 at Overseas Family School
1995 Aug? left HK for Singapore 
     Joined Visa. Doug Lawson, Eric Trotter, David Chan, 
     Mark Cullimore, Jim Dixon, Bruce Mansfield.
     Alex Y4 Simon Y2 at Overseas Family School. 
     Lived at Grenville, Mt Sinai Rd, Ghim Moh, Buona Vista, 
     Holland Village
1994 Bought Cavendish Ct S$690k 
     Alex Y3 Simon Y1 Peak School. 
     Bought Spitfire
1993 Joined Unisys - Steve Todd, Ian Miller, Hugh Sutherland
     Lived at Mansfield Rd 12/F.
1992
1991 Joined Unisoft - Bob Poulter. 
     Lived at Borrett Rd 3/F?.
1990
1989 July 27 Simon Born. Joined Sun, Bruce Goldstein. 
     Lived at Borrett Rd.
1988 5 Nicol sold for $75k?
1987 Sat Feb 28 Alex born. Oct left Aus for HK with HP. 
     Ken Koo then Serge Daust. Jim Hanley. 
     Sun Hung Kai Centre then Bond Centre (now called Lippo). 
     Lived at 44 Macdonald Rd.
1986
1985
1984
1983
1982 Built 5 Nicol Rd for $55k?
1981 Dec? To Aus with HP. David Chambers, Ian Murray, Garland
     Smith, Leong Tan, Cliff Wilkinson, Glen Taylor, Les Burnett
1980 Jul? To HK with HP
1979 July 29 Married Wandsworth Town Hall. 
     Sep? To Riyadh with HP
     Erika with Women's Uni, Shara Siteen/Arba'en
1978 Aug? Huntings - Qatar. Erika came at Christmas.
1977 Univ College London Surveying Mr Crompton Prof?
1976 Ruberoid
1975 Cornerbank. Aug? 
     Met Erika in Canterbury. 
     Christmas Day - found Cumberland Park, Acton.
1974 Aug? Left Lesotho. 
     Sep? Heinz, Watford.
1973 Left UKC in May? 2.2 Honours Maths. Sept? to Lesotho.
1972 UKC yr 3 in 10? Canterbury Rd Whitstable
1971 UKC yr 2 in Eliott College
1970 UKC yr 1 in digs. Distinction.
1969 U6 Maths A Physics A Chemistry B
1968 L6 Further Maths 2
1967 5th Maths 1, chemistry 1, physics 1, biology 2, aeronautics
     3, geology 3, english 3, french 3, geography 3, russian 9
1966 4th 14-15 Mr Smith, maths. Mr Herrick physics
1965 3rd 13-14 Mr Griffith, chemistry & rubgy Mr Jones geog & rugby
1964 2nd 12- 13
1963 11-12 Sep started Hayes County Grammar
1962 10-11
1961 9-10
1960 8-9
1959 7-8 to UK? Hayes Park Primary 
     218 Kingshill Avenue, Hayes.
1958 6-7
1957 5-6 to Canada?
1956 4-5
1955 3-4
1954 2-3
1953 1-2 Jul 24 Erika born 10 Bembridge Hse, Wandsworth.
1952 0-1
1951 Dec 3rd born Sunderland General Hosp
1929 Oct 8th Mum born
1927 Feb 5th Dad born

Contents


3. Promptu


Shop 5, Arbour Lane Terraces, Robina Town Centre Drive
Robina Town Centre 
QLD 4230

ABN 16 094 841 139

Phone: +61 7 5584 5900 (5908 direct)
Fax: +61 7 5575 9550

Redhat Network: oz.agiletv/grasshopper

Contents


3.1 Infrastructure


1nTh3M0n3y$

redhat log in is oz.agiletv/grasshopper

Contents


3.1.1 IRC

host is irc.oz.agile.tv:6667
/list - to find out what groups there are
/join #cps
/join #promptu

Contents


3.2 BL9 release notes

http://www.oz.agile.tv/kernel/ReleaseNotes/CPS-PCLbl9.html

edit at:

//DaddyCool/web/kernel/ReleaseNotes/CPS-PCLbl9.html

for stand_alone_server:
atv_partMgr load_config /etc/atv/partMgr/disk-config
vi /etc/atv/atv_aus.config
REPOS_REMOTE=surfers:/agile/repositories/bl9
SERVER_TYPE=DISK_SLICE_DEVEL_CLW
atv_aus atvupgrade
vi /etc/agile.conf
NODE_TYPE="stand_alone_server"
DEDICATED_FIREWALL="no"
DNS_SERVERS=192.168.16.1
NTP_SERVER=192.168.16.1
service atv-config write
reboot

Contents


3.3 bl9/10 stand_alone_server installation


MUST SELECT "PCL HARD DISK INSTALLATION" - nothing else needed on that page

After physical install and reboot:

vi /etc/atv/atv_aus.config # with:
REPOS_REMOTE=surfers:/agile/repositories/bl9
SERVER_TYPE=DISK_SLICE_PRODUCTION
EXTRA_POOLS=""

vi /etc/atv/partMgr/disk-config
atv_partMgr load_config /etc/atv/partMgr/disk-config
atv_partMgr list # to check it
atv_aus atvupgrade
atv-verify

vi /etc/agile.conf
change NODE_TYPE="stand_alone_server"
set ENGINEID="tulkas"
DEDICATED_FIREWALL="no"
DNS_SERVERS=192.168.16.1
NTP_SERVER=192.168.16.1
service atv-config write

vi /etc/init.d/atv-dlog - comment out 'unconfigured' lines
reboot

Contents


3.4 BL9rc8 installation on tulkas


After physical install and reboot:

vi /etc/atv/partMgr/disk-config
atv_partMgr load_config /etc/atv/partMgr/disk-config
atv_partMgr list # to check it

vi /etc/atv/atv_aus.config # with:
REPOS_REMOTE=surfers:/agile/repositories/bl9
SERVER_TYPE=DISK_SLICE_PRODUCTION
EXTRA_POOLS=""
atv_aus atvupgrade
atv-verify

vi /etc/agile.conf
change NODE_TYPE="stand_alone_server"
set ENGINEID="tulkas"
DEDICATED_FIREWALL="no"
DNS_SERVERS=192.168.16.1
NTP_SERVER=192.168.16.1
service atv-config write

reboot

Contents


3.5 VMware config

Use bridged networking
192.168.31.28/16 Mask 255.255.240.0 
/etc/resolv.conf:
search oz.agile.tv
nameserver 192.168.16.1

gateway is 192.168.16.254

Contents


3.6 dm-snapshot


All examples out there use making a cd rom 'writable' - but iso9660
is always ro and the examples fail (see linux gazette article in
particular). What they forget is to mount a file on the cdrom as
a ext3 (or other writable) file system - _that_ can be made writable.

Here's an example that actually works (not using cdrom):

# make a 50Mb blank block device area to play with, put a fs on
it etc:

dd if=/dev/zero of=/tmp/dummy bs=512 count=102400
losetup /dev/loop0 /tmp/dummy 
mke2fs /dev/loop0
mount /dev/loop0 /mnt/tmp
touch /mnt/tmp/junk
ll /mnt/tmp
umount /mnt/tmp

# now make a 5Mb COW file and snapshot it using dmsetup:
dd if=/dev/zero of=/tmp/dummy-cow bs=512 count=10240
losetup /dev/loop1 /tmp/dummy-cow 
echo 0 $(blockdev --getsize /dev/loop0) snapshot /dev/loop0 /dev/loop1 p 8 |dmsetup create dummy-snap
mount /dev/mapper/dummy-snap /mnt/tmp

# see the old contents:
ll /mnt/tmp

# add some new contents:
touch /mnt/tmp/new-file
ll /mnt/tmp
umount /mnt/tmp
dmsetup remove dummy-snap

# mount the old image (but don't change it!!)
mount -o ro /dev/loop0 /mnt/tmp

# note that "new-file" has disappeared:
ll /mnt/tmp
umount /mnt/tmp

# resurrect the snapshoted image:
echo 0 $(blockdev --getsize /dev/loop0) snapshot /dev/loop0 /dev/loop1 p 8 |dmsetup create dummy-snap
mount /dev/mapper/dummy-snap /mnt/tmp

# CHeck that "new-file" has reappeared:
ll /mnt/tmp

# Create an 'original' image:
echo 0 $(blockdev --getsize /dev/loop0) snapshot-origin /dev/loop0  |dmsetup create dummy-orig
mkdir -p /mnt/tmp-orig
mount /dev/mapper/dummy-orig /mnt/tmp-orig
ll /mnt/tmp-orig

# Note that changes to /mnt/tmp-orig do not appear on /mnt/tmp!!! So
  not really a unionfs

# clean up
umount /mnt/tmp
dmsetup remove dummy-snap
umount /mnt/tmp-orig
dmsetup remove dummy-orig
losetup -d /dev/loop0
losetup -d /dev/loop1
rm /tmp/dummy /tmp/dummy-cow
rmdir /mnt/tmp-orig

Contents


3.7 Building rpms that we have patched (eg util-linux mkinitrd):


- as for security fixes - no-merge SRPMS

Why do we need to re-build? Because we have our own kernel headers
and patched glibc

export JAVA_HOME="/usr/java/jdk"
PATH=$JAVA_HOME/bin:$PATH
PCMI_LIBS=/usr/atv/atv-clw-pcmi-1.4/lib
export CLASSPATH=$CLASSPATH:$PCMI_LIBS/control-api.jar:$PCMI_LIBS/data-api.jar:$PCMI_LIBS/util-api.jar:$PCMI_LIBS/widget-api.jar

export TOPDIR=~/rpm
rm $TOPDIR/SOURCE/*
rm $TOPDIR/SPECS/*
# get the new SRPM:
rpm -i pkg.src.rpm # puts it into SOURCE & SPECS
# in the p4 directory for the package:
rm -f SOURCES/*
cp $TOPDIR/SOURCE/* SOURCES
cp $TOPDIR/SPECS/* SPECS
# find out if anything is deleted:
p4 diff -sd SOURCES/...
# reload our patches (shown by p4 diff -sd):
p4 sync -f SOURCES/filename
# delete any files from p4 that upstream deleted:
p4 delete SOURCES/filename
# find out what's different:
p4 diff -se SOURCES/...
# add new patch files from upstream:
p4 add SOURCES/*
# reconcile changes in the spec file:
p4 diff SPECS/pkg.spec
# or (maybe easier) merge $TOPDIR/SPECS/pkg.spec with SPECS/pkg.spec
emacs SPECS/pkg.spec # & merge $TOPDIR/SPECS/pkg.spec
p4 submit ...
# rebuild
make testrpm
make releaserpm

Contents


3.8 Building unmerged (redhat) SRPMs (ie no promptu patches):


check out //atv/2005/src/clusterware/v3.0/bl8/pcl/userland/external/
and copy that one directory to the build machine

copy the latest SRPMS to external/ - it'll be in /kits/rhel/updates or
bl8: http://mirrors.kernel.org/redhat/redhat/linux/updates/enterprise/4AS/en/os/SRPMS/
bl9: http://mirrors.kernel.org/redhat/redhat/linux/enterprise/5Server/en/os/SRPMS/

Checked in SRPMS are in atv/2005/src/clusterware/v3.0/bl9/pcl/install/SRPMS

cd external; make world

Results are in $TOPDIR which is implicitly cleaned by 'make
  world'!!! So save anything there that you need!!

Contents


3.9 Building CD/DVDs

On build system as root:

BL10=/home/bhepple/perforce/atv/2005/src/clusterware/v3.0/bl10/pcl/userland
REPOSITORY=/home/bhepple/tmp/agile-mirror/repositories/bl10
DVDBLD=/home/bhepple/perforce/atv/2005/src/clusterware/v3.0/bl10/pcl/install/i386/PCL/RPMS

cd $BL10/../install
Put any RPMS into i386/PCL/RPMS/

rm $DVDBLD/*
for d in base development clw_nas_server clw_server clw_isoimg
do 
    cp $REPOSITORY/i386/RPMS.$d/*.rpm $DVDBLD
done

./generate_image.sh cd (or dvd) cleanbuild
Look at mkisocmd-cd/dvd for how to create the iso
Use DVD to NFS install to a fresh directory
Package slice RPM:
./package_scripts/packageImage.sh slice-image
copy slice RPM to $DVDBLD & rebuild DVD:
./generate_image.sh dvd cleanbuild
./mkisocmd-dvd

Contents


3.10 Building release userland rpms:


make releaserpm

If it's a new package:

STARTDATE=0 make releaserpm

If you need to re-make, delete the label with:
p4 label -d atv-clw-services-1.0-14

Contents


3.11 Releasing BL9rc8


Release pages: http://www/oz/kernel/releases.html and http://www.mp.agile.tv/twiki/bin/view/Main/UserlandBuildProcedures

log on to cpsbld as root
unset P4CLIENT

What's changed since last rc7: label was OS_userland_PC_repository-PCLbl9c, so:
cd $BL9
p4 sync -n ...@OS_userland_PC_repository-PCLbl9c | awk -F '/' '{print $11}' | sort -u
anaconda-11.1.2.87
apache-tomcat-6.x
atv-biosconfig-1.x
atv-clw-pcmi-1.0
atv-nas-1.x
atv-pcl-config-1.x
atv-server-config-1.x
pcl-release-3.x

Copy the old label to our new one (and change locked to unlocked):

p4 label -t OS_userland_PC_repository-PCLbl9c OS_userland_PC_repository-PCLbl9d

Drop the label onto the files in p4:

p4 sync ...
p4 labelsync -l OS_userland_PC_repository-PCLbl9d ...

on cpsbld as root in /home/build/userland/bl9:

for p in anaconda-11.1.2.87 atv-biosconfig-1.x atv-clw-pcmi-1.0 atv-nas-1.x atv-pcl-config-1.x atv-server-config-1.x pcl-release-3.x jdk-1.6.0 ; do (cd $p; make releaserpm); done &> log

Gave some errors mainly in version numbers needing a bump.
These are OK:

/home/pcl/RPMS/i386/anaconda-11.1.2.87-1.el5.centos.atv.7.i386.rpm
/home/pcl/RPMS/i386/anaconda-runtime-11.1.2.87-1.el5.centos.atv.7.i386.rpm
/home/pcl/RPMS/i386/biosconfig-1.0-atv.6.i386.rpm
/home/pcl/RPMS/i386/atv-clw-pcmi-1.5-7.i386.rpm
/home/pcl/RPMS/i386/atv-clw-pcmi-libs-1.5-7.i386.rpm
/home/pcl/RPMS/noarch/atv-nas-1.6-9.noarch.rpm
/home/pcl/RPMS/i386/atv-pcl-config-1.3-18.i386.rpm
/home/pcl/RPMS/noarch/atv-server-config-1.5-18.noarch.rpm
/home/pcl/RPMS/noarch/atv-server-config-pcmi-1.5-18.noarch.rpm
/home/pcl/RPMS/i386/pcl-release-3.0_rc7-8.i386.rpm
... can't do a 'make releaserpm' on this one, just do make rpm.
  Whoops, need to bump the rc7 to rc8 ...
/home/pcl/RPMS/i386/pcl-release-3.0_rc8-8.i386.rpm
/home/pcl/RPMS/i386/jdk-1.6.0_07-fcs.atv.1.i386.rpm
All copied & checked in to p4 at atv/2005/released/engine/clusterware/v3.0/bl9/i386

Got rpms to check in on 3rd attempt!!
Started to build DVD:
cd ~/perforce/atv/2005/released/engine/clusterware/v3.0/bl9/i386
p4 submit ...
p4 labelsync -l OS_userland_PC_repository-PCLbl9d ...
p4 label OS_userland_PC_repository-PCLbl9d # and lock it
cd /home/build/userland/bl9/install
rm i386/PCL/RPMS/*

Use generate_image.sh to copy the latest RPMS from p4 release area:
export B="/home/bhepple/perforce/atv/2005/released/engine/clusterware/v3.0/bl9/i386"
./generate_image.sh dirs "$B/RPMS.base $B/RPMS.development $B/RPMS.clw_server $B/RPMS.clw_nas_server $B/RPMS.clw_base $B/RPMS.clw_isoimg"

It gave some errors in later processing but it copied the files - Kat reckons I should have added a "cleanbuild" command in there. Stupid script should test for fat fingered freddie.

Use /agile/users/kmaffey/bin/finddups to find duplicates and then remove them.
o As root: gave more errors:
./generate_image.sh dvd cleanbuild

Really, really get rid of duplicates and it all runs OK

Ran contents of mkisofs_dvd

growisofs made a disk - failed verification but iso was OK on VMware

Changed Stray->Brushtail and 3.x->3.0 in generate_image.sh and try again

Contents


3.12 dlog viewer

ssh -X promptu@dynamic-28 /usr/bin/atv_dlog_viewer
... it's in the atv-clw-dlog-viewer package

Contents


3.13 Create new rpm tree:

mkdir SPECS SRPMS SOURCES BUILD RPMS RPMS/i686 RPMS/i386 RPMS/noarch

Contents


3.14 PCMI

Browse on http://hostname:81/PCMI or port 8081 when we run as non-root

Contents


3.15 pcc (doesn't work on NAS)


atv-pcl-config-*.rpm

. /etc/atv/clw-config-central.sh
pcc get <KEY>

or 

pcmi_clw-config-central-helper.sh get <KEY>
/etc/atv/clw-config-central-helper.sh get <KEY>

# fragments are in /etc/atv/clw_config_fragments

# fragment_apache-tomcat.sh:
pcc get JAVA_HOME
pcc get CATALINA_HOME
pcc get ATV_TOMCAT_PORT

# fragment_atv-aus.sh:
pcc get REPOS_TYPE
pcc get REPOS_REMOTE
pcc get REPOS_LOCAL
pcc get SERVER_TYPE
pcc get EXTRA_POOLS
pcc get SERVER_TYPES_LIST

# fragment_atv-clw-pcmi.sh:
pcc get PCMI_PORT
pcc get PCMI_WRITABLE
pcc get SECURE

# fragment_atv-firewall.sh:
pcc get INTERNET_IF
pcc get MANAGEMENT_IF
pcc get ENG_INTERNAL_SUBNET
pcc get ALLOW_INCOMING_SSH

# fragment_atv-ipmi.sh:
pcc get ATV_IPMI_USERNAME # needs to be root
pcc get ATV_IPMI_PASSWORD # needs to be root

# fragment_atv-sysconfig.sh slices only:
pcc get NODE_TYPE
pcc get ENGINE_NW_ADDR
pcc get ENGINE_NETMASK
pcc get ENGINEID
pcc get ENGINE_NAS_SINGLESLICE
pcc get DEDICATED_FIREWALL
pcc get DNS_SERVERS
pcc get DUMP_DEV
pcc get SWAP_DEV
pcc get NTP_SERVER

# fragment_clw_pgsql_config.sh:
pcc get WARNING_DB_SIZE
pcc get CRITICAL_DB_SIZE
pcc get WARNING_DB_SPACE
pcc get CRITICAL_DB_SPACE
pcc get ALERT_DB_SPACE
pcc get DATABASE_XLOG_MANAGEMENT

# fragment_clw_system_tools.sh:
pcc get AUTOMATIC_DATABASE_BACKUP
pcc get AUTOMATIC_DATABASE_BACKUP_FREQUENCY
pcc get LAST_AUTOMATIC_DATABASE_BACKUP_DATE

# fragment_httpd.sh:
pcc get ATV_WEB_SERVER_PORT

# fragment_pcl_config.sh:
pcc get ALL_IF_IP # needs to be root
pcc get ALL_IF_NETMASK # needs to be root
pcc get CURRENT_TIMEZONE # needs to be root
pcc get ZONE
pcc get IF_DATA eth0 # needs to be root

# fragment_server.sh NAS only:
pcc get NODE_TYPE
pcc get MIRRORED_NAS_TYPE
pcc get DRBD_META_DEV
pcc get ENGINE_NW_ADDR_LIST
pcc get NTP_EXT_SERVERS
pcc get ENGINE_INTERNAL_IFS
pcc get ENGINE_EXTERNAL_IFS
pcc get ENGINE_EXTERNAL_IP
pcc get DRBD_HB_IP_ADDR
pcc get DRBD_HB_ALT_IP_ADDR
pcc get MIRRORED_NAS_STATE 
pcc get DRBD_HA_IF
pcc get ENGINE_VIP_ADDR_LIST
pcc get ENGINE_SHARED_ADDR_LIST
pcc get ENGINE_SHARED_ADDR
pcc get HB_EXT_HOST_LIST

Contents


3.16 Stopping FMS from rebooting the system


Comment out the line in /etc/cron.d/atv_fms*

Contents


3.17 Multi-slice


Contents


3.17.1 Finding where something is running

in a multiple slice engine, it is not obvious where something is running eg tomcat.

Use "atv_fmswhereis application" where 'application' is
defined in /etc/atv/applications. But beware! The name
you need is inside the file!!! For example, on bl8 we have
/etc/atv/applications/apache_tomcat.xml but the name of the
application is apache-tomcat. Bloody hell, why not make it the
same name?

atv_fmswhereis httpd

Contents


3.17.2 Logging on to the NAS


If you log on then you get to a random slice - wherever FMS decides
to run sshd. From there you can 'ssh nas'

The NAS runs PCMI.
Other tomcats are running on other slices for mobile apps.

Contents


3.18 Adding entries in the /etc/sudoers file


*** In the spec file of your package: add a dependency to
atv-clw-sudo-config:

Requires: ..., atv-clw-sudo-config

*** Add a shell-fragment (chmod'd to 0440) in /etc/sudoers.d/your-package-name.sh:
In %install:
install -D -m 0440 etc/sudoers.d/your-package-name.sh ${RPM_BUILD_ROOT}/etc/sudoers.d/your-package-name.sh
(see below for the contents).

*** In the %post section, add:
# setup the sudo priviledges:
/usr/sbin/atv_promptu_sudoers -i

*** In the %postun section, add:

%postun
# remove the sudo priviledges for this packages sudo stanzas:
/usr/sbin/atv_promptu_sudoers -i

*** The fragment that you provide in /etc/sudoers.d/ should provide a
bash shell function called print_promptu_entries() based on the
following example:

#!/bin/sh
print_promptu_entries() {
    echo "
# This section is written by $NAME. Do not edit between the Promptu
# START and END markers.

# Cmnd alias specification
"

    echo -n "Cmnd_Alias YOUR-PACKAGE-NAME_CMDS ="
    echo -n ' /usr/bin/pcmi_clw-config-central-helper.sh set *' <<< substitute your commands
	... etc
    echo
    echo
    echo 'user_name        ALL = NOPASSWD: YOUR-PACKAGE-NAME_CMDS' <<< substitute your commands
    
    echo
}

Contents


3.19 Create the LPS database


service atv-domdb create

Contents


3.20 Create an alias nas-cps for sauron nas:


/etc/sysconfig/network-scripts/ifcfg-bond1:0

# edited at : Wed Aug  6 10:48:29 EST 2008
# edited by : atv-server-net::write_ifcfg_ext_master
DEVICE=bond1:0
ONBOOT=yes
ONPARENT=no
HOTPLUG=no
USERCTL=no
#BOOTPROTO=dhcp
IPADDR=192.168.16.52
NETMASK=255.255.255.0
BROADCAST=192.168.16.255
NETWORK=192.168.16.0
TYPE=Bonding

ifup bond1:0

Contents


3.21 Compiling LPS stuff


eg in bl9/dlog
../../../../tools/agileBuild.sh build kit/*.spec

... it puts stuff in ../../../../???/i686

Contents


3.22 Making BL10 bootstrap build system from CentOS


DVDBLD=$BL10/../install/i386/PCL/RPMS
export REPOSITORY=/home/bhepple/tmp/agile-mirror/repositories/bl10

Install CentOS as a server with no extras

Create a repo for the DVD: /etc/yum.repos.d/c5-media.repo
[c5-media]
name = c5-media
#mediaid=1194015397.199387
metadata_expire=-1
gpgcheck = 0
cost=500
baseurl = file:///kits/centos/5.3/os/i386/CentOS
enabled = 0

May need to install yum from the CD:
rpm -i yum-3*  python-elementtree-* python-iniparse-* python-sqlite-* yum-metadata-parser-*

Add these (and their dependencies) with:

yum --disablerepo=\* --enablerepo=c5-media install

libglade2-devel swig gcc-c++ libXxf86misc-devel qt-devel-docs
ant-apache-regexp velocity lynx parted-devel bzip2-devel bison
aspell-devel pcre-devel byacc tcl-devel gperf python-devel
libtiff-devel pam-devel libcap-devel libart_lgpl-devel kernel-devel
ncurses-devel texinfo libutempter-devel gdbm-devel doxygen
lm_sensors-devel distcache-devel perl-XML-Simple audit-libs-devel
intltool docbook-utils dejagnu libicu-devel readline-devel newt-devel
libdhcp-devel arts-devel libxslt-devel libacl-devel libtool cups-devel
gettext-devel jadetex curl-devel xmlto kudzu-devel libXcomposite
xorg-x11-xinit libraw1394 cdparanoia-libs-alpha9.8 htdig libXScrnSaver
libXdamage ruby avahi avahi-devel kdnssd-avahi-devel

Compile (in userland/external), install and copy to $DVDBLD: libnet postgresql apr

Compile in userland and copy to $DVDBLD: kdelibs
Install on build system: kdelibs-devel

From Centos-5: (depends on kdelibs-devel??)
yum install kdnssd-avahi-devel avahi-devel iscsi-initiator-utils e4fsprogs

Compile in userland, install and copy to $DVDBLD: 
apt
apache-tomcat
ACE-5.5.1+TAO-1.5.1
jdk-6
anaconda

had to:
rm /usr/lib/servlet-api.jar
ln -s /usr/lib/apache-tomcat/lib/servlet-api.jar /usr/lib/servlet-api.jar     

yum --disablerepo=\* --enablerepo=c5-media install kdesdk kdebase kdebindings
... they need kdelibs

cd $BL10; make rpm
copy all RPMS to $DVDBLD

Compile (in userland/external) and copy to $DVDBLD: 
postgresql-8.2.9-1.src.rpm
apr-util-1.2.7-7.el5
perl-DBD-Pg

TOPDIR=`rpm --eval %_topdir`

Compile LPS stuff: 
cd bl10
rpm -e atv-clw-libs atv-clw-dispatcher-libs atv-clw-dispatcher atv-clw-dispatcher-devel atv-clw-fms-libs atv-clw-devel
cd util
unalias cp
../../../../tools/agileBuild.sh build kit/*.spec
install the rpms on the build system:
rpm -i $TOPDIR/RPMS/i386/atv-clw-libs-*
rpm -i $TOPDIR/RPMS/i386/atv-clw-devel-*
cp $TOPDIR/RPMS/i386/atv-clw-libs-* $REPOSITORY/i386/RPMS.clw_libs
cp $TOPDIR/RPMS/i386/atv-clw-devel-* $REPOSITORY/i386/RPMS.clw_devel

cd ../dispatcher
../../../../tools/agileBuild.sh build kit/*.spec
cp $TOPDIR/RPMS/i386/atv-clw-dispatcher* $DVDBLD 
cp $TOPDIR/RPMS/i386/atv-clw-dispatcher-devel-* $REPOSITORY/i386/RPMS.clw_devel
cp $TOPDIR/RPMS/i386/atv-clw-dispatcher-libs-* $REPOSITORY/i386/RPMS.clw_libs
cp $TOPDIR/RPMS/i386/atv-clw-dispatcher-[0-9]* $REPOSITORY/i386/RPMS.clw_slice
install the rpms on the build system:
rpm -i $TOPDIR/RPMS/i386/atv-clw-dispatcher-*

cd ../dlog
for s in kit/*.spec; do ../../../../tools/agileBuild.sh build $s; done
cp $TOPDIR/RPMS/i386/atv-clw-dlog* $DVDBLD 
cp $TOPDIR/RPMS/i386/atv-clw-dlog-parser-* $REPOSITORY/i386/RPMS.clw_slice
cp $TOPDIR/RPMS/i386/atv-clw-dlog-server-* $REPOSITORY/i386/RPMS.clw_slice
cp $TOPDIR/RPMS/i386/atv-clw-dlog-viewer-* $REPOSITORY/i386/RPMS.clw_slice
cp $TOPDIR/RPMS/i386/atv-clw-dlog-pcmi-* $REPOSITORY/i386/RPMS.clw_pcmi

cd ../fms
../../../../tools/agileBuild.sh build kit/*.spec
cp $TOPDIR/RPMS/i386/atv-clw-fms-devel-* $REPOSITORY/i386/RPMS.clw_devel
cp $TOPDIR/RPMS/i386/atv-clw-fms-libs-* $REPOSITORY/i386/RPMS.clw_libs
cp $TOPDIR/RPMS/i386/atv-clw-fms-[0-9]* $REPOSITORY/i386/RPMS.clw_slice
cp $TOPDIR/RPMS/i386/atv-clw-fms-test-* $REPOSITORY/i386/RPMS.clw_test
cp $TOPDIR/RPMS/i386/atv-clw-fms-* $DVDBLD

Compile (in userland/external) and copy to $DVDBLD: 
quagga (and install quaga-devel on the build system)
atv-ospf

# still need kernel-BOOT & kernel-PCLnetbootsmp copy the bl9 ones:
cp /agile/repositories/bl9/i386/RPMS.clw_isoimg/kernel-BOOT-2.6.18-pclBL9d_.i686.rpm $REPOSITORY/i386/RPMS.clw_isoimg/
cp /agile/repositories/bl9/i386/RPMS.base/kernel-PCLnetbootsmp-2.6.18-pclBL9f_.i686.rpm $REPOSITORY/i386/RPMS.clw_isoimg/

Build the repository:
cd $BL10/external
make install
cd $REPOSITORY
vi sync_repository.conf
./sync_yum_repository.sh

Build the DVDBLD area:
rm $DVDBLD/*
cp -p `find . -name \*.rpm` $DVDBLD

find out what's missing (so we can copy from the Centos DVD):
cd $DVDBLD/../../..
./generate_image.sh dvd cleanbuild
and ^c it after the check
edit missing.rpms
# copy missing rpms from Centos DVD:
DVD=/kits/centos/5.3/os/i386/CentOS
(cd $DVD ; while read R; do find -regex "\./$R-[0-9].*\.rpm"; done) <centos53-rpms  | while read R; do cp $DVD/$R i386/PCL/RPMS/; done
# check again:
./checkrpms $DVDBLD $RPMLIST $ANACONDALIST
# fixup the ones that failed the regex above (because they have '+' in the filename!!) 

finddups # and remove dups

Now build the DVD per instructions
Build the slice rpm - install in repo & $DVDBLD and rebuild the DVD

Contents


3.23 Release process


1. have someone review your change (eg me or scott or tony) and check it 
in with "Bug:<bug number>, Reviewer: <name>" in the P4 change 
description, and close the bug with a cross reference to "fixed by 
change <changenum>"
2. make releaserpm (preferably on cpsbld)
3. test it (just a sanity check of the rpm as you've already tested the 
fix on sting)
4. check the rpm in under the appropriate pool at 
//atv/2005/released/engine/clusterware/v3.0/bl9/i386/
5. announce the release in the agile.integration newsgroup under the 
latest mamba thread.

Contents


3.24 Clickatell


the login details for https://www.clickatell.com/login.php?csite=clickatell
are:
Product - Clickatell Central(API)
Username - kmaffey
ClientID - MKA711
Password - deadcat2

Contents


4. Unix


Contents


4.1 Adding rasam to a network


rasam=192.168.2.214
on Rasam (linux):
	route add -net 192.168.254.0 netmask 255.255.255.0 eth0
	change /etc/resolve.conf to point to 192.168.254.246
	check hosts contains .2.214 for rasam

on pakora & raita (& anything else that needs to talk to rasam):
	route add -host 192.168.2.214 eth0
	check hosts, hosts.equiv

Contents


4.2 AIX


C (and other AIX) documentation:
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.xlcpp8a.doc/compiler/ref/preface.htm

Compiler is supposed to define:
_AIX
_AIX43 on AIX 4.3 and above
_AIX51, _AIX52 ???

ack is a "p-Series 44P model 270" - a single 375MHz ppc processor

needs bos.adt.syscalls installing in order to do kernel compilation

docs: 
	http://www16.boulder.ibm.com/pseries/en_US/infocenter/base/aix.htm
LED error codes:
	http://www.angelfire.com/il2/sgillen/errorcodes.html

mount -v cdrfs -o ro /dev/cd0 /mnt
	Linux needs insecure flag in /etc/exports --- OR ---
	nfso -o nfs_use_reserved_ports=1
	See /etc/filesystems. 

See /etc/pse.cfg (streams only?)

Backup /etc/ & /usr/lib/ objrepos before testing driver

Debugger=idebug
To start desktop:
/usr/dt/bin/dtlogin -daemon

To update the .toc file:

	inutoc `pwd`

To run external X display, run xdm as root

To see all SCSI discs (may need to run cfgmgr):
	lsdev -C -sscsi 

To start automounter:
	smit mkautomnt    ... or
	startsrc -s automountd

To stop automounter:
	stopsrc -s automountd

To see if automountd is running:
	lssrc -s automountd

AIX has no domainname command!!!

OS Level:
	oslevel, also
	instfix -i | grep AIX_ML

Debuggers:
	dbx (commandline)
	idebug (GUI)

There is no "top" - use monitor (4.3 only) or nmon

freeware repositories:
	http://www.ibm.com/servers/aix/products/aixos/linux
	http://www.bullfreeware.com/

AIX FAQ:
	http://www.emerson.emory.edu/services/aix-faq/

route {add|delete} [ -net | -host ] dest gateway
	route delete -net 0.0.0.0 192.168.2.1

To clear shared libraries from the cache:
	/usr/sbin/slibclean

Contents


4.2.1 32-bit Kernel Extension Considerations


http://www16.boulder.ibm.com/pseries/en_US/aixprggd/kernextc/kernextctfrm.htm:

The introduction of the scalable 64-bit ABI requires 32-bit
kernel extensions to be modified in order to be used by 64-bit
applications on AIX 5.1 and later. Existing AIX 4.3 kernel
extensions can still be used without change for 32-bit
applications on AIX 5.1 and later. If an AIX 4.3 kernel extension
exports 64-bit system calls, the symbols will be marked as
invalid for 64-bit processes, and if a 64-bit program requires
these symbols, the program will fail to execute.

Once a kernel extension has been updated to support the new
64-bit ABI, there are two ways to indicate that the kernel
extension can be used by 64-bit processes again. The first way
uses a linker flag to mark the module as a ported kernel
extension. Use the bM:LT linker flag to mark the module in this
manner. The second way requires changing the sysconfig or
kmod_load call used to load the kernel extension. When the
SYS_64L flag is passed to sysconfig, or the LD_64L flag is passed
to kmod_load, the specified kernel extension will be allowed to
export 64-bit system calls.

Kernel extensions in the 64-bit kernel are always assumed to
support the 64-bit ABI. The module type, specified by the -bM
linker flag, as well as the SYS_64L and LD_64L flags are always
ignored when the 64-bit kernel is running.

32-bit device drivers cannot be used by 64-bit applications
unless the DEV_64L flag is set in the d_opts field. The DEV_64BIT
flag is ignored, and in the 64-bit kernel, DEV_64L is ignored as
well.


But:

In Chapter 1. of the same technical reference book you point to,
the third paragraph reads:

"Kernel extensions run in the same mode as the kernel. That is,
when the 64-bit kernel is used, kernel extensions run in 64-bit
mode. These kernel extensions  must be compiled in 64-bit mode."

Contents


4.2.2 64-bit support


Both 32- abd 64-bit applications are supported on both 32- and 64-bit
kernels.

Kernel mode is shown by:
bootinfo -K
Hardware width is shown by 
bootinfo -y # (ack is 64-bit hardware)

Switch to 64-bit kernel:
ln -fs /usr/lib/boot/unix_64 /unix
bosboot -a
shutdown -Fr

Switch to 32-bit kernel:
ln -fs /usr/lib/boot/unix_mp /unix
bosboot -a
shutdown -Fr

Applications can be 32 or 64-bit, not mixed -ie if an app is64-bit then it
_must_ link against a 64-bit library.

Libraries, on the other hand, can be mixed. eg. in the system libraries
(eg libc) there are both 32- and 64-bit entrypoints eg. frexp.o and
frexp_64.o We don't have the mechanics to do this name-mangling and I
don't see system tools to do it for us so our current approach of offering
separate 32- and 64-bit libraries looks good.

ar and nm accept -X32 or -X64 options to list (or operate on) either class
of object. There is also a -X32_64 option to list (or operate on) both
types.

It appears that 64-bit apps compiled on 4.3.3 will not run on 5L and vice
versa although 32-bits are portable.

Please check that the loader gets the 64-bit switch -b64 (see "man ld").
But note - if the OBJECT_MODE environment variable is set to 64 the -q64
(compiler) and -X64 (ar nm) options do not need to be specified. 

=================================================================
Frequently Asked Questions
 FAQ help
*   Search tips
How do you set AIX 4.3 64 bit systems into 32 bit mode?

A: If system has greater than 2G of memory it will boot automatically into 64 bit mode.

To force 32 bit mode follow these instructions.

   1. When the Op Panel displays E07A hit any of the TTY.
      note: If the sound works you will hear 3 beeps.
      note: You have 10 seconds to hit key.
   2. At the Service Processor Main Menu enter 83665.
   3. Enter 1
   4. Enter 99
   5. At the IPLROS welcome screen hit any key of the TTY.
      note: You have 4 seconds to hit the key.
   6. Enter 6 until you see 64 bit is off.
      note: The states are: Enabled, Forced, Off.
   7. Enter 1 

NOTE: To determine if you successfully switched to 32 bit mode look for the following.

If you see TCE messages when you boot up then you are in 64 bit mode. If you have more than 2G at an AIX prompt then you are in 64 bit mode.

bootinfo -r will list memory in KBs. 

==================================================================
Question
When IBM ships a new 64-bit system, which kernel (32-bit or 64-bit) is installed as the default kernel?

Answer
When a new system ships it will have a 32-bit kernel as the default.

AIX v5.1 includes a new fileset bos.mp64. This fileset contains the 64-bit kernel and it will automatically be installed on machines which have 64-bit hardware. This kernel will not be activated by default , instead one of the 32-bit kernels (from bos.up or bos.mp) will be used.

The 64-bit kernel can be selected to be active at AIX install time, or later using the steps described below.

Switching between kernels

In AIX 5.1 there are three possible kernels:

unix_up - from the bos.up fileset
32-bit kernel for uni-processor systems
unix_mp - from the bos.mp fileset
32-bit kernel for multi-processor systems
unix_64 - from the bos.mp64 fileset
64-bit kernel for uni and multi-processor systems

The customer can switch between these kernels by running a few commands and rebooting. This is documented in the AIX README file (/usr/lpp/bos/README). Care must be taken to avoid invalid combinations like:

64-bit kernel on 32-bit hardware.
UP kernel on MP hardware.

Here are the commands to use:

ln -fs /usr/lib/boot/unix_XX /unix
ln -fs /usr/lib/boot/unix_XX /usr/lib/boot/unix
bosboot -a
shutdown -Fr

where XX is '64', 'up', or 'mp' as desired. 

bootinfo -K

How can I change from one kernel mode to another?

/unix is a symbolic link to the booted kernel. To find out what
kernel mode is running, enter ls -l /unix and see what file /unix
is linked to. Following are the three possible outputs from ls -l
/unix command and their corresponding kernels:


/unix -> /usr/lib/boot/unix_up 		# 32 bit uniprocessor kernel 
/unix -> /usr/lib/boot/unix_mp 		# 32 bit multiprocessor kernel
/unix -> /usr/lib/boot/unix_64 		# 64 bit multiprocessor kernel       

During the installation process, one of the 32-bit kernels,
appropriate to the hardware, is enabled by default. The system
can be changed to boot up in 64-bit kernel mode by using the
following commands:


ln -sf /usr/lib/boot/unix_64    /unix
ln -sf /usr/lib/boot/unix_64    /usr/lib/boot/unix
bosboot -ad  /dev/hdiskxx
shutdown -r

The /dev/hdiskxx directory is where the boot logical volume
/dev/hd5 is located. To find out what xx is in hdiskxx, run the
following command:


 lslv -m hd5
 

Contents


4.2.2.1 Converting 32-bit extensions to 64-bit

http://www-106.ibm.com/developerworks/eserver/articles/32to64.html

Ensure type-safe: point, long and int are not the same:

	32-bit	64-bit
pointer	32	64
long	32?	32
int	32	32

... use int32_t etc to be specific

size_t	32	64
key_t	32	64

iomem_att is not available in 64-bit!! see io_map_init, io_map??

 start_addr = (volatile char*)io_map(i_pstDev->regsHandle +
  (PCI_Dev.dds.bar0 & (PAGESIZE - 1)));

use -q64 on xlc for 64-bit: defines __64BIT__
sys/types.h also defines __64BIT_KERNEL
use -qinfo=pro to check for missing prototypes

Make sure _KERNEL and _KERNSYS macros are defined.

Contents


4.2.3 dbx


http://publib16.boulder.ibm.com/pseries/en_US/aixprggd/genprogc/genprogctfrm.htm

Fer gawd sake, don't use -O - it _REALLY_ throws the debugger off.

.dbxinit instead of .gdbinit.

use [ dir1 dir2 ] ... spells out the directories for source
run [ args ]
step/s
next/n
cont/c
stop in "procedure"
stop at "hello.c":<line number>
stop { [Variable] [ at SourceLine | in Procedure ] [ if Condition ]}
print/p
assign x=5
return

screen is supposed to throw up an Xwindow (but appears to be
broken)

Contents


4.2.4 errno


#define EPERM   1   /* Operation not permitted      */
#define ENOENT  2   /* No such file or directory        */
#define ESRCH   3   /* No such process          */
#define EINTR   4   /* interrupted system call      */
#define EIO 5   /* I/O error                */
#define ENXIO   6   /* No such device or address        */
#define E2BIG   7   /* Arg list too long            */
#define ENOEXEC 8   /* Exec format error            */
#define EBADF   9   /* Bad file descriptor          */
#define ECHILD  10  /* No child processes           */
#define EAGAIN  11  /* Resource temporarily unavailable */
#define ENOMEM  12  /* Not enough space         */
#define EACCES  13  /* Permission denied            */
#define EFAULT  14  /* Bad address              */
#define ENOTBLK 15  /* Block device required        */
#define EBUSY   16  /* Resource busy            */
#define EEXIST  17  /* File exists              */
#define EXDEV   18  /* Improper link            */
#define ENODEV  19  /* No such device           */
#define ENOTDIR 20  /* Not a directory          */
#define EISDIR  21  /* Is a directory           */
#define EINVAL  22  /* Invalid argument         */
#define ENFILE  23  /* Too many open files in system    */
#define EMFILE  24  /* Too many open files          */
#define ENOTTY  25  /* Inappropriate I/O control operation  */
#define ETXTBSY 26  /* Text file busy           */
#define EFBIG   27  /* File too large           */
#define ENOSPC  28  /* No space left on device      */
#define ESPIPE  29  /* Invalid seek             */
#define EROFS   30  /* Read only file system        */
#define EMLINK  31  /* Too many links           */
#define EPIPE   32  /* Broken pipe              */
#define EDOM    33  /* Domain error within math function    */
#define ERANGE  34  /* Result too large         */
#define ENOMSG  35  /* No message of desired type       */
#define EIDRM   36  /* Identifier removed           */
#define ECHRNG  37  /* Channel number out of range      */
#define EL2NSYNC 38 /* Level 2 not synchronized     */
#define EL3HLT  39  /* Level 3 halted           */
#define EL3RST  40  /* Level 3 reset            */
#define ELNRNG  41  /* Link number out of range     */
#define EUNATCH 42  /* Protocol driver not attached     */
#define ENOCSI  43  /* No CSI structure available       */
#define EL2HLT  44  /* Level 2 halted           */
#define EDEADLK 45  /* Resource deadlock avoided        */

#define ENOTREADY   46  /* Device not ready     */
#define EWRPROTECT  47  /* Write-protected media    */
#define EFORMAT     48  /* Unformatted media        */

#define ENOLCK      49  /* No locks available       */

#define ENOCONNECT      50      /* no connection                */
#define ESTALE          52      /* no filesystem                */
#define EDIST       53  /* old, currently unused AIX errno*/

Contents


4.2.5 Getting a snap dump to IBM


Disable kdb & reboot:
bosdebug -o
bosdebug -L
bosboot -a
shutdown -Fr

Consider adding -g to compile flags on the dd to get more info from
the dump.

Now let the dump run and on reboot, run 
snap -ac

Log the call on the phone - the web pages suck too much

Ph: 131426
Cust #: 311181 
Machine: 9111 model 520
Serial: 6514E1C

Contents


4.2.6 HOWTO build a .bff file


Jim Abbey  has a tool called "lppbuild".
It is now available from "aixpdslib.seas.ucla.edu"
in either of

/pub/lppbuild/RISC/3.2/src/lppbuild.1.0.tar.Z
/pub/lppbuild/RISC/4.1/src/lppbuild.1.0.tar.Z

Both are identical and the procedures also work on 4.2.

Ciaran Diegnan has built a tool called
"mklpp". You can retrieve a copy (along with many other
smit-installable freeware packages) from . 

Contents


4.2.7 Install a driver:

1.copy the driver and configuration utility cfge8k into the system area,
	cp aix-ppc/e8k /usr/lib/drivers/pci
	cp aix-ppc/cfge8k /usr/lib/methods
2.insert the driver information into ODM :
	odmadd ../install/aix/root.odmadd
3.Run cfgmgr to re-scan the bus, assign drivers to cards and run cfge8k

Removing the driver:
for i in 0 1 2 3; do rmdev -d -l e8k$i; done
odmdelete -q "uniquetype=adapter/pci/e8k" -o PdAt
odmdelete -q "uniquetype=adapter/pci/e8k" -o PdDv
odmdelete -q "uniquetype=adapter/pci/e8k" -o PdCn
odmdelete -q "PdDvLn=adapter/pci/e8k" -o CuDv

odmget -q"uniquetype=adapter/pci/e8k" {PdDv|PdAtPdCn|CuDv|CuAt|CuCn} ... to get ODM db entries
odmadd root.odmadd ...  to add predefined attr
odmdelete -q "uniquetype=adapter/pci/e8k" -o PdDv ...  to delete ODM entries
lsdev -P -c adapter ... to check the predefined devices
lsdev -C -c adapter ... to check the configured devices
lsattr -El e8k0 ...to check device attr (ie. The the atributes in PdAt )
lscfg -l e8k0 ...to display configuration, diagnostic, and vital product data (VPD) information about the system.

Contents


4.2.8 Installation program = installp


List "supplemental fileset info" .bff file:
	installp -iq -d . -f epm.bff

To list the packages in a .bff file: 
	installp -L -d `pwd`/devices.pci.11106510.bff 
also:
	/usr/lib/instl/sm_inst list_filesets -l -f _all_available -d .

To list the files in a package:
	lslpp -f ERACxxxxx.rte
	lslpp -f devices.pci.11106510.rte

To list the package containing a file:
	lslpp -Jw filename

To install a package:
	cd <directory-of-bff-file>
	installp -acgNQqwX -d . ERACxxxxxx.rte

To install the driver:
	installp -u devices.pci.11106510.rte
	installp -acgNQqwX -d $P/AIX/ETpcihsm/V1.70/Install devices.pci.11106510.rte
	cfgmgr

To remove a package:
	installp -u ERACxxxxx

List what is in a package without installing (PREVIEW)
installp -pacXd . all

List the package that owns a file
lslpp -w

List all packages installed
lslpp -L

There appears to be no way to list the files in a .bff file -
perhaps use 'restore -T -B <XXXXxxxx.bff' - Nope, doesn't work
Maybe look in /usr/lpp/ETcprt after installation.

Management tool = smit

Contents


4.2.9 Kernel dump analysis


crash dump:
crash /dev/hd6
find -k "HEPPLE"
od <address> <nbytes> a >file

create a panic with panic("message")
sysdumpstart -p
savecore -f -d /tmp

Determine where dumps are going with smit:
Problem Determination->System Dump->Show Information About the Previous System Dump

-OR-

sysdumpdev -L  

Note the compressed dump size N and calculate C=1+N/512
C=16742912
dd if=/dev/hd6 bs=512 skip=1 count=`echo "$C 512 / 1 + p" |dc` |uncompress >/usr/dumpfile
kdb -k /usr/lib/drivers/pci/e8k /usr/dumpfile

(0)> stack  ( or f)
(0)> set display_stack_frames
(0)> stack
(0)> symptom
(0)> stat
(0)> find -s 0 HEPPLE
(0)> dp 075F82A0 8192 > junk ... using the address found above

To put the kernel into debug mode (^\ drops the console into kdb):
bosboot -a -D
shutdown -Fr

To reset:
bosdebug -o
bosboot -a 
shutdown -Fr

You may need to use the HMC terminal.
To see what current debug dettings are:
bosdebug -L
 

Contents


4.2.10 Malloc debugging


valgrind is not available on AIX.
Setting MALLOCDEBUG=logfilename might help
See http://www.ibm.com/developerworks/aix/library/au-mallocdebug.html

Also, set:
MALLOCTYPE=debug MALLOCDEBUG=postfree_checking,validate_ptrs,report_allocations

Contents


4.2.11 Message catalogues


"dspcat devices.cat 44 29" gives:
	Graphics Adapter

File is /usr/lib/methods/devices.cat

gencat e8k.cat e8k.msg: creates e8k.cat from e8k.msg

mkcatdefs - creates symbollic message catalog with .h file

runcat - runs gencat from mkcatdefs pipe

Contents


4.2.12 Power5 configuration notes

==========================

Session with Mario Bono, Apr 8th 2005

Hardware & network name & address assignments:
192.168.2.170 p5hmc Hardware Management Console (HMC) 3GHz Xeon running Linux
Login locally as hscroot/abc123 or root/passw0rd or ibmcsr/servmode

Internal network from HMC to Power5 is 172.16.X.X/255.255.0.0 - class B

http://p5hsm/remote_client.html has a remote client for Linux and
Winblows to talk to the HMC ... but the Linux version looks broken.

The Power5 itself is a 2x CPU 4Gb system with multiple logical
partitions assigned:

192.168.2.171 p5vio - login locally (only) as padmin/abc123
192.168.2.172 p5 - p5dev - development partition and NIM server - root/fred
192.168.2.173 p5 - p5tst
192.168.2.174 p5 - p5dev2
192.168.2.175 p5 - p5tst2

To allow EEH errors to be injected by the s/w tool:
Advanced Systems Mgt->Service Focal Point->Service Utilities->Launch ASM->Sys conf->PCI Error injection policy
Login as admin/abc123

Note that AIX5.2 needs a dedicated CPU (ie not fractional)

VIO Partition
=============

The VIO partition needs to own all networking, DVD and discs, but not
the PSOs.

VIO needs "trunk adapter" and 802.1Q setting

Need to run "licence -accept" at first bootup

More capable shell is available with "oem_setup_env"

Adding the first partition (p5dev):
===================================

Make a shared ethernet adapter on VIO:
lsdev -type adapter # to see adapters
mkvdev -sea ent0 -vadapter ent2 -defaultid 1
mktcip -hostname p5vio -inetaddr 192.168.2.130 -interface en3 -netmask 255.255.255.0 -gateway 192.168.2.2

Create a virtual ethernet adapter in the p5dev partition using the HMC with IEEE801.1Q but _NOT_ trunk
Make a virtual SCSI adapter in the p5dev partition using the HMC

lsmap -all # to see all virtual devices
cfgdev # to grab changes without shutdown/restart

Create new volume group (uservg) with smit. Then:

mkvg -lv rootvg-devnim uservg 15G
lsvg -lv uservg # now map the logical volume to the virtual adapter:
mkvdev -vdev rootvg-devnim -vadapter vhost0 -dev vdevnim0
lsmap -all # shows the new disc

General
=======

If you make a change to a partition profile, then you need to shutdown
that partition fully and then restart to see the changes. A simple
"reboot" is not enough.

To make the CD/DVD available to another partition, first of all
relinquish it from the partition that owns it by doing a "rmdev -l" on
each device file in the device chain eg
rmdev -l cd0
rmdev -l ide0
rmdev -l pci3
(no need to do pci0)

Then, on the HMC, Dynamic Logical Patitioning->Remove. The next client
partition to boot will grab the DVD.

To boot off the CD, use the HMC->Advanced->Boot Mode to boot into SMC
mode.

To make a filesystem bigger:
chfs -a size=+32768 /

NIM
===

To setup the nim server, execute nim_master_setup in that partition.

To restore a nim mksysb image do:
smit nim_mkclient or 
smit nim_client_setup

Enabling EEH error-injection
============================
EEH is only for Power5 processors.

At the HMC:
Service Focal Point -> Service Utilities -> select the CEC for the managed
system and use Launch ASM Interface from the first pull-down.

Then from the ASM interface you can enable/disable EEH

Contents


4.2.13 Serial line problems


I fixed the serial line problems with AIX - it's a bit of a
catch-22 but I have a fix for you.

The problem is that the default for a tty is to have -clocal set
in the stty parameters. This means that the port cannot be opened
until the modem control lines indicate the presence of a DCE
(data communications equipment) - ie a modem. The card reader
does not provide these lines so the port cannot be opened.

The stty command is normally used to set this parameter:

	stty clocal </dev/tty1

... but it relies on the shell opening the device, and here's the
catch-22, it can't do that because there's no modem. It hangs
forever.

The answer is to by-pass stty and use smit:
Devices -> 
TTY ->
Change / Show Characteristics of a TTY ->
tty1 Available 01-S2-00-00 Asynchronous Terminal

and then add clocal to the list "STTY attributes for RUN time".
You'll have to press the "insert" key because smit helpfully
assumes you want to overwrite!

You will also need:
FLOW CONTROL to be used                            [none]
OPEN DISCIPLINE to be used                         [wtopen]

Once this is done, you should see "clocal" (as opposed to "-clocal") in
the output of:

	stty -a </dev/tty1

... which should not hang.

All this is over and above the problems we already solved with
AIX ie (as root):

1 use smit to create tty1 if not already there
2 mkdir /dev/cua
3 ln -s /dev/tty1 /dev/cua/a
4 chmod a+rw /dev/tty1

Then it can read and write to the card reader and all is hunky dory.

Trouble is, without a smartcard reader the open waits forever.
You need to set OPENDISCIPLINE back to dtropen!

bash-2.05a# stty -a </dev/tty1 
speed 9600 baud; 0 rows; 0 columns; 
eucw 1:1:0:0, scrw 1:1:0:0:
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@
eol2 = ^?; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R
discard = ^O; werase = ^W; lnext = ^V
-parenb -parodd cs8 -cstopb hupcl cread clocal -parext 
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
-ixon -ixany -ixoff imaxbel 
isig icanon -xcase echo echoe echok -echonl -noflsh 
-tostop echoctl -echoprt echoke -flusho -pending iexten 
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 

Contents


4.2.14 Seting up dtlogin (may also enable xdmcp)

   1. If the /etc/dt/config/Xservers file does not exist, copy the /usr/dt/config/Xservers file to the /etc/dt/config directory.
   2. If you have to copy Xservers to /etc/dt/config, you must change or add the Dtlogin.servers: line in /etc/dt/config/Xconfig to be:

      Dtlogin*servers: /etc/dt/config/Xservers

   3. Edit the line in /etc/dt/config/Xservers that starts the Xserver to read:

      * Local local@none /path/X :0 

   4. Reread the Login Manager configuration files.

Start the login server:
/usr/dt/bin/dtlogin -daemon

Start up automatically at boot time:
smit dtconfig

Contents


4.2.15 Setting up xdmcp


Configuration is in /usr/lib/X11/xdm
Edit Xservers to remove 0: if not needed
Start xdm

Maybe run /usr/lib/X11/xdm/xdmconf to enable xdm startup at boot

root X -query hostname ... gives you twm (woo hoo!)

Contents


4.2.16 Shared libraries

$(CC) -bM:SRE -bexpall -bnoentry -o libfoo.a foo.o

To restrict exported symbols to the simple ascii list exports.txt, add this:

-bnoexpall -bE:exports.txt

Contents


4.2.17 System console


9600/8N1

minicom is normally to /dev/ttyS0 and needs a NULL modem - best
is 9-pin to 9-pin but RS/6000 end needs pillars removing to make
physical contact.

IBM terminal appears to need no NULL modem.

Contents


4.3 Apps


Contents


4.3.1 apache httpd

openssl setup:
httpd-1 has a separate mod_ssl module from www.mod_ssl.org
httpd-2 includes the mod_ssl module but it has a separate rpm

Create self-signed certificate (or use a genuine one):
cd /etc/httpd # or somewhere
mkdir CA
cd CA
openssl genrsa -des3 -out my-ca.key 2048 # record the password
openssl req -new -x509 -days 3650 -key my-ca.key -out my-ca.crt
openssl x509 -in my-ca.crt -text -noout # just to list it
openssl genrsa -des3 -out mod_ssl.key 1024 # record the password
openssl req -new -key mod_ssl.key -out mod_ssl.csr
openssl x509 -req -in mod_ssl.csr -out mod_ssl.crt -sha1 -CA my-ca.crt -CAkey my-ca.key -CAcreateserial -days 3650
chmod 440 *.key
chgrp apache *
chmod a+r *.crt
cp -p mod_ssl.crt /etc/httpd/conf/ssl.crt
cp -p mod_ssl.key /etc/httpd/conf/ssl.key
cp -p my-ca.crt /etc/httpd/conf/
atv-admin start
cd /atv_share
mkdir -p www/ssl
chgrp -R apache www

/etc/httpd/conf.d/ssl.conf:
SSLCertificateFile /etc/httpd/conf/ssl.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key
SSLCACertificateFile /etc/httpd/conf/my-ca.crt

Contents


4.3.2 automake


Makefile.am -> (automake) -> Makefile.in

(autoscan) -> configure.ac or configure.in

configure.ac is the preferred name - configure.in is the old name

configure.in -> (autoconf) -> configure

Makefile.in -> (configure) -> Makefile config.h(?) config.status config.log

Contents


4.3.3 cscope


find . -name \*.[ch] >cscope.files
cscope -b -q -k

emacs xemacs.el is in the tarball under contrib/xcscope - put it
into ~/elisp

May need to add this at the end:

(add-hook 'java-mode-hook (function cscope:hook))

Contents


4.3.4 cups


remote printer is ipp://raita/printers/lp

for windows: http://192.168.101.18:631/printers/lp

Contents


4.3.5 CVS


CVSROOT syntax is:
 	
[:method:][[user][:password]@]hostname[:[port]]/path/to/repository

generally, use with global -d option:

cvs -d :ext:bhepple@cvshost.local.aus.rsa.com:/usr/local/cvs commit

Initialise CVS repository:
	 cvs -d /home/bhepple/work/cvsroot init
Import files into CVS:
	 cd rspxml
	 cvs import rspxml initial_load start

-- OR -- you can avoid the "Vendor tag" with this (needs RCS):

cd <your source tree>
source=`pwd`
module=xyzzy      <<== Your choice of directory name
mkdir /opt/cvsroot/$module
cd /opt/cvsroot/$module
(cd $source; tar cf - .) | tar xvpBf -
find . -type f -exec ci -t-Original. {} \;

(see FAQ)

Checkout same:
	 cvs -d /home/bhepple/work/cvsroot co -d openssl-mytag openssl
Make a branch:
	cd openssl
	cvs tag -b branch-engine-0_9_6b-eracom-1_2
or:
	cvs rtag -b -r starting-tag branch-name modules ...

Tag a file:
	cvs tag tagname files

Change CD to the branch:
	cvs up -r branch-engine-0_9_6b-eracom-1_2
	... can't rename a branch
Delete a tag or branch:
	cvs tag -d engine-0_9_6b-eracom-1_2
Move revision to a tag:
	cvs tag -r <rev> -F <tag> [ filename ]
Typically:
	cvs tag -r HEAD -F netsrv_300beta1_aix postinstall
	cvs tag -r branch_tag -F netsrv_300beta1_aix postinstall

Merge from branch to HEAD (in working directory):
	cvs up -kk -j branch-tag [ filename ]
... remember to tag the branch eg merged-to-head-tagname-N

To re-merge from the branch to the HEAD, don't do the same again ie,
don't do:
	cvs up -kk -j branch-tag [ filename ]
do this instead:
	cvs up -kk  -j merged-to-head-tagname-N -j branch-tag [ filename ]

Revert to a prior version:
	cvs up -kk -j HEAD -j prior-version filename

NB -kk means "don't expand keywords" - reduces conflicts in merges

Contents


4.3.6 Electric fence


load with -lefence or use gdb and the README.gdb from efence package as .gdbinit and commadn efence before running.

... or just run with 

export EF_PROTECT_BELOW=1
export EF_PROTECT_FREE=1
export EF_FREE_WIPES=1
export EF_ALIGNMENT=0

export LD_PRELOAD=/usr/lib/libefence.so.0.0
run command

see
man efence

Contents


4.3.7 emacs


# Local Variables: 
# fill-column: 70 
# eval:(setq filename (substring buffer-file-name (string-match "[a-zA-Z0-9_.]+$" buffer-file-name))) 
# eval:(setq compile-command "m4 -P fvwm2rc.m4 > .fvwm2rc")
# End: 

^X^Mf - switch coding systems eg DOS ( see list-coding-systems)

Fonts from http://www.emacswiki.org/cgi-bin/emacs-en/GoodFonts#toc9:

-xos4-terminus-medium-r-normal--14-140-*-*-*-*-*-*
-jmk-neep alt-medium-r-*-*-20-*-*-*-c-*-iso8859-1
-bitstream-bitstream vera sans mono-medium-r-*-*-*-120-*-*-*-*-*-*

Contents


4.3.8 Firefox


about:config to access more preferences

Contents


4.3.9 fluxbox


install:
fluxbox
wmctrl
fbpager
feh
next

To get the git version of fbpager:

git clone git://git.fluxbox.org/fbpager.git

Then automake; configure; make etc etc

Contents


4.3.10 Freetype


Monospace is a meta-font:
raita:~/ $ fc-match Monospace
VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
pacific:~/ $ fc-match Monospace
DejaVuLGCSansMono.ttf: "DejaVu LGC Sans Mono" "Book"

From /usr/share/doc/fontconfig-*/fontconfig-user.txt.bz2:
Names:
   Fontconfig provides a textual representation for patterns that
   the library can both accept and generate. The representation is
   in three parts, first a list of family names, second a list of
   point sizes and finally a list of additional properties:
        <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>...

   Values in a list are separated with commas. The name needn't
   include either families or point sizes; they can be elided. In
   addition, there are symbolic constants that simultaneously
   indicate both a name and a value. Here are some examples:
  Name                            Meaning
  ----------------------------------------------------------
  Times-12                        12 point Times Roman
  Times-12:bold                   12 point Times Bold
  Courier:italic                  Courier Italic in the default size
  Monospace:matrix=1 .1 0 1       The users preferred monospace font
                                  with artificial obliquing

Contents


4.3.11 gimp


 
FIxing Up Moire Patterns

Even if you scan with the right resolution (300 ppi for a drawing
or book that has a line frequency of 150 lpi) the moir? pattern
problem will pop up again when you resize the image to make it
fit your layout. The solution is to:

1. Add some Noise: (right-click|Filters|Noise|Noisify)

2. Then add a little Gaussian Blur:
(right-click|Filters|Blur|Gaussian Blur (IIR))

3. Then sharpen it up with Unsharp Mask (a lot):
(right-click|Filters|Enhance|Unsharp Mask)

4. Now you can resize and print your image

The result isn't perfect, but this is as good as it gets without running one of the anti-moir? programs available on the market.

Contents


4.3.12 gtkpod


For iPod Classics and the video Nanos, there's an extra step to provcide the firewire configuration:

lsusb -v | grep -i Serial
.. should give a 16-digit hex number

Put it in the file:
/mnt/stick/iPod_Control/Device/SysInfo

in the form:
FirewireGuid: 0x000A27001D39C102

(don't forget the 0x)

Contents


4.3.13 MozillaFirebird


about:config for all configuration options! Well hidden!
Set image.animation_mode to "once"

How do I enable Emacs-style keybindings in GTK+ applications?

By default, GTK+ uses Windows-like keyboard shortcuts for command line editing. Many UNIX users are more familiar or more comfortable with Emacs-style shortcuts. For example, GTK+ uses Control+A to mean, "select all," where as Emacs uses Control+A to mean, "put cursor at the beginning of line."

In order to use Emacs-style keybindings in GTK+ applications, edit ~/.gtkrc-2.0, and add the following:

gtk-key-theme-name = "Emacs"
       

If you are using the GNOME Desktop, however, this is not sufficient. You must also change the GConf key /desktop/gnome/interface/gtk_key_theme to "Emacs" using Applications > System Tools > Configuration Editor (gconf-editor from the command line).

Contents


4.3.14 mplayer/mencoder


Play DVD:
mplayer dvd:// [ --dvd-device /mnt/scratch/torrent/FILM ]

Dump stream: # is title number:
mplayer dvd://# -dumpstream -dumpfile output.dump
... note that it ignores sland!!

Possible way to RIP DVD and preserve aspect ratio:
# is title number:
mencoder dvd://# -sland en -ovc lavc -lavcopts vcodec=mpeg4:aspect=16.0/9.0 -vop crop=714:548:0:14 -oac copy -o output.avi

Contents


4.3.15 nxclient

Only thing works from home is:

host: pacific port:22
Desktop: unix, custom
Settings: Run the console

... you get no window manager and just a console.

Start apps from the console or start fluxbox with startfluxbox - use
NX_CLIENT to screen out inappropriate commands in .fluxbox/startup

Contents


4.3.16 p4


To set up a client:
p4 client # defaults to hostname
... set compress on

To get rid of a client:
p4 client -d pacific
... now remove the local files

Sync files (copy from depot to workspace)
p4 sync ...

Sync (restore) missing files:
p4 diff -sd | p4 -x- sync -f

revision number: filename.c#12 or filename.c#head #1 is first. #0=#none = imaginary
change number:   filename.c@3
label:           filename.c@label
client version(?)filename.c@kmaffey
by date:         filename.c@2008/09/21[:hh:mm:ss]

Adding a file:
p4 add filename
Adding a binary file:
p4 add -t <filetype> filename
Add a directory of files:
find . -type f |p4 -x- add

Delete a file:
p4 delete filename

Edit a file:
p4 edit filename (C-x p e)

What's open?
p4 opened

Revert to the depot version: (un-edit/close a file)
p4 revert filename

History
p4 filelog filespec
-l for longer listing
-i to span branches - I think that's the only command which understands branches

Send the changes to the depot:
p4 submit filename (C-x p S)
# note: always give filelist otherwise it'll submit everything globally!! not just in pwd
# warning! emacs p4 command does it globally!

List changes:
p4 changes filename (C-x p C) - use -i to span branches

List differences:
p4 diff filename (C-x p -) # only diffs against current client file!!
p4 diff2 file#1 file@2009/01/02 # diff against any versions of the file

Create a label:
p4 label <labelname>

Label files:
p4 labelsync -l labelname files

To un-sync files (remove them from the workspace):
p4 sync files#none
To un-sync files that have been deleted from the workspace:
p4 diff -sd |p4 -x- sync #none    ...????

Auto-resolve:
p4 resolve -as files

Manually resolve files:
p4 resolve files

Undelete files:
Find the change that undeleted the files N
p4 sync filespec@$((N - 1))
p4 add filespec
p4 submit filespec
filespec can be ...

Merge branches - requires undoc command!!! fer chrisakes:
p4 interchanges branch1/filespec branch2/filespec ... undoc command to get change numbers
For each changenum:
p4 integ -n branch1/filespec@changenum branch2/filespec
... check it over then do it without the -n
p4 resolve branch2/filespec
p4 submit branch2/filespec

Contents


4.3.17 Purify


Look for "mlk" for memory leaks

To capture purify output:

PURIFYOPTIONS="-log-file=junk"

Contents


4.3.17.1 Running Purify on engbuild20

# sync source (or CVS)
cd HEAD
REM=engbuild20
RDIR=/home/build/bhepple/dsm-1_1-iteration_2-branch
rsync  --rsh="ssh -l build" -avR . -C --exclude='*~' --exclude='*/out*' --exclude='*/shared*' --exclude='*/tmp*' --exclude='*/lib*.so' --exclude='cscope*' --exclude='TAGS' --exclude='out' $REM:$RDIR

# run purify:
ssh -X build@engbuild20
cd bhepple
. .bashrc
. .bash_profile

cd dsm-1_1-iteration_2-branch/spec 
or 
cd dsm-1_1-iteration_2-branch/rspcert

export PURIFY=purify
export MK1MF_OPTS="-style=purify,debug"
export MD_PLATFORM=solspv8p
source ./build/script/buildrmt_phases/dsm_var.sh
or
source ./build/script/buildrmt_phases/var.sh


perl ../build/script/config.pl -platform solaris-usparc-cc -debug -DSPE_NO_VERIFY
make -f makefile.solaris-usparc-cc 

or (but gdb on engbuild20 is broken, at least when Purify is enabled):

./buildrmt.sh config 
make -f makefile.solaris-usparc-cc
./buildrmt.sh make


For rspcert, I had to:
make -k -f makefile.solspv8p

make -f makefile.solaris-usparc-cc testall 2>&1 |less

... purify build implies -debug

Contents


4.3.17.2 Running Purify on HP-UX

# sync source (or CVS)
cd HEAD
REM=engbuild22
RDIR=/home/build/bhepple/SPEC/HEAD
rsync  --rsh="ssh -l build" -avR . -C --exclude='*~' --exclude='*/out*' --exclude='*/shared*' --exclude='*/tmp*' --exclude='*/lib*.so' --exclude='cscope*' --exclude='TAGS' --exclude='out' $REM:$RDIR

# run purify:
ssh -X build@engbuild22
cd bhepple
. .bashrc
. .bash_profile

cd SPEC/HEAD/spec 
or 
cd SPEC/HEAD/rspcert

export MK1MF_OPTS="-style=purify,debug -DSPE_NO_VERIFY"
export MD_PLATFORM=hpux11pa20

Modify dsm_var.sh to remove ERUN=purifyrun lines

source ./build/script/buildrmt_phases/dsm_var.sh
or
source ./build/script/buildrmt_phases/var.sh

./buildrmt.sh config 
make -f makefile.hpux11-pa20
# or
./buildrmt.sh make

For rspcert, I had to:
make -k -f makefile.solspv8p

make -f makefile.solaris-usparc-cc testall 2>&1 |less

... purify build implies -debug

Contents


4.3.18 SpamBayes


First, create a SpamBayes database, by running 
 sb_filter.py -n

Training:

sb_mboxtrain.py -g Eracom -g Eracom/openssl-dev -g
Eracom/openssl-users -g Erika -g inbox -s trash

Files:

.procmailrc:

:0 fw:hamlock
| /usr/bin/sb_filter.py

:0
* ^X-SpamBayes-Classification: spam
Mail/junk/.

.spambayesrc:

[Storage]
persistent_use_database = True
persistent_storage_file = ~/.hammiedb

.hammiedb: is the database

Need sylpheed-claws for definable filters extension - or use
procmail?

Contents


4.3.19 SSH


create keys with 
	ssh-keygen -t rsa

copy .ssh/id_rsa.pub to .ssh/authorized_keys at remote end

make sure home directory is 0700!!

Contents


4.3.20 Subversion


Mebbe look at esvn, rapidsvn (appears to be lame)

Making a feature branch (for the dd):

TAG=dd_aix_eeh
MSG="blah blah"
REPO=svn://dixie/eracom/devel
NEWDIR=$REPO/features/$TAG

svn mkdir $NEWDIR -m "$MSG directory"
svn mkdir $NEWDIR/prod -m "$MSG directory"
for i in csa8k common ethsm dist doc bin include Makefile.arch Makefile.mak
do
    svn copy $REPO/trunk/prod/$i $NEWDIR/prod -m "$MSG"
done

cd ~/work/prod
mkdir $TAG
cd $TAG
svn checkout $NEWDIR/prod

Merge from HEAD into a branch:

svn status -v objlistu.mak ... gives the last commted revision in 2nd field:
             1348      148 adriant      objlistu.mak

Then apply the differences between 2 versions to the wc
svn merge -r 148:HEAD $REPO/trunk/prod/cprov/libsrc/pkcs11/objlistu.mak
svn commit objlistu.mak

Sheesh!

Find out the BASE revision of the current branch:
svn log --verbose --stop-on-copy

Contents


4.3.21 swig


cd <where km.h lives>

km.i:
%module km
%{
/* Includes the header in the wrapper code */
#include "km.h"
%}
 
/* Parse the header file to generate wrappers */
%include "km.h"

swig -python km.i
gcc -c km_wrap.c -I /usr/include/python2.5 
ld -shared -rpath "`cd ../lib;pwd`" -L ../lib -lkmclient_shared -o _km.so km_wrap.o

Install module - where?

python
>>> import km
>>> km.R_KM_init


Contents


4.3.22 valgrind


valgrind --show-reachable=yes --leak-check=full <program> <options>

Contents


4.3.23 VIM


:syntax off

:set background=dark (before :syntax enable)
:colorschemes 

blue - blue background
elflord - quite readable
koehler - ditto
pablo - ditto
ron - ditto

Windowing:
^ws		split
^wV		split vertically
^wn		new
^wq		quit
^wc		close current
^wj		next window down
^wh		next window left
^wl		next window right
^wk		next window up
^w=		all equal size
^w-		smaller
^w+		bigger

:hid[e]		hide current window
:on[ly]		only 1 window
:ls!		list all buffers
:[N]b[uffer]	edit buffer N
:sp[lit] 	[file]

:make		run make and jump to error
:cn		goto next error
:cN		goto prev error

gd		goto definition
^p,^n		word completion

vimdiff commands:
]c [c 		find next/prev difference
dp		put the text from this pane to the other
do		get the text from the other pane to this one
:set noscrollbind
		to stop the panes from scrolling together

:<range>s/pattern/subs/flags where flags are:
c confirm
g global on the line
i ignore case
I don't ignore case

If you get <Up> <Down> at : or / prompts then vim has had history compiled out - try :history


Contents


4.3.23.1 gvim

To enable UTF-8 viewing, set guifont and guifontwide: 
 :set guifont=-misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1
 :set guifontwide=-misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1
 
 note: to find out which fonts you can use, please read the UTF-8 help:
 :h utf-8

 Then, set read encoding to UTF-8:
 :set encoding=utf-8

Contents


4.3.24 VMWare license codes


Use this for VMware server: 99H8R-YAWAK-2CL1M-4C5V0

Serial Numbers for VMware ESX Server 2, 2-Processor:
40JRR-ZK14H-F85N5-4V4UW

Serial Numbers for VMware Workstation 5 (for Linux operating systems):
6008N-E238G-RAKFJ-4J1CJ

Serial Numbers for VMware GSX Server 3 for Linux, 2 Processor:
48589-3FA0K-9C070-482FD

Serial Numbers for VMware GSX Server 3 for Windows, 2 Processor:
40489-36U6K-8DN23-4C57N

Serial Numbers for VMware Virtual SMP 2-way, for ESX Server, 2-Processor:
42HUW-ZH405-GGPU3-43P18

Serial Numbers for VMware Workstation 5 (for Windows operating systems):
6AM84-ED60Y-PG463-4R7L5

Serial Numbers for P2V Assistant 2, Enterprise Edition:
3A4KN-14AFU-N22CL-5AQ24

VMTN Support Code:
7AMU4-U6VD3-0XT1K-2FWXL

VMware(TM) Workstation 5 (for Windows operating systems)
684AH-F0M2U-KD5G2-415R5

VMware(TM) Workstation 5 (for Linux operating systems)
6800H-E2MD2-R1MCN-42N2X 

vmware server 2.0.0:
Serial Number for Windows: 98DF1-RDX4K-K5QDH-4RNJT
Serial Number for Linux: 9AXF4-R69D2-JEQ4N-4H4JR



Contents


4.4 Broadband


BigPond cable is faster - up to 6mbps = 600kBps - but needs
special cable modem - can be with BigPond's own wireless router -
$399 professional install? $60/m unlimited. Also, DLINK have the
DI804 which has a login client for BigPond and Optus.
http://www.dlink.com.au/products/routers/di804/ available from
OzCableGuy amongst others: http://www.ozcableguy.com/dlink.html

Optus claim to be "100 time faster than 28.8kbps dialup modem -
2880kbps = 288kBps = 0.288mBps = 2.88mbps" According to
http://members.optusnet.com.au/djalexm/speedtest/ I am getting
1.7mbps
http://www.agnitek.com/performance/speed2.html gave 581kbps

bigpond: http://bc.whirlpool.net.au/bc-isp.cfm?id=1&s=1

TPG is best value ADSL - unlimited/256kbps at $50/m - but you
must change to Telstra ADSL!
http://bc.whirlpool.net.au/bc-isp.cfm?id=18


TPG: http://whirlpool.net.au/faq-ab.cfm#5.3.2


Do any hardware routers include a built-in BPB Cable login client?
	Yes!

Compex NetPassage 15 series
This unit gives you the ability to share a single broadband internet access account with up to 253 computers. It features a NAT firewall for security, a DHCP server for easy computer configuration, packet filters, port forwarding, and a built-in five port hub (the 15a model has a four port switch). As noted, built-in is a reliable cable login client appropriate for the BigPond Broadband network, which simply works, and automatically re-connects after network outages.

--- About: http://www.compex.com.sg
--- Firmware: http://www.compex.com.sg/...prod_list.pl?965374211
--- Review: http://whirlpool.net.au/article.cfm/138

D-link DI 804
This router now has BPB-cable compatible firmware. You can download the latest firmware for this router here:

--- About: http://www.dlink.com.au/products/routers/di804/
--- Firmware: http://www.dlink.com.au/tech/drivers/files/internets/di804.htm

Netgear R-series
A built-in login client is included in firmware version 3.26 for Netgear's R-series routers (RT311, RT314, RP114, RO318, MR314). You can download this firmware from Netgear. Also, Fulton.net.au has written a setup guide for the new firmware.

--- About: http://www.netgear.com.au/categories.asp?xrp=4&yrp=12
--- Firmware: http://www.netgear.com.au/telstra_update.asp
--- Guide: http://www.fulton.net.au/cableclient.htm

A few other routers support BigPond Broadband Cable now, but the ones mentioned above are recommended.

DI-614+ appears to have BigPond cable login and wireless. 802.11B
Enhanced $126.72 from OzCableGuy

DI-624 is 802.11g enhanced 108mbs $173.30
DI-624+ is 802.11g 54mbs $137.28
Netgear WGT624 802.11G+ (11/54/108MB) Wireless Router $150.54

nodes:
DWL-G520  802.11G+ (11/54/108MB) XtremeG Wireless PCI Network Card $108.24
DWL-G520+ 802.11G (11/22/54MB) Wireless PCI Network Card $80.52
Netgear WG311T 802.11G+ (11/54/108MB) Wireless PCI Card $108.24

Contents


4.4.1 Optus


For FTP: members.optusnet.com.au. The user ID and password are the
same as those for your email account.

Network Service	Service Settings
Primary Domain Name Server 	211.29.132.12
Secondary Domain Name Server 	198.142.0.51
Domain Name Suffix 	optusnet.com.au
POP3 (incoming) Mail Server 	mail.optusnet.com.au (port 110)
SMTP (outgoing) Mail Server 	mail.optusnet.com.au (port 25)
NNTP (news) Server 	news.optusnet.com.au (port 119)
Time (NTP) Server 	time.optusnet.com.au
WebSpace FTP Server (Host) 	members.optusnet.com.au (port 21)
OptusNet Home Page 	www.optusnet.com.au
Your Email Address 	username@optusnet.com.au
Your WebSpace Address 	http://members.optusnet.com.au/~username

Cable modem is a Motorola SB5100 
IP 192.168.100.1 (not crossover cable!)
Serial Number 	134558421403459602042000
HFC MAC Address 	00:0F:9F:EA:B0:6E
CPE USB MAC Address 	00:11:80:C8:CF:F7
Cable modem tips:
http://homepage.ntlworld.com/robin.d.h.walker/cmtips/

IP address assigned to raita on 19/4/05 was 210.49.127.86 and
cable modem was 210.49.127.1

Netgear router is a Netgear WGT624
IP 192.168.0.1

Theoretical speeds are 10Mbps/256Kbps == 1.25MBps/32KBps

Contents


4.5 Create old-style font information for TrueType fonts


As root:

   1. cd /usr/share/fonts/truetype/ttf-bitstream-vera
   2. mkfontscale
   3. mkfontdir

xset +fp /usr/share/fonts/truetype/ttf-bitstream-vera

Contents


4.6 Dec Alpha


2100:
No DOS floppy utilities available!!!
Press halt at bootup to enter front panel mode
>>>> ecu to run configuration utility - need !ERA100 on a DOS floppy
>>>> boot -fl s to boot single user then run
# bcheckrc 
# ksh -o emacs

dmesg is 'uerf -r 300 -R'

.CFG file ID inside file must be same as filename

Contents


4.7 FreeBSD


Static route:
route add 192.168.254.245 192.168.2.0
also put an entry in /etc/rc.conf:
	route_raita="192.168.254.245 192.168.2.214"
	static_routes="raita"

moused needs -3 option (/etc/rc.conf)

Packaging - pkg_create

Contents


4.7.1 CD Writing


audio on IDE:
cdrecord -v speed=16 dev=2,1,0 -audio -pad  driveropts=burnfree *.wav
(or maybe dev=ATA:x,x,x == DMA? - doesn't work)

data on IDE:
cdrecord -v speed=16 dev=2,1,0 -data driveropts=burnfree *.iso



burncd (fails with I/O error on raita - track fails but fixate works,
invalidating the CD):

audio: burncd -f /dev/acd0 audio file1 file2 file3 fixate

data:
burncd -f /dev/acd0 data file1 fixate

-t: to test-write

Contents


4.7.2 Console

allscreens="80x30" in /etc/rc.conf
To get modes do:
vidcontrol -i mode | grep T

Contents


4.7.3 Crash dump


Use swapinfo to determine the current swap device and use it for
future dumps:

In /etc/rc.conf:
dumpdev="/dev/ad2s1b"

(or use dumpon /dev/ad2s1b)

To prevent a dump:
dumpon off

After a dump, savecore copies the dump from the dumpdev device to
a file vmcore.0 in dumpdir (set in /etc/rc.conf, default /var/crash)

kgdb /boot/kernel/kernel /var/crash/vmcore.0

bhepple@rasam:prod/ $ kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 5cdad0   kernel
 2   14 0xc09ce000 537f0    acpi.ko
 3    1 0xc1d90000 17000    linux.ko
 4    1 0xc1fda000 4f000    e8k.ko

bhepple@rasam:prod/ $ objdump --section-headers $D/e8k.ko | grep text
  4 .text         00003bc4  000025c4  000025c4  000025c4  2**2
                                                ^^^^^^^^

0xc1fda000 + 25c4 = 0xc1fdc5c4

add-symbol-file /mnt/curry/root/home/bhepple/work/prod/freebsd/prod/csa8k/drv/unix/driver/e8k.ko 0xc1fdc5c4

/mnt/raita/guest/work/prod/freebsd/prod/csa8k/drv/unix/driver/e8k.ko

backtrace ... should give e8k symbols

Contents


4.7.4 Documentation


Device driver chapters on:
http://freebsd.active-venture.com/

Kernel source is at:
/usr/src/sys

with drivers in
/usr/src/sys/dev

Contents


4.7.5 DVD


Good notes:
http://networking.ringofsaturn.com/Unix/FreeBSD-Burning.php

Contents


4.7.6 Firewall

http://www.fwbuilder.org

http://renaud.waldura.com/doc/freebsd/firewall/

Contents


4.7.7 gdm etc


Make an entry in /etc/ttys !!!

Contents


4.7.8 graphical startup with [gkx]dm


Edit /etc/ttys and add a line like this:

ttyv8 "/usr/local/bin/kdm -nodaemon" xterm on secure

Contents


4.7.9 idli (FreeBSD on vmware)

check hostname in /etc/rc.conf and re-boot if changed
run vmare.config after boot
disable firewall: sh /etc/rc.firewall open
ssh keys?

Contents


4.7.10 Kernel build


cd /usr/src/sys/i386/conf
cp GENERIC RAITA

Now edit RAITA and copy somewhere safe

cd /usr/src
make buildkernel KERNCONF=RAITA
make installkernel KERNCONF=RAITA

Recovery boot:

when the system counts down from 10 at the boot menu. Hit any key
except for the Enter key, type unload and then type 

	boot /boot/kernel.old/kernel

or the filename of any other kernel 

Contents


4.7.11 Kernel source


Should all be in /usr/src/sys

Install from the CD:

cd /
mount /cdrom
mkdir -p /usr/src/sys
ln -s /usr/src/sys /sys
cat /cdrom/src/ssys.[a-d]* | tar -xzvf -

Contents


4.7.12 Make disc writable

mount -u -w /mnt/ext2fs.4

Contents


4.7.13 Modules

kldload if_ath
kldstat

Contents


4.7.14 Networking


under vmware, find out ip address of vmnet8 with ifconfig -a on raita then open up firewall if necessary

ifconfig lnc0 inet 172.16.233.3 up # raita is 172.16.233.2
netstat -rn
route add default 172.16.233.2

or
dhclient lnc0

or ifconfig_lnc0="dhcp"

To use ath0 as dhcp, it's very easy but 3+ hours to track this down -
nothing in docs but had to put debug into rc.conf!!

put 'if_ath_load="YES"' in /boot/loader.conf 
put 'ifconfig_ath0="dhcp"' in /etc/rc.conf

or manually:

killall dhclient
kldload ath
ifconfig ath0 192.168.0.18
ifconfig ath0 ssid Baroona wepmode on wepkey deadb
echo "192.168.0.1" >>/etc/resolv.conf
route add default 192.168.0.1

static route:
route add 192.168.2.214/32 -interface rl0 -cloning

Contents


4.7.15 NFS & Automount


showmount -e dux

Put this in /etc/rc.conf:
amd_enable="YES"

deamon is amd

NFS mounts appear magically in /host/dux/eracom etc

Contents


4.7.16 nvidia


Need kernel sources installed

cd /usr/ports/x11/nvidia-driver
make install
see work/doc/README

change /etc/X11/xorg.conf to use nvidia driver instead of nv

Contents


4.7.17 Permission to su


User must be a member of wheel group

See /etc/devfs.conf for setting permissions on devices. Maybe add yourself to operator group.

# Commonly used by many ports
link    acd0    cdrom
link    acd0    dvd
perm    acd0    0660
perm    cd0     0660
perm    pass0   0660
perm    pass1   0660
perm    pass2   0660
perm    pass3   0660
perm    xpt0    0666

Contents


4.7.18 Ports & packages


Packages are binary
ports are source

To avoid dialogs:
export BATCH=yes

See /var/db/pkg for database of installation
See sysinstall


Contents


4.7.18.1 Packages

supported on default install
much quicker but no chance to optimise:

fetch url
pkg_add lsof-4.5.4.tbz
pkg_add -r lsof # gets via fetch(3) - PACKAGESITE=url to override mirror
PACKAGESITE=http://mirror.pacific.net.au/FreeBSD/ports/i386/packages-5.4-release/ pkg_add -r www/firefox-1.0.3,1.tbz

or:
PACKAGESITE=http://mirror.pacific.net.au/FreeBSD/ports/i386/packages-5.4-release/All pkg_add -r firefox-1.0.3,1.tbz

Maybe also PACKAGEROOT An example setting would be "ftp://ftp3.FreeBSD.org"

pkg_info -a |less # shows all packages
pkg_info -v xzgv\*
pkg_info -L # shows files
pkg_info -W <filename> # which package is file in
pkg_delete or pkg_deinstall (better?)
pkg_version or portversion (better?)

Contents


4.7.18.2 Ports
To find ports:
cd /usr/ports
make search name=lsof

/usr/ports/INDEX-* are indexes of the ports (for quick access?)
or look at http://www.FreeBSD.org/ports or http://www.FreshPorts.org
or http://www.tummy.com/journals/entries/scott_20050427_124833

To install a port, eg lsof:

cd /usr/ports/sysutils/lsof
CD_MOUNTPTS=/usr/home/cd1 make
 Or
FORCE_PACKAGE_REGISTER=YES make install # installs from the internet
 Or
make deinstall

Most usually:
make config
make all install clean

portsclean to cleanup

To update to the latest set of ports:

csup -g -L2 /root/ports-supfile 

# ports-supfile is customised from the example
# in /usr/share/examples/cvsup/ports-supfile

Contents


4.7.18.3 portupgrade

Or (!) use portupgrade eg. 

pkgdb -F 
# oddly for its name, this program is in portupgrade, not base - but
# it updates the portupgrade files, not /var/db/pkg

pkg_version -v # to see what can be updated (from base)
portsdb -uU # updates /usr/ports/INDEX* - run after csup
portupgrade -aRy # to make it all up to date (emerge -u world?)
portupgrade -Rr firefox
portinstall == portupgrade -N
portversion -L = # ???

May need to add FORCE_PKG_REGISTER=yes to get packages to install

add --batch to stop questions

Try the following (this is safe):

1. Regenerate the ports index files (also make sure your ports
collection is up to date before doing this):
    > rm /usr/ports/INDEX*
    > portsdb -Uu
2. Regenerate the package database:
    > rm /var/db/pkg/pkgdb.db
    > pkgdb -u

Contents


4.7.18.4 portmanager

To see which installed ports have available updates, run

     portmanager -s | grep OLD

begin the update with

     nice -n20 portmanager -u

CVS source update:

     cvsup -L0 /usr/local/etc/cvsup/cvsupfile

  Kernel:

     cd /usr/src
     make buildkernel KERNCONF=FOO
     make installkernel KERNCONF=FOO
     cd /boot
     cp -R kernel.old kernel-`uname -r`
     shutdown -r now
     rm -rf /usr/obj/*

  Base System:

     tar cjvf /root/snapshot-etc-`date '+%Y%m%d'`.tar.bz2 /etc
     cd /usr/src
     make buildworld
     make buildkernel KERNCONF=FOO
     make installkernel KERNCONF=FOO
     cd /boot
     cp -R kernel.old kernel-`uname -r`
     cd /usr/src
     mergemaster -p
     make installworld
     mergemaster
     shutdown -r now
     chflags -R noschg /usr/obj/
     rm -rf /usr/obj/*

  Ports:

     portmanager -s | grep OLD
     screen
     portmanager -u


* portmanager -u -ip editors/nedit editors/openoffice                 
*                                                                     
* upgrades everything except nedit,open office and their dependencies 
*                                                                     
* portmanager -sl will show you leaf ports, these are safe to remove  
*                                                                     
* portmanager -slid will let you safely remove leaf ports             
*                                                                     
* see man portmanager(1) or http://portmanager.sunsite.dk             
*

also, pkg_cutleaves to remove unused ports.

Run pkgdb -F to update database before doing above.

Contents


4.7.18.5 portmaster

Pure sh script without database version of /var/db/pkg

http://dougbarton.us/portmaster.html
ports/ports-mgmt/portmaster

Contents


4.7.18.6 portaudit

checks for vulnerabilities & blocks installation

# to fetch the portsaudit list:
portaudit -Fda

Contents


4.7.19 rc.d startup scripts


/etc/rc.d contains the scripts
Startup control is in /etc/rc.conf eg:

sshd_enable="YES"

Contents


4.7.20 SCSI

Advansys driver is adv

To see devices available:
camcontrol devlist

To recognise devices not powered on at boot:
camcontrol rescan

cdrecord -scanbus needs root access to /dev/xpt0 - the CAM layer, shows:

bhepple@raita:bhepple/ $ root cdrecord -scanbus
Cdrecord-Clone 2.01 (i386-unknown-freebsd5.3) Copyright (C) 1995-2004 Jörg Schilling
Using libscg version 'schily-0.8'.
scsibus1:
        1,0,0   100) *
        1,1,0   101) *
        1,2,0   102) *
        1,3,0   103) 'Nikon   ' 'LS-1000         ' '1.06' Scanner
        1,4,0   104) 'UMAX    ' 'Astra 610S      ' 'V1.3' Scanner
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) *
scsibus2:
        2,0,0   200) *
        2,1,0   201) 'OPTORITE' 'DVD RW DD0405   ' '140E' Removable CD-ROM

Running xsane as root shows coolscan at /dev/pass0 and astra at /dev/pass1

chmod a+rw /dev/pass[01]
xsane umax:/dev/pass1 work

Also, changing /usr/local/etc/sane.d/umax.conf for /dev/pass1 works

Contents


4.7.21 The Canonical Way to Update Your System


To update your system, you should check /usr/src/UPDATING for any pre-buildworld steps necessary for your version of the sources and then use the following procedure:

cd /usr/src
make update
make buildworld
make buildkernel
make installkernel
reboot ... to single user mode

    Note: There are a few rare cases when an extra run of mergemaster -p is needed before the buildworld step. These are described in UPDATING. In general, though, you can safely omit this step if you are not updating across one or more major FreeBSD versions.

After installkernel finishes successfully, you should boot in single user mode (i.e. using boot -s from the loader prompt). Then run:

mergemaster -p
make installworld
mergemaster
reboot

Contents


4.7.22 truss (strace ==)


Requires /proc/mem from procfs:

bash-2.05b# kldload procfs
kldload: can't load procfs: File exists
bash-2.05b# mount_procfs proc /proc

Contents


4.7.23 Tuning


http://silverwraith.com/papers/freebsd-tuning.php
http://silverwraith.com/papers/freebsd-kernel.php

Contents


4.7.24 USB


dmesg |grep uhub to see what sort of bridge - uhci/ehci/ohci

usbdevs

Contents


4.7.24.1 Printer

USB printer is /dev/ulpt0

Contents


4.7.24.2 USB sticks

device is /dev/da0 (check dmesg for actual)

mount -tmsdos /dev/da0s1 /mnt/stick

Contents


4.7.24.3 Camera

Contents


4.7.25 Wireless


wicontrol == iwconfig + iwlist

eg wicontrol -i ath0

Contents


4.8 HP-UX


To boot dev system: 
	BOOT 0/0/1/1.15
To Boot test system:
	BOOT 0/0/2/1.15

For driver development:
	B.11.11 needs ?
	B.11.23 needs ddk11_23.1.0.depot

/usr/sbin/sam
/sbin/set_parms addl_network

Build a package:
swpackage -s ${PKGNAME}.psf -x media_type=tape @ $DEPOT

Install a package:
swinstall -s fullpath/filename productname

install files are .depot - see SD-UX 
productname can be \\*

List files in package:
swlist -l file -s /full-path/depot_file

List details of package:
swlist -v -s /full-path/depot_file

Find Eracom packages:
swlist | grep ERAC

Remove package:
swremove ERACjpsdk

No rsh = remsh - CVSRSH

cd rom is /dev/dsk/c2t1d0

Single user mode: interrupt boot by pressing a key within the 10
secs timeout. Then enter BOOT and answer yes to IPL. Then enter
'hpux -is' to boot to single user.

Remove DLKM: remove e8k entries from /stand/dlkm/[system.d,mod.d]
Remove e8k entry from /stand/dlkm/mod_register. reboot or init 3.

Crash debugger
cd /var/adm/crash
q4 crash.X
examine &msgbuf+8 using s
Debugger is wdb (front end to gdb - gdb alone also works)
package scripts go in:
/var/adm/sw/products/ERACcpsw/pfiles

The files required for HP-UX are:
master - provides the driver name, version info and type
system - provides additional parameters
mod.o - the driver itself
The utilities to install the driver are as follows:
kmadmin -U e8k ... removes driver from the OS
kminstall -d e8k ... removes control files and binary
kminstall -a e8k ... adds the driver to the OS file system area
kmsystem -c Y -l Y e8k ... marks driver as CONFIGURABLE and LOADABLE
config -M e8k -u ... updates the running kernel to include the new driver
kmadmin -L e8k ... loads the driver; calls the driver's load method
ioscan ...scans IO, assigns drivers to boards, calls driver's attach method

To load the module at boot time, add an entry in /etc/loadmods

List the driver:
kmadmin -s ...shows all modules in the system (must be root)
kmadmin -S ...same but gives full details! (must be root)

To make dev files:
	MAJ=`lsdev -h -d e8k |awk '{print $1}'`
	echo "Major device number = $MAJ"
	[ -n "$MAJ" ] && for i in 0 1 2 3; do 
	    rm -f /dev/e8k$i
	    echo "Creating /dev/e8k$i"
	    mknod /dev/e8k$i c $MAJ $i
	done

To remove the driver from the system:
rm /dev/e8k[0123]
kmadmin -U e8k
kminstall -d e8k

Compilers are at:
	ftp://nova210.external.hp.com/SOFTWARE/COMPILERS
	

Note - depots compiled on hppa wil install on Itanium. But will
they run?

Downloads:
	http://h21007.www2.hp.com/dspp/dld/dld_DownloadsHomePage_IDX/1,2380,,00.html
	http://hpux.connect.org.uk

Getting to single user:
	Get to HPUX> prompt then "boot -is vmunix"

Expand LVM:
	# See what physical partition we need:
	mount |grep /opt
	umount /opt
	lvextend -L 4000 /dev/vg00/lvol6
	extendfs /dev/vg00/lvol6
	mount /dev/vg00/lvol6 /opt

LD_LIBRARY_PATH equivalent is SHLIB_PATH

User forum: http://forums1.itrc.hp.com/service/index.html

Contents


4.8.1 11i v2 == B.11.23


Kernel modules load is now:

	kcmodule e8k=loaded

Unload:
	kcmodule e8k=unused

Info:
	kcmodule -v e8k
	kcmodule # all modules

May need mod_systemfile in postinstall and preremove scripts

To backup a kernel:
	kconfig  -s

Contents


4.8.2 64-bit support


compiler option: +DD64 or +DA2.0W
+compat for 32-bit style eg SHLIB_PATH behaviour etc
+std for 64-bit style

What mode the kernel is in:
getconf KERNEL_BITS # hpux returns 64
  or
file /stand/vmunix # ELF-64 (64-bit) or PA-RISC (32-bit)

Is machine capable of 32 and 64 bit mode?
getconf HW_32_64_CAPABLE # hpux returns 1

What is machine model?
getconf MACHINE_MODEL # hpux retuns 9000/800/A500-6X
 also:
model # hpux returns 9000/800/A500-6X

See also sysdef(1M)

64-bit libraries are in /lib/pa20_64:
{bhepple@hpux:pa20_64/}:$ file libc.*
libc.2:         ELF-64 shared object file - PA-RISC 2.0 (LP64)
libc.a:         archive file
libc.sl:        ELF-64 shared object file - PA-RISC 2.0 (LP64)
{bhepple@hpux:pa20_64/}:$ ll libc.sl
lrwxr-xr-x   1 root       root             8 Dec  9  2002 libc.sl@ -> ./libc.2

Programs:

file /usr/local/pa*/gcc:

pa11_32/bin/gcc:        PA-RISC1.1 shared executable dynamically linked -not stripped
pa20_32/bin/gcc:        PA-RISC2.0 shared executable dynamically linked -not stripped
pa20_64/bin/gcc:        ELF-64 executable object file - PA-RISC 2.0 (LP64)

Now, what about Itanium vs HP-PA - have to wait until ita is
up. Note that Java SDK (j2se) is distributed as separate packages
for Integrity and PA-RISC-2.

Contents


4.8.3 HP-UX Versions


11i v1.0 == B.11.11 ... HP-PA only 06/00, 06/01, 09/01, 12/01
11i v1.5 == B.11.20 ... Itanium 06/01
11i v1.6 == B.11.22 ... HP-PA??? & Itanium 06/02
11i v2.0 == B.11.23 ... HP-PA & Itanium 09/03

Contents


4.8.4 ita


/dev/vg00/lvol5 was mounted to /home - now available

Expanded /opt & /usr to 4Gb

CD/DVD is /dev/dsk/c2t0d0 eg.

mount -F cdfs /dev/dsk/c2t0d0 /SD...

Contents


4.8.5 pfs filesystem


maps is09660 filenames correctly (ordinary mount - cdfs - does
not)

pfs_mountd &
pfsd &
pfs_mount /dev/rdsk/c2t1d0 /cdrom

On ita: /dev/dsk/c2t0d0

Contents


4.8.6 Shared libraries:


cc -b -o sub1.o -c sub1.c
ld -b sub1.o  -o libsub1.sl
cc -o t -L. -lsub1 t.c -ldl

... fails to find dlopen etc. -ldld doesn't help.

See http://docs.hp.com/en/1405/options.htm and 
http://docs.hp.com/en/7762/5991-4874/options.htm

Hide all except named entrypoints:
+e ep1 +e ep2 etc... or put them into a file "exports.exp" and
include on the command line "-c exports.exp"

To build exports.exp from a imple list exports.list:
.SUFFIXES: .list .exp
.list.exp:
	sed 's/^/+e /' < $< >$@

Contents


4.8.7 Software sources


Try "HP DSPP Developer Edge" at http://software.hp.com

Contents


4.9 Identify remote system


telnet IP 80 (or maybe 8080)
get

Contents


4.10 Installation checklist


network
	static route to 192.168.4
	resolv.conf
	hosts
	hosts.equiv
	enable root logon remote tty (/etc/default/login)
	automountd - /etc/auto_home

NIS
	nsswitch
	ypinit -c

CVS
C/C++
Java
gmake
less	(needs ncurses)
gzip
bash
	.bash_profile for root
	.bashrc for root
m4

root

patches
	cd /tmp
	gunzip /mnt/cd/files/2.6_Recommended.tar.gz
	tar xvf 2.6_Recommended.tar
	cd 2.6_Recommended.tar.gz
	./install_cluster

documentation

Contents


4.11 Languages


Contents


4.11.1 bash


Quick Reference: http://tldp.org/LDP/abs/html/refcards.html





Contents


4.11.1.1 Prompting for input with readline

... and providing a default value

# prompt for a single line of input and return the result in ANS
# $1 = default - to be pushed into the readline history (or "")
# $@ = prompt
# returns answer in ANS
prompt() {
	ANS=""
	DEFAULT="$1"
	shift
	PROMPT="$@"
	shift
	
	if [ "$DEFAULT" ]; then
		TMP=/tmp/$$.tmp
		echo "$DEFAULT" > $TMP
		history -r $TMP
		rm -f $TMP
		PROMPT="$PROMPT [use 'up' key for $DEFAULT]"
	fi

	PROMPT="$PROMPT: "
	read -p "$PROMPT" -e ANS
}

Contents


4.11.1.2 ! arguments
!! last command
!* all arguments except the first (ie the command) == !:1-$
!:n the nth argument (0 base)
!:$ the last argument

Contents


4.11.1.3 ${} variants
${VAR:-word} use VAR if set and non-NULL otherwise use 'word'
${VAR:=word} same but set VAR to 'word' if VAR is unset or NULL
${VAR:?} gives an error if VAR is not set
${VAR:+word} use word if VAR is non-NULL; otherwise use NULL
${VAR:offset:length} substring - length < 0 means start at end. If VAR is an array name indexed by * or @ then it returns length elements starting at offset. (bash-2.0)
${!prefix@} the list of variables that start with prefix (can use *) (bash-2.04)
${#VAR} the length of VAR
${VAR#pattern} remove (glob) pattern from the start of VAR. ## means longest match.
${VAR%pattern} remove (glob) pattern from the end of VAR. %% means longest match.
${VAR/pattern/string} pattern substitution. Pattern starting with # anchors to the start; starting with % anchors it to the end. Pattern starting with / matches all occurances. (bash-2.0) 

${!VAR} is indirect variable (bash-2.0) (\$$VAR or \${$VAR} for bash-1.x)

Contents


4.11.1.4 ARRAYS
are zero based
bash-2.0

VAR=( a b c d )
VAR[0]="something"
Dereference with ${VAR[0]} - or ${VAR[@]} for all at once

${#VAR[@]} is the size of the array but
${#VAR} is the size of the first element!!!

To add to the array:
VAR[${#VAR[@]}]="something" ! sheesh

or

VAR=( ${VAR[@]} foobar )

Contents


4.11.1.5 (( ))

bash-2.04

for (( expr1 ; expr2 ; expr3 )) ; do list ; done
eg. for (( N=400; N<=415; N++ )); do echo $N; done

$((expr)) is evaluated as arithmetic eg $(($n + 1)) (bash-2.0)

Contents


4.11.1.6 [[ ]]

bash-2.02

Same as  [ ] except:
== != match against a bash pattern

=~ matches against a regexp (bash-3.0) 
If RHS is quoted then =~ matches against it as a STRING (bash-3.1)

Can use && and ||
octal & hex numbers are evaluated correctly
192.168.18.60

Contents


4.11.1.7 Ranges

Easiest is to use seq:

for N in `seq 400 415`; do ...; done

for N in {400..415}; do ... ; done

for (( N=400; N<=415; N++ )); do ... done

Contents


4.11.1.8 Boilerplate

#!/bin/sh

# Copyright 2008 Bob Hepple
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

PROG=`basename $0`
TMP="/tmp/tmp$$.tmp"

trap "/bin/rm -f $TMP" EXIT 

usage() {
  echo "Usage: $PROG [-h] "
  echo "foo bar"
  echo "Options:"
  echo "  -h, --help: this help"
}

LONG_GETOPT=""
case `uname` in
	[lL]inux) 
	LONG_GETOPT="yes"
	break
	;;
esac

if [ "$LONG_GETOPT" ]; then
	TEMP=`getopt -o h --long help -n '$PROG' -- "$@"`
else
	TEMP=`getopt h "$@"`
fi

if [ $? != 0 ]; then
	exit 1
fi

eval set -- "$TEMP"
while true ; do
	case $1 in
		-h|--help) usage; exit 0;;
		--) shift; break;;
		*) echo "Internal error!" ; exit 1 ;;
	esac
done

if [ $# -gt 0 ]; then
	cd $1
	[ $? -ne 0 ] && exit 1
fi

exit 0

Contents


4.11.1.9 Profiling

Put this at the start of code to profile:
Maybe add an empty loop to calculate an approx baseline.
Something internal to bash to get the time instead of executing `date`?

shopt -s extglob
set +x
START=`date +%s.%N`
START_S="${START%.*}"
START_N="${START#*.}"
# remove leading 0's as they infer an octal number:
# this is what needs the extglob:
START_N="${START_N##+(0)}"
LAST_S=$START_S
LAST_N=$START_N
echo "timings: clock started" >&2

elapsed() {
    set +x
    NOW=`date +%s.%N`
    NOW_S="${NOW%.*}"
    NOW_N="${NOW#*.}"
    # remove leading 0's as they infer an octal number:
    NOW_N="${NOW_N##+(0)}"
    TOTAL_N=$(( (NOW_S - START_S) * 1000000000 + NOW_N - START_N ))
    ELAP_N=$(( (NOW_S - LAST_S) * 1000000000 + NOW_N - LAST_N ))
    echo "timings: $TOTAL_N $ELAP_N" >&2
    LAST_S=$NOW_S
    LAST_N=$NOW_N
    set -x
}

trap "elapsed >&2" DEBUG 
set -x

Contents


4.11.1.10 += operator

bash-3.1

A="asd"
A+="fds"

Contents


4.11.2 C


Reformatted for gjots from the original Psion files C_langauge.s5
and C_functions.s5 from
http://3lib.ukonline.co.uk/pocketinfo/index.html

by 

Bob Hepple bhepple@freeshell.org Nov 2002

To output the macro currently defined on GNU CC:

cpp -dM /dev/null

Contents


4.11.2.1 C Language

Contents


4.11.2.1.1 arithmetic operators
-	subtraction, unary minus
+	addition
*	multiplication
/	division
%	modulus division (returns remainder of integer division)
--	decrement
++	increment

Contents


4.11.2.1.2 arrays

Arrays of any datatype may be declared, with multiple dimensions.
The general form of a single dimension array is:

type varname[size];

Where size specifies the number of elements in the array varname
of objects of type type. The elements of the array are numbered
from 0 to size-1.

Elements are accessed using the element number is square
brackets, e.g. the following code sets the ninth element of array
a to 1:

a[8] = 1;

Multidimensional arrays are created by specifying additional
dimensions in additional square brackets, e.g. to declare a 7 by
10 integer array:

int a[7][10];

Remember that no bounds checking is done, and reads or writes out
of bounds are likely to cause memory violations or corruption.

Contents


4.11.2.1.3 assignment operators

The normal assignment operator is the equals sign (=).

Shorthand can be used to apply an operation to a variable, and
leave the result in that variable, for the general form:

a = a op ...
a op= ...

For example:

x += 5		is	x = x + 5
x /= a+1 	is	x = x / (a+1)

Contents


4.11.2.1.4 bitwise operators

&	and
|	or
^	xor
~	complement
>>	right shift (sign bit extended)
<<	left shift (sign bit overwritten)

Contents


4.11.2.1.5 comma operator

Evaluates several steps, and returns the result of the last, e.g.

a = 20;
b = (a=a+5, a/5);

After this, a = 25 (20 + 5), and b = 5 (25 / 5).

This is most often used in for statements.

Contents


4.11.2.1.6 constants

Constants can be specified for any of the basic datatypes as in
the following examples:

int		1, 342, 25000, -3186
long int	40000L, 212326L, -37642L
short int	5, 54, -63
unsigned int	10000U, 428U, 40000
float		1.24F, 3.24e6F, -45.98F
double		1.427, 1246.792, -0.063, 3.23e8
long double	138.538L, -63.3561L
char		'A', 'b', '='

Contents


4.11.2.1.7 octal and hexadecimal

Octal constants are specified by giving them a leading zero, for
example:

012 ten      043 thirty-five

Hexadecimal constants have a leading 0x, for example:

0xA ten     0x23 thirty-five

Contents


4.11.2.1.8 pointer operators

The & operator returns the address of a variable, e.g. a = &var

The * operator sets the variable at the specified address, e.g.
*a = 1. This uses the type of the pointer to determine how to set
the variable.

Pointers can have integer values added and subtracted; the
specified value is multiplied by the size of the type to
determine the actual change in the pointer. For example,
incrementing a pointer to double adds 8 bytes.

Contents


4.11.2.1.9 relational operators

==	equal
!=	not equal
>	greater than
>=	greater than or equal
<	less than
<=	less than or equal

&&	and
||	or
!	not

Contents


4.11.2.1.10 special characters

Special backslash constructs can be used in character and string
constants to represent characters which cannot be entered from
the keyboard:

\a		alert
\b		backspace
\f		form feed
\n		newline
\r		carriage return
\t		horizontal tab
\v		vertical tab
\"		double quote
\'		single quote
\0		null
\\		backslash
\0n		Octal constant
\xn		Hexadecimal constant

Contents


4.11.2.1.11 strings

Strings are not an explicit builtin datatype in C, but are
supported in the libraries as zero terminated arrays of
characters.

String constants can be specified using double quotes, so the
string hello world can be specified as "hello world", which will
be compiled as an array of 12 characters the last one being a
zero byte.

Contents


4.11.2.1.12 struct & union operators

The . (dot) operator accesses structure/union members from the
actual structure, e.g.

person.age = 21;

The -> (arrow) operator accesses structure/union members from a
pointer to the structure, e.g.

perptr->age = 21;

Contents


4.11.2.1.13 ternary (?) operator

Replaces if statements of the general form:

if exp1 then x=exp2 else x=exp3;

with the form:

x = exp1 ? exp2 : exp3;

Contents


4.11.2.1.14 Precedence

The follow is the order of precedence, from highest to lowest,
for the C programming language:

Operator 	Associativity
Left ==> Right: (expr) [index] -> . ! ~ ++ -- (type) sizeof
Right <== Left: Unary operator: + - * & 	
Left ==> Right: * / % 	
Left ==> Right: + - 	
Left ==> right: << >> 	
Left ==> Right: < <= > >= 	
Left ==> Right: == != 	
Left ==> Right: Binary operator:    & 
Left ==> Right: Binary operator:    ^ 
Left ==> Right: Binary operator:    | 
Left ==> Right: && 	
Left ==> Right: || 	
Right <== Left: expr ? true_expr :  false_expr 
Right <== Left: += -= *= /= <<= &= ^= |= %= >>= = 
Left ==> Right: , 	

Unary operator:

    Unary
    Operator 	Example
    + 	+23209
    - 	-value
    * 	*pointer
    & 	&variable

Binary operator :

    Binary
    Operator 	Example
    & 	terrance = 0xCC; phillip = 0xAA;
    (terrance & phillip) == 0x88;
    ^ 	right = 0xF0; wrong = 0xCC;
    (right ^ wrong) == 0x3C;
    | 	curds = 0x99; whey = 0x96;
    (curds | whey) == 0x9F;

Contents


4.11.2.1.15 #

Turns the argument it precedes into a quoted string, used in
macro definitions.

#define mkstr(s) # s

mkstr(hello) = "hello"

Contents


4.11.2.1.16 ##

Concatenates two tokens, used in macro definitions.

#define concat(a,b) a ## b

concat(x,y) = xy

Contents


4.11.2.1.17 #define

Performs macro substitutions of one piece of text for another.

#define name replacement

The replacement sequence is terminated only by th end of the
line; note especially that a semicolon does not terminate the
sequence. Definition of macros can also be done as options to the
compiler.

The macro can also have arguments, for example:

#define MAX(a,b) ((a)>(b) ? (a) : (b))

Variadic arguments are also possible, eg:

#define eprintf(format, ...) fprintf (stderr, __VA_ARGS__)

eprintf("value = %d\n, i) expands to
fprintf(stderr, "value = %d\n, i);

Contents


4.11.2.1.18 #error

Stops compilation and displays the line number and specified
error message.

#error Shouldn't have reached here!

Contents


4.11.2.1.19 #if

Conditionally compiles a section of code.

#if constant-expression
code...
#elif constant-expression
other code...
#else
more code...
#endif

The constant expression typically contains macros passed as
options to the compiler, e.g.

#if DBGLVL==1
debugging code...
#elif DBGLVL=2
more debugging code...
#endif

Contents


4.11.2.1.20 #ifdef

Work as for #if but are true if a macro is defined or not defined
respectively.

Contents


4.11.2.1.21 #include

Reads source from another file.

#include "filename"
#include <filename>

Typically, double quotes causes the file to be searched for in
the current directory and a user defined path, while angle
brackets looks in a system defined path.

Contents


4.11.2.1.22 #line

Changes the contents of __LINE__ and __FILE__.

#line number "filename"

Used for debugging and special purposes, or generated by
pre-processing steps to retain original line numbers. Filename is
optional.

Contents


4.11.2.1.23 #pragma

Implementation defined directive, dependent on the compiler being
used.

Contents


4.11.2.1.24 #undef

Removes a previously defined definition.

Contents


4.11.2.1.25 auto

Declares local variables; entirely optional, hence seldom used.

Contents


4.11.2.1.26 break

Exits from a do, for, or while loop without evaluating the loop
condition. Also used to exit from a switch statement.

Always terminates the innermost loop, regardless of the nesting.

/* print a list up to a zero value */
for (i=0; i<20; i++) {
  if (a[i] == 0) break;

  printf("Value %d=%d", i, a[i])l
}

Contents


4.11.2.1.27 case

See switch

Contents


4.11.2.1.28 char

Data type, used to declare character variables.

Contents


4.11.2.1.29 const

Data type modifier; the variable that follows may not be
modified, but may be given an initial value when declared.

Used in function prototypes to indicate that a parameter will not
be changed.

Contents


4.11.2.1.30 continue

Bypasses remaining code in a loop and forces the conditional test
to be evaluated.

/* print a list skipping zero values */
for (i=0; i<20; i++) {
  if (a[i] == 0) break;

  printf("Value %d=%d", i, a[i])l
}

Contents


4.11.2.1.31 default

Used in a switch statement to indicate the default block of code
if no matches are found.

Contents


4.11.2.1.32 do

Indicates the start of a do { ... } while loop.

Will always have at least one iteration, because the condition is
tested at the end of the loop.

/* read from a file until EOF */
do {
  c = getc(fp);
  save(c);
} while (!feof(fp));

Contents


4.11.2.1.33 double

Data type, used to declare double-precision floating-point
variables.

Contents


4.11.2.1.34 else

See if.

Contents


4.11.2.1.35 enum

Type specifier used to create enumeration types, which are simply
lists of named integer constants.

The first normally has value 0, and each value is one more than
the preceding. Values can be specified.

enum day {mon,tue,wed, thu,fri,sat,sun};
enum day today;

if (today==Mon) {
	/* the start of the week */
}

enum color (red=1,green,blue,white=7,black);
/* red=1, green=2, blue=3, white=7, black=8 */

Contents


4.11.2.1.36 extern

Data type modifier used to indicate variables declared elsewhere;
often used for global variables defined in another module and
available at link time.

Contents


4.11.2.1.37 float

Data type, used to declare floating-point variables.

Contents


4.11.2.1.38 for

Loop allowing automatic initialisation and incrementing of a
counter.

for (i=0; i<10; i++) {
  printf("%d\n", i);
}

Each of the three parts of the for statement can be a number of
statements separated by commas.

for (i=0, j=10; i<10; i++, j--) {
  a[i] = b[j]
}

Contents


4.11.2.1.39 goto

Jumps to the specified label. Can only be used within the current
function.

goto label;
...
...
...
label:

Contents


4.11.2.1.40 if

Conditionally executes a block of code.

if (a==1) {
  printf("a equals one\n");
}
else {
  printf("a doesn't equal one\n");
}

Contents


4.11.2.1.41 int

Data type, used to declare integer variables.

Contents


4.11.2.1.42 long

Data type, used to declare double length integer variables.

Contents


4.11.2.1.43 register

Storage class modifier used to advise the compiler to store the
variable in a CPU register or other fast memory.

Contents


4.11.2.1.44 return

Returns from a function, with a value if the function is not void.

void hello()
{
  printf("Hello\n");
  return;
}

int max(a, b)
{
	return (a>b) ? a : b;
}

Contents


4.11.2.1.45 short

Data type modifier used to declare short integers.

Contents


4.11.2.1.46 signed

Data type modifier used to declare and signed char variable.

Contents


4.11.2.1.47 sizeof

Compile time operator which returns the length of the variable or
type.

struct info myinfo;
memset(&myinfo, 0, sizeof(info));

Contents


4.11.2.1.48 static

Data type modifier indicating the variable should retain its
value between function calls.

Contents


4.11.2.1.49 struct

Defines a structure, a named group of variables.

General form is:

struct tag {
  type var1;
  type var2;
  ...
} var-list;

The tag is the type name of the structure; individual elements
are accessed using the dot when operating on a structure, or the
arrow when operating through a pointer.

struct person {
  char name[50];
  int  age;
  char sex;
} mum, dad;
strcpy(mum.name, "Julia");
mum.age = 50;
mum.sex = 'F';
...

Contents


4.11.2.1.50 switch

Routes execution depending on an integer or character value, with
the option for a default behaviour.

General form:

switch (var) {
  case const1:
    statements 1;
    break;

  case const2:
    statements 2;
    break;
  ...
  case constn:
    statements n;
    break;

  default:
    default statements;
}

Contents


4.11.2.1.51 typedef

Creates a new name for an existing datatype. Often used to create
structure or union datatypes.

typedef int age;
typedef struct person_tag {
  char name[80];
  int  age;
} person;

Contents


4.11.2.1.52 union

Similar to a struct, but the variables use the same memory location.

e.g. the following union:

union tag {
  char c1[10];
  char c2[6];
} a_union;

uses ten bytes of memory:

**********
|   c1   |
| c2 |

Contents


4.11.2.1.53 unsigned

Data type modifier which removes the sign bit of an integer. This
doubles the maximum positive number which can be held, but
prevents negative numbers.

Contents


4.11.2.1.54 void

Used to declare functions which return no meaningful value, and
void pointers which can point to any type of object.

Contents


4.11.2.1.55 volatile

Data type modifier indicating that the variable may be altered by
processes outwith the program. For example, hardware clocks.

Contents


4.11.2.1.56 while

Loop where the condition is tested at the start.

/* copy memory up to not including a zero */
while (*p!=0) {
  *p2=*p;
  p++;
  p2++;
}

Contents


4.11.2.1.57 __DATE__

Predefined macro - compilation date.

Contents


4.11.2.1.58 __FILE__

Predefined macro - current source filename.

Contents


4.11.2.1.59 __LINE__

Predefined macro - line number in current source file.

Contents


4.11.2.1.60 __STDC__

Predefined macro - set to 1 if this is a standard C implementation.

Contents


4.11.2.1.61 __TIME__

Predefined macro - compilation time.

Contents


4.11.2.2 C Functions

Contents


4.11.2.2.1 abort
#include stdlib.h
void abort(void);

Causes immediate abnormal termination of the program; does not
return.

Typically closes but does not flush all open files and other
connections.

Contents


4.11.2.2.2 abs
#include stdlib.h
int abs(int num);

Returns the absolute (positive) value of num.

Contents


4.11.2.2.3 acos
#include math.h
double acos(double arg);

Returns, in radians, the arc cosine of arg, which must be in the
range -1 to 1.

Contents


4.11.2.2.4 asctime
#include time.h
char * asctime(struct tm *ptr);

Returns a pointer to a string representation of the information
in the structure pointed to by ptr, in the form:

day month date hours:minutes:seconds year\n\0

For example:
Thu Oct 28 14:55:20 1999

Note that the buffer used is overwritten by subsequent calls to
the function.

Contents


4.11.2.2.5 asin
#include math.h
double asin(double arg);

Returns, in radians, the arc sine of arg, which must be in the
range -1 to 1.

Contents


4.11.2.2.6 assert
#include assert.h
void assert(int exp);

Writes a message to stderr and aborts execution if the expression
exp is zero.

Output is implementation dependent, but typically looks like this:

Assertion failed: expression, file file, line line

Contents


4.11.2.2.7 atan
#include math.h
double atan(double arg);

Returns, in radians, the arc tangent of arg.

Contents


4.11.2.2.8 atan2
#include math.h
double atan2(double y, double x);

Returns, in radians, the arc tangent of y/x, using the signs of
the arguments to determine the correct quadrant.

Contents


4.11.2.2.9 atexit
#include stdlib.h
int atexit(void (*func)(void));

Registers the function func to be called on normal program
termination.

At least 32 termination functios may be registered, and they will
be called in reverse order of their registering.

Returns zero on successful registration, non-zero otherwise.

Contents


4.11.2.2.10 atof
#include stdlib.h
double atof(const char *str);

Converts the string pointed to by str into a double. If the
string does not contain a valid floating point number, the result
is undefined.

The number can be terminated by any and character that is not
part of a valid floating point number.

Contents


4.11.2.2.11 atoi
#include stdlib.h
int atoi(const char *str);

Converts the string pointed to by str into an int. If the string
does not contain a valid integer number, the result is undefined.

The number can be terminated by any and character that is not
part of a valid integer number.

Contents


4.11.2.2.12 atol
#include stdlib.h
long atol(const char *str);

Converts the string pointed to by str into a long. If the string
does not contain a valid integer number, the result is undefined.

The number can be terminated by any and character that is not
part of a valid integer number.

Contents


4.11.2.2.13 bsearch
#include stdlib.h
void * bsearch(const void *key, const void *buf, size_t num, size_t size, int (*compare)(const void *, const void *));

Performs a binary search on the sorted array buf and returns a
pointer to the first member that matches key, or null if no match
is found.

The number of elements in the array is specified by num, and the
size of each element in bytes is specified by size. The array
must be sorted in ascending order.

The function compare is used to compare an element of the array
with the key, in the following form:

int function(const void *arg1, const void *arg2)

returning:
arg1 < arg2    less than 0
arg1 = arg2    0
arg1 > arg2    greater than 0

Contents


4.11.2.2.14 calloc
#include stdlib.h
void * calloc(size_t num, size_t size);

Allocates num * size bytes of memory from the heap.

Returns a pointer to the allocated memory, or null if allocation
fails.

Contents


4.11.2.2.15 ceil
#include math.h
double ceil(double num);

Returns the smallest integer not less than num.

Contents


4.11.2.2.16 clearerr
#include stdio.h
void clearerr(FILE *stream);

Resets the error flag and end of file flag for the stream pointed
to by stream.

Contents


4.11.2.2.17 clock
#include time.h
clock_t clock(void);

Returns the amount of time the calling process has been running,
in clock ticks.

To convert to seconds, divide the result by CLK_TCK.

-1 is returned if the time is not available.

Contents


4.11.2.2.18 cos
#include math.h
double cos(double arg);

Returns the cosine of arg, where arg is in radians.

Contents


4.11.2.2.19 cosh
#include math.h
double cosh(double arg);

Returns the hyperbolic cosine of arg, where arg is in radians.

Contents


4.11.2.2.20 ctime
#include time.h
char * ctime(const time_t *time);

Returns a pointer to a string representation of the calendar time
in time, in the form:

day month date hours:minutes:seconds year\n\0

For example:
Thu Oct 28 14:55:20 1999

Note that the buffer used is overwritten by subsequent calls to
the function.

Contents


4.11.2.2.21 difftime
#include time.h
double difftime(time_t time2, time_t time1);

Returns the difference, in seconds, between time1 and time2.

i.e. it returns time2 - time1

Contents


4.11.2.2.22 div
#include stdlib.h
div_t div(int numerator, int denominator);

Returns the quotient and remainder of numerator/denominator in a
div_t structure.

The div_t structure is defined in stdlib.h and will have at least
two integer fields quot and rem.

Contents


4.11.2.2.23 exit
#include stdlib.h
void exit(int exit_code);

Causes immediate normal termination of the program, returning
exit_code to the calling process.

Contents


4.11.2.2.24 exp
#include math.h
double exp(double arg);

Returns the natural logarithm e raised to the arg power.

Contents


4.11.2.2.25 fabs
#include math.h
double fabs(double num);

Returns the absolute (positive) value of num.

Contents


4.11.2.2.26 fclose
#include stdio.h
int fclose(FILE *stream);

Closes the file associated with stream and flushes its buffer.
After closing the file, stream will no longer be connected with
the file.

Returns zero on success, or non-zero on failure. Errors can be
caused by trying to close already closed files, removing storage
media, or lack of disk space.

Contents


4.11.2.2.27 feof
#include stdio.h
int feof(FILE *stream);

Checks the position of the file associated with stream to
determine if the eof of the file has been reached.

Returns non-zero if the position is at end of file.

Contents


4.11.2.2.28 ferror
#include stdio.h
int ferror(FILE *stream);

Returns the error status for the given stream.

Zero indicates no error, otherwise a non-zero error code will be
returned.

Contents


4.11.2.2.29 fflush
#include stdio.h
int fflush(FILE *stream);

Explicitely flushes the buffer associated with stream, causing
output buffers to be physically written and input buffers to be
cleared.

Returns zero on success, non-zero on error.

Note that all buffers are automatically flushed on normal program
termination, when they are full, or when the file is closed.

Contents


4.11.2.2.30 fgetc
#include stdio.h
int fgetc(FILE *stream);

Returnns the next character from the input stream.

On error, or if the end of the file is reached, returns EOF. Note
that EOF is a valid character, so feof() or ferror() should be
used to check for end-of-file or error conditions.

Contents


4.11.2.2.31 fgetpos
#include stdio.h
int fgetpos(FILE *stream, fpos_t *position);

Returns the current file position indicator for stream in the
object pointed to by position.

The value stored is useful only for restoring the file position
with a call to fsetpos().

Returns zero on success, non-zero on error.

Contents


4.11.2.2.32 fgets
#include stdio.h
char * fgets(char *str, int num, FILE *stream);

Reads up to num-1 characters from stream and puts them in the
character array pointed to by str.

Characters are read up to a newline character, or end of file.
The string will be terminated by a null character, and any
newline character will be retained.

Returns str on success, or a null pointer on error. Use ferror()
and feof() to determine status on error.

Contents


4.11.2.2.33 floor
#include math.h
double floor(double num);

Returns the largest integer not greater than num.

Contents


4.11.2.2.34 fmod
#include math.h
double fmod(double x, double y);

Returns the remainder of x/y.

Contents


4.11.2.2.35 fopen
#include stdio.h
FILE * fopen(const char *filename, const char *mode);

Opens the file represented by filename for access as specified by
mode. Valid values for mode are as follows:

"r"		open text file for reading
"w"		create text file for writing
"a"		append to text file
"rb" 	open binary file for reading
"wb" 	create binary file for writing
"ab" 	append to binary file
"r+" 	open text file for read/write
"w+" 	create text file for read/write
"a+" 	open text file for read/write
"rb+" 	open binary file for read/write
"wb+" 	create binary file for read/write
"ab+" 	open binary file for read/write

Returns a FILE pointer on success, or null on failure.

If a file is opened in text mode, some character conversions may
occur. For example, newline characters may be converted to
carriage return/linefeed. This is system dependent.

Opening a file for writing will cause a new file to be created;
any pre-existing file will be erased first.

Opening a file for reading or appending requires it to exist. If
opened for appending, the file position will be set to the end of
file.

Contents


4.11.2.2.36 fprintf
#include stdio.h
int fprintf(FILE *stream, const char *format, ...);

Prints to stream as specified by string format, using additional
parameters as required.

Returns the number of characters printed, or a negative value on
error.

The string format is a combination of characters which will be
printed directly, and format commands beginning % which will be
replaced by arguments. There must be the same number and type of
arguments as there format commands, in the same order.

Format commands are:

%c		character
%d		signed decimal integer
%i		signed decimal integer
%e		scientific notation floating point
%E		scientific notation floating point
%f		decimal floating point
%g		uses %e or %f, whichever is shorted
%G		uses %E or %f, whichever is shorted
%o		unsigned octal
%s		string
%u		unsigned decimal integer
%x		unsigned hexadecimal
%X		unsigned hexadecimal
%p		pointer
%%	percent sign

Format commands may have modifiers to specify field width, number
of decimal places, and justification. The general form is:

%<width>.<places><format>

Where width specifies the minimum width in characters and places
specifies the number of decimal places. For strings and integers,
places specifies the maximum width after which output will be
truncated. Preceding width with a zero will cause output to be
padded with zeros instead of spaces.

Output is normally right justified. Placing a minus sign after
the % will left justify the field.

Modifiers may be used to specify different datatypes, as follows:

l	long / double
h	short
L	long double

%n will cause the number of characters printed so far to be
written to the corresponding pointer to integer in the argument
list.

Hash (#) preceding a g, f or e code ensures the decimal point is
printed even when there are no decimal digits. Using it with
octal or hexadecimal formats o and h will cause them to be
prefixed with 0 or 0x respectively.

The width and places specifiers may be passed as arguments by
placing and asterisk in the format. They are matched in the order
they occur, in the same way as the values to be printed.

Contents


4.11.2.2.37 fputc
#include stdio.h
int fputc(int ch, FILE *stream);

Writes the character ch to the specified stream.

Returns ch on success, of EOF on error. Use ferror() to determine
error status.

Contents


4.11.2.2.38 fputs
#include stdio.h
int fputs(const char *str, FILE *stream);

Writes the null terminated string str to the specified stream.
The null terminator is not written.

Returns a non-negative value on success, and EOF on failure. Use
ferror() to determine error status.

If the file is opened in text mode, character conversions may
take place.

Contents


4.11.2.2.39 fread
#include stdio.h
int fread(void *buf, size_t size, size_t count, FILE *stream);

Reads count objects, each size bytes long, into the memory at buf
from the specified stream.

Returns the number of items actually read. If this is less than
the number requested, use feof() and ferror() to determine the
status.

Character conversions may occur if the file is opened in text
mode.

Contents


4.11.2.2.40 free
#include stdlib.h
void free(void * ptr);

Returns the memory pointed to by ptr to the heap, making it
available for future allocation.

Free must only be called with a pointer obtained from a dynamic
allocation function such as malloc or calloc.

Contents


4.11.2.2.41 freopen
#include stdio.h
FILE * freopen(const char *filename, const char *mode, FILE *stream);

Associates an existing stream with a different filename. The
access mode is in the same format as for fopen().

The function first attempts to close the file already associated
with stream. However, if this fails it still opens the new file.

Returns a pointer to stream on success, or null on failure.

Contents


4.11.2.2.42 frexp
#include math.h
double frexp(double num, int *exp);

Decomposes num into a mantissa in the range 0.5 to less than 1,
and an integer exponent such that num = mantissa * 2exp.

The mantissa is returned by the function, and the exponent is
stored at exp.

Contents


4.11.2.2.43 fscanf
#include stdio.h
int fscanf(FILE *stream, const char *format, ...);

Read from stream and stores the information in variables in the
argument list, using the control string format.

The control string contains format specifiers, white space and
non-white space separators.

Format specifiers indicate the values which should be read into
arguments, as follows:

%c		single character
%d		decimal integer
%i		decimal integer
%e		floating point number
%f		floating point number
%g		floating point number
%o		octal number
%s		string
%x		hexadecimal number
%p		pointer
%u		unsigned integer

%n		number of characters read
%[]		range of characters

White space in format causes one or more white space characters
from the input to be skipped. Non white space characters in
format will be read from the input and discarded; if a matching
character is not found, fscanf() will terminate.

All variables used to receive values must be passed by address.

Strings will be read only up to the first white space. All input
data must be separated by white space, unless explicitely
specified in format.

Placing a * after the % will cause the value to be read but not
assigned. This can be used to skip over unrequired fields.

Format commands can specify a maximum width after the % to limit
the number of characters read for any field.

Returns the number of fields assigned to arguments, or EOF if
there is an error before any fields are assigned.

Contents


4.11.2.2.44 fseek
#include stdio.h
int fseek(FILE *stream, long offset, int origin);

Sets the file position for stream as specified by offset and
origin.

The offset is the number of bytes to seek, from the origin as
defined by the following macros:

SEEK_SET 	seek from start of file
SEEK_CUR 	seek from current position
SEEK_END 	seek (backwards) from end of file

Returns zero on success, non-zero on failure.

Contents


4.11.2.2.45 fsetpos
#include stdio.h
int fsetpos(FILE *stream, const fpos_t *position);

Returns the file position for stream to the point specified by
position, which must have been obtained from a call to fgetpos().

Returns zero on success, and non-zero on failure.

Contents


4.11.2.2.46 ftell
#include stdio.h
long ftell(FILE *stream);

Retuns the current file position for stream, in bytes from the
start of the file.

May not be meaningful for text files because of character
conversions, except as an argument to fseek().

Returns -1L on error, and the result may not be meaningful for
files incapable of random seeks such as modems and terminals.

Contents


4.11.2.2.47 fwrite
#include stdio.h
int fwrite(const void *buf, size_t size, size_t count, FILE *stream);

Writes count objects, each size bytes long, from the memory
location buf to the specified stream.

Returns the number of items actually written; use ferror() to
determine the status if this is less then count.

Character conversions may occur if the stream is opened in text
mode.

Contents


4.11.2.2.48 getc
#include stdio.h
int getc(FILE *stream);

Returnns the next character from the input stream.

On error, or if the end of the file is reached, returns EOF. Note
that EOF is a valid character, so feof() or ferror() should be
used to check for end-of-file or error conditions.

Contents


4.11.2.2.49 getchar
#include stdio.h
int getchar(void);

Equivalent to fgetc(stdin)

Contents


4.11.2.2.50 getenv
#include stdlib.h
char * getenv(const char *name);

Returns a pointer to the environment variable name, or null if
name is not found.

Note that the returned string must not be changed.

Contents


4.11.2.2.51 gets
#include stdio.h
char * gets(char *str);

Reads characters from stdin until a newline or EOF is reached,
placing them in str. The string will be null terminated.

Returns str on success, or null on error or end-of-file. Use
feof() and ferror() to determine the status if null is returned.

Note that there is no limit to the number of characters read.

Contents


4.11.2.2.52 gmtime
#include time.h
struct tm * gmtime(time_t *time);

Returns a pointer to the broken down form of time in a tm
structure, based on Greenwich Mean Time.

Note the structure will be overwritten by subsequent calls to
this function.

Contents


4.11.2.2.53 isalnum
#include ctype.h
int isalnum(int ch);

Returns non-zero if ch is a letter of the alphabet or a digit.

Contents


4.11.2.2.54 isalpha
#include ctype.h
int isalpha(int ch);

Returns non-zero if ch is a letter of the alphabet, which may
vary from language to language.

Contents


4.11.2.2.55 iscntrl
#include ctype.h
int iscntrl(int ch);

Returns non-zero if ch is a control character (0-31 or 127).

Contents


4.11.2.2.56 isdigit
#include ctype.h
int isdigit(int ch);

Returns non-zero if ch is a digit ('0' through '9').

Contents


4.11.2.2.57 isgraph
#include ctype.h
int isgraph(int ch);

Returns non-zero if ch is a printable character and not a space.
This usually means the range 33 - 126.

Contents


4.11.2.2.58 islower
#include ctype.h
int islower(int ch);

Returns non-zero if ch is a lowercase letter.

Contents


4.11.2.2.59 isprint
#include ctype.h
int isprint(int ch);

Returns non-zero if ch is a printable character, including space.
This is normally the range 32 - 126.

Contents


4.11.2.2.60 ispunct
#include ctype.h
int ispunct(int ch);

Return non-zero if ch is a punctuation character. Punctuation
means all printing characters except alphanumerics and space.

Contents


4.11.2.2.61 isspace
#include ctype.h
int isspace(int ch);

Returns non-zero if ch is a space, horizontal tab, vertical tab,
carriage return or newline character.

Contents


4.11.2.2.62 isupper
#include ctype.h
int isupper(int ch);

Returns non-zero if ch is an uppercase letter.

Contents


4.11.2.2.63 isxdigit
#include ctype.h
int isxdigit(int ch);

Returns non-zero if ch is a hexadecimal digit (A-F, a-f or 0-9)

Contents


4.11.2.2.64 labs
#include stdlib.h
long labs(long num);

Returns the absolute (positive) value of num.

Contents


4.11.2.2.65 ldexp
#include math.h
double ldexp(double num, int exp);

Returns num * 2exp.

Contents


4.11.2.2.66 ldiv
#include stdlib.h
ldiv_t ldiv(long numerator, long denominator);

Returns the quotient and remainder of numerator/denominator in a
ldiv_t structure.

The ldiv_t structure is defined in stdlib.h and will have at
least two long integer fields quot and rem.

Contents


4.11.2.2.67 localeconv
#include locale.h
struct lconv * localeconv(void);

Returns a pointer to a structure of type lconv which contains
various locale specific values.

The contents of the structure must not be changed. See the
locale.h file for its contents.

Contents


4.11.2.2.68 localtime
#include time.h
struct tm * localtime(time_t *time);

Returns a pointer to the broken down form of time in a tm
structure, based on Local Time.

Note the structure will be overwritten by subsequent calls to
this function.

Contents


4.11.2.2.69 log
#include math.h
double log(double num);

Returns the natural logarithm of num.

Contents


4.11.2.2.70 log10
#include math.h
double log10(double num);

Returns the base 10 logarithm of num.

Contents


4.11.2.2.71 longjmp
#include setjmp.h
void longjmp(jmp_buf envbuf, int status);

Causes program execution to resume at the point of the last call
to setjmp(), allowing for a jump between functions.

The value status becomes the return value from the original
setjmp() call, and must not be 0.

Contents


4.11.2.2.72 malloc
#include stdlib.h
void * malloc(size_t size);

Allocates size bytes of memory from the heap.

Returns a pointer to the allocated memory, or null if allocation
fails.

Contents


4.11.2.2.73 memchr
#include string.h
void * memchr(const void *buffer, int ch, size_t count);

Searches the first count characters of the buffer pointed to by
buffer for the first occurrence of character ch. Return value is
pointer to first occurrence of ch or null if not found

Contents


4.11.2.2.74 memcmp
#include string.h
int memcmp(const void *buf1, const void *buf2, size_t count);

Lexicographically compares the first count characters of the
buffers pointed to by buf1 and buf2. Return value is:

<0   buf1 is less than buf2
=0   buf1 is equal to buf2
>0   buf1 is greater than buf2 

Contents


4.11.2.2.75 memcpy
#include string.h
void * memcpy(void *to, const void *from, size_t count);

Copies count characters from the buffer pointed to by from into
the buffer pointed to by to.

If the buffers overlap behaviour is undefined.

Contents


4.11.2.2.76 memmove
#include string.h
void * memmove(void *to, const void *from, size_t count);

Copies count characters from the buffer pointed to by from into
the buffer pointed to by to.

If the buffers overlap the copy will take place correctly,
leaving the correct contents in to but modifying from.

Contents


4.11.2.2.77 memset
#include string.h
void * memset(void *buf, int ch, size_t count);

Sets count memory locations starting at buf to the low-order byte
of ch.

Most commonly used to initialise a block of memory, such as a
structure.

Contents


4.11.2.2.78 mktime
#include time.h
time_t mktime(struct tm *time);

Returns the calendar time equivalent of the broken-down time in
the structure time.

Elements tm_wday and tm_yday are set by the function.

Returns -1 if the information cannot be represented as a valid
time.

Contents


4.11.2.2.79 modf
#include math.h
double modf(double num, int *i);

Decomposes num into its integer and fractional parts, storing the
integer at i and returning the fraction.

Contents


4.11.2.2.80 perror
#include stdio.h
void perror(const char *str);

Translates the global variable errno to an error message and
writes it to stderr. If str is not null, it will be written
before the error message.

Contents


4.11.2.2.81 pow
#include math.h
double pow(double base, double exp);

Returns base raised to the exp power.

Contents


4.11.2.2.82 printf
#include stdio.h
int printf(const char *format, ...);

Equivalent to fprintf(stdout, format, ...)

Contents


4.11.2.2.83 putc
#include stdio.h
int putc(int ch, FILE *stream);

Writes the character in the least significant byte of ch to the
output stream pointed to by stream.

Returns the character written on success, or EOF on failure. Use
ferror() to determine the status.

Contents


4.11.2.2.84 putchar
#include stdio.h
int putchar(int ch);

Equivalent to fputc(ch, stdout)

Contents


4.11.2.2.85 puts
#include stdio.h
int puts(char *str);

Equivalent to fputs(str, stdout)

Contents


4.11.2.2.86 qsort
#include stdlib.h
void qsort(void *buf, size_t num, size_t size, int (*compare)(const void *, const void *));

Sorts the array pointer to by buf using a quicksort algorithm.
The number of elements is specified by num, and the size in bytes
of each element is specified by size.

The function compare is used to compare two elements of the
array, in the following form:

int function(const void *arg1, const void *arg2)

returning:
arg1 < arg2    less than 0
arg1 = arg2    0
arg1 > arg2    greater than 0

The array will be sorted in ascending order.

Contents


4.11.2.2.87 raise
#include signal.h
int raise(int signal);

Send the signal specified by signal to the executing program.
Return value 0 is successful, otherwise non-zero

Contents


4.11.2.2.88 rand
#include stdlib.h
int rand(void);

Returns a pseudo-random number between 0 and RAND_MAX.

Contents


4.11.2.2.89 realloc
#include stdlib.h
void * realloc(void *ptr, size_t size);

Changes the size of a previously allocated memory block pointed
to by ptr to a new number of bytes size. The new size may be
greater or less than the original.

The block may need to be moved to increase its size, in which
case the old contents will be copied to the new location.

Returns a pointer to the new block, or null if allocation failed
(in which case the old block remains valid).

If size is zero, the memory if freed.

Contents


4.11.2.2.90 remove
#include stdio.h
int remove(const char *filename);

Erases (deletes) the file specified by filename.

Returns 0 on success, and non-zero on failure.

Contents


4.11.2.2.91 rename
#include stdio.h
int rename(const char *oldname, const char *newname);

Renames (moves) the specified file from oldname to newname. The
new name must not already be used.

Returns 0 on success, or non-zero on failure.

Contents


4.11.2.2.92 rewind
#include stdio.h
void rewind(FILE *stream);

Moves the file position indicator for stream to the beginning of
the stream, and clears the end-of-file and error flags.

Contents


4.11.2.2.93 scanf
#include stdio.h
int scanf(const char *format, ...);

Equivalent to fscanf(stdin, format, ...)

Contents


4.11.2.2.94 setbuf
#include stdio.h
void setbuf(FILE *stream, char *buf);

Sets the buffer used by stream to buf, or turns off buffering if
buf is null.

If specified, the buffer must be BUFSIZ characters long.

Contents


4.11.2.2.95 setjmp
#include setjmp.h
int setjmp(jmp_buf envbuf);

Saves the contents of the system stack in the buffer envbuf for
later use by longjmp().

Returns 0 on invocation, and the value passed to longjmp() after
the jump back.

Contents


4.11.2.2.96 setlocale
#include locale.h
char * setlocale(int type, const char *locale);

Sets the current locale for the specified type to locale.

If locale is null it returns a pointer to the current locale.

The following macros should be used for values of type:
LC_ALL refers to all categories
LC_COLLATE affects strcoll()
LC_CTYPE affects the character functions
LC_MONETARY determines the monetary format
LC_NUMERIC determines the decimal point format
LC_TIME affects strftime()

Contents


4.11.2.2.97 setvbuf
#include stdio.h
int setvbuf(FILE *stream, char *buf, int mode, size_t size);

Allows the buffer location, size and  mode to be specified for
the stream. If buf is null, it will be allocated.

The mode can be one of:

_IOFBF	full buffering
_IONBF	no buffering
_IOLBF	line buffering

The size must be greater than zero.

Returns zero on success, or non-zero on failure.

Contents


4.11.2.2.98 signal
#include signal.h
(*func)(int) signal(int signal, void (*func)(int));

Registers the function func to receive the specified signal.

Alternatively, func can be one of the following:

SIG_DFL   to use default signal handling
SIG_IGN   ignore the signal

Returns func if successful, or SIG_ERR if not.

Contents


4.11.2.2.99 sin
#include math.h
double sin(double arg);

Returns the sine of arg, where arg is in radians.

Contents


4.11.2.2.100 sinh
#include math.h
double sinh(double arg);

Returns the hyperbolic sine of arg, where arg is in radians.

Contents


4.11.2.2.101 sprintf
#include stdio.h
int sprintf(char *buf, const char *format, ...);

As fprintf(), but the output is written to the string buf.

Contents


4.11.2.2.102 sqrt
#include math.h
double sqrt(double num);

Returns the square root of num.

Contents


4.11.2.2.103 srand
#include stdlib.h
void srand(unsigned seed);

Sets the starting point for the sequence generated by rand()
using the value seed.

Using the same value of seed will cause the same sequence of
random numbers to be generated.

Contents


4.11.2.2.104 sscanf
#include stdio.h
int sscanf(const char *buf, const char *format, ...);

As fscanf, except the input is taken from the string at buf.

Contents


4.11.2.2.105 strcat
#include string.h
char * strcat(char *str1, const char *str2);

Concatenates the null-terminated string str2 onto the end of
str1. If the strings overlap, behaviour is undefined. Return
str1.

Contents


4.11.2.2.106 strchr
#include string.h
char * strchr(const char *str, int ch);

Searches the null-terminated string str for the first occurrence
of character ch. Return value is a pointer to first occurrence of
ch or null if not found

Contents


4.11.2.2.107 strcmp
#include string.h
int strcmp(const char *str1, const char *str2);

Compares the two null-terminated strings str1 and str2. Return
value is

<0   str1 is less than str2
=0   str1 is equal to str2
>0   str1 is greater than str2

Contents


4.11.2.2.108 strcoll
#include string.h
int strcoll(const char *str1, const char *str2);

Compares the strings pointed to by str1 and str2, in accordance
with the locale specified using setlocale(). Return value is

<0   str1 is less than str2
=0   str1 is equal to str2
>0   str1 is greater than str2

Contents


4.11.2.2.109 strcpy
#include string.h
char * strcpy(char *str1, const char *str2);

Copies the contents of str2 into str1, where str2 must be a
pointer to a null-terminated string. Returns str1.

If str1 and str2 overlap, the behaviour is undefined.

Contents


4.11.2.2.110 strcspn
#include string.h
int strcspn(const char *str1, const char *str2);

Finds the length of the initial substring of str1 made up only of
characters not in str2.

Put differently, it returns the index of the first character in
str1 which is also in str2.

Contents


4.11.2.2.111 strdup
#include string.h
char * strdup(char *str);

Duplicates the string pointed to by str, obtaining the memory
through a call to malloc().

Returns a pointer to the new string on success, or null on
failure.

Contents


4.11.2.2.112 strerror
#include string.h
char * strerror(int errnum);

Returns a pointer to an implementation specific string associated
with errnum.

Contents


4.11.2.2.113 strftime
#include time.h
size_t strftime(char *str, size_t maxsize, const char *fmt, const struct tm *time);

Formats date, time and other information into the string str from
the structure time based on the format string fmt. A maximum of
maxsize characters will be written.

Format commands beginning with % will be replaced with time and
date values in local format. Other characters will be copied.

%a		abbreviated weekday name
%A		full weekday name
%b		abbreviated month name
%B		full month name
%c		standard date and time string
%d		day of month as decimal (1-31)
%H		hour (0-23)
%I		hour (1-12)
%j		day of year as decimal (1-366)
%m		month as decimal (1-12)
%M		minute as decimal (0-59)
%p		locale's equivalent of AM or PM
%S		second as decimal (0-59)
%U		week of year, Sunday being first day (0-52)
%w		weekday as decimal (0-6, Sunday being 0)
%W	week of year, Monday being first day (0-52)
%x		standard date string
%X		standard time string
%y		year in decimal without century (00-99)
%Y		year including century as decimal
%Z		time zone name
%%	percent sign

Returns the number of characters written, or zero on error.

Contents


4.11.2.2.114 strlen
#include string.h
size_t strlen(char *str);

Returns the length of the null-terminated string str, not
including the null.

Contents


4.11.2.2.115 strncat
#include string.h
char * strncat(char *str1, char *str2, size_t count);

Concatenates up to count characters of str2 onto the end of str1.

If the strings overlap, behaviour is undefined. Returns str1.

Contents


4.11.2.2.116 strncmp
#include string.g
int strncmp(const char *str1, const char *str2, size_t count);

Compares two null terminated strings str1 and str2; up to a
maximum of count characters are compared.

Return value is
<0   str1 is less than str2
=0   str1 is equal to str2
>0   str1 is greater than str2

Contents


4.11.2.2.117 strncpy
#include string.h
char * strncpy(char *str1, const char *str2, size_t count);

Copies up to count characters from the null-terminated string
str2 to str1.

If str2 has less than count characters, then str1 will have nulls
appended until count characters have been copied.

If str2 has more than count characters then str1 will not be null
terminated.

Returns str1.

Contents


4.11.2.2.118 strpbrk
#include string.h
char * strpbrk(const char *str1, const char *str2);

Returns a pointer to the first character in str1 which matches
any character in str2 or null.

Contents


4.11.2.2.119 strrchr
#include string.h
char * strrchr(const char *str, int ch);

Returns a pointer to the last occurence of character ch in the
string str or null.

Contents


4.11.2.2.120 strspn
#include string.h
size_t strspn(const char *str1, const char *str2);

Returns the length of the initial substring of str1 made up of
characters found in str2.

Stated differently, it returns the index of the first character
in str1 which cannot be found in str2.

Contents


4.11.2.2.121 strstr
#include string.h
char * strstr(const char *str1, const char *str2);

Returns a pointer to the first occurrence of str2 in str1 or null.

Contents


4.11.2.2.122 strtod
#include stdlib.h
double strtod(const char *start, char **end);

Returns the floating point number found at start, reading up to
any character that cannot form part of a floating point number.

White space is skipped before the conversion, and end is set to
the first character after the number.

Contents


4.11.2.2.123 strtok
#include string.h
char * strtok(char *str1, const char *str2);

Splits str1 into tokens separated by characters found in str2.

The first call finds the first separator and replaces it with a
null, returning a pointer to the first token.

Subsequent calls should have str1 set to null, and will return a
pointer to the next token.

Null is returned when there are no more tokens. It is possible to
change the set of delimiters for each call.

Contents


4.11.2.2.124 strtol
#include stdlib.h
long strtol(const char *start, char **end, int radix);

Returns the integer number (in the base specified by radix) found
at start, reading up to any character that cannot form part of an
integer number in that base.

White space is skipped before the conversion, and end is set to
the first character after the number.

The base radix must be in the range 2 - 36.

Contents


4.11.2.2.125 strtoul
#include stdlib.h
unsigned long strtoul(const char *start, char **end, int radix);

Returns the unsigned integer number (in the base specified by
radix) found at start, reading up to any character that cannot
form part of an integer number in that base.

White space is skipped before the conversion, and end is set to
the first character after the number.

The base radix must be in the range 2 - 36.

Contents


4.11.2.2.126 strxfrm
#include string.h
size_t strxfrm(char *str1, const char *str2, sie_t count);

Transforms the first count characters of str2 and places them in
str1.

After translation, a comparison using strcmp() on str1 will
produce the same results as a strcoll() using the original string
str2.

Return value is the length of the transformed string.

Contents


4.11.2.2.127 system
#include stdlib.h
int system(const char *str);

Passes the command pointed to by str to the command processor of
the operating system.

Return value is system dependent.

Passing null as str will return non-zero if the command processor
is present, and zero otherwise.

Contents


4.11.2.2.128 tan
#include math.h
double tan(double arg);

Returns the tangent of arg, where arg is in radians.

Contents


4.11.2.2.129 tanh
#include math.h
double tanh(double arg);

Returns the hyperbolic tangent of arg, where arg is in radians.

Contents


4.11.2.2.130 time
#include time.h
time_t time(time_t *time);

Returns the current calendar time, or -1 if the system has no time.

If time is not null, it will also be set to the return value.

Contents


4.11.2.2.131 tmpfile
#include stdio.h
FILE * tmpfile(void);

Opens a temporary file for update and returns a pointer to its
stream. The file will automatically have a unique filename to
avoid conflicts.

Returns a null pointer on failure.

The temporary file will be automatically removed when it is
closed, or when the program terminates.

Contents


4.11.2.2.132 tmpnam
#include stdio.h
char * tmpnam(char *name);

Generates a unique filename and stores it in name. This function
can be called at least TMP_MAX times, which will be at least 25.

Returns a pointer to name on success, or null on failure.

Contents


4.11.2.2.133 tolower
#include ctype.h
int tolower(int ch);

Returns the lowercase equivalent of ch, or ch unchanged if it is
not an uppercase letter.

Contents


4.11.2.2.134 toupper
#include ctype.h
int toupper(int ch);

Returns the uppercase equivalent of ch, or ch unchanged if it is
not a lowercase letter.

Contents


4.11.2.2.135 ungetc
#include stdio.h
int ungetc(int ch, FILE *stream);

Retuns the character ch to the stream stream, so it will be
returned by the next read operation.

One character ungetc is guaranteed, some versions may accept more.

Returns ch on success, and EOF on failure.

Contents


4.11.2.2.136 va_arg
#include stdarg.h 
type va_arg(va_list argptr, type);

Macro used to retrieve arguments to variable argument functions,
where argptr has been initialised by a call to va_start() and
type is the expected data type of the argument.

Note that varargs.h is older an incompatible - but allowed variadic
functions to call other variadics.

eg. 
              void foo(char *fmt, ...)
              {
                   va_list ap;
                   int d;
                   char c, *p, *s;

                   va_start(ap, fmt);
                   while (*fmt)
                        switch(*fmt++) {
                        case 's':           /* string */
                             s = va_arg(ap, char *);
                             printf("string %s\n", s);
                             break;
                        case 'd':           /* int */
                             d = va_arg(ap, int);
                             printf("int %d\n", d);
                             break;
                        case 'c':           /* char */
                             c = va_arg(ap, char);
                             printf("char %c\n", c);
                             break;
                        }
                   va_end(ap);
              }

Contents


4.11.2.2.137 va_end
#include stdarg.h
void va_end(va_list argptr);

Stops reading variable arguments, freeing up memory etc

Contents


4.11.2.2.138 va_start
#include stdarg.h
void va_start(va_list argptr, last_parm);

Initialises the retrieval of variable argument list arguments,
where argptr is a control structure used by later calls to
va_arg() and last_parm is the last declared argument.

Contents


4.11.2.2.139 vfprintf
#include stdarg.h 
#include stdio.h
int vfprintf(FILE *stream, char *format, va_list argptr);

Equivalent to fprintf(), except the argument list has been
replaced by a pointer to a list of arguments.

Contents


4.11.2.2.140 vprintf
#include stdarg.h 
#include stdio.h
int vprintf(char *format, va_list argptr);

Equivalent to printf(), except the argument list has been
replaced by a pointer to a list of arguments.

Contents


4.11.2.2.141 vsprintf
#include stdarg.h 
#include stdio.h
int vsprintf(char *buf, char *format, va_list argptr);

Equivalent to sprintf(), except the argument list has been
replaced by a pointer to a list of arguments.

Contents


4.11.2.3 Boilerplate

/*****************************************************************
Copyright 2008 Bob Hepple

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*****************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <pwd.h>
#include <getopt.h>
#include <string.h>

#define MAX_LINE 1024

char *progname = NULL;
char *version_string = "version 1.0";
int verbose = 0;

void usage(void) {
    char *usage_msg[] = {

"foobar is a program which ...",
"",
"options:",
"-h              print this help on stdout",
"-v              verbose operation",
"-V              prints the version on stdout",
"",
NULL
};
    char **line;

    printf("Usage: %s [ -hvV [--] commands ]\n", progname);
    line = usage_msg;
    while (*line) {
        puts(*line);
        line++;
    }
}

int foobar(char **argv) {
    int retval = 0;

    return(retval);
}

int main(int argc, char **argv) {
    int c;
    int retval = 0;

    progname = argv[0] + strlen(argv[0]) - 1;
    while (progname > argv[0] && *progname != '/') {
        progname--;
    }
    if (*progname == '/') {
        progname++;
    }

    while ((c = getopt(argc, argv, "hvV")) != -1) {
        switch (c) {
        case 'v':
            verbose = 1;
            break;
        case 'V':
            printf("%s: version %s\n", progname, version_string);
            goto end;
            break;
        case 'h':
            usage();
            goto end;
        default:
            fprintf(stderr, "%s: bad option (-%c)\n", progname, c);
            retval = 1;
            goto end;
        }
    }

    retval = foobar(argv);

end:
    exit(retval);
}

Contents


4.11.3 Java


1.4 has no -native options - need to detect and unset

Contents


4.11.4 Perl


Install a new module:
perl -MCPAN -e 'install XML::XPath'

Interactive install:
perl -MCPAN -e shell

Is a module (Foo) on the system:
perl -MFoo -e 1

Print module path:
perl -e "print qq(@INC)"

Syntax check only:
perl -c script.pl

Contents


4.11.4.1 Tracing

Download and install Devel::Trace, from 
http://perl.plover.com/Trace/Trace.pm
to /usr/share/perl/5.8.7/Devel/

Then:
perl -d:Trace <program>

According to "man perlrun":
PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS program

Contents


4.11.4.2 Sample 1: provides something similar to "expect"
#
# Params:
# $in [In] a file handle
# $timeout [In] an integer
# $good_string [In] a string
# $bad_strings [In] an array of strings
#
sub wait_for($ $ $ $)
{
    my ($in, $timeout, $good_string, $bad_strings) = @_;
    my $retval = 0;

    if ($debug)
    {
        print STDERR "wait_for: timeout=$timeout, good_string = \"$good_string\", bad strings:\n";
        map { print STDERR "\"$_\"\n"; } @{$bad_strings};
    }

    my $buf = "";
    my $char_in = "";

    alarm $timeout;
    while (sysread $in, $char_in, 1)
    {
        alarm 0;
        if ($char_in eq "\n")
        {
            print "$buf\n" if $logging_process;
            $buf = "";
            alarm $timeout;
            next;
        }
        $buf = "$buf$char_in";
        for my $string (@{$bad_strings})
        {
            if ($buf =~ /$string/i)
            {
                print $buf if $logging_process and $buf;
                $buf = "";
                print STDERR "$prefix got bad string \"$string\"\n"; 
                $retval = 0;
                last;
            }
        }
        if ($buf =~ /$good_string/i)
        {
            print $buf if $logging_process and $buf;
            $buf = "";
            print STDERR "$prefix got good string \"$good_string\"\n";
            $retval = 1;
            last;
        }
        alarm $timeout;
    }

    print $buf if $logging_process and $buf;
    $buf = "";
    alarm 0;
    return $retval;
}

# Check port is not already in use:
# $type [In] type of port "ssl" or "tcp"
# $port [In] port number, eg. 4443
sub port_avail($ $)
{
    my ($type, $port) = @_;
    my @bad_strings = ("Connection refused");
    my $retval = 1;

    open2(*FROM_TELNET, *TO_TELNET, "telnet localhost $port 2>&1") 
        or die "Cannot spawn telnet: $!\n";
    print TO_TELNET "";
    if (wait_for(FROM_TELNET, $timeout, "Connected", \@bad_strings) == 1)
    {
        print STDERR "$prefix Port $port is unavailable for $type\n"; 
        $retval = 0;
    } else 
    {
        print STDERR "$prefix Port $port is available for $type.\n";
        $retval = 1;
    };
    close TO_TELNET;
    close FROM_TELNET;
    return $retval;
}

Contents


4.11.4.3 Syntax notes

Scalar ($)
$foo is a scalar - number, string, reference or file handle

Arrays (@)
@foo is an array eg @foo=("a", "b", $c);
$foo[0] is the first element of @foo

Associative arrays (hashes) (%)
%foo is a hash eg %foo = (Jan => 31, Feb => 28, ... etc)
$foo{'Feb'} is the 'Feb' value of the hash

Functions/subroutine:
	sub foo($ $ $) { # with prototype
		my ($foo, $bar, $foobar) = @_; # copies parameters

Calling subroutines (&)
	&foo(1, 2, 3);
If the subroutine has a prototype then the & can be skipped:

	foo(1 2 3);

References (\)
\$foo is a pointer to $foo

To dereference, add an extra sigil:
	$pointer = \$foo;
	$$pointer = 0; # derefenrence scalar
	push(@$arrayref, $filename); # dereference array
	&$coderef(1,2,3); #dereference subroutine

Typeglobs (*)
... are a symbol table entry thus:

	*foo = $bar;

... makes foo an alias to bar.

	*foo = *bar;

... make $foo == $bar, @foo == @bar, %foo == %bar etc

Contents


4.11.5 Python


Quick Ref: http://www.brunningonline.net/simon/python/quick-ref2_0.html

Debugger:
python /usr/lib/python2.2/pdb.py prog.py [ -options ]

ddd --pydb --debugger /usr/lib/python2.2/pdb.py gjots2

To see what class foobar belongs to:
	print foobar

To see how a class is defined:
	print myclass.__dict__

To see what names a module defines:
	import foobar
	print dir(foobar)

To convert a bunch of lines in a string to a list:
	h="aaa\nbbb\nccc"
	hl=h.split('\n')

To sort a list (in place):
	h1.sort() ==  h1.sort(cmp)
	h1.sort(comparison_function)

To ignore case:
	a.sort(lambda x, y: cmp(string.lower(x), string.lower(y)))

To sort a list in reverse order (in place):
	h1.reverse() or h1.sort(-cmp) ... slower

To join up a list into a string:
	j=string.join(hl,"\n")

To suppress the extra space in a print:
eg 
print "a=", 3
> a= 3
sys.stdout.write("a=%d\n" % 3)
> a=3

Contents


4.11.5.1 Python/tcl/tk

tcl -> neosoft - Ajuba -> Interwoven -> ???

Need Safe-tcl?

tkinter = python + tk - included in python - has Win32 but not on
OpenServer? tk look & feel

wxPython - supposedly better, newer, probably not on SCO, based
on the C++ wxWindows, native look & feel

Boa - GUI builder for wxPython (& IDE?)
wxGlade - " - ? seems very unfinished
PythonCard - + - ? like Max HyperCard

http://hapdebugger.sourceforge.net/ - debugger for wxPython

PythonWorks =  GUI builder (http://www.pythonware.com) - seems to
be moribund; no reply to emails

tix - extra widgets for tk - eg tree, file, tables
http://tix.sourceforge.net/

pmw - python megawidgets - 100% python, so portable but no tree
widget

Win32
	tcl - yes
	tk - yes
	tclX - ?
	python - yes
	tkinter - yes
	tix - yes

UnixWare	
	tcl820-8.2.0.pkg
	tk820-8.2.0.pkg
	tclX811-8.1.1.pkg
	python-1.5.2.pkg
	python-2.2.pkg
	tkinter - NONE - part of python?
	tix - NONE

OpenServer
	tcl-8.1.1-VOLS.tar 
	tk-8.1.1-VOLS.tar 
	tclX-8.1.1-VOLS.tar
	python-1.5.2-VOLS.tar
	tkinter - NONE? - part of python?
	tix - NONE?

Linux
	tcl-8.3.3-67
	tk-8.3.3-67
	tclx-8.3-67
	tkinter-1.5.2
	tix-8.2.0
	python-1.5.2

Contents


4.12 Linux


Static route:

add a line to /etc/sysconfig/static-routes:
eth0 -host 192.168.254.245

or

route add -host 192.168.254.245 eth0

Gateway route:
route add -net 192.168.4.0 gw 192.168.2.15 netmask 255.255.255.0
route add -net default gw 192.168.2.1 netmask 255.255.255.0

Check DisplaySize parameter in /etc/X11/XF86Config-4

Add driver:
	cp linux-i386/e8k_driver.o /lib/modules/$(uname -r)/kernel/drivers/char/e8k.o
	modprobe e8k

On 2.2.x:
	cp linux-i386/e8k_driver.o /lib/modules/$(uname -r)/misc/e8k.o

List driver:
	lsmod

Create /dev files
	major=`cat /proc/devices |awk "\\$2==\"e8k\" {print \\$1}"`
	for minor in 0 1 2 3
	do
		mknod -m a+rw /dev/e8k${minor} c $major ${minor}
		chgrp $group /dev/e8k${minor}
		chmod $mode /dev/e8k${minor}
	done

Remove driver:
	rmmod e8k

Mount loop device:
	mount -t iso9660 -o loop=/dev/loop1 cd.iso /mnt/tmp

Contents


4.12.1 Audio


Contents


4.12.1.1 Digitising from vinyl

audacity for editing - insists on using speaker, even esddsp fails to make a difference (sometimes - someimte it works!!)

gwc for cleaning up (gnome-wave-cleaner)
gramofile for cleanup too
rythmbox, xmms or opuslegit? as players. xine & mplayer too
alsamixer -V all - make sure capture is on!!
arecord for recording:
arecord -t wav -f cd filename.wav

Connect to MIC on nina, set alsamixer -Vcapture to accept from MIC at about 27% - maybe test the level.

White phono connection from turntable is flakey - jiggle until no more hum

1. arecord to capture audio
1a. make a backup as gwc operates on the actual file
2. gwc to remove crap at start and end
3. gwc to remove clicks - keep going until no more
4. gramofile to create tracks - use filename of 0.wav
4a. wavtomp3 0*.wav
5. id3wrapper to tag and rename

Contents


4.12.1.2 Alsa

Make sure the drivers are compiled:
ALSA_CARDS='intel8x0 ens1371' in /etc/make.conf

Make sure /etc/modules.d/alsa has the right drivers eg:

alias snd-card-0 snd-ens1371
alias sound-slot-0 snd-ens1371
alias snd-card-1 snd-intel8x0
alias sound-slot-1 snd-intel8x0

Include the OSS emulation stuff:

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss

cat /proc/asound/cards to see the cards present.

Alsa `device' files (not /dev/files!!) are eg:
hw:0,0 - first digital out on 1st card
hw:1,0 - first digital out on 2nd card etc

/dev/files are:

OSS files: (skype uses these):
bhepple@raita:~/ $ ll /dev/dsp*
lrwxrwxrwx  1 root root       9 Jan 22 12:53 /dev/dsp -> sound/dsp
lrwxrwxrwx  1 root root      10 Jan 22 12:53 /dev/dsp1 -> sound/dsp1
crw-------  1 root audio 14, 35 Feb 10  2004 /dev/dsp2
crw-------  1 root audio 14, 51 Feb 10  2004 /dev/dsp3

ALSA files:
bhepple@raita:~/ $ ll /dev/sound
crw-rw----  1 root audio 14, 12 Jan 22 12:53 adsp
crw-rw----  1 root audio 14, 28 Jan 22 12:53 adsp1
crw-rw----  1 root audio 14,  4 Jan 22 12:53 audio
crw-rw----  1 root audio 14, 20 Jan 22 12:53 audio1
crw-rw----  1 root audio 14,  3 Jan 22 12:53 dsp
crw-rw----  1 root audio 14, 19 Jan 22 12:53 dsp1
crw-rw----  1 root audio 14,  0 Jan 22 12:53 mixer
crw-rw----  1 root audio 14, 16 Jan 22 12:53 mixer1
crw-rw----  1 root audio 14,  1 Jan 22 12:53 sequencer
crw-rw----  1 root audio 14,  8 Jan 22 12:53 sequencer2

Use alsamixer [-c N ] to control sound (eg unmute)

Use `alsactl store' as root to store settings

Contents


4.12.1.3 Jack

Install alsa-utils alsa-tools jack 
http://jackit.sourceforge.net

To record and listen:
jackstart -d alsa
alsaplayer -i text -o jack -s jazz http://218.118.234.57:8000
ecasound -i:jack_auto,jazz -o:jazz-radio.ogg

Contents


4.12.1.4 Arts

is the KDE sound daemon

Contents


4.12.1.5 ESD

is the gnome sound daemon

xmms and xine can drive esd which should then be able to switch &
control the output

esd -d 'hw:0,0' to output to card 0
esd -d 'hw:1,0' to output to card 1

Contents


4.12.1.6 Recording from RealPlay

(as root): but CD-RW can't be played in some CD players (eg the
Hyundai Elantra's)!

	(cd /opt/RealPlayer9; vsound -s -d ./realplay http://www.abc.net.au/rn/talks/8.30/helthrpt/audio/health_08092003_2856.ram) |sox -t au - -c 2 -r 44100 /tmp/junk.wav
	cdrecord dev=0,0,0 blank=fast
	cdrecord -pad -v speed=4 dev=0,0,0 -audio /tmp/junk.wav


Also:

vsound -k -d /opt/RealPlayer8/realplay http://www.abc.net.au/rn/science/ss/audio/science_15052004_2856.ram
... saves to vsound23675.au ... but rewinds & truncates file at end!!!

sox -t au - -c 2 -r 44100 science_15052004.mp3 < vsound23675.au
50minutes ~150Mb audio compresses to ~50Mb as mp3 in 4mins

State of the art:
	use vsound in the "grabit" script
	edit with audacity
	re-sample with sox (-r 44100 -c 2)
	limit to 80? minutes 727?Mb (762085680 is ok)
	save to CD:
	cdrecord --scanbus dev=ATAPI (or maybe ATA == DMA?)
	cdrecord -pad -v speed=4 dev=ATAPI:0,1,0 -audio *.wav

Contents


4.12.1.7 Xine

Setup->Audio

Select alsa as the sound driver then device files are
hw:0,0 for headphones
hw:1,0 for speakers

Need to restart if changed

Contents


4.12.1.8 xmms

Use the OSS plugin. Use ^P to set plugin and configure
(watch out - the OSS plugin configuration pops underneath the
configuration screen).

alsa plugin gives crap quality with ICH5

hw:0,0 for headphones
hw:1,0 for speakers

Need to restart if changed

Contents


4.12.1.9 gmplayer

Setup->Audio

Select alsa as the sound driver then device files are
hw=0.0 for headphones
hw=1.0 for speakers

Need to restart if changed

Contents


4.12.1.10 Skype

Uses OSS unless esd is running.  Seems to be no way to get the
thing use esd for output/input and speakers for ringing.

Contents


4.12.2 Auto mounts


If getting "operation ont permitted" errors then after changing
/etc/exports, you may need to stop the NFS server and then "rm
/var/lib/nfs/*"

Put these into /etc/auto.misc:

raita_root      -fstype=nfs             raita:/
raita_guest     -fstype=nfs             raita:/guest
raita_tengig    -fstype=nfs             raita:/mnt/tengig

curry_root      -fstype=nfs             curry:/
curry_guest     -fstype=nfs             curry:/guest

dux_root        -fstype=nfs             dux:/
dux_eracom      -fstype=nfs             dux:/eracom
dux_nobackup    -fstype=nfs             dux:/nobackup

mkdir -p /mnt/raita
cd /mnt/raita
ln -s /misc/raita_root root
ln -s /misc/raita_guest guest
ln -s /misc/raita_tengig tengig

mkdir -p /mnt/curry
cd /mnt/curry
ln -s /misc/curry_root root
ln -s /misc/curry_guest guest

mkdir -p /mnt/dux
cd /mnt/dux
ln -s /misc/dux_root root
ln -s /misc/dux_eracom eracom
ln -s /misc/dux_nobackup nobackup

chkconfig --level 235 autofs on

Contents


4.12.3 CD Writing


Make sure .iso is mountable with:
mount -t iso9660 -o loop cd.iso /mnt/tmp

Data:
mkisofs  -r   -o cd.iso   private_collection/
              `-------'   `-----------------'
                  |               |
         write output to   take directory as input

To make bootable, include boot.img (image of 1.44 bootable
floppy) and add -b boot.img -c options.

move .iso file to a fast disc - check that DMA in on:
	hdparm [ -d1 ] /dev/hdb 

cdrecord -scanbus [ dev=ATAPI ]
cdrecord -v speed=16 dev=1,0,0 -data cd.iso
cdrecord -v speed=16 dev=ATAPI:0,1,0 -data cd.iso

Audio:

Use "cdparanoia -B" to read all tracks then xcdroast.

Use mpg321 for this, mpg123 seems to have problems?:
for i in *.mp3; do filename=`basename "$i" .mp3`; mpg123 --cdr "$filename.cdr" "$i"; done

... make sure files are 44100Hz - not 32000!!! But how to tell?

Better still, guarantee it with: converting mp3 to .wav/.cdr:
for i in *.mp3; do echo "Processing $i"; F=`basename "$i" .mp3`; sox "$i" -c 2 -w -r 44100 "$f.wav"; done

blank=fast|all to blank CD-RW

audio on SCSI:
cdrecord -v speed=16 dev=1,0,0 -audio -pad  driveropts=burnfree *.cdr

audio on IDE:
cdrecord -v speed=16 dev=/dev/hdc -audio -pad  driveropts=burnfree *.wav
(or maybe dev=ATA:x,x,x == DMA? - doesn't work)

data on IDE:
cdrecord -v speed=16 dev=/dev/hdc -data  driveropts=burnfree *.iso

create iso & write files to dvd with RockRidge & Joliet:
growisofs -Z /dev/dvd -R -J file(s)
(-J - Joliet - is only needed for M$)

write ISO to dvd:
growisofs -Z /dev/dvd=file.iso

append files:
growisofs -M /dev/dvd -R -J file(s)

To blank a DVD+-RW:
dvd+rw-format -blank /dev/dvd

Note 700Mb = 80mins = 734,003,200 bytes
823104 (841996976 bytes) is OK!! Maybe 82600k
828464 (847496444 bytes) does not fit

Contents


4.12.4 Distros


Contents


4.12.4.1 Debian/Knoppix/Ubuntu

To bring up as rasam without DHCP:

knoppix 2 (no X) 
ifconfig eth0 192.168.2.214 up 
[ on rasam/knoppix:
route del -net 192.168.2.0 netmask 255.255.255.0 eth0 ]
route add -host 192.168.254.245 eth0 
route add -net default gw 192.168.254.245
add nameserver 192.168.0.1 to /etc/resolv.conf

To connect with wireless:
1. Go to the command line and type... wlcardconfig
2. Enter your wireless network's name (SSID) when prompted.
3. Enter your WEP key/password (if your network is encrypted) 
   when prompted.
4. Leave the other specs blank.
5. After you complete the config, at the command line type... 
   pump -i eth0
   (where "0" is the number of your wireless card)

also:

There is a netcardconfig script under the knoppix menu. That
script does both ifconfig, iwconfig, and wlcardconfig all in one
shot. Try that first if you're trying to set up a wireless
connection on your pc. 

Wheelmouse:
Boot with "knoppix wheelmouse"!! Not needed with 3.4+1

Look at klik:
http://klik.atekon.de/

Contents


4.12.4.1.1 Install from knoppix CD

Boot to console with:
	knoppix lang=us 2

knoppix-installer and choose the Debian variant - the others are
problematic eg. the knoppix variant only has one user!

Contents


4.12.4.1.2 Debian stuff for knoppix

To load nvidia driver:

module-assistant auto-install nvidia
apt-get -t testing install nvidia-glx
Put nvidia in /etc/modules
Edit /etc/X11/XF86Config-4 and:
in Module section: add "glx", remove "dri" and "GLcore" 

To have ath0 autoconfigured at boot:
Edit /etc/network/interfaces, add ath0 to the auto line and add
this:

iface ath0 inet dhcp
	wireless-essid Hepple
	wireless-key s:deadb

To do it manually:

iwconfig ( this will give you your card info and network /wireless info)

iwconfig ath0 channel 6 ( substitute channel 6 for whichever channel your router is transmitting on)

iwlist scan ( this may take a minute, this will give you your routers wireless settings.)

iwconfig ath0 essid xxxxxx ( replace xxxxxx with your routers essid)

iwconfig ath0 ap xx xx xx xx xx xx( this is the six double digit mac address required and is listed in your iwlist scan message as above.)

iwconfig ath0 key XXXXXXXXXX ( replace XXXXXXXX with your own hex wep key )

dhclient ( this gets your dhcp sorted ) you should now be up and running.

Contents


4.12.4.1.3 apt / dpkg / dselect

dpkg manages packages on the local system
apt also knows about remote servers through /etc/apt/sources.list

Find the best mirror with netselect (apt-get install netselect).
	netselect-apt stable
create sources.list optimised for stable branch

dselect is a character gui front end to dpkg.
aptitude is a character gui front end to apt.

See debian doc, also:
http://www.newsforge.com/article.pl?sid=04/12/02/1710208&from=rss

To find a package:
	apt-cache search <keyword>

To show package details:
	dpkg -p <package> # or
	dpkg -s <package>
	apt-cache show <package> # or
	apt-cache showpkg <package>

To show dependencies of a package:
	apt-cache depends <package>

To show packages that depend on a package:
	apt-get -s remove <package> # -s means 'simulate' .. OR
	apt-cache showpkg <package>

To list files in a package:
	dpkg -L <package>

To list packages matching a pattern:
	dpkg -l <package-pattern>
	dpkg -l # lists all available packages

To find the package that a file belongs to:
	dpkg -S <filename> # installed packages only
	apt-file search <filename> # works on uninstalled files too!

Managing services:
	update-rc.d <service eg. portmap> defaults 

To install/remove a package:
	apt-get install | remove <package>
	apt-get -s install <package> # -s == simulation
	apt-get --purge remove <package> # removes the config files too

To get the system up to date:
	apt-get update
	apt-get dist-upgrade
	vi /etc/apt/sources.list
	apt-show-versions -u # or 
	apt-get -u upgrade
	apt-get upgrade

To list all packages:
	COLUMNS=132 dpkg -l # or
	dpkg --get-selections

Contents


4.12.4.1.4 Netgear configuration

Just access KNOPPIX->config->wavelan configuration
pump -i ath0

Contents


4.12.4.1.5 Networking

/etc/network/interfaces

auto lo eth0
iface lo inet loopback

iface eth0 inet static
        address 192.168.2.214
        netmask 255.255.255.0
        broadcast 192.168.2.255
        gateway 192.168.2.2

Contents


4.12.4.1.6 Kernel source installation

Try module-assistant

Unpack the kernel source and patch as usual, run "make menuconfig" etc as usual, but then:

	make-kpkg [--initrd] kernel-image

... makes a custom kernel package. Install it with:

	dpkg -i kernel-image-2.4.20_10.00.Custom_i386.deb

If built with --initrd, then initrd binary is built at "dpkg -i" time.

Contents


4.12.4.1.7 init.d

update-rc.d ssh defaults

Contents


4.12.4.2 Gentoo

Contents


4.12.4.2.1 Avoiding downgrading unmasked emerges

If you do:
	emerge /usr/portage/net-mail/sylpheed/sylpheed-0.9.7.ebuild

ie. unmasking it the same as using ACCEPT_KEYWORDS="~x86" then a
later "emerge -u world" downgrades sylpheed to the last stable
version - at this time, 0.9.4

The way to avoid this is to do this instead:
	emerge -U world 

Nope - that got deprecated but it was not announced much!
Instead, put an entry in /etc/portage/package.keywords like

=gcc-0.9.0 ~x86

and 0.9.0 will be the minimum level until the stable chain passes
that level. See http://gentoo-wiki.com/TIP_package.keywords

This will print a list of packages that have been installed under
a mask:

while read P; do if etcat -v $P |grep '\[M.I\]' >/dev/null; then echo $P; fi; done </var/lib/portage/world

Contents


4.12.4.2.2 rc.d

scripts in /etc/init.d
configuration scripts in /etc/conf.d

See and control the runlevels with
rc-update show|add|del <runlevel>

runlevels are 
boot  default  nonetwork  single

See status of runlevels with rc-status

Note that the local script runs /etc/conf.d/local.start|stop

Contents


4.12.4.2.3 curry

need to do a 

ACCEPT_KEYWORDS="~x86" emerge net-mail/sylpheed-0.9.7

gdcalc, gjots & qalculate ebuilds???

Contents


4.12.4.2.4 GF5: What are masked packages?

Packages that will not be installed on your system unless you
take specific actions. A package may be masked by placing an
entry in /usr/portage/profiles/package.mask. Historically, this
was the only way to mask packages. If you wish to install a
package that is masked in package.mask, you will need to comment
out the mask entry line for that package. Note that package.mask
is overwritten by "emerge sync", so your changes will not persist
across a sync. Some workarounds for this can be found in emerge
overwrites packages.mask. You can also mask problematic packages
by adding entries to packages.mask.

The newer way to mask packages is to declare KEYWORDS in the
ebuild file. For each architecture (x86, ppc, sparc, sparc64,
alpha), an ebuild may be marked '-arch', meaning "does not work",
'~arch', meaning "unstable", or 'arch', meaning "stable". You can
set your level of tolerance for unstable ebuilds by defining
ACCEPT_KEYWORDS in /etc/make.conf - for example,
ACCEPT_KEYWORDS="~x86" will accept unstable packages on the x86
architecture. By default, your profile is set to accept stable
packages only. ACCEPT_KEYWORDS can also be set on the command
line. For example, Code: ACCEPT_KEYWORDS="~x86" emerge -pv
unstablepackage Make sure not to put spaces around the '='.

There is currently no way for ACCEPT_KEYWORDS to "stick" to a
package or packages, so it is somewhat complicated to mix stable
and unstable packages. "Sticky variables" will hopefully become
part of Portage. Those interested should follow bug #3252.

You can always pass a full path to an ebuild to emerge, and this
will bypass all mask checking, so this is another quick way to
install one masked package. This method has the downside of also
bypassing dependency checking, so it is not recommended for
general use.

If you are using Portage >= 2.0.48, there is another option for
installing masked packages that does not require editing
package.mask. You can add a category/package entry into the file
/etc/portage/package.unmask, which will survive across an "emerge
sync".

You can also mask packages locally, if you wish. With early
versions of Portage 2.0.48, the file to do this is
/etc/portage/profiles/package.mask. With Portage 2.0.48-r4 and
beyond, this file moves to /etc/portage/package.mask.

To get an overview of what versions of a package are available,
you can use the "etcat" command, which is included in the
gentoolkit package. For example: Code: etcat -v package

Contents


4.12.4.2.5 Local ebuilds

See PORTDIR_OVERLAY=/usr/local/portage in /etc/make.conf

Contents


4.12.4.2.6 Move from xfree to xorg

http://forums.gentoo.org/viewtopic.php?t=158911

Also if anyone wants to backup ther xfree compilation, just
incase Wink do this:

Code:
quickpkg xfree


That will make a binary package of the xfree (WITHOUT recompiling
it). Then you can just:

Code:
emerge --usepkgonly xfree

Save off XF86Config* somewhere


Clean up your system:
Stop the xfree/xfs tasks:
Code:

   /etc/init.d/xdm stop
   /etc/init.d/xfs stop

I don't know if this is necessary, I did that because these are being removed later:
Code:

   rc-update del xdm
   rc-update del xfs


Let's start removing that deprecated xfree thing Wink (you made a backup of your data!!!)
Code:

   emerge -C xfree

Don't know if this is necessary, just thought that there are several things changed Wink
Code:

   env-update

Go for x.org:
Code:

   emerge xorg-x11 -pv

Like what you are seeing? Ok, go on:
Code:

   emerge xorg-x11 -f (you can leave that step, I've got a very bad connection :/ )
   emerge xorg-x11

Have a coffee, this took ~55 minutes on my system
After that I did a
Code:

   env-update

followed by
Code:

   etc-update

This reorganized a lot of configs on my system, after that I just had to edit a few files:


      copied /etc/X11/XF86Config to /etc/X11/xorg.conf
      edited FontPaths in this configuration
      edited directories in /etc/fonts/fonts.conf


Then gave it a try:
Code:

   /etc/init.d/xfs start

Watching the service with fingers crossed scanning his font directories... Wink
All done without any trouble!

Ok, we're save to do
Code:

   rc-update add xfs default

Next I had to switch to xorg-x11 libGL:
Code:

   opengl-update xorg-x11

Ready to go for
Code:

   /etc/init.d/xdm start

Was without any problems bringing up my gdm, logged in and enjoyed my new environment Smile

Last thing to do:
Code:

   rc-update add xdm default



Additional things:
When updating ati-drivers portage wants xfree, I just injected it by typing
Code:

   emerge --inject x11-base/xfree-4.3.0-r5

that gave me an error:
Code:

   !!! BAD COUNTER in 'x11-base/xfree-4.3.0-r5'

but also said
Code:

   >>> Injected x11-base/xfree-4.3.0-r5.

To be sure I tried
Code:

   emerge ati-drivers -pv

which gave me
Code:

   These are the packages that I would merge, in order:

   Calculating dependencies ...done!
   [ebuild  N    ] media-video/ati-drivers-3.2.8-r1  +gnome -kde -qt  4,262 kB
 
   Total size of downloads: 4,262 kB

So the error seems to be not critical Wink


First I was a bit afraid of removing that xfree-monster and replacing it with x.org... had horrible ideas about being there without anything running, broken libs etc.
Nothing of these nightmares happened, it works perfect and now I will start studying the differences between those systems Smile

Fonts problem under xorg:
http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts

Contents


4.12.4.2.7 Portage queries

What's installed:
	less /var/lib/portage/world

What's owns file X:
	equery belongs X

What files are in package X:
	equery files [ --filter=doc] X

What installed packages depend on package X:
	equery depends dev-libs/openssl

To find out depencies of a package:
	equery depgraph <package>

Get info on installed package X:
X doesn't need to be a complete package name
	emerge --search X 
	emerge --searchdesc X

What packages are available:
	equery list -p pkg
	emerge search X

What USE flags a package uses:
	equery uses pkg
	emerge -vp pkg

What ebuild file applies:
	equery which pkg

What needs building after changing USE flags:
	emerge -uDvp --newuse world

Contents


4.12.4.2.8 raita Installation

o Todo: cups?, foomatic?, openjade etc?, gentoo docs, xmixer,
audacity+, xcal, sunclock, xpdf, acroread, tkwget, xtide?,
cdrdao, cdriso, devils-dict-pre?, gnome-utils?, patience,
xfonts-artwiz?

o success: rxvt, tcl, tk, tkcvs, gs, gv, emacs, cvs, vim, ascpu,
asmem, gftp, freeswan, fvwm-2.5, perl, mozilla, jdk, gimp*,
xsane*, apache, imagemagick*, ncftp*, openssl, openssh,
fetchmail*, units*, mailx*, samba*, xloadimage, xephem, xzgv*,
rpm, nvidia, rdate, openoffice*, freefont, aquafont, aquapfont,
xmms, vmware, gnumeric, xosview*, ical, xine-ui, sox*, alsa*,
mpg123*, mpg321*, AbiWord, xgammon, xgalaga, xearth, xcdroast+,
ddd, linneighborhood, gnomba, antiword, cdrtools, grip, mtools,
at, glade, glade-2, alsaplayer, mplayer, cdparanoia, bladeenc?,
acroread, foomatic, cups, audacity, qalculate, gjots, gdcalc,
wine, winesetuptk, nedit, gpa, gpg, strace, gmplayer, pygtk,
gnome-python, pyorbit, dillo, mpage, gaim, nano, webmin, lynx,
rpm, swig, gentoolkit, fetchmail, moinmoin, chkrootkit

o non-emerge: root, wmpload, ccrypt, HOWTO, realplay, xpat2,
tkdiff 

o failed: lprn?, Xnest, xcpustate*, xplaycd (multimedia)

Injected:
	gnome-extra/gnome-games-2.4.0
	net-www/epiphany-1.0
	mozilla-firebird or mozilla?

Fix:
Get netpbm docs
http://www.openoffice.org/FAQs/fontguide.html#8

Get:
leim-21.3.tar.gz

# emerge nvidia-glx
# emerge nvidia-kernel
# nano -w /etc/X11/XF86Config
# echo "nvidia" >> /etc/modules.autoload
# modprobe nvidia

In XF86Config:
Uncomment glx
change "nv" to "nvidia"

Bloody awful time with sendmail/procmail. Mail was being
swallowed quietly - actually, I just didn't realise it but
procmail was delivering to ~/.maildir/new. It just needed the
following in /etc/procmailrc:	

DEFAULT=/var/spool/mail/$LOGNAME

Actally, MAIL=/var/spool/mail/$USER in /etc/profile is the right
place to do this!

'su' command syntax is different to RH9!!! Now is:
	su - user [ args ]

Needed to remove line "only_from" line from /etc/xinetd.conf as
well as enable individual services!

Need to "emerge inject net-www/epiphany-1.0" and/or 1.0.6 to
prevent mozilla and epiphany from being installed!

3/11/04: masked packages are:

app-arch/rpm        [M I] 4.2.1 (0) OVERLAY
media-video/dvdauthor        [M~I] 0.6.10 (0) OVERLAY
media-video/transcode        [M~I] 0.6.12-r1 (0) OVERLAY
mail-filter/spambayes        [M~I] 1.0_alpha9 (0) OVERLAY
net-wireless/madwifi-tools        [M~I] 0.1_pre20040906 (0) OVERLAY
media-video/mplayer        [M~I] 1.0_pre5-r2 (0) OVERLAY
media-video/kino        [M~I] 0.7.0 (0) OVERLAY
sys-apps/gscanbus        [M~I] 0.7.1 (0) OVERLAY
media-video/dvgrab        [M~I] 1.5 (0) OVERLAY

to remove blocks, did:
emerge unmerge modutils module-init-tools gtk-engines-thinice acme

emerge -pv depclean threw up these which may need re-installing:
app-misc/gramps-1.0.1
media-fonts/freefonts-0.10-r2
media-libs/openquicktime-1.0-r1
x11-themes/gtk-engines-metal-2.2.0
 media-sound/mp3info-0.8.4-r1
 dev-libs/libole2-0.2.4-r1
 sys-libs/libavc1394-0.4.1
 sys-libs/libraw1394-0.9.0
 app-admin/addpatches-0.2
 media-video/nvidia-kernel-1.0.5336-r4
 media-libs/mpeg-lib-1.3.1-r1
 net-wireless/madwifi-driver-0.1_pre20040824-r1
 dev-util/glade-0.6.4
 sys-apps/netkit-base-0.17-r6
 media-video/nvidia-glx-1.0.5336-r2
 media-libs/libcdaudio-0.99.6-r2

4/11/04: problems re-emerging openoffice-bin, gimp-2.0.4 and
dvdauthor - as instructed by "revdep-rebuild -pv" - they seem to
work

Contents


4.12.4.2.9 Sysadmin

To set start up state of daemons:
	rc-update add <daemon> <run-levels>

run-levels is just "boot", "default" or "nonetwork"

See /etc/runlevels

See /etc/rc.conf

To create digests for new ebuilds, do this:

	ebuild pkg digest

If you want to recompile your entire system do the following:

emerge gentoolkit  #only if you dont currently have it
qpkg -nc -I | sort | uniq | NOCOLOR=true xargs emerge 2>&1 >qpkg-make.log

or (better):

emerge -e world

To handle etc-update:
read F; b=`basename "$F"`; d=`dirname "$F"`; meld $d/$b $d/._cfg0000_$b; rm -i $d/._cfg0000_$b

emerge localepurge, edit /etc/locale.nopurge and run 
localepurge
occasionally to flush out unwanted locale files.

Use distcleaner (http://www.leak.com.ar/~juam/code/distcleaner/) 
distcleaner -a not_installed

or 
distclean.py (http://www.stacken.kth.se/~foo/gentoo/) to remove old tarballs from
/usr/portage/distfiles

Find packages no longer in portage (too old - maybe need ~x86 flags):

python -c 'import portage; print [x for x in portage.db["/"]["vartree"].getallcpv() if len(portage.portdb.xmatch("match-all","="+x))==0]'

To build a bin package (into PKGDIR=/usr/portage/packages/All):
	emerge --buildpkg

To create a bin package from an already installed package:
	quickpkg

To use a bin package:
	emerge --usepkg
 	PORTAGE_BINHOST="ftp://buildhost/gentoo" emerge --usepkg --getbinpkg 

To find out what USE flags can be set for a package:
	equery uses transcode

USE variable descriptions:
	/usr/portage/profiles/use.desc

Contents


4.12.4.2.10 emerge sync & update

Apparently, this is the right way to sync & update the system now:

emerge --sync
emerge -uDv --newuse world
emerge -pv --depclean
emerge -v --depclean # remove orphans, sorta
revdep-rebuild -pv
revdep-rebuild -v # fix reverse dependencies
dispatch-conf ... instead of etc-update which is 'filthy' Keeps versions of config files

# to clean up the distfiles (& save heaps of space):
distcleaner -a not_installed

# clean up unwanted locale files:
localepurge

# find unneeded entries in world file:
dep -wp
# a better depclean?:
dep -dp
# find slot duplicates:
dep -Pp

# dep is from udept package: http://catmur.co.uk/gentoo/udept

emerge -inject is now deprecated - put the package in
/etc/portage/profile/package.provided - note that the version
number need not be a valid one but _must_ be present

eg. 
net-www/mozilla-999
net-www/epiphany-999

Skip a single version of a package with a line in /etc/portage/package.mask:
=mail-filter/spambayes-1.0_rc1

also, print packages with multiple versions:
qpkg -I -d

Contents


4.12.4.2.11 udev

http://www.gentoo.org/doc/en/udev-guide.xml

Contents


4.12.4.2.12 Networking setup files

All in /etc:
resolv.conf

hosts

conf.d/net ... settings for each if incl routes and default gw eg:
iface_eth0="192.168.254.245 broadcast 192.168.254.255 netmask 255.255.255.0"
iface_ath0="dhcp"
dhcpcd_ath0="-dR" # options to dhcpcd

conf.d/dhcp

dhcp/dhcp.conf

openvpn/*

iptables-firewall.conf # for Arno's firewall

rc.firewall # for guarddog

Startup scripts:
/etc/init.d/net.ath0
/etc/init.d/net.eth0
/etc/init.d/openvpn
/etc/init.d/iptables.arno

Where to set iwconfig????

To find out what access points there are:
iwlist ath0 scan # ath0 must be "Managed"

Contents


4.12.4.2.13 Files


/etc/make.profile -> ../usr/portage/profiles/default-linux/x86/2005.0/

/etc/locales.build - what locales to include when building libc. Needs
	echo "sys-libs/glibc userlocales" >> /etc/portage/package.use

/etc/portage/ # local customisations
	package.keywords
	package.mask
	package.provided
	package.use
	profile

/usr/portage/profiles/use.desc # use descriptions
/etc/make.conf

Contents


4.12.4.2.14 nvidia

nvidia USE flag in /etc/make.conf

emerge nvidia-kernel
emerge nvidia-glx
eselect glopen list
eselect glopen set ...
change xorg.conf - no dri or GLcore

Contents


4.12.4.2.15 cyrus-sasl

I had to do CFLAGS="" emerge -u cyrus-sasl even though it wasn't set

Contents


4.12.4.2.16 To find out which packages have no dependents (ie are orphans):

equery list # lists all packages (plus annoying header) |
  sed 's/-[0-9].*$//' # remove version strings (but it fails on eg fonts-75dpi-1.0.2) |
  (  
     read W # remove annoying header
     while read PKG; do 
        echo "$PKG is needed by:"
        equery depends $PKG
        echo
      done
  ) > /root/dependencies

Contents


4.12.4.3 RedHat

Add a static route by creating:
/etc/sysconfig/network-scripts/route-eth0
with contents:
192.168.254.245 dev eth0

To get rpm running on 2.6:
	export LD_ASSUME_KERNEL=2.2.5

Configuring interfaces:
http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-networkscripts-interfaces.html

Contents


4.12.4.3.1 Fedora
Core 1 2.4.22
Core 2 (Tetnatz?) 2.6.5-1.358
Core 3 2.6.9-1.667
Core 4 (Stenz) 2.6.11-1.1369_FC4
Core 8 2.6.24.7-92.fc8

up2date repository configuration:
	/etc/sysconfig/rhn/sources

Contents


4.12.4.3.2 Kernels

1.0	  	 
1.1 	  	 
2.0 	  		    1.2.13-2
2.1 	  	 
3.0.3 	Picasso 	2.0-1
4.0 	Colgate 	2.0.18-6
4.1 	Vanderbilt 	 
4.2 	Biltmore 	2.0.30-2
5.0 	Hurricane 	2.0.32-2
5.1 	Manhattan 	2.0.34-0.6
5.2 	Apollo 		2.0.36-0.7
6.0 	Hedwig 		2.2.5-15
6.1 	Cartman 	2.2.12-20
6.2 	Zoot 		2.2.14-5.0
7.0 	Guinness 	2.2.16-22
7.1 	Seawolf 	2.4.2-2
7.2 	Enigma 		2.4.7-10/2.4.9-21smp1
7.3 	Valhalla 	2.4.18-32
8.0 	Psyche 		2.4.18-14
9.0 	Shrike 		2.4.20-8/2.4.20-20.9
WS1 			    2.4.21
WS3 	Taroon		2.4.21-2.EL
RHEL 4 	            2.6.9
RHEL 5              2.6.18

also see:

http://www-306.ibm.com/software/data/informix/linux/ids.html

Contents


4.12.4.3.3 /etc/init.d
chkconfig --level 345 ntpd on

Contents


4.12.4.3.4 CentOS
Downstream from RedHat
Load more RPMS from RPMFORGE

Contents


4.12.4.3.5 RPM
To override /usr/src/redhat:

rpmbuild --define="_topdir ${TOPDIR}" -bp etc
-bs = build the SRPM

or

~/.rpmmacros:
%_topdir    /home/bhepple/tmp/rpm
%_tmpdir    /home/bhepple/tmp/rpm/tmp

To list all macros:
rpm --showrc

To see an individual macro:
rpm --eval %_topdir

To set macros in ~/.rpmmacros:
%_topdir    /home/bhepple/tmp/rpm
%_tmppath    %{_topdir}/tmp

build from a source package:
rpmbuild --rebuild SRPM [ --define 'dist .pcl' ]

To see the log of what was installed and when:

rpm -qa --last |less

To print the fields of an rpm package: 
http://www.rpm.org/max-rpm/s1-rpm-query-parts.html
rpm -qp --queryformat <format> pkg
eg 
NAME == N
VERSION == V
RELEASE == R
SOURCERPM

rpm -qp "%{INSTALLTIME}:date\n" pkg
rpm -qp --queryformat "%{N} %{V} %{R}\n" pkg

To print out the tags available:
rpm --querytags

Contents


4.12.4.3.6 yum

See yum (CLI and account-free) and up2date (GUI but needs an account with RH)

Bring in keys:
	rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora

To install a package:
	yum install emacs

To get RPMs other than Official Fedora one install FreshRPMS:
	install: http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/3/freshrpms-release/freshrpms-release-1-1.fc.fr.noarch.rpm
	and then:
	yum -y check_update

To check what needs updating:
	yum check-update

To update packages:
	yum update packagename packagename packagename

To update all:
	yum update

Configuration: eg. add a repository:
	/etc/yum.conf

To use a local copy of RPMS:
	createrepo /opt/fedora-core4-dvd/Fedora/RPMS
and then add this to /etc/yum.conf:
	

[local]
name=localstuff
baseurl=file:///opt/fedora-core4-dvd/Fedora/RPMS

To use local DVD/CDROM only (this is on CentOS5.2):
Look in /etc/yum.repos.d for the media repo:
	mount /dev/dvd /media/cdrom
	yum --disablerepo=\* --enablerepo=c5-media list available

This works as a repo:
[c5-media]
name = c5-media
#mediaid=1194015397.199387
metadata_expire=-1
gpgcheck = 0
cost=500
baseurl = file:///home/bhepple/tmp/dvd/
enabled = 0

Contents


4.12.4.3.7 Static network configuration:

/etc/sysconfig/network:
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=tulkas.oz.agile.tv
GATEWAYDEV=eth0
GATEWAY=192.168.16.1

/etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=none
HOTPLUG=no
HWADDR=00:14:22:09:7A:86
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.18.60
NETMASK=255.255.255.0
BROADCAST=192.168.18.255

/etc/sysconfig/network-scripts/route-eth0:
ADDRESS0=192.168.16.0   # addresses served by this gateway
NETMASK0=255.255.255.0
GATEWAY0=               # IP address of the gateway; blank to use eth0
ADDRESS1=0.0.0.0
NETMASK1=255.255.255.255
GATEWAY1=192.168.16.254


See:
http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html
http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html

Contents


4.12.4.3.8 dhcp network configuration:

/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=tulkas.oz.agile.tv

/etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:11:11:5D:9C:25
ONBOOT=yes
DHCP_HOSTNAME=pacific.oz.agile.tv
SEARCH=oz.agile.tv
TYPE=Ethernet
DNS1=192.168.16.1

Contents


4.12.4.4 rPath/foresight

Anaconda installer
kudzu hardware mgr
... looks like RH but for RPM => conary:

Contents


4.12.4.4.1 Conary

http://wiki.rpath.com/wiki/Conary:conary_query
http://planet.conary.com/
http://people.rpath.com/~johnsonm/mug2007/

http://wiki.rpath.com/wiki/Conary:Package_Recipe_Classes
http://wiki.rpath.com/wiki/Conary:Group_Recipe_Classes

While very similar to RedHat (eg. the use of anaconda for
installation, kudzu for hardware management and chkconfig for
startup scripts with /etc/init.d/*  and /etc/rc*.d), rPath is
built on a new repository and package management system, conary,
that supplants RedHat's rpm.

Here's an overview of the main query commands of conary:

conary help                # prints help
conary help query          # prints help on the query command
conary query               # lists all packages installed on the system with the revision
conary query <pkg>         # just shows the package and its version
conary query --info <pkg>  # gives a little (very little) info about a package
conary query --ls <pkg>    # lists the files in the package
conary query --lsl <pkg>   # lists long info about files in the package
conary query --path <file> # lists the package that the file belongs to (note:
   this is not documented by conary help query!!!)
conary query --deps <pkg>  # lists dependency (backward & forward)

There is no descriptive information included in the packaging system - such as
an analogue of rpm ­qi <pkg>. Here is a sample:

    [root@rsa etc]# conary query ­­info TurboKid                         
    Name      : TurboKid           Build time: Thu Jun  1 17:53:00 2006
    Version   : 0.9a5­1­1          Label     : rap­emc.rpath.com@rpath:emc­production­1
    Size      : 14406             
    Pinned    : False
    Flavor    :

... that's it! That's all you get! Compare the ubuntu (debian) way:
    bhepple­pc:chkconfig­1.3.30/ $ dpkg ­s vim
    Package: vim
    ... snip ...
    Description: Vi IMproved ­ enhanced vi editor
     Vim is an almost compatible version of the UNIX editor Vi.
     .
     Many new features have been added: multi level undo, syntax
     highlighting, command line history, on­line help, filename
     completion, block operations, folding, Unicode support, etc.
     .
     This package contain a version of vim compiled with a rather
     standard set of features. See the other vim­* packages if you
     need more (or less).

conary config prints details of the repository and other configuration details.
Note that the EMC Shanghai repository is set in /etc/conary/config.d/rba­
shanghai:

Contents


4.12.4.4.1.1 Compile conary/cvc for linux

Need libelf-dev
Need libsqlite3-dev
NO_KID=1 make
NO_KID=1 make install
mkdir /var/lib/conarydb
chmod a+rwx /var/lib/conarydb

Contents


4.12.4.5 SourceMage

Enquire about spell's website:
	gaze url <pkg>

Enquire what packages are available:
	gaze grimoire

Install package:
	cast <pkg>

See dependencies before installing:
	cast --deps <pkg>

Remove package:
	dispel <pkg>

Front-end:
	sorcery

Download only:
	summon <pkg>

Upgrade the grimoire:
	sorcery update
	scribe update

/etc/init.d is controlled through simpleinit/initctl

Contents


4.12.4.6 Suse

Mirror at http://mirror.pacific.net.au/linux/suse

Contents


4.12.4.6.1 Kernels
SUSE 8      2.4.18
SUSE 8.1    2.4.19
SUSE 8.2    2.4.20
SUSE 9      2.4.21
SUSE 9.1    2.6.4
SUSE 9.2    2.6.8
SUSE SLES8  2.4.19
SUSE SLES9  2.6.5

Contents


4.12.4.7 Yoper

Yoper and Netgear wireless card:
http://www.linuxforums.org/forum/post-119238.html

Contents


4.12.5 gnome/gtk2 fonts


see .gtkrc-2.0 instead of .gtkrc

use gfontsel instead of xfontsel
/etc/fonts/font.conf
fc-cache -v -f to rebuild cache

Populate /etc/fonts/local.fonts, eg:
    <dir>/usr/X11R6/lib/X11/fonts/local</dir>
    <dir>/usr/X11R6/lib/X11/fonts/misc</dir>
    <dir>/usr/X11R6/lib/X11/fonts/Speedo</dir>
    <dir>/usr/X11R6/lib/X11/fonts/CID</dir>
    <dir>/usr/X11R6/lib/X11/fonts/util</dir>
    <dir>/usr/X11R6/lib/X11/fonts/truetype</dir>
    <dir>/usr/X11R6/lib/X11/fonts/TrueType</dir>
    <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>
    <dir>/usr/X11R6/lib/X11/fonts/cyrillic</dir>
    <dir>/usr/X11R6/lib/X11/fonts/freefont</dir>
    <dir>/usr/X11R6/lib/X11/fonts/jmk</dir>
    <dir>/usr/X11R6/lib/X11/fonts/lfp-fix</dir>
    <dir>/usr/X11R6/lib/X11/fonts/lfp-var</dir>
    <dir>/usr/X11R6/lib/X11/fonts/ukr</dir>
    <dir>/usr/X11R6/lib/X11/fonts/util</dir>
    <dir>/usr/share/fonts/default/Type1</dir>
    <dir>/usr/share/fonts/default/corefonts</dir>
    <dir>/usr/share/fonts/default/ghostscript</dir>
    <dir>/usr/share/ghostscript/fonts</dir>
    <dir>/usr/share/fonts/freefont</dir>
    <dir>/usr/share/fonts/terminus</dir>
    <dir>/usr/share/fonts/afms/adobe</dir>
    <dir>/usr/share/fonts/ttf/ja/aqua</dir>
    <dir>/usr/share/fonts/ttf/ja/aquap</dir>
    <dir>/usr/share/fonts/ttf-bitstream-vera</dir>

maybe:
> /usr/X11R6/bin/mkfontdir
> /usr/X11R6/bin/mkfontscale
> /usr/X11R6/bin/fc-cache
> xset fp rehash
ttmkfdir to create fonts.dir
ttmkfdir -o fonts.scale

export GDK_USE_XFT=1 for antialiased fonts

Contents


4.12.6 Kernel gen


1. get sources - eg 
#remove sys-kernel/gentoo-sources/ from /etc/portage/profile/package.provided
emerge -u sys-kernel/gentoo-sources/
#untar and remake link to /usr/src/linux

2. Configure
#copy old config in here and
make oldconfig
#maybe adjust with make xconfig
#get some clues with
cat `find . -name Kconfig` >junk
less junk

3. Compile
make bzImage modules modules_install

4. Install
cp arch/i386/boot/bzImage /boot/bzImage-${VERSION}
cp System.map /boot/System.map-${VERSION}
cp .config /boot/config-${VERSION}
#adjust /etc/lilo/conf
lilo

5. Reboot
# reboot to single user eg
22r5 single

8. Reinstall non-core drivers
emerge nvidia-driver
emerge madwifi-ng
emerge alsa-driver

9. Reboot

Contents


4.12.7 kgdb


See http://kgdb.sourceforge.net

2 machines - test (rasam) and monitor linked with null modem
serial cable _and_ a network.

Build kernel with -g flag - have no modules save e8k

Copy the kernel to test machine:
	rcp System.map rasam:/boot/System.map-2.4.6-kgdb
	rcp arch/i386/boot/bzImage rasam:/boot/vmlinuz-2.4.6-kgdb

Configure lilo/grub with:
	append="gdb gdbttyS=0 gdbbaud=115200"

Note: I needed root=/dev/hda2 instead of LABEL=/

Set appropriate speed for serial line on monitor machine:
	stty ispeed 115200 ospeed 115200 < /dev/ttyS0

Connect to the test machine using gdb command "target":
	(gdb) target remote /dev/ttyS0

to make the test kernel drop into kgdb:
	echo -e "\003" > /dev/ttyS0

To stop kernel execution, press Ctrl + C on the gdb terminal.

To create a gdb scriptfile to debug the module, compile the e8k
driver on the target machine. Then change /etc/init.d/e8k to use
insmod -m instead of modprobe > e8k-map. Then process this file
with a modified loadmodule.sh (make-e8k-script) to create the
scriptfile.

	make-e8k-script <e8k-map >e8k-script 

The driver e8k.o and source need to be visible to gdb on the
monitor.

	(gdb) source e8k-script

make-e8k-script is in ~/work/linux

Note: to debug init_module code:
	(gdb) dir kernel
	(gdb) b sys_init_module

When that breakpoint is hit, break at the line that calls
mod->init() and check *name to see if it's our module. Then step
into init_module.


Contents


4.12.8 Kiobufs removed


One of the advantages of the new "commits" mailing list is that
one can see the patches which slip quietly into the kernel
without public discussion. One of those is this patch by
Christoph Hellwig, via Andrew Morton, which removes the "kiobuf"
infrastructure from the kernel. This patch has been merged by
Linus, and will show up in the 2.5.43 development kernel.

The kiobuf structure was developed by Stephen Tweedie as a way,
initially, of implementing the raw block I/O devices in the 2.3
development series. Using kiobufs, kernel code can perform
operations directly to and from user-space buffers without having
to worry about walking page tables, pinning pages into memory,
and so on. Kiobufs did the job they were designed to do, and they
found their way into a number of kernel developments.

Not everybody was happy with the kiobuf interface, however. Many
saw it as a heavyweight structure, requiring a lot of time (and
memory) to set up and tear down. Kiobufs also forced the
splitting of large I/O operations into small chunks - often as
small as a single 512-byte sector, but never larger than 64KB. As
a result, kiobufs never became the high-performance I/O mechanism
that it was intended to be.

So what replaces kiobufs in the 2.5 kernel? Modern direct I/O
code uses the get_user_pages() function:

        int get_user_pages (struct task_struct *tsk,
                            struct mm_struct *mm,
                            unsigned long start, int len,
                            int write, int force,
                            struct page **pages,
                            struct vm_area_struct **vmas);


This function faults in len user pages starting at start, and
locks them into the page cache. Return values include the struct
page pointers (in pages) and pointers to the associated VMA
structures (in vmas); either can be NULL if the caller is not
interested in that information. Code which used kiobufs will want
the struct page pointers, which can be used to set up DMA
operations or other direct transfers; most callers do not need
the VMA pointers. The pages should be passed (individually) to
page_cache_release() when the operation is complete.

The asynchronous I/O patches have also, at times, included a new
kvec structure which looks like a lighter, faster version of
kiobufs. No patches with kvecs have been merged by Linus,
however. 

Kiobufs, meanwhile, have reached a dead end. It's worth
remembering, though, that kiobufs were the pioneering effort into
the use of struct page pointers for direct I/O. The code may be
gone, but the lessons learned from kiobufs live on in the current
implementation.

For examples of use, see: (2.4.18):
	kernel/ptrace.c
	fs/binfmt_elf.c
	mm/memory.c (definition also make_pages_present())

Also:
	2.5.25-akpm/fs/direct-io.c
	2.5.45/drivers/scsi/sg.c has an excellent implementation

Also see bio_map_user() which uses get_user_pages()

Contents


4.12.9 Linux 2.5.x-2.6.x


http://lwn.net/Articles/39901/:

You need replacement module utilities from 
http://www.kernel.org/pub/linux/kernel/people/rusty/modules/ - A
backwards compatible set of module utilities is also available 
from the same URL in RPM format.

For Red Hat users, there's another pitfall in "/etc/rc.sysinit". 
During startup, the script sets up the binary used to dynamically
load  modules stored at "/proc/sys/kernel/modprobe". The
initscript looks  for "/proc/ksyms", but since it doesn't exist
in 2.5 kernels, the  binary used is "/sbin/true" instead.

This, eventually, will keep modules from working. Red Hat users
will  have to patch the "/etc/rc.sysinit" script to set 
"/proc/sys/kernel/modprobe" to "/sbin/modprobe", even  when
"/proc/ksyms" doesn't exist.

gcc 3.2.2-5 as shipped by Red Hat generates incorrect code in the
 kmalloc optimisation introduced in 2.5.71  See
http://linus.bkbits.net:8080/linux-2.5/cset@1.1410

RPM and realplay may need:
 export LD_ASSUME_KERNEL=2.2.5

vmware - not in 4.0.2 or 4.0.5 ...? patches may work at
http://thomer.com/linux/migrate-to-2.6.html

Contents


4.12.9.1 2.6.6? Building external modules

http://lwn.net/Articles/79560/:

Building external modules
Changes in the kernel build process have yielded a number of benefits in 2.6. They have, however, exposed a few rough edges for people building external modules. The required procedure is a bit inelegant, forces the user to ignore warnings from the build code ("you messed with SUBDIRS, do not complain if something goes wrong"), and does not support modversions. It also requires the presence of a configured and built kernel source tree, something which was not necessary with previous kernels, and a build of an external module will often try to rebuild things in the main tree as well. Fixing up the external module build process has been on the "to do" list for some time.

Finally, somebody has done it. Sam Ravnborg has posted a patch which improves the external module build process in a number of ways.

The basic form of a makefile for an external module will not change much. It should still look something like:

    ifneq ($(KERNELRELEASE),)
    obj-m	:= module.o

    else
    KDIR	:= /lib/modules/$(shell uname -r)/build
    PWD		:= $(shell pwd)

    default:
	$(MAKE) -C $(KDIR) M=$(PWD) 
    endif

The change has been underlined above; the parameter that once read SUBDIRS=$(PWD) has changed to M=$(PWD). The older SUBDIRS= format will still work, however. It is also no longer necessary to specify the modules target when invoking the kernel build system.

When the kernel build system is invoked with the M= parameter, it does a number of things differently. It will make no effort to ensure that the built files in the kernel source tree are current; if a developer makes a change to the main tree, it is his or her responsibility to rebuild it before trying to make any external modules. Only a few targets (modules, clean, modules_install) are supported when building external modules. And the modpost program now maintains a file (Module.symvers) containing the symbol version information if modversions is in use; this file is used when postprocessing an external module to note the symbol versions expected by that module.

Among other things, the new scheme will allow distributors to package sufficient information for the building of external modules without the user having to actually configure and build the full kernel source tree. That information can be stored under /lib/modules by replacing the build symbolic link (which currently points back to the source tree) with a directory containing just the required information. That should make life simpler for everybody involved. 

Contents


4.12.10 Live CD's


Knoppix
Kanotix
Kurumin
Livux
MEPIS
ProMEPIS
Slax
Aurox
BerryLinux
Basilisk
Adios
PCLinuxOS
MandrakeMove
Gnoppix
RiP
SystemRescueCD
Ultimate Boot CD
INSERT

Contents


4.12.11 Locale


LC_ALL=C to get rid of crap in man pages

Contents


4.12.12 Networking


Contents


4.12.12.1 Static routes

ip route add 0.0.0.0/32 via 192.168.16.1 dev eth0

add a line to /etc/sysconfig/static-routes:
eth0 -host 192.168.254.245

or

route add -host 192.168.254.245 eth0

Gateway route:
route add -net 192.168.4.0 gw 192.168.2.15 netmask 255.255.255.0
route add -net default gw 192.168.2.1 netmask 255.255.255.0

Contents


4.12.12.2 NFS and firewall

Put these in the iptables configuration:

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 111 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 111 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 892 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 892 -j ACCEPT

and set MOUNTD_PORT=892 in /etc/sysconfig/nfs

Contents


4.12.12.3 NIS Client
==========

In /etc/sysconfig/network
NISDOMAIN=gc.eracom.com.au

/etc/pam.d/login - change 'pwdb' to 'unix' - but RH7.3 has 'switch'. Hmm... probably early Linux only

domainname gc.eracom.com.au (only needed the first time)

add + as last line of /etc/passwd and delete any existing users

/etc/nsswitch.conf may need:

	passwd: files nis nisplus
	hosts: files nis nisplus dns

/etc/host.conf may need "nis" adding

Make sure /usr/sbin/portmap is running (ps -ef |grep portmap). If
not, then:

	chkconfig --level 345 portmap on
	/etc/init.d/portmap start

Make sure /etc/yp.conf has a line with "ypserver dux"
Make sure /etc/hosts has:
	127.0.0.1 localhost.localdomain localhost
	192.168.2.253 dux.gc.eracom.com.au dux

Make sure you can "see" dux:
	ping dux

Now get ypbind running:
	chkconfig --level 345 ypbind on
	/etc/init.d/ypbind restart

ps -ef |grep ypbind should show something

ypcat passwd should show NIS users

You'll also want home directories to be automounted from dux and
until I can figure out how to do it from NIS we use the
auto-mounter:

Make sure /etc/auto.misc has a line:
	/misc   /etc/auto.misc  --timeout=60

Make sure /etc/auto.misc has a line:
	home	dux:/eracom/home

Make sure automounter is running:
	chkconfig --level 345 autofs on
	/etc/init.d/autofs restart

Make any present /home directory aside and use NFS mounted from dux:
	mv /home /home2
	ln -s /misc/home /home

Test out the log in:
	su - barry

... should log you in as barry with home directory auto-mounted.

Contents


4.12.12.4 NIS Server
See http://www.linux-nis.org

In /etc/sysconfig/network
NISDOMAIN=gc.eracom.com.au
/etc/pam.d/login - change 'pwdb' to 'unix' - but RH7.3 has 'switch'. Hmm.

/etc/rc.d/init.d/ypserv start
/usr/lib/yp/ypinit -m

Add a line with just a plus sign into /etc/passwd

cd /var/yp; make all


Contents


4.12.13 Photos


jhead prints the Exif header from jpg files

In theory:
lpr -o media=photo -o fitplot -o position=top-left x.jpg

Paper sizes incl A4 etc:
http://www.cl.cam.ac.uk/~mgk25/iso-paper.html

Get the image right - ratio the same as paper ratio
eg Kodak paper is 4x6.5inches (102*165mm)
Epson is 4x6inches (100x150mm)

There's a border of 4mm all around:
100x150 becomes 92x142 drawable
102x165 becomes 94x157 drawable

/etc/cups/ppd/lp.ppd contains known PageSize eg A4, Photo

Print to file from gimp using "Postscript Level 2" with ppd file
as /etc/cups/ppd/lp.ppd. Use "Photo with tear off" for 4x6.5"
paper and perhaps 4x6 for Epson 4x6" paper.

but in fact "lpr ~/mozilla.ps" works OK

-o gamma=1000+/1000- will lighten/darken the image 800 seems about
right for images that look right on the screen.

Long axis goes into the printer ie:

+------------+
| hp5160     |
+------------+
       +--+
       |  | ^
       |  | |
       |  |
       +--+

Or - print to printer lp but make sure -oraw is not set and ppd
is correct. 

Contents


4.12.14 prelink


prelink -afmR 
... after building new libraries.

Contents


4.12.15 Running X


Starting another X using xdmcp (remote):

X :2 -query dun
X :2 -broadcast

Starting gnome in another vt (locally):
Maybe kill /usr/libexec/gnome-settings-daemon first and then

startx /etc/X11/Sessions/Gnome -- :2

Or with Xnest:

startx /etc/X11/Sessions/Gnome -- /usr/X11R6/bin/Xnest :2

In general:

startx [[ client ] options ... ] [ -- [ server ] options ... ]

Simplest case:

startx `which xterm` -- :1

To get fonts right:
echo "Xft.dpi: 96" | xrdb -merge

Contents


4.12.16 Setting ccrypt passwd instead of MD5


Use a non-linux system (eg dun) to encode the passwd in a dummy account:

useradd tmp
passwd tmp # etc, etc

Then copy and paste the entry from /etc/shadow into dux's
/etc/shadow.

Contents


4.12.17 Setting timezone


ln -sf /usr/share/zoneinfo/Australia/Brisbane /etc/localtime

... now why does it get reset every time I do an 'emerge -uDv world'? (But not when I do -uv?)

Contents


4.12.18 Shared libraries:


cc -o sub1.o -fpic -c sub1.c # of -fPIC
cc -shared -Wl,-Bsymbolic  -o libsub1.so sub1.o
cc -o t -L . -lsub1 t.c -ldl

export_list.txt:
VERSION {
global:
    exported_entrypoint1;
    exported_entrypoint2;
    ...
local:
    *;
};

Then, an option is given to the linker as follows:
-Wl,--version-script=export_list.txt

To build exports.exp from a simple list exports.list:

.SUFFIXES: .list .exp
.list.exp:
	@( \
echo -e 'VERSION {\nglobal:'; \
sed 's/$$/;/' < $<; \
echo -e 'local:\n*;\n};' ) >$@

Contents


4.12.19 smbmount


smbmount //gc-srv1/Document /mnt/tmp -o username=bhepple%<password>,uid=1016

Contents


4.12.20 Sony NetMD


gnetmd - GUI http://www.pdr.cx/dls/
libnetmd - library - http://opennmd.monochromatic.net/

Contents


4.12.21 sysfs & udev


Print info about device:
	udevinfo -a -p /sys/class/scsi_generic/sg0

Rule writing:
	http://www.reactivated.net/udevrules.php

Contents


4.12.22 To propagate YP file eg passwd


/etc/rc.d/init.d/ypserv stop
/usr/lib/yp/ypinit -m
/etc/rc.d/init.d/ypserv start

You may need to refresh the yp cache to flush the changes
through. dum & ita seem to take a long time to flush.
On dun restarting rpc even rebooting do not help.
hpux, ack, p5dev got the change immediately!

On dun I tried:

/etc/init.d/nscd stop
/etc/init.d/nscd start
/usr/sbin/nscd -i passwd

... all to no avail.

Contents


4.12.23 USB


Storage device (dongle):
	modprobe usb_storage
	mount -t msdos -o uid=1016 /dev/sdb1 /mnt/tmp

... ie uses sd_mod (SCSI disc driver)
=================================

        modprobe usbcore (not on 2.6.7?)
	modprobe uhci
        mount -t usbdevfs none /proc/bus/usb 

Then run
	usbview



Contents


4.12.23.1 eBookMan

The older version of the uhci module - usb-uhci - seems
to be less successful with the Linux USB utilities and
the ebm is sometimes not recognised.

This is the serial mode sync program for Linux provided
by Franklin on the developer's page. It needs to talk
serial protocols so the OS must load another module on
the USB stack:

                insmod usbserial vendor=0x09b2 product=0x0001

I have written to the USB vendor list maintainer to ask
that that id be added to the Linux driver's list of
recognised ids - he just replied to say it's already in
the head-of-tree version of the USB code!!!

From now on it's pretty much plain sailing:

         ebmsync -r /dev/ttyUSB0 -i

... etc all works according to the docs. 

There are just 2 remaining problems.

First of all, the ebm link sometimes freezes. But at
least it can be aborted with ^C and it's a simple
matter to :

                rmmod usbserial
                rmmod uhci
                modprobe uhci
                insmod usbserial vendor=0x09b2 product=0x0001

in order to re-start the link. Of course, I put these
things into mini-scripts to save a bit of typing:

Contents


4.12.23.2 SanSui MRV-950

Fails on Linux (Knoppix 3.6, 3.8 & Gentoo 2.6.13-r5)

SayFriend USB-Mass
Manufacturer: ENOX(SayFriend )
Serial Number: 000000000000
Speed: 12Mb/s (full)
USB Version:  1.00
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 8
Number of Configurations: 1
Vendor Id: 0db6
Product Id: 4002
Revision Number:  1.00

Config Number: 1
	Number of Interfaces: 1
	Attributes: a0
	MaxPower Needed: 100mA

	Interface Number: 0
		Name: usb-storage
		Alternate Number: 0
		Class: 08(stor.) 
		Sub Class: 6
		Protocol: 50
		Number of Endpoints: 2

			Endpoint Address: 83
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 64
			Interval: 0ms

			Endpoint Address: 03
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 64
			Interval: 0ms

Contents


4.12.23.3 JetFlash 128Mb

TS128MJF2A
Manufacturer: JetFlash
Speed: 480Mb/s (high)
USB Version:  2.00
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 64
Number of Configurations: 1
Vendor Id: 0c76
Product Id: 0005
Revision Number:  1.00

Config Number: 1
	Number of Interfaces: 1
	Attributes: 80
	MaxPower Needed: 100mA

	Interface Number: 0
		Name: usb-storage
		Alternate Number: 0
		Class: 08(stor.) 
		Sub Class: 6
		Protocol: 50
		Number of Endpoints: 3

			Endpoint Address: 81
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 512
			Interval: 0ms

			Endpoint Address: 02
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 512
			Interval: 31875us

			Endpoint Address: 83
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 8
			Interval: 64ms

Contents


4.12.24 Using a compose key


Put it in /etc/X11/xorg.conf

Maybe use right ALT?

# Your section in xorg.conf about the keyboard looks similar to this:
Section "InputDevice"
        Identifier      "Keyboard0"
        Driver          "kbd"
        Option          "XkbModel"      "pc104"
        Option          "XkbLayout"     "us"
        Option          "XkbOptions"    "compose:rwin"
EndSection

See /usr/X11R6/lib/X11/locale/<your_character_enocding>/Compose
for codes available.

Contents


4.12.25 UUID


To discover the UUID of an existing ext2 file system:

dumpe2fs /dev/sdf2
 
... or ...

ls -l /dev/disk/by-uuid

Contents


4.12.26 Video


Linux AV FAQ: http://forum.doom9.org/showthread.php?s=&postid=628819

Camera is Sony DCR-TRV230E

	modprobe ieee1394
	modprobe raw1394
	modprobe dv1394

chmod a+rw /dev/*1394 /dev/video1394/0

/dev/hda is too slow? Too many dropped frames. /dev/hdb
(/mnt/tengig) is better?

To capture video, play and then:
	dvgrab simon

... and kino drop too many frames, even with a quiet system. Why?

	dvgrab --format raw simon
	dv2avi simon.dv simon.avi

... raw stream is corrupt.

To edit, use kino. (kino capture to av2 is OK)
Use dvtitler plugin? needs kino-0.7 and 0.7.1 bombs for me

DISPLAY=GDK seems to work

To 
kino -> export

Need dv2 avi format, default on kino is dv1 and does not work
with remaining tools.

195 seconds = 697Mb = 3Mb/sec = 225Mb/min = 13.5Gb/hour!!!

On raita (600MHz Celeron) conversion to mpeg took 30 minutes.
195 seconds => 30 minutes, ie about 10:1
63303436 bytes in the mpeg ie 325000 bytes per second

ie. 1 hour video would need 10 hours processing, maybe 4 on
Athlon, the raw file would be 10Gb and the mpeg would be 1.2Gb

On raita-2 (Pentium-4 3GHz) conversion of 1.4Gb 6m:32s file to
365Mb DVD mpeg file (make sure mp2enc has -r 48000 option?
kino-0.7 should be ok) took 18m - ratio of ~ 1:3. A 90m tape
would therefore take 20Gb for the raw file and 4h:8m to process
to a 5Gb file ... too big? Need to edit to 80mins?

Kino uses this to produce "8 - DVD" mpeg:
lav2yuv *.avi | mpeg2enc -v 0 -f 8 -I -O -n p -o file.mpv
lav2wav *.avi | mp2enc -v 0 -r 48000 -o file.mp2
mplex -v 0 -f 8 -o file.mpeg file.mpv file.mp2

Apparently, the lav2yuv utility can read .eli files - but kino
can't, it can only read smil files!

Trying this:
mpeg2enc -v 0 -I 1 -f 8 -b 8500 -F 3 -n p -a 2 -c -q 6 -4 1 -2 1
mp2enc -v 0 -b 224 -r 48000 -s
mplex -v 0
6m took 36m to process -  6:1
-4 4 estimated at 23m - 4:1
-q 10 estimated at 30m - 5:1

Try mpeg2enc with "-4 2 -2 1" "-Q 1.0-4.0 (best)" "-q 2..31(worst)"

cam2dvd.sh does this:
	transcode -i simon-001.avi -x ffmpeg -V -w 8500 --encode_fields b --export_asr 2 -F 8 -c -q 6 -4 2 -2 1 -K file=matrix.txt -R 2 -y mpeg2enc,mp2enc -b 224 -m simon-001 -o simon-001 --print_status 10

which boils down to:
	mpeg2enc -v 0 -I 1 -f 8 -b 8500 -F 3 -n p -a 2 -o simon-001.m2v -c -q 6 -4 2 -2 1 -K file=matrix.txt -R 2
	mp2enc -v 0 -r 32000 -b 224 -s -o simon-001.mpa
	mplex -r 10000 -f 8 -S 4400 $OUT.m2v $OUT.mpa -o $OUT.vob

Try:
	mpeg2enc -v 0 -I 1 -f 8 -b 8500 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1 -R 2
	mp2enc -v 0 -r 48000 -b 224
kino automatically adds -f 8 to mplex

"-b 8500 -q 6 -4 1 -2 1" (-R 0) is supposed to give  slightly
better quality (?) and slower (?) - does 55m in 4270m which is
about 1:5. Result is still jittery. DVD-R seems to make no
difference compared to DVD+RW.

... did not export the entire file - stopped at 4.?G - maybe file
limit (it was to a vfat file system) Trying auto-split? Yes -
that worked - but need to try it on a player. Jittery.

"-b 8500 -q 6 -4 2 -2 1 -R 2" takes 7h11m for 71m = 1:7 !! tape6-2 u

Need to try "-N 0.5 -E -10"

"-I 1 -f 8 -b 7000 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1" took 292:71
= 1:4 far fewer jitters, plays to the end. tape6-3. Image quality
is still iffy - xine looks perfect.

"-I 1 -f 8 -b 8000 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1 -N 0.5 -E -10" tape6-4 still jittery.

"-f 8 -b 7000 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1" took 8:2 = 1:4
tape6-2mins-5. ie no -I option. Worst yet for jitter. Image
quality seemed better.

"-f 8 -b 7000 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1" and "already
deinterlaced" took 1:2!! tape6-10secs-6. ie no -I option.
Probably the best yet. Quality still not sharp but few jitters.

mpeg2enc options:
-v 0 verbosity (kino supplies)
-I 1 interlace (kino supplies)
-f 8 for DVD (kino supplies)
-b 8500 bitrate
-F 3 PAL framerate (inferred from input)
-n p PAL (kino supplies)
-a 2 aspect ratio 4:3 (kino supplies)
-c closed GOPs
-q 6 quantization
-4 2 encoding quality
-2 1 encoding quality
-K file=matrix.txt
-R 2 number of B frames (supposed to improve compression but doesn't according to the man page) - adds 60% to the time needed
... did 12s in 66s - 5:1


Sonic DVD running on VMware and IDE disc transcoded 3m (1 Gb) avi
file in 10 minutes 1:3.3 - DVD can be plyed by xine and written
to DVD by growisofs!! Plays nicely on PS2... but can only get 1hr
on a DVD. 1hr 15m is 5.7G!!!

To capture, use /mnt/tmp:
	mount -t vfat -ouid=1016,shortname=win95 /dev/hde6 /mnt/tmp
then:
	umount /mnt/tmp
	vmware & and use Sonic DVD to create DVD (to F:)

Maybe try better quality DVD-R media - Maxell or TDK?

According to
http://www.bealecorner.com/trv900/DVD/authoring.html, 8000 is an
upper bound on bitrate, maybe 7000. Anyway, most video is much
lower.

Deinterlace settings on kino:
None: -I 1
mpeg2enc -v 0 -b 7000 -F 3 -c -q 6 -4 2 -2 1 -f 8 -I 1 -n p -a 2 (4:1)
Best of all. No jitter; steady pause; decent quality.

Internal: -I 0
mpeg2enc -v 0 -b 7000 -F 3 -c -q 6 -4 2 -2 1 -f 8 -I 0 -n p -a 2 (2:1)
++ WARN: [mpeg2enc] Progressive encoding selected with interlaced input!
++ WARN: [mpeg2enc]   (This will damage the chroma channels.)
Decent quality. Nice steady pause. A few jitters in play.

Already: -I 0
mpeg2enc -v 0 -b 7000 -F 3 -c -q 6 -4 2 -2 1 -f 8 -I 0 -n p -a 2 (2:1)
++ WARN: [mpeg2enc] Progressive encoding selected with interlaced input!
++ WARN: [mpeg2enc]   (This will damage the chroma channels.) 
Decent quality. Jitter on pause.

YUV Denoise fast: yuvdenoise | -I 0
mpeg2enc -v 0 -b 7000 -F 3 -c -q 6 -4 2 -2 1 -f 8 -I 0 -n p -a 2 (3.5:1)

YUV Denoise slow: yuvdenoise | -I 0
mpeg2enc -v 0 -f 8 -b 7000 -F 3 -n p -a 2 -c -q 6 -4 2 -2 1 -f 8 -I 0 -n p -a 2 Decent quality, just a bit of smearing on faces. Steady pause. (5.5:1)

tape6-7: 8 - DVD, None, mpeg2enc -v 0 -b 8000 -c -q 6 -4 1 -2 1,
mp2enc -v 0 -r 48000 -b 224, mplex -v 0, split, cleanup. 6hr:71m = 5:1

Contents


4.12.26.1 AVI to DVD

May be more up to date: http://forums.gentoo.org/viewtopic.php?t=117709

Derived from:
http://mightylegends.zapto.org/dvd/dvdauthor_howto.php

TITLE=whatever

For non-standard file types such as .wmv,.mov,.asf etc. it's
necessary to first encode the movie to .avi with mencoder, like
this:

mencoder -o ${TITLE}.avi -ovc lavc -oac lavc -ofps 25 ${TITLE}.mov

transcode -i $TITLE.avi -V -y mpeg -F d -Z 352x288 --export_fps 25 --export_asr 2 -E 48000 -b 224 -o $TITLE

... mebbe leave out the -Z 352x288 which gives half resolution, I
think... check that it recognises the input otherwise it reads
fron /dev/null!

mplex -f 8 -o ${TITLE}_dvd.mpg ${TITLE}.m2v ${TITLE}.mpa

rm -rf dvd; dvdauthor -o dvd --video=pal *.mpg; dvdauthor -T -o dvd

(... or use *.mpg if >1)

growisofs -Z /dev/cdrom -dvd-video -overburn dvd/
rm -f $TITLE.mov $TITLE.m2v $TITLE.mpa ${TITLE}.mpg
rm -rf dvd


Mebbe try:
ffmpeg -i $TITLE.avi -sameq -vcodec mpegvideo -ab 128 -ar 22050 -ac 2 $TITLE.mpg ... seg violation!

'-x mplayer' works with transcode on that DivX .avi file thanks
to divx2svcd script

also divx2dvd.pl:
http://freshmeat.net/projects/divx2dvd/?branch_id=51138&release_id=164134

try "--export_prof dvd-pal" - esp if input is NTSC!

maybe try "-Z fast" to speed it up?

maybe try "-w 8000" for better quality - PerfectPink quality is
OK - just valerie stuff

For DIV3 avi (PerfectPink): 27 fps 1.6hours
transcode -i $TITLE.avi -x mplayer -V -y mpeg -F d -Z 352x288,fast --export_prof dvd-pal --export_fps 25 --export_asr 2 -E 48000 -b 224 -o $TITLE

... gave audio sync problems; transcode syas that it's inputting
29.97 and outputing 25 fps, but still out of sync

To Cut a section from a avi file, use mencoder:
mencoder -ss 1:04:00 -endpos 0:35:0 -oac copy -ovc copy video2.avi -o video1.avi
... will copy 35 minutes starting at 1:04:00

Merging videos with mencoder:
cat *avi | mencoder -oac copy -ovc copy -o myvideo.avi -

This would simply concatenate all avi files in the current directory into a new video called myvideo.avi, maintaining the original audio and video codecs. 

Contents


4.12.26.1.1 divx2dvd process

http://public.sys3175.co.uk/DivX2DVD:

Extract the audio track

As the audio track gets output as a .wav file its huuuuge, so
make sure you have plenty of disk space. It is then re-encoded as
a .mp2 that the DVD format needs. It is possible to rewrite the
commands to use an .mp3 as the intermediate file, which saves
space at the expense of possible sound quality.

TITLE=whatever
mplayer -quiet -vo null -vc dummy -ao pcm -hardframedrop -aofile $TITLE.wav $TITLE.avi

toolame -e -s 48 -p 2 -b 224 $TITLE.wav $TITLE.mp2

Extract the video

The video needs to be converted to an MPEG stream. mplayer can
convert directly to an MPEG, but I found that mplex couldn't
understand the MPEG. Instead we use an uncompressed intermediate
format, and a FIFO to avoid having huge files. The nice of the
second process makes sure that the pipe doesn't empty before the
end.

mkfifo stream.yuv

mplayer -vo yuv4mpeg -ao null $TITLE.avi &
mpeg2enc -v 0 -f 8 -F 3 -o $TITLE.mpeg < stream.yuv

Joining them back up

Now we have the audio and video in the right formats, we need to
join them back together. This is the magic bit - we must make a
sort-of MPEG with special DVD cue markers in it (a .vob), and
mplex is one of few programs that can do that.

Use -S0 for unlimited VOB size or it will be cut off at 2000MB.
dvdauthor will break it up into multiple smaller VOBs anyway.

 mplex -f 8 -S 0 -o $TITLE.mpg $TITLE.mpeg $TITLE.mp2

Create the DVD filesystem

Video DVDs have special names for the files and special indexes.
dvdauthor can generate these for you

rm -rf dvd; dvdauthor -o dvd --video=pal *.mpeg; dvdauthor -T -o dvd

growisofs -Z /dev/cdrom -dvd-video -overburn dvd/

Tidy up:
rm -f $TITLE.wav $TITLE.mp2 $TITLE.mpeg $TITLE.mpg stream.yuv
rm -rf dvd

Contents


4.12.26.1.2 Another avi2dvd script

This fails on the transcode - ffmpeg failing? Tried
ffmpeg-0.4.8.20040322-r1 & 0.4.7. Maybe need to install toolame? Nope - doesn't help.

Very heavy on CPU and disk.

#!/bin/sh

# ***************************************************************
# This is a batch processing script for normalizing and converting
# a mixed collection of .avi files into .mpg files that can be fed
# to dvdauthor to create dvd's that will play perfectly on nearly
# all NTSC dvd players and analog/digital televisions.
#
# A special feature of this script is the overscan compensation
# based on laborious trial and error. Because I went to this
# trouble your subtitles and/or supertitles will be visible
# on even the most badly overcompensated television screen, but
# you will not see deformed edges on a television that has 'normal'
# overscan.
#
# The list of input files should be edited below, replacing 
# file_01.avi, file_02 etc. with your batch of filenames.
# No other editing is required.
#
# NOTE: This script takes it's input filenames from the
#       command line if provided, otherwise it will use
#       the list declared below on the 'files=' line.
#
# This script requires transcode, mplayer, sox, and toolame.
#
# Performance on my 2.8 GHz system is 30-40 fps conversion.
#
# copyright 2004 Phil Ehrens <phil@slug.org>
# Valuable contributions by Adam Di Carlo <adam@onshored.com>
# ***************************************************************
# declare the list of root filenames to operate on. this is
# the only line of this file that is edited for use. list the
# names of all the files you want to process.
# The source files will NOT be deleted.
#
# YOU MAY EDIT THE FOLLOWING LINE TO BE THE LIST OF INPUT
# FILES IF YOU DO NOT WISH TO PROVIDE THEM ON THE COMMAND
# LINE.
#
# For example:
#
#   files="file_01.avi file_02.avi file_03.avi file_04.avi"
#

files=""
FPS=25
#FPS=29.97
PROF=dvd-pal
#PROF=dvd-ntsc
#
# YOU DO NOT NEED TO EDIT ANYTHING BELOW HERE!!
#

# this block writes out the ffmpeg.cfg file with some
# possibly useful values. Note that the lines in this
# block must begin in text column zero or the script
# will exit at this point!


cat > ffmpeg.cfg <<_EOF
[mpeg2video]
vhq = 1
vqsquish = 0
vqcomp = 0.7
vqblur = 0.3
_EOF

# Script will take input file(s) on the command line, or, if
# no arguments are passed, will use the 'files' list declared
# above. 

[ ! -z "$1" ] && files="$@";

for arg in $files; do

# strip the .avi file extension

	file=`echo $arg | sed -e 's/\.avi$//'`

# test for file existence

	if [ ! -f "$file.avi" ];

		then

		echo "file '$file.avi' doesn't exist" >&2
		exit 1

	fi

# use mencoder to force frame rate to 29.970 all the way through.
# this is because an avi may be a concatenated series of subfiles
# each with a different frame rate, or even a single avi file
# may have a varying frame rate in the worst case.

	mencoder -oac copy \
		-ovc copy \
		-ofps $FPS \
		-o output.avi \
		"$file.avi" > /dev/null 2>&1 

# dump the audio to a .wav file using mplayer

	mplayer -ao pcm \
        -vo null \
        -vc dummy \
        output.avi > /dev/null 2>&1

# if the sound turns out to be 8 bit, then sox needs
# extra options to handle it correctly.
# thanks to Kenneth Stailey for this patch!

	file audiodump.wav | grep -qs 'PCM, 8 bit'
	if [ $? = 0 ]; then
		B=-b
		W=-w
	else
		B=
		W=
	fi

# if the incoming sound is at 44100
# upsample the sound to 48000.
# here we rely on the fact that sox will abort if the input
# frequency is 48000.
# there will be a stub 44 byte long output.wav if sox aborts.

	if sox $B audiodump.wav -r 48000 $W output.wav resample ; then
		WAVFILE=output.wav 
	else

# otherwise sound was already 48000

		WAVFILE=audiodump.wav
	fi

# and make it into toolame mp2 format, nice!

	nice -n 20 toolame -p 2 -b 384 $WAVFILE output.mp2 > /dev/null 2>&1
	rm -f output.wav audiodump.wav

# note the use of '-x mplayer,null' to remove export problems
# imposed by bugs in ffmpeg that sometimes cause segfaults.
#
# the -j option here is intended to account for a phenomenon
# of the NTSC standard and analog TV sets called 'overscan'.
# the black borders created by this option will NOT be visible
# on your TV screen unless the source .avi has already got
# overscan compensation, which is HIGHLY unlikely.
#
# note also that we add -e 48000,16,2 in the transcode invocation
# forcing the sync adjustment to -1600@1000

	transcode --nice 20 \
		--print_status 500 \
		-x mplayer,null \
		-y ffmpeg,null \
		-F mpeg2video \
		-e 48000,16,2 \
		--export_asr 2 \
		--export_prof $PROF \
		-Z 720x480,fast \
		-o output \
		-i output.avi
#		-j -16,-36,-24,-36 # for NTSC

	rm -f output.avi

# mplex supports constant sync offset correction.
# '-O -300ms' would, for example, start audio 300 ms
# earlier than otherwise.

	mplex -f 8 -o "$file.mpg" output.m2v output.mp2

	rm -f output.m2v output.mp2 ;

# now you have .mpg files, all ready for dvdauthor.
# like so:
#          dvdauthor -t -o mydvd -c 0,11:30 file_01.mpg -c 0,11:30 file_02.mpg -c 0,11:30 file_03.mpg
#          (and possibly -v ntsc+4:3+720xfull if you get errors
#          and want to be certain that nothing funny happens.)
#          dvdauthor -T -o mydvd
#          mkisofs -dvd-video -o mydvd.dvd.iso mydvd
#          dvdrecord -v -sao dev=0,0,0 driveropts=burnfree mydvd.dvd.iso

done

Contents


4.12.26.2 Current best practice

kino settings:
Export
MPEG

File Format	8 - DVD
Deinterlace 	None
Video Pipe	mpeg2enc -v 0 -q 6 -4 1 -2 1
Audio Encoding	mp2enc -v 0 -r 48000 -b 224
Multiplexor	mplex -v 0
Scene split	yes
cleanup		yes

Time taken = 5:1

4888514560 bytes is too much (4663MB = 4.55Gb)
4813166592 bytes is too much (=4.53Gb) 
4797818880 bytes is OK (=4.47Gb)
4645816320 bytes is OK (4431Mb = 4.33Gb)

rm -rf dvd; dvdauthor -o dvd --video=pal *.mpeg; dvdauthor -T -o dvd

growisofs -Z /dev/cdrom -dvd-video -overburn dvd/

Contents


4.12.26.3 DV-to-DVD-HOWTO

From: http://zebra.fh-weingarten.de/~transcode/docs/DV-to-DVD-HOWTO.txt

    +-----------------+
    | DV-to-DVD-HOWTO |
    +-----------------+

    v1.0, 2004/01/05, Florin Andrei <florin@andrei.myip.org>


Here are some suggestions on how to convert Digital Video
material (DV) to DVD. This document is focused on material that's
shot with DV camcorders. See the end of the document for helper
scripts.

1. About DV

Digital Video is a format used by most of the modern digital
camcorders, both in the proffesional arena and in the amateur
range. The compression used is kinda similar to MJPEG; each image
is compressed independently of the others (unlike MPEG1/2/4) so
DV is "editing-friendly". Usually, NTSC DV has a resolution of
720x480 and the pixels are non-square; the aspect ratio is
usually either 4:3 or 16:9; the framerate is 29.97 fps and the
image is interlaced, with the bottom field first. PAL is similar,
but the resolution is 720x576 and the framerate is 25 fps.
Variations are possible on non-standard and/or expensive
equipment (24 fps, progressive, etc.) but are rare. At the normal
parameters above, 60 minutes of movie get compressed by normal DV
gear at approx. 10...15 GB of video files.

2. About DVD

Very popular digital media, it's using MPEG2 encoding for video
and a variety of encodings for sound (MP2, AC3, DTS, PCM). There
are several resolutions permitted by the standard, 720x480 (NTSC)
and 720x576 (PAL) being the most popular. The sum of the bitrates
of the video track and of the current audio track must not be
higher than 10.08 Mbit/s, not even for a fraction of a second;
failure to comply generates DVDs that are unplayable on most
standalone DVD players. Usually, proffesional DVDs have their
video tracks encoded at a peak bitrate of 9800 kbps, hence
leaving some room for an audio track. The average video bitrate
varies greatly, but it's usually between 2000...7000 kbps.

3. Capturing DV

You need a FireWire card and dvgrab version 1.4 or newer. Run the
"grab" script, then start the camcorder. "grab" is designed so
that it will create a new file for each new scene on the tape (a
new scene begins whenever you paused or stopped the camcorder
when shooting). If the entire tape was shot in one big scene,
only one file will be created. dvgrab can create OpenDML AVI
files, so don't worry about file size, OpenDML stuff can be as
big as necessary. At the end, stop the camcorder if it doesn't
stop by itself, then CTRL-C the script. The order of the
operations is important. Follow this document carefully.

4. Optional processing

You can preview the captured DV/AVI files with a media player.
Currently, Xine seems to be the only one supporting OpenDML. If
you don't want a scene, you can simply delete the corresponding
file. If you wanna make changes inside a scene, you must use a
video editor that understands DV and OpenDML; Kino seems to be
working fine.

5. Transcoding to DVD

You need a recent transcode version, such as 0.6.11. You need a
new mjpegtools version as well, at least 1.6.1.92 (plain 1.6.1
won't work), or 1.6.2 when it will get released. You also need a
fairly recent dvdauthor version, such as 0.6.8. The script that
does the job is "conv-dvd". It is designed to work with a capture
project directory created by the "grab" script. Let's discuss the
script:

The $flags variable contains the parameters passed to mpeg2enc.
You have to choose one version and uncomment it; the first two
are for high-quality encoding, the last two are for efficient
file size. Explanation of the parameters:

-c means "all GOPs are closed"; this generates an MPEG2 stream
that's more compatible with various apps and players

-q sets the quantization factor; 6 is a reasonable value for DV
material converted to DVD; decrease it for higher quality, but be
aware that you might create video tracks that are not accepted by
the multiplexer; increase it for smaller file sizes at the
expense of image quality

-4 2 -2 1 controls the motion estimation; an even better
(quality-wise) value would be "-4 1" but the quality increase is
almost imperceptible while the encoding speed decreases a lot;
just leave it like it is

-K defines the encoder matrix; this script uses a matrix devised
by Steven Schultz to maximize the image quality, or the tmpgenc
matrix for a more efficient compression (at the expense of image
quality)

-N is a very gentle low-pass filter that reduces the bitrate
usage tremenduosly while not affecting the image too much

-E tells the encoder to simply discard bits that are hard to
encode yet do not contribute to the image too much

-R controls the B frames; encoding with 0 B frames is unusual and
some truly broken players may get upset, although it is perfectly
legal from the DVD standard p.o.v.; encoding with 2 B frames is
normal for proffesional DVDs but it slows down encoding a lot (by
60%) and it makes the compression slightly less efficient for
amateur DV stuff (material that's less than _perfect_). If you're
like me and don't care about encoding speed (i let the script run
overnight), then encode with 2 B-frames; if you're in a rush or
want to obtain better compression (your space on the DVD is
limited) then encode with 0 B-frames, but be aware of the broken
players.

The $asr variable controls the aspect ratio. Uncomment the
appropriate value, depending on how your camcorder was
configured. 4:3 is normal TV screen, 16:9 is HDTV. You cannot use
one of them if your camcorder was configured with the other.

The $bitr variable controls the MPEG2 bitrate used for the DVD.
WARNING: Do not increase it above 8500 regardless of what you've
been told. I know that proffesional DVDs are encoded at a peak
value of 9800 kbps, i know that various pieces of documentation
recommend 9800 as One Value To Rule Them All. Just ignore them.
Trust me. If you do otherwise, sooner or later you'll create a
DVD that will not be playable on some standalone players. I
learned that the hard way. You have been warned. Moreover, you
don't truly need very high values. I did many evaluations, and
the results are pretty surprising: many scenes that i shot do not
take the peak bitrate above 7000 kbps, and the average is at 2000
or something! Only very rarely you'll need such high bitrates.

Down below in the script you'll find the transcode command. Let's
discuss some command-line parameters:

-x ffmpeg tells transcode to use ffmpeg as the DV decoder instead
of the default Quasar codec. This way you'll obtain a compression
better by 10% or so.

--encode_fields b tells transcode that the DV material is "bottom
field first". For some reason, that's true for any DV camcorder
in the world.

Commented out in the script you'll find some parameters for
generating AC3 sound for your DVD instead of MP2. While AC3 is
more popular, for some reason there are audio/video sync issues
if you use it. I'm still investigating the bug, meanwhile MP2
should be perfectly fine, you can use it with no problems.

After transcoding, the script will multiplex the audio and video
files using mplex. The results are a bunch of VOB files. You can
test each one of them individually with a media player, since
they're essentially MPEG2 files on steroids.

After multiplexing everything, the VOBs are transformed in a DVD
image on the hard-drive with the help of dvdauthor. The DVD is
created so that each scene on the DV tape is translated into a
chapter on the DVD. I believe this makes a lot of sense and
allows for a simple way to jump to various scenes while playing
the DVD. This whole chapter affair is accomplished through the
XML file that's built while transcoding, which instructs
dvdauthor to set chapter marks at the beginning of each scene. Of
course, you can change all that, see dvdauthor documentation.

At the end, there are a few chown/chmod commands, to normalize
file ownership and permissions. I am not sure if this is really
required, i just put them there just in case. Remove them if they
annoy you.

6. Test the DVD image

You can test the newly created DVD image with xine like this:

xine dvd:///full/path/to/the/dvd/image/

The trailing slash is important. xine will play the image just
like it were a true DVD, with chapters and all.

7. Burn the DVD

You need a fairly new version of dvd+rw-tools.

growisofs -speed=4 -Z /dev/scd0 -V "$label" -dvd-video $dvd-image

$label is the ISO label you desire. Usually, labels are all caps
and do not contain spaces. Example: MY_COOL_MOVIE

$dvd-image is the directory containing the DVD image.

Of course, you can change the speed and the DVD-Writer device to
suit your existing hardware.

    +--------------------------+
    | Appendix A - conf-dvd.sh |
    +--------------------------+

----------------snip----------------
#!/bin/sh

if [ $# -ne "1" ]; then
  echo "Usage: $0 dirname"
  exit
fi

name=$1
pushd $name

# high quality, 80 min / DVD
# fast encoding, slightly unusual MPEG2 (no B frames)
flags="-c -q 6 -4 2 -2 1 -K file=matrix.txt -R 0"
# slower encoding, classic MPEG2
#flags="-c -q 6 -4 2 -2 1 -K file=matrix.txt -R 2"
#
# ok quality, 120 min / DVD
# fast encoding, slightly unusual MPEG2 (no B frames)
#flags="-c -q 6 -4 2 -2 1 -N 0.5 -E -10 -K tmpgenc -R 0"
# slower encoding, classic MPEG2
#flags="-c -q 6 -4 2 -2 1 -N 0.5 -E -10 -K tmpgenc -R 2"

# Aspect ratio of the original DV tape
# 4:3
asr="--export_asr 2"
# 16:9
#asr="--export_asr 3"

bitr="8500"
xmlf="dvdauthor.xml"

# Steven Schultz's combined HQ matrix
cat - > matrix.txt << MATRIX
# High resolution INTRA table
8,16,18,20,24,25,26,30
16,16,20,23,25,26,30,30
18,20,22,24,26,28,29,31
20,21,23,24,26,28,31,31
21,23,24,25,28,30,30,33
23,24,25,28,30,30,33,36
24,25,26,29,29,31,34,38
25,26,28,29,31,34,38,42
# TMPEGEnc NON-INTRA table
16,17,18,19,20,21,22,23
17,18,19,20,21,22,23,24
18,19,20,21,22,23,24,25
19,20,21,22,23,24,26,27
20,21,22,23,25,26,27,28
21,22,23,24,26,27,28,30
22,23,24,26,27,28,30,31
23,24,25,27,28,30,31,33
MATRIX

rm -f $xmlf
# dvdauthor XML config head
cat - >> $xmlf << XMLHEAD
<dvdauthor>
<vmgm />
<titleset>
<titles>
<pgc>
XMLHEAD

for inp in `ls dv`; do
out=`basename $inp .avi`
transcode -i dv/$inp -x ffmpeg \
	-V -w $bitr \
	--encode_fields b \
	${asr} \
	-F 8,"${flags}" \
	-y mpeg2enc,mp2enc -b 224 -m $out \
	-o $out \
	--print_status 10
##################################################
# stuff to copy/paste in the transcode parameters
##################################################
# use this if DV sound is not sampled at 48kHz
# (it almost ALWAYS is 48kHz!)
#	-E 48000,16,2 -J resample \
#
# AC3 sound
# (has A/V sync bugs, don't use it yet, still investigating...)
#	-y mpeg2enc,raw -N 0x2000 -b 192 -m $out.ac3 \
#
# MP2 sound
#	-y mpeg2enc,mp2enc -b 224 -m $out \
##################################################

# use this with MP2
mplex -r 10000 -f 8 -S 4400 $out.m2v $out.mpa -o $out.vob
# use this with AC3
#mplex -r 10000 -f 8 -S 4400 $out.m2v $out.ac3 -o $out.vob
echo "<vob file=\"$out.vob\" />" >> $xmlf
done

# dvdauthor XML config tail
cat - >> $xmlf << XMLTAIL
</pgc>
</titles>
</titleset>
</dvdauthor>
XMLTAIL

dvdauthor -o $name -x $xmlf

# the next commands require the following line in visudo:
# yourusername ALL = NOPASSWD: ALL
sudo chown -R root:root $name
sudo chmod -R 0755 $name
sudo chmod 0644 $name/*_TS/*
sync
popd
----------------snip----------------


    +----------------------+
    | Appendix B - grab.sh |
    +----------------------+

----------------snip----------------
#!/bin/sh

if [ ! $1 ]; then
  echo "Usage: $0 dirname"
  exit
fi
name=$1

mkdir -v ${name} || exit
pushd ${name}
mkdir -v dv || exit
pushd dv

dvgrab --autosplit --size 0 --format dv2 --opendml \
  --noavc --buffers 200 ${name}-
popd
popd
----------------snip----------------

Contents


4.12.26.4 DVD

MJPEG HOWTO:
https://sourceforge.net/docman/display_doc.php?docid=3456&group_id=5776

DVD+RW/+R/-R[W] for Linux:
http://fy.chalmers.se/~appro/linux/DVD+RW/#compat

AUTHORING PC MEDIA TO DVD USING THE LINUX OPERATING SYSTEM:
http://mightylegends.zapto.org/dvd/dvdauthor_howto.php

http://zebra.fh-weingarten.de/~transcode/docs/DV-to-DVD-HOWTO.txt

Some thoughts on DVD authoring
http://www.tappin.me.uk/Linux/dvd.html

Format +RW:

dvd+rw-format -lead-out /dev/cdrom (growisofs appears to do this)

makedvd --video=pal+4:3+720xfull VOBFILES

VOBFILES are mpeg-2 produced by kino "8 - DVD option"


or use dvdauthor (need 0.6.10). Simplest control file (no menus) is:
<dvdauthor>
    <vmgm />
    <titleset>
        <titles>
            <pgc>
                <vob file="file1.mpeg" />
            </pgc>
            <pgc>
                <vob file="file2.VOB" chapters="0,0:30,1:00,1:30"/>
            </pgc>
        </titles>
    </titleset>
</dvdauthor>

then:
dvdauthor -o mydvd -x simon.xml

or
dvdauthor -t -o mydvd --video=pal -c 0,11:30 file_01.mpg -c 0,11:30 file_02.mpg -c 0,11:30 file_03.mpg

or
dvdauthor -o mydvd --video=pal *.mpeg   ... and then

then:
dvdauthor -T -o mydvd

then, to write directly to the DVD:
	growisofs -Z /dev/cdrom -dvd-video [-overburn] mydvd/

to create an iso file:
	mkisofs -dvd-video -odvd.iso mydvd/

to write iso image to the DVD:
	growisofs -dvd-compat -Z /dev/cdrom=image.iso
	... takes 14-15 mins

GUIs
qdvdauthor http://qdvdauthor.sourceforge.net/
dvdstyler http://dvdstyler.sourceforge.net/index.html
varsha (java) http://varsha.sourceforge.net/

Contents


4.12.26.5 Links
Good description of formats:
http://users.netwit.net.au/~pursang/video.html

DVD ripping and transcoding with Linux: (DVD->AVI)
http://www.bunkus.org/dvdripping4linux/en/single/

Good advice:
http://www.videohelp.com/
eg AVI to DVD:
http://www.videohelp.com/forum/viewtopic.php?t=242455

Contents


4.12.26.6 Playing:

mplayer -vo x11 t001.mpeg ... actually gl2 works beter - no purple people

also gmplayer and xine

xine dvd:///full/path/to/the/dvd/image/

or (with a physical DVD):
xine dvd://dev/dvd/

mplayer/mencoder useful options

Play title 2 from DVD:
mplayer dvd://2

Start at 1 hour and stop at 2 hours:
mencoder -ss 1:00:00 -endpos 2:00:00

Use subtitles:
mplayer -slang=en

Play DVD video from a directory with VOB files:
mplayer dvd:// -dvd-device /mnt/cd/

Contents


4.12.26.7 VCD

Note: even SVCD is limited to 420x4?? - much cropping/resampling
of PAL 720x576

Then:
        vcdimager -t svcd t001.mpeg
giving
        videocd.bin  videocd.cue

which are used in cdrdao:

SVCD Video from mpeg:

vcdimager -t svcd t001.mpeg
root cdrdao write --device 1,0,0 --driver generic-mmc videocd.cue

Contents


4.12.26.8 DVD to AVI (rip)

See http://linux-programming-newbie.org/ (long)

May need to do this to copy double sided DVD's

From http://gentoo-wiki.com/HOWTO_Rip_DVD_mencoder

Decide on title number with
mplayer dvd://#

T=#

mencoder dvd://$T -ovc xvid -xvidencopts pass=1 -alang en -oac copy -o /dev/null
mencoder dvd://$T -ovc xvid -xvidencopts pass=2 -alang en -oac mp3lame -lameopts vbr=3 -o movie.avi

Note: the 1st stage took about an hour & the 2nd stage failed on opening the video device

Maybe try dvdrip?
Also http://handbrake.fr/

Contents


4.12.26.9 Copying DVDs

ls /mnt/cd/
cd /mnt/scratch/torrents/complete
vobcopy -m

or 

dvdbackup - http://dvd-create.sourceforge.net/dvdbackup-readme.html

To gather info about the dvd
dvdbackup -i /dev/dvd -I

To backup the whole DVD

dvdbackup -M -i/dev/dvd -o/my/dvd/backup/dir/

This action creates a valid DVD-Video structure that can be burned to a DVD-/+R(W) with help of mkisofs version 1.11a27 or later

If that fails, try title by title with mencoder: ... it doesn't work!!!

mencoder dvd://# -ovc xvid -xvidencopts pass=1 -alang en -slang en -oac copy -o /dev/null
mencoder dvd://# -ovc xvid -xvidencopts pass=2:bitrate=1000 -alang en -slang en -oac mp3lame -lameopts vbr=3 -o movie.avi

Contents


4.12.26.10 Convert any video file to DVD with open source tools

http://www.linux.com/article.pl?sid=06/04/17/2058219

Thursday April 27, 2006 (02:01 PM GMT)

By: Manolis Tzanidakis

You've just downloaded the new episode of your favorite video podcast, and you'd like to watch it on your big-screen TV. Unfortunately, the video is encoded in XviD or QuickTime format, which your DVD player doesn't support. Don't worry -- here's how you can convert any video file to DVD using dvdauthor and MPlayer.

Packages for both programs are available for most Linux distributions and BSDs, so you can install them on your favorite OS easily. Compiling the programs from source isn't difficult, as long as you get their dependencies right. Both programs provide adequate documentation about the installation. You can burn the final files to a DVD disc with the help of the growisofs utility from the dvd+rw-tools suite.

Converting the files to MPEG-2

First, you must convert your file to MPEG-2 for the video and to AC3 for the audio, in order to be compliant with the DVD video specifications. If the audio on your file is already encoded in AC3 format, you can use it as is without re-encoding it. Run this command to check the audio format of the file:

mplayer -vo dummy -ao dummy -identify your_video.avi 2>&1 | grep AUDIO_FORMAT | cut -d '=' -f 2

If it returns hwac3, the audio part of your file is encoded in AC3, and you can convert the file to MPEG-2 with the following command:

mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9 \
-ofps 25 -o your_video.mpg your_video.avi

If it isn't encoded in AC3, run this command:

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup \
-srate 48000 -af lavcresample=48000 \
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:\
acodec=ac3:abitrate=192 -ofps 25 -o your_video.mpg your_video.avi

The previous commands create an MPEG-2 file in phase-alternating line (PAL) format with an aspect ratio of 16:9. PAL is used in most of Europe (except France). 

If you want to create a National Television System Committee (NTSC) DVD, which is the North American video standard, replace scale=720:576 with scale=720:480, keyint=15 with keyint=18, and -ofps 25 with -ofps 30000/1001. If you don't have a wide-screen TV, you should encode your file with an aspect ratio of 4:3 by replacing aspect=16/9 with aspect=4/3.

For more information, check the MPlayer's man page, which provides detailed explanations about each option used in these commands.

This process should take some time to finish. My 1.5GHz Centrino laptop took about 25 minutes to convert a file with a one-hour runtime that was encoded in XviD.

Creating the DVD structure

Now you can use dvdauthor to create the layout of the DVD from the MPEG-2 file of your video. Although you can pass any options to dvdauthor directly from the command line, it's easier and more flexible to create an XML file with the appropriate options instead. Open your favorite editor and create a file called dvd.xml with the following contents:

<dvdauthor>
  <vmgm />
    <titleset>
      <titles>
        <pgc>
          <vob file="your_video.mpg" chapters="0,0:10,0:20,0:30,0:40,0:50" />
        </pgc>
      </titles>
    </titleset>
</dvdauthor>

I split my hour-long video into six 10-minute chapters. Adjust the chapters= option for your video, or remove the option from your XML file if you don't want chapters.

Type dvdauthor -o dvd -x dvd.xml to create the layout of the DVD; the -o switch defines the output directory, and -x is used for the XML file. This command takes five to 10 minutes, depending on your video size and your CPU speed. Once it completes, you'll have a directory named dvd with two subdirectories: AUDIO_TS and VIDEO_TS. Before burning the video to a disc, you can check it by running mplayer dvd:// -dvd-device ./dvd.

If the video plays correctly, you can burn it onto a DVD disc with growisofs by running growisofs -dvd-compat -Z /dev/dvdrw -dvd-video ./dvd/. Make sure to replace /dev/dvdrw with the device name of your DVD recorder.

The only thing left is to make some popcorn, get your favorite beverage, and enjoy the show. 

Contents


4.12.26.11 Possible method to copy DVD

From http://www.avtechpulse.com/opensource/dvd.html

subtitles work!!

DVD=/dev/hdd # or whatever
T=track number - use lsdvd to sus out?
TITLE=whatever

mplayer dvd://$T -dumpstream $DVD
mv stream.dump $TITLE-$T.raw

eg
lsdvd - find the main title, maybe 13:
mplayer -alang en -slang en dvd://13 -dumpstream /dev/dvd

Contents


4.12.26.12 MPlayer keyboard

b / j               Cycle through the available subtitles.
 r and t            Move subtitles up/down.
 <- and ->          Seek backward/forward 10 seconds.
up and down         Seek forward/backward 1 minute.
pgup and pgdown     Seek forward/backward 10 minutes.
< and >             Go backward/forward in the playlist.
.                   Step  forward
+ and -             Adjust audio delay by +/- 0.1 seconds
f                   Toggle fullscreen (also see -fs).
o                   Toggle OSD
[ ]                 Adjust speed by 10%
{ }                 Halve/double speed

Options
-fs                 Fullscreen
-slang en           Subtitles

Contents


4.12.26.13 Webcam

is a Logitech 046d:08d7
driver is gspca_zc3xx in 2.6.27++ udev auto-loads it
mplayer tv:// # fails
xawtv -device /dev/video0 # fails
skype bombs

Trying media-libs/libv4l and:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so # fails - that's for v4l2 apps!!!
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so mplayer tv:// # works but it's rather dim
 - use 1/2 for contrast
 - use 3/4 for brightness

skype still bombs even with the wrapper

luvcview works without the PRELOAD!!

This works:
LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so skype

Contents


4.12.27 VMware


I've not only got a fix for this but also an explanation of why it
happens. My virtual machines were created in an older version of Linux
which used ide-scsi emulation for CD drives. FC2 with the 2.6 kernel uses
native ide to access the CD. The inability to access the CD was nothing to
do with upgrading to 4.5.2 but rather with moving to FC2 and the 2.6
kernel.

The fix is this: temporarily alter your CD drive settings. In the cdrom
device setup, select "Use ISO image", and browse to
/usr/lib/vmware/isoimages/linux.iso. Start the VM, and then when you do
VM -> Install VMware Tools it should work. Once you have installed the new
tools, shut the VM down, and change the cdrom device setup back to "Use a
physical drive". After that all should be well.

Contents


4.12.28 Wine


Many programs use an Installshield installer to install.
In order to get these installers running you need to install DCOM95 first.
DCOM95 can be downloaded here:
http://prdownloads.sourceforge.net/wine/dcom95.exe?download.
Type WINEDLLOVERRIDES="ole32=n" wine dcom95.exe to install DCOM95.

To run the application installer it's necessary that ole32.dll, oleaut32.dll and rpcrt4.dll are loaded as native when the setup program is run.
To do that type WINEDLLOVERRIDES="ole32,oleaut32,rpcrt4=n" wine setup.exe.

Contents


4.12.29 Wireless


Kismet for security http://www.kismetwireless.net/
http://forums.gentoo.org/viewtopic.php?t=21919

Contents


4.12.29.1 Netgear WG311T PCI wireless card

http://www.packetpro.com/~peterson/linux-netgear_wg311t_pci.html
http://www.mattfoster.clara.co.uk/madwifi-faq.htm
http://madwifiwiki.thewebhost.de/wiki/
http://acx100.sourceforge.net/ - TI chipset
http://lisas.de/~andi/acx100/ - TI chipset
http://forums.gentoo.org/viewtopic.php?t=122584 - TI chipset

Contents


4.12.29.1.1 Gentoo installation

emerge wiretess-tools for iwconfig etc
(http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html)

enable wireless, sysctl and crypto support in kernel. Compile
kernel.

emerge /usr/portage/net-wireless/madwifi-driver/madwifi-driver-0.1_pre20040824-r1.ebuild (http://sourceforge.net/projects/madwifi/)

modprobe ath_pci

cd /etc/init.d; cp net.eth0 net.ath0

add this to /etc/conf.d/net:
iface_ath0="dhcp"
dhcpcd_ath0="-d"

/etc/init.d/net.ath0 start

"iwconfig ath0" gives:

ath0      IEEE 802.11g  ESSID:"Hepple"  
          Mode:Managed  Frequency:2.462GHz  Access Point: 00:09:5B:EA:05:5A  
          Bit Rate:36Mb/s   Tx-Power:50 dBm   Sensitivity=0/3  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:46/94  Signal level:-49 dBm  Noise level:-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

"iwlist ath0 scan" gives:
ath0      Scan completed :
          Cell 01 - Address: 00:09:5B:EA:05:5A
                    ESSID:"Hepple"
                    Mode:Master
                    Frequency:2.462GHz
                    Quality:42/94  Signal level:-53 dBm  Noise level:-95 dBm
                    Encryption key:off
                    Bit Rate:1Mb/s
                    Bit Rate:2Mb/s
                    Bit Rate:5Mb/s
                    Bit Rate:6Mb/s
                    Bit Rate:9Mb/s
                    Bit Rate:11Mb/s
                    Bit Rate:12Mb/s
                    Bit Rate:18Mb/s
                    Bit Rate:24Mb/s
                    Bit Rate:36Mb/s
                    Bit Rate:48Mb/s
                    Bit Rate:54Mb/s
                    Extra:bcn_int=100

I had to unpack
/usr/portage/distfiles/madwifi-driver-0.1_pre20040824.tar.bz2
manually and "cd tools; make" to build the tools. I put them into
/usr/local/bin. Provides 80211stats, athchans, athkey, athstats.

Note that when DHCP comes it it over-writes /etc/resolv.conf!!
Backup is in /etc/resolv.conf.ppp0.

To bring ppp0/dialup back up:
/etc/init.d/net.ath0 stop
internet start   or    wvdial bigpond

if you forget to bring the wireless down first then set up the
default route with:
route add -net default gw 144.130.40.228 (or whatever ppp is at).






This little script will create WEP keys on the shell.

 dd if=/dev/urandom count=1 2> /dev/null | md5sum | head -n 2 | tail -n 1 | cut -c-26;

If you want to generate a whole bunch of them, try

 for ((n=0;n<10;n++)); do
   dd if=/dev/urandom count=1 2> /dev/null | md5sum | head -n 2 | tail -n 1 | cut -c-26;
 done

(Shamelessly copied from Gentoo Weekly Newsletter Volume 2, Issue 31)

Contents


4.12.29.2 WGT624 (router) settings

0000:02:0c.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg 
NIC (rev 01)
        Subsystem: Netgear: Unknown device 4d00
        Flags: bus master, medium devsel, latency 32, IRQ 9
        Memory at ed000000 (32-bit, non-prefetchable)
        Capabilities: [44] Power Management version 2

SSID Hepple

Contents


4.12.29.3 New madwifi
svn checkout http://svn.madwifi.org/trunk madwifi-ng

rmmod ndiswrapper
modprobe ath_pci countrycode=36
sysctl dev.wifi0.diversity=0 # ???
sysctl dev.wifi0.rxantenna=1
sysctl dev.wifi0.txantenna=1
wlanconfig ath0 create wlandev wifi0 wlanmode sta
modprobe wlan_scan_sta
ifconfig ath0 up
iwlist ath0 scan
iwconfig ath0 essid Baroona key s:deadb
# dhclient ath0 ... unless we're statically configured (as on raita)
ifconfig ath0 192.168.0.18 netmask 255.255.255.0
route add 192.168.0.1 ath0
route add default gw 192.168.0.1

or, hopefully:
/etc/init.d/net.ath0 start

/etc/init.d/net.ath0 stop # or:

ifconfig ath0 down
route del default gw 192.168.0.1
route del 192.168.0.1 ath0
wlanconfig ath0 destroy
rmmod ath_pci ath_rate_sample wlan_wep wlan_scan_sta wlan ath_hal

ndiswrapper gives this for iwconfig:
wlan0     IEEE 802.11g  ESSID:"Baroona"  Nickname:"Baroona"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:09:5B:EC:45:4A   
          Bit Rate=108 Mb/s   
          Encryption key:6465-6164-62   Security mode:restricted
          Power Management:off
          Link Quality:0/100  Signal level:-85 dBm  Noise level:-256 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


madwifi gives:
ath0      IEEE 802.11g  ESSID:"Baroona"  Nickname:"Baroona"
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:09:5B:EC:45:4A   
          Bit Rate:11 Mb/s   Tx-Power:15 dBm   Sensitivity=0/3  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:6465-6164-62   Security mode:restricted
          Power Management:off
          Link Quality=6/94  Signal level=-89 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Contents


4.13 LVM


Create physical volumes from block devices:
pvcreate /dev/sda1
pvcreate /dev/sda3

Display PV info:
pvdisplay /dev/sda3
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               scratch_volg
  PV Size               62.17 GB / not usable 3.84 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              15915
  Free PE               15915
  Allocated PE          0
  PV UUID               GCr44i-4V0i-1uG2-T00Q-PaCR-KRxk-EFFkWO

Create volume group from PVs:
vgcreate scratch_volg /dev/sda1 /dev/sda3

Display VG info:
vgdisplay scratch_volg
  --- Volume group ---
  VG Name               scratch_volg
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               111.77 GB
  PE Size               4.00 MB
  Total PE              28614
  Alloc PE / Size       0 / 0
  Free  PE / Size       28614 / 111.77 GB
  VG UUID               04J9lC-99JH-xHCr-263D-Ktcy-sxJY-5cTaSJ

Create Logical volume:
lvcreate -l 28614 scratch_volg -n scratch_lv
... 28614 is the number of blocks - see "Total PE" above for maximum
... presumably you can create several LVs in a VG

Use it:
mke2fs -c /dev/scratch_volg/scratch_lv
In /etc/fstab:
/dev/scratch_volg/scratch_lv /mnt/scratch auto defaults 0 0

To discover layout of an existing setup:
df # to discover LV name eg /dev/mapper/VolGroup00-LogVol00
vgdisplay -v |less # to browse the setup - PV are listed at the end

Contents


4.14 Non-unix OS


Contents


4.14.1 Win32


Contents


4.14.1.1 Shared libs

Compile with:
cl /MD /W3 /Ox /Gs /GF /Gy /nologo -DWIN32 /c foobar.c

The default is to export nothing!!!

There are 3 ways to export something:

1. Put __declspec(dllexport) in the source code, eg.: 

void __declspec(dllexport) foobar(void);

2. An EXPORTS statement in a .def file eg.:
EXPORT
foobar

... then include the def file in the LINK line eg.:
LINK /DLL /NOLOGO /OUT:foobar.dll /DEF:foobar.def foobar.obj

3. An /EXPORT specification in a LINK command, eg.:

LINK /DLL /NOLOGO /OUT:foobar.dll /EXPORT:foobar foobar.obj

Note that the LINK command produces foobar.{lib,exp} as well as the dll and you need to link the application against the .lib file!!! eg.:

LINK foobar.lib /OUT:main.exe main.obj

Sheesh.



Contents


4.15 Portability


"Notes On Writing Portable Programs In C":
http://www.chris-lott.org/resources/cstyle/portableC.html

"C Reserved Identifiers":
http://oakroadsystems.com/tech/c-predef.htm

"Pre-defined C/C++ Compiler Macros":
http://predef.sourceforge.net/index.php

Contents


4.16 SCO Openserver -dal


pkgadd -d full_file_name - adds a package	
pkgrm - removes a package	
pkginfo - gives info about a package	
pkgchk -v : lists the files in a package

boot: hd(40)unix.safe

Remove driver: /etc/conf/bin/idinstall -d ecsa
Add driver: /etc/conf/bin/idinstall -a -k ecsa
Build kernel: /etc/conf/bin/idbuild

mount -f NFS raita:/guest /mnt/guest

mount: mnt !!!
File system files: /etc/default/filesys set mount=yes to allow users to mount eg.

bdev=dux:/eracom mountdir=/mnt/dux mount=yes fstyp=NFS \\
	fsck=dirty rcmount=no rcfsck=dirty \\
	mntops="timeo=300,retrans=5,wsize=8192,rsize=8192,intr,suid,rw"

bdev=/dev/cd0 mountdir=/mnt/cdrom mount=yes \\
	fsck=dirty rcmount=no rcfsck=dirty \\

for dal:
mount dux:/eracom /mnt/dux/eracom/

/dev/cd0 is created by scoadmin program - need to specifiy
primary/secondary, master/slave. rasam should be secondary-slave.

To display multiple CPU activity: mpstat

The control files are:
Master - the driver's name and DDI level 
System - configuration data about the device - IRQs, DMA required etc
Node -how the system can build device files for the adapter
Space.c 
Driver.o

/etc/conf/bin/idinstall -d e8k ... delete existing driver files
/etc/conf/bin/idinstall -a -k e8k ... install driver files (-k = "keep).
/etc/conf/bin/idbuild -y ... recompile the kernel

To control GUI login: scologin disable|stop|start|enable etc

Contents


4.16.1 NIS client


domainname ""
/etc/yp/ypinit

Add +: to /etc/passwd
Add +::: to /etc/group

/etc/nis start|stop

... even then did not work and subsequently could not change
passwd as it was relying on yppasswd! Had to re-install!

Contents


4.17 SCO Unixware - sambal


was Caldera, was SCO!

Build system is 7.1.0

We also have UnixWare 7.1.1 in the office. UnixWare 7.1.2 is
"OpenUnix 8" but the new name has been dropped again in favour of
the older "UnixWare". UnixWare 7.1.3 is due out in December 2002.

UnixWare 7.1.0 only has JDK-1.2.2 and 1.3.0 (useless to us)
available.

There is a JDK-1.3.1 for SCO OpenLinux but that needs UnixWare
7.1.2 (OpenUnix 8) plus the MSLA and LKP (Linux Kernel
Personality) installed.

Admin tool is "DISPLAY=raita:0 scoadmin"

pkgadd -d full_file_name - adds a package	
pkgrm - removes a package	
pkginfo - gives info about a package	
pkgchk -v : lists the files in a package

emergency_disk diskette1/2	
initstate=1 at bootup	
cd /; shutdown -y now [-i6 for multi-user]		

to stop inetd:  sacadm -k -p inetd	
to start inetd: sacadm -s -p inetd	
	
Change network config: netcfg then sh /etc/init.d/inetdinit stop and
then start (no - NFS doesn't work - needs a reboot)

Change /etc/resolv.conf too
Static route: route add -interface -net 192.168.254 192.168.2.214

NFS mount:
mount -F nfs dux:/eracom /mnt/dux
/etc/vfstab

To start xdm equivalent - 
cp /usr/dt/config/* /etc/dt/config
edit /etc/dt/config/Xservers to remove local display

Do not run X locally (removing mouse at bootup seems to work) since
you have only one licence.

/usr/dt/dtlogin -daemon
Licence: DEM046463/ekfyzqtg
SCO Developer license 2080/926520
Virtual consoles: alt-sysreq f[1-12} (f1 for X), alt-sysreq-h for console

Home operation
Use netcfg to change to 192.168.254.214 and domain to finder.com.au
Change /etc/resolv.conf too

SCO Developer license 2080/926520		
Netscape Server Admin login is admin, no password.		

To load/unload drivers:	Dynamically Loadable Kernel Modules (DLKMs)
can be added to the kernel	using the idinstall(1M), idbuild(1M), and
modadmin(1M) commands. Most DLKMs can be installed with a command
sequence such as the following,	executed from the directory that
contains the driver's DSP files:		       

# su root	       
# cd <directory_containing_DSP>	      
# /etc/conf/bin/idinstall -a -k -M <driver>	       
# modadmin -l <driver>		    

To unload the DLKM:		       
# su root	       
# modadmin -U <driver>		    

To show all loaded DLKMs, run:		       
# modadmin -S	
	
cmn_err(D3) calls are logged in the /usr/adm/log/osmlog file. When the
system is rebooted, this file is saved as /usr/adm/log/osmlog.old
file. See also syslogd(1M).
		
Use the pkgmk(1) command to create a DSP package that contains all the
driver component files. Then, use the pkgtrans(1) command to transfer
the package to the destination media (usually a floppy disk).
immediate build If you do want to configure your loadable driver into
the running system immediately, invoke idbuild with the -M option.
This option configures your loadable driver into the system
immediately, without a reboot. Fred Shifter/Sichter, Dremer Solutions
0417 723582

scoadmin can be run from console

Console is Ctl-Alt-h or f2 f3 etc
logs are at /dev/osm but a cat and a syslogd are running at the same time

20011022 - may need to build jprov as root due to ksh weirdness

SMP
need osmp install (I had to do 
pkgtrans -s /tmp/junk osmp and then
pkgadd -d /tmp/junk)

psradm -vn 1 to turn on a processor
psrinfo
pbind
pexbind

Drvmap - the driver name and the PCI identifier
Master - the driver's DDI level
System - configuration data about the device - IRQs, DMA required etc
Node -how the system can build device files for the adapter
Driver.o - the driver must be called this!

Adding driver:
/sbin/modadmin -U e8k ... unloads any existing driver of that name
/etc/conf/bin/idinstall -M -k -N e8k ... installs driver in the filesystem
/sbin/dcu -S ... re-builds system tables 
/etc/conf/bin/idbuild -M e8k ... reconfigures the system to include driver
/sbin/modadmin -l e8k ... loads the driver into the kernel
/etc/conf/bin/idmknod -M e8k ... creates the device files

modadmin -Q e8k ... shows the drivers

Removing driver:
modadmin -U e8k
/etc/conf/bin/idinstall -d e8k
rm -f /dev/e8k?

1.2.2 has a problem with javac - it uses a wrapper and plays with
$0 which is not set right. NEed to replace all occurances of $0
in /opt/java2-1.2.2/bin/javac with /opt/java2-1.2.2/bin/javac.

Debugger is "debug"

Contents


4.18 Solaris


http://www.sunfreeware.com - software downloads

To reconfigure video or network, press ESC before booting. Other
reconfiguration with "b -r" or "touch /reconfigure; reboot"

Configure video board with kdmconfig

IP address is obtained from /etc/hosts

Console login is under Options in X login. To disable X, comment
out 0: line in /usr/dt/config/Xservers.

To control root login: /etc/default/login:
# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
CONSOLE=/dev/console
	
Static route: 
	route add -interface -net 192.168.254 192.168.2.214 or
	route add -net 192.168.4.0 -netmask 255.255.255.0 192.168.2.15
	route add default 192.168.2.2
	route delete default 192.168.2.1
Make it permanent in /etc/defaultrouter

mount: /etc/vfstab

cdroms automounted to /cdrom
home directories automounted through /etc/auto_home

When mounting to Linux, use
-o vers=2,proto=udp,rsize=8192,wsize=8192
also try async

In auto_home:
bhepple dux:/eracom/home/& or
* dux:/eracom/home/&

To check patch level:
	/usr/bin/showrev -p

64 bit enquiry /usr/bin/isainfo -k - on Solaris 7 & up

boot disk0 kernel/unix for 32bit kernel
boot disk0 kernel/sparcv9/unix for 64bit kernel

64 bit compile (default is -xarch=generic):
	cc -xarch=v9
Apps are 64 or 32 - cannot mix
64-bit libs in /usr/lib/sparcv9

Enable root login on X: see CONSOLE line in /etc/default/login

Software downloads for Sol 8,9 & 10:
http://www.blastwave.org

strace equivalent is truss

stack trace from a core dump:
	$ mdb core
	> $C

Contents


4.18.1 Driver add & remove


Add driver - add_drv will call devfsadm which needs an entry in
/etc/devlink.tab such as:
	type=e8k;name=cpu;minor=e8k	e8k\N0
That whitespace _must_ be a tab!

	cp e8k_driver.o /platform/$(uname -m)/kernel/drv/e8k
	/usr/sbin/add_drv -m"* 0666 root root" -i'"pci1011,1065"' e8k

List driver:
	prtconf -D |grep e8k
	modinfo | grep e8k

Removing driver:
	rem_drv e8k

modinfo gives "module id", then:

modunload -i "module_id"

Contents


4.18.2 Driver Debug messages


Appear in /var/adm/messages not /var/log/syslog!!!!!

Contents


4.18.3 If it won't boot with the driver


Remove the card, of course! Also:

Useful in development only - NAH - DOESN'T WORK becuase the damn
thing reboots into whatever mode it was in before!

Suppose the default is to boot into
64-bit kernel then only install the 32-bit driver and run in
32-bit mode:

	boot kernel/unix

If it fails then it'll boot into 64-bit mode and you're still clean:

	boot kernel/sparcv9/unix

Contents


4.18.4 Install/Backup/Restore new image:


Install:

start with clean 2.6 image, remove freeware packages, upgrade the
OS and then install new freeware packages. 

If you install the OS from scratch, the installation program will
not preserve the disc layout.

Backup:
	"boot disk0", then:
	dd if=/dev/rdsk/c0t2d0s3 bs=1024k |gzip -c >/images/<file>

Restore:
	"boot disk0", then:
	gunzip -c /images/<file> |dd of=/dev/rdsk/c0t2d0s3 bs=1024k

OR:

reboot disk0
restoreImage images/sol7...
reboot disk2

Contents


4.18.5 Installation checklist


dun: 192.168.2.193
nis: gc.eracom.com.au

add auto_misc to auto_master - add a line:
	/misc           auto_misc       -nobrowse
add this to auto_misc:
	dux_eracom		dux:/eracom
	dux_nobackup	dux:/nobackup

	mkdir -p /mnt/dux
	ln -s /misc/dux_eracom /mnt/dux/eracom
	ls -s /misc/dux_nobackup /mnt/dux/nobackup
add this to auto_home:
	*       dux:/eracom/home/&
	/etc/init.d/autofs stop
	/etc/init.d/autofs start
	cp ~bhepple/.bashrc ~/
	cp ~bhepple/.bash_profile ~/
create /etc/resolv/conf:
	search gc.eracom.com.au
	nameserver 192.168.2.1
point /etc/nsswitch.conf to use files first in hosts: line:
	hosts:      files dns xfn nis [NOTFOUND=return]

Add SunSolve patches
bash (& ln -s /usr/local/bin/bash /bin/bash if necessary)
Make sure rlogin works automatically
gzip
make 3.79 or later (Sol9). Also, cd /usr/local/bin; ln -s make gmake 
cvs (Sol9)
ncurses
less 
top (Sol9)
m4
patch - unzip or untar recommended patches for OS then:
	 ./install_cluster -nosave
forte-C & C++ 6u2 (or Forte Compiler Collection 7 for Sparc)
root
java 1.2 If necessary:
	cd /usr; rm java
	sh /mnt/dux/nobackup/opt/packages/solaris/sparc/java_12x/jdk*
	ln -s jdk1.2.2 java
	check java -version is 1.2
make sure prod tree compiles:
	JDK=/usr/jdk1.2.2 CPROVDIR=`pwd` gmake
change /etc/default/login to allow non-console root login
add dns before other items in hosts: line in /etc/nsswitch.conf
cp ~bhepple/.bashrc & .bash_profile to ~root
maybe add dux & curry to /etc/hosts
run catman

Contents


4.18.6 Kernel debugger - adb & kadb


Trouble is, kadb/adb doesn't seem to give anything useful on driver
crashed).

Make sure savecore is enabled in /etc/init.d/sysetup (enabled by
default) Core is in /var/crash/dun

At boot prompt: 

ok boot kadb -d 
kadb: kernel/unix 
kadb[0]:

While kernel is running:
L1+A on SPARC consoles
Ctl-Alt-D on x86
#~ on tip (serial console?)

On a crash dump:
	adb -k /var/crash/dun/unix.1 /var/crash/dun/vmcore.1

On a live system:
	adb -k /dev/ksyms /dev/mem

Commands:
$c stack trace
$b display breakpoints
$q quit
$c 
scsi_transport:b sets breakpoint
:c continue 
:s step
:e step over
:u step after return
:d delete breakpoint
:z delete all breakpoints

To place a breakpoint at every module's _init() entrypoint so that
kadb is entered in boot, add moddebug to /etc/system:

	set moddebug | 0x00000001

or while in adb/kadb:
	moddebug/X    (prints value)
	moddebug/W 0x00000001 (sets value)
driver_alias

Contents


4.18.7 Moving a disk from one i386 box to another


I wanted to put a harddisk with an installation of Solaris 9 into another box.
Needless to say that Solaris didn't boot properly, since every single piece of
the hardware was different.

Here are the error messages I got and how I fixed it:

First when I booted the second machine with the harddisk I got the following messages:

	mount: No such device or address
	/dev/dsk/c0d0s1: No such device or address
	The / file system /dev/rdsk/c0d0s0 is being checked
	Can't open /dev/rdsk/c0d0s0
	/dev/rdsk/c0d0s0: CAN'T CHECK FILE SYSTEM
	/dev/rdsk/c0d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY
	WARNING - Unable to repair the / file system
	Run fsck manually (fsck -F ufs /dev/rdsk/c0d0s0)
	Exit shell when done to continue the boot process

OK, so I logged in with the root password and tried "fsck -F ufs /dev/rdsk/c0d0s0",
but it says there is no such device, albeit it is there in /dev.

When I quit the shell with "exit", I got this:

	resuming system initialization
	mount: No such device or address
	mount: Cannot open /dev/dsk/c0d0s0
	failed to open /etc/coreadm.conf: Read-only file system
	eeprom: cannot mkdir /boot/solaris Read-only file system
	INIT: Cannot create /var/adm/utmpx
	INIT: failed to write of utmpx entry: "   "
	INIT: failed to write of utmpx entry: "   "
	INIT: SINGLE USER MODE 

I asked the folks at the Solaris-x86 mailing list for help and Laurent's solution
worked very well. Thanks again Laurent! :-)

1.	Boot from the "1 of 2" Solaris installation CDROM by using "b -s"  (without the quotes)
	instead of "1" or "2" when asked for the  installation type

2.	mount the root boot partition at /mnt
# mount /dev/dsk/c0d0s0 /mnt

3.	Reconfigure the device tree:

# cd /mnt
# mv dev dev.old
# mv devices devices.old
# devfsadm -r /mnt

4.	Verify that the links /mnt/dev/dsk/c0d0s* to ../../devices/* exist.

5.	Type "rm /mnt/etc/path_to_install"   (or remove all lines but comments in this file)

6.	Remove the CDROM and /usr/sbin/reboot (if you removed /etc/path_to_install then, at
	the booting Solaris prompt, type "b -a")

The system should come up fine now!

One mistake I made was, that I didn't have plugged in the PS/2 mouse when booting with the
installation CD and while doing "devfsadm", so the X windows system failed to init.
Here is the error message I got when testing with kdmconfig :

Error opening "/dev/kdmouse"
Fatal server error: failed to initialize core device
XIO: fatal IO error 146 (connection refused) on X server "unix:0.0"
     after 0 requests (0 known processed) with 0 events remaining.

I booted with "b -r" to rebuild /dev and /devices and it worked!
(or "touch /reconfigure" and reboot)

Contents


4.18.8 Network adapter config


Configuring Your Network Interface Card on Solaris

 

Step 1: Check the hardware compatibility list to make sure your
nic is compatible with Solaris 8:

http://soldc.sun.com/support/drivers/hcl/index.html

Step 2: Find your driver:

If your NIC is on the Solaris hcl list you can find the driver
name in the /boot/solaris/devicedb/master file.

Type cat /boot/solaris/devicedb/master | grep "yourNIC" to find
the device driver.

For example my nic is the 3Com 3C905B-TX

cat /boot/solaris/devicedb/master |grep 3Com gives a list of
drivers from 3Com

the following line is the one that corresponded to my particular
Nic

pci10b7,9055 pci10b7,9055 net pci elxl.bef "3Com 3C905B-TX Fast
Etherlink XL 10/100"

Step 3: Update the Solaris /etc/driver_aliases file

Make sure your driver is listed. Sometimes you have to add it
manually.

For my nic this is the line that had to be in the file:

elxl "pci10b7,9055"

Step 4: Plumb the interface:

Your network card must be configured with the network address of
your host machine in order for the TCP /IP software to have
access to it. You do this with the ifconfig command. With Solaris
network interfaces must be attached with the syntax :ifconfig
interface plumb before they become visible to the kernel and
configurable.

ifconfig elxl0 plumb
ifconfig elxl0 <ip address> netmask <x.x.x.0> broadcast <x.x.x.255>
ifconfig elxl0 up

Step 5: Have the system update your device:

Now all you need to do is run devfsadm to update your systems
devices

type devfsadm or devfsadm -i <driver_name>

Step 6: Reboot/Reconfigure:

type touch /reconfigure

then reboot Solaris

Contents


4.18.9 NIS Client


See http://www.ebsinc.com/solaris/network/nis.html

domainname gc.eracom.com.au and put into /etc/defaultdomain

... use /etc/nsswitch.nis and add dns to hosts line. 

Servers are in /var/yp/binding/gc.eracom.com.au/ypservers - set up with
ypinit -c ... use a real name such as dux, not numeric IP address

	/etc/init.d/rpc stop
	/etc/init.d/rpc start

	ps -ef |grep ypbind 
... should show something
	ypcat passwd 
... should show NIS users

Put this into /etc/auto_home:
*       -rsize=8192,wsize=8192  dux:/eracom/home/&

	/etc/init.d/autofs stop
	/etc/init.d/autofs start

May need link for bash:

	ln -s /usr/local/bin/bash /bin

May need to run yppasswd on dux

Contents


4.18.10 Packaging


pkgadd -d full_file_name - adds a package	
pkgrm - removes a package	
pkginfo - gives info about a package (use -l option for more info)
pkgchk -v : lists the files in a package

Contents


4.18.11 Shared libraries:


cc -o sub1.o -c sub1.c
cc -G -Bsymbolic -xcode=pic32 -o libsub1.so sub1.o
cc -o t -L. -lsub1 -ldl t.c

To build exports.exp from a simple list exports.list:
.list.exp:
	@( \
echo '{\nglobal:'; \
sed 's/$$/;/' < $<; \
echo 'local:\n*;\n};' ) >$@

and add -Mexports.exp to the compile line

Contents


4.18.12 Sun C compiler


www.sun.com/forte/c try&buy install with /etc/opt/licences/lit or
dump into  /opt/SUNWspro/license_dir/sunpro.lic,node

lynx -dump http://jsecom16a.sun.com/licenses/sparc.dat > /opt/SUNWspro/license_dir/sunpro.lic,node

On i386:
lynx -dump http://jsecom16a.sun.com/licenses/intel.dat > /opt/SUNWspro/license_dir/sunpro.lic,node

The following was needed to install C++ the last time I tried (6.2 FCS)

Unpack tar file in /tmp ... results in /tmp/products/...

mkdir /tmp/.install/JRE/i386/bin
cd /tmp/.install/JRE/i386/bin
ln -s /usr/java1.2/jre/bin/java jre

.... presumably any java jre will do ...

Contents


4.18.13 Wasting a day on network cards:


It seems that Solaris is unable to cope with rebooting with the
NIC in a different slot than last time. Only solution seems to be
to  boot and reconfigure without the card, eliminating it from
the system completely, and then re-installing it.

But first, try renaming /etc/hostname.elxl0 to elxl1 or vice versa

	rem_drv elxl (for 3Com 3c509B)
	reboot
	add_drv -i '"pci10b7,9055"' elxl

Then see what device files you get in /devices/pci*. Then set
up /etc/hostname.elxlN to contain "rasam" where N is the number
of the device.

	reboot

It _may_ come up - you might need to do a
	ifconfig elxlN plumb
	ifconfig elxlN <ip address> netmask <x.x.x.0> broadcast <x.x.x.255>
	ifconfig elxlN up
	devfsadm -i elxl

Multiple CPU information:
	mpstat
	psrinfo -v

Contents


4.19 Sourceforge

Project Descriptive Name:  gjots2
Project Unix Name:         gjots2
CVS Server:                cvs.sourceforge.net
Shell Server:              shell.sourceforge.net
Web Server:                gjots2.sourceforge.net
Group directory:	   /home/groups/g/gj/gjots2

The Project Admin page for your project may be accessed at
https://sourceforge.net/project/admin/?group_id=133116

Should you need to contact the SourceForge.net team, we may be reached
by submitting a Support Request at:
https://sourceforge.net/tracker/?func=add&group_id=1&atid=200001

Documentation:
https://sourceforge.net/docman/?group_id=1

Edit keys:
https://sourceforge.net/account/

CVS access:
cvs -d :ext:bhepple@cvs.sourceforge.net:/cvsroot/gjots2 co gjots

Shell access:
ssh -t bhepple,gjots2@shell.sourceforge.net create

Contents


4.20 test progs


Contents


4.20.1 align.c


#include <stdio.h>

main() {
        char arb[8];
        int i;
        unsigned long *longvar;

        for (i = 0; i < 8; i++) {
                arb[i] = i;
        }

        for (i = 0; i < 4; i++) {
                longvar = (unsigned long *) (arb + i);
                printf("%d: *0x%X = 0x%X\n", i, longvar, *longvar);
        }
}

Contents


4.20.2 endian.c


#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv) {
        int t = 0x61626364;
        char *c = (char *) &t;

        printf(" %c %c %c %c \n", c[0], c[1], c[2], c[3]);
}

Contents


4.20.3 pack.c


#include <stdio.h>

int
main(int argc, char *argv[]) {

#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif
        struct {
                char c;
                int i;
                double d;
        } dummy;
#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif

#ifdef _AIX43
# pragma options align=packed
#else
# pragma pack(1)
#endif
        struct {
                char c;
                int i;
                double d;
        } dummy1;
#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif

#ifdef _AIX43
# pragma options align=twobyte
#else
# pragma pack(2)
#endif
        struct {
                char c;
                int i;
                double d;
        } dummy2;
#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif

#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack(4)
#endif
        struct {
                char c;
                int i;
                double d;
        } dummy4;
#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif

#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack(8)
#endif
        struct {
                char c;
                int i;
                double d;
        } dummy8;
#ifdef _AIX43
# pragma options align=reset
#else
# pragma pack()
#endif

# pragma pack(push,HashInfo,2)
        struct {
                char c;
                int i;
                double d;
        } dummyHash;
# pragma pack(pop,HashInfo)

        printf("Size dummy  = %d\n", sizeof(dummy));
        printf("Size dummy1 = %d\n", sizeof(dummy1));
        printf("Size dummy2 = %d\n", sizeof(dummy2));
        printf("Size dummy4 = %d\n", sizeof(dummy4));
        printf("Size dummy8 = %d\n", sizeof(dummy8));
        printf("Size dummyHash = %d\n", sizeof(dummyHash));
}

/*
#if 0

Results:

Linux: egcs-2.91.66: OK - () 1 2 4; not - 8, push nor 0
FreeBSD: 2.95.3: OK - () 1 2 4; not - 8, push nor 0
        Solaris 5.6 i386: Sun WorkShop 6 update 1 C 5.2 2000/09/12: OK - () 1 2; not - 4 8 push; 4 is the default
        ... also -misalign and -misalign2 (half-word alignment) in later cc's
AIX: 

#endif
*/

Contents


4.21 Torrents


http://comparebt.blogspot.com/

http://www.btjunkie.org
http://www.bushtorrent.com
http://www.torrentreactor.net
http://www.isohunt.com
http://www.meganova.org
http://www.mininova.org
http://www.thepiratebay.org
http://www.torrentportal.com
http://www.torrentspy.com
http://www.torrentz.com

Contents


4.22 www

w3c dom conformance test:
http://www.visi.com/~m16/webdev/W3C_DOM_conformance_test.html
another line

Contents


4.22.1 Cool HTML


http://manual.sidux.com/en/part-uuid-en.htm

Contents


4.23 X11


Contents


4.23.1 Dual head


To run dual head (without Xinerama), configure both monitors but
with a single screen in xorg.conf with double the virtual size eg if mode is 1600x1200 then put a line

virtual 3200 1200

Then run xrandr and see the 2 displays eg:

Screen 0: minimum 320 x 200, current 3200 x 1200, maximum 3200 x 2400
VGA-0 connected 1600x1200+1600+0 (normal left inverted right x axis y axis) 367mm x 275mm
   1600x1200      60.0*+   59.9  
   1280x1024      59.9  
   640x480        60.0  
DVI-0 connected 1600x1200+0+0 (normal left inverted right x axis y axis) 367mm x 275mm
   1600x1200      60.0*+   59.9  
   1280x1024      75.0     59.9  
   1152x864       74.8  
   1024x768       75.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0  
   720x400        70.1  
S-video disconnected (normal left inverted right x axis y axis)

The two displays are then VGA-0 and DVI-0. Now run

xrandr --output VGA-0 --right-of DVI-0

(maybe change the order or say --left-of). Put that
into an autostart file. but what happened to the fonts?
everything is huge!! Somewhat fixed by setting the dpi in
gnome-control-center->appearance->font->force dpi and in
kde-control-center->similar

 1 34567890123456789012345678901234567890123456789012345678901234567890123456789

Liberation Mono is a fairly good font

Firefox has an about:config item layout.css.dpi which can be -1 0 or whatever.

Contents


4.23.1.1 Persistent

Start up a VNC server on the remote box and leave it running. No need to open holes in your firewall except for SSH, which is pretty safe to do.

To tunnel through the firewall and log in, type these commands on your local machine:

    ssh -f -N -L 5901:localhost:5901 -X username@remotebox.example.com
    vncviewer localhost:5901

Voila: VNC connection, secured by SSH. When you are done just

    killall ssh

.
Note that 5901 means the :1 VNC session, 5902 means :2, etc.

Because ssh has the ability to do so much, it deserves special attention to security. The default implementation should be tweaked more than a little bit, including disabling password login, changing the port and, please don't forget, disabling ssh1. There are other, more subtle, cryptographic attacks, but even those few changes should make it more secure.

Contents


4.23.2 Resolution calculator


http://www.raydreams.com/prog/dpi.aspx

Contents


4.24 Window Managers


Contents


4.24.1 fluxbox


dependencies:
next_desktop.pl
wmctrl
fbpager
xvkbd

for print:
xwd
xwdtopnm
pnmtopng
Xdialog

Contents


4.24.2 gnome/gtk


if not running gnome desktop, de-uglify gnome apps with:
[ `u gnome-settings-daemon` ] || /usr/libexec/gnome-settings-daemon &

Maybe need to run:
gone-control-center

Maybe we don't even need to bother with gnome-settings-manager - just set
your fonts in ~/.gtkrc-2.0 eg.

include "/usr/share/themes/ClearlooksClassic/gtk-2.0/gtkrc"

style "user-font" {
        font_name = "Sans 8"
}

widget_class "*" style "user-font"

gtk-font-name="Sans 8"

if gconf-editor is not available:

default emacs keys:
gconftool-2 -s --type string /desktop/gnome/interface/gtk_key_theme Emacs

disable gnome screensaver:
gconftool-2 -s /apps/gnome_settings_daemon/plugins/background/active --type bool false