File: TWDT.html

package info (click to toggle)
lg-issue108 1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,784 kB
  • ctags: 186
  • sloc: perl: 534; python: 288; xml: 67; sh: 39; makefile: 34; sed: 27
file content (8760 lines) | stat: -rw-r--r-- 324,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760


<html>
<head>
<link href="../lg.css" rel="stylesheet" type="text/css" media="screen, projection" />
<title>
Linux Gazette : November 2004 (#108) 
</title>

<style type="text/css" media="screen, projection">
<!--

.twdtarticle {
	width: 84%;
	/* margin:0px;
	left:0px; */
}

#twdtbody {
/*
	margin-left:0px;
	margin-right:0px;
*/
}

.twdtarticle h1 {
	font-size:19px;
	text-align:center;
}

.lgcontent {
        width: 84%;
        margin-top: 30px;
        /* left:0px; */
}

-->
</style>


</head>

<body id="twdtbody">


<img src="../gx/2003/newlogo-blank-200-gold2.jpg" alt="Linux Gazette" id="twdtlogo"/>
<p id="fun">...making Linux just a little more fun!</p>




<div class="content lgcontent">

<h2>November 2004 (#108):</h2>

<ul>


	<li><a href="#lg_mail">The Mailbag</a>

	<li><a href="#lg_answer">The Answer Gang</a>

	<li><a href="#lg_bytes">News Bytes</a>, by <i>Michael Conry</i></li>

	<li><a href="#anonymous">GRUB boot diskette for Knoppix</a>, by <i>Anonymous</i></li>

	<li><a href="#bilbrey">Using a Non-Default GUI (in RHEL and kin)</a>, by <i>Brian Bilbrey</i></li>

	<li><a href="#nielsen">Preparing For My Interviews Part 1: MySQL and Perl</a>, by <i>Mark Nielsen</i></li>

	<li><a href="#odonovan">Advanced Features of netfilter/iptables</a>, by <i>Barry O'Donovan</i></li>

	<li><a href="#okopnik">Laptop review: Averatec 5400 series</a>, by <i>Ben Okopnik</i></li>

	<li><a href="#oregan">Outliners and Mind mapping</a>, by <i>Jimmy O'Regan</i></li>

	<li><a href="#oregan2">Screen scraping with Perl</a>, by <i>Jimmy O'Regan</i></li>

	<li><a href="#park">Bash Shell and Beyond</a>, by <i>William Park</i></li>

	<li><a href="#park1">Setting the Clock on Linux</a>, by <i>William Park</i></li>

	<li><a href="#seymour">Design Awareness</a>, by <i>Mark Seymour</i></li>

	<li><a href="#youngman">An Introduction to JSPWiki</a>, by <i>Neil Youngman</i></li>

	<li><a href="#lg_laundrette">The Linux Laundrette</a>, by <i>Jimmy O'Regan</i></li>

</ul>

</div>




<br />


<div class="content lgcontent">

<a name="lg_mail"></a>
<h1>The Mailbag</h1>


</b>
</p>


<p>
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">HELP WANTED : Article Ideas</FONT></STRONG></BIG>
<BR>
<STRONG>Submit comments about articles, or articles themselves (after reading <a href="../faq/author.html">our guidelines</a>) to <A HREF="mailto:gazette@linuxgazette.net">The Editors of <i>Linux Gazette</I></A>, and technical answers and tips about Linux to <A HREF="mailto:tag@linuxgazette.net">The Answer Gang</A>. 
</STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#wanted.1"
	><strong>Linux and Oracle</strong></a>
<li><A HREF="#wanted.2"
	><strong>We Want Your Tips!</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Linux and Oracle</FONT></H3>
Fri, 22 Oct 2004 14:39:53 -0700
<BR>Jeff Rohloff (<a href="mailto:tag@linuxgazette.net?cc=J5494R@LVMPD.com&subject=%20Re%3A%20%5BLG%20108%5D%20help%20wanted%20%231">J5494R from LVMPD.com</a>)


<P>
My name is Jeff Rohloff, and I am the IT manager of the detention center
here in Las Vegas, NV.  I am involved in a project that uses Oracle DB
and application servers.  We have investigated the deployment of this
app on a server running Linux, and have been very excited what we have
found so far.  We have presented this to the executive staff and they
too are excited.  My last hurdle is do a risk assessment of the
deployment of Linux into our environment that is primarily Microsoft.
Do you know of a site, or do you have info that you maybe able to share
that might help me put this document together.  Thanks in advance..
</P>

<font color="#660000"><blockquote>This is extremely situation
dependent. You should at least ensure that the people that'll be using
this database are trained to do so.
 -- Thomas</blockquote></font>

<blockquote><font color="#1F1F1F">In my experience, Oracle in a mixed Windows/Linux environment works
quite well. I recently taught a class on Linux implementation at the
CapitalOne bank headquarters where they're converting to exactly that
setup. Their tech people were highly positive in their reactions to my
questions about the integration process; it eliminated several of the
problems they'd experienced under Wind0ws (I can't recall exactly what
the former problems were, but they had something to do with failing to
service a query during high traffic periods.)
</font></blockquote>
<blockquote><font color="#1F1F1F">You're definitely not riding the bleeding edge with this; many companies
have implemented this configuration by now, and you could certainly
benefit from their experience. Oracle themselves probably have case
studies on file that you could examine, although it may require a bit of
digging and prodding.
 -- Ben</font></blockquote>

<blockquote><font color="#000066">Perhaps our readers could point out some specific resources that Jeff
could use while making his decision about their Oracle setup.
</font></blockquote>
<blockquote><font color="#000066">But it does raise a neat idea for an article. The core of any good
advocacy (in my not too humble opinion) is the ability to take the
other viewpoint(s) and examine all the data from a broader perspective
- what will really serve the needs <EM>best</EM> from the options available.
Soooo... a good article on risk analysis, itself, with managers like
Jeff and businesses in mind, would be a welcome sight.  Any takers?
Read our Author Guidelines - then contact our articles@ staff.
 -- Heather</font></blockquote>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">We Want Your Tips!</FONT></H3>
Fri, 29 Oct 2004 17:49:23 -0800
<BR>Heather Stern (<a href="mailto:tag@linuxgazette.net?cc=star@starshine.org&subject=%20Re%3A%20%5BLG%20108%5D%20help%20wanted%20%232">The Answer Gang's Editor Gal</a>)


<P>
Sorry if we're a bit light on the tips this month, folks.
</P>
<P>
As mentioned in a past issue, people have been asking us for more Tips that
are the little bitty tidbits you can nibble on, the quick answer, the really
handy pencil to tuck in your Linux pocket.  Some of our meatier tips come
from The Answer Gang, maybe a little too meaty for some tastes.  The fact is
the very best of the tidbit-style Two Cent Tips come from you, dear readers...
</P>
<P>
Send 'em in!  mail your tip to <A HREF="mailto:tag@linuxgazette.net"
	>tag@linuxgazette.net</A>.  Ideally, they aren't
faq's, aren't obvious (until you see them, at least), but give you a "wow!
I wish I'd known <EM>that</EM> a few weeks ago" feeling.
</P>

<!-- end 2 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GENERAL MAIL</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#mailbag.1"
	><strong>Gentoo should not get all the press</strong></a>
<li><A HREF="#mailbag.2"
	><strong>LG#105, "Fine-tuning SpamAssassin"</strong></a>
<li><A HREF="#mailbag.3"
	><strong>Re: How to Reset forgotten Root passwords</strong></a>
<li><A HREF="#mailbag.4"
	><strong>Re: stunnel article in the Linux Gazette</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Gentoo should not get all the press</FONT></H3>
Thu, 21 Oct 2004 08:48:02 -0400
<BR>linuxham (<a href="mailto:gazette@linuxgazette.net?subject=%20Re%3A%20%5BLG%20108%5D%20mailbag%20%231">linuxham from wowway.com</a>)



<br>Answered By  Raj Shekhar, Thomas Adam, Mike Orr, Jason Creighton

<P>
<A HREF="http://www.debian.org/">Debian</A>, ahhh Debian. Don't care about any cutesy install, easy enough IMHO.
</P>
<BLOCKQUOTE>
[Mike] 
I managed to stay out of this thread so far because the author is so
closed-minded, but just to set the facts straight, Gentoo's install is
<EM>less</EM> cutesy than Debian.  No curses dialogs to guide you through.
There <EM>is</EM> one little dialog program you can run to configure the network,
but it's optional.  Everything else is done by hand the old-fashioned way
or by running little console programs.  What more do you want?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Jason] 
Alternatively phrased, what <EM>less</EM> do you want?
</BLOCKQUOTE>
<BLOCKQUOTE>
For instance, the only thing in the Crux install that doesn't happen on
the command line is a curses-based package selection program. Everything
else (creating the target filesystem, mounting it, installing a
bootloader if you need to, etc.) you did yourself.
</BLOCKQUOTE>
<BLOCKQUOTE>
Which, oddly enough, I found to be simpler than trying to figure out how
someone else designed an installer.
</BLOCKQUOTE>
<BLOCKQUOTE>
I had not realized that Gentoo had a minimal install. Sounds like I
might like it. (If only I had the bandwidth...)
</BLOCKQUOTE>
<BLOCKQUOTE>
[Mike] 
Gentoo is not the first or only compile-it-yourself distro, but it
happens to be the one that's supported enough to make a lot of
first-time compile-distro users try it out.   So it's creating a
"market" for a different kind of distribution.  Something like that
deserves press coverage.  Will it remain in that privileged position
forever?  Probably not.  I first encountered <A HREF="http://www.redhat.com/">Red Hat</A> some months after
it appeared when a guy recommended it saying, "These guys actually test
their distribution."  RH brought a new level of quality control to
Linux, which <A HREF="http://www.suse.com/">SuSE</A> and others then stepped up to compete with.  No doubt
other distros modelled after BSD ports will appear too, and the binary
distros may start focusing more on their (already existing) option of
letting users install from source if they wish.
</BLOCKQUOTE>
<BLOCKQUOTE>
Rock Linux is another compile-it-yourself distro, and last time I looked
at it, it had an install similar to Gentoo's.  You might also look at
<A HREF="http://www.slackware.org/">Slackware</A>, which is more simplistic than Debian (and I mean that in a
good way), although it's more cutesy than Gentoo.
</BLOCKQUOTE>
<P><STRONG>
Gonna stick with it because
</STRONG></P>
<P><STRONG>
1. It is FREE, never gonna have to pay for it in any way, really a strange concept...
</STRONG></P>
<BLOCKQUOTE>
[Mike] 
Gentoo is free, and Rock and Slackware and Fedora and...
</BLOCKQUOTE>
<BLOCKQUOTE>
[Raj] 
...so is the Mandrake Community Edition (it lacks the
acrobat reader, crossover office and other proprietary stuff)
</BLOCKQUOTE>
<P><STRONG>
2. APT works sooo well.  Just install Woody base, set sources to testing, and invoke aptget ugrade dist to get Sarge installed. Then aptget for whatever else over the net
</STRONG></P>

<blockquote><font color="#000066">[sic] folks. Debian's actual command (to do mass upgrades without breaking holds or allowing package removals for apps that changed drastically) is:
apt-get upgrade dist
 -- Heather</font></blockquote>
<BLOCKQUOTE>
[Raj] 
You can do that with yum too.  MDK provides rpmuri (might have got the
name wrong). I am surprised that people still complain about the RPM
dependency hell.  Then there are some people who can run apt on redhat
too, but I have not looked at it.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Mike] 
Debian can justly be proud of its pioneering work in distro technology.
It was the first distro to create a package searcher/downloader like
apt, a program many of the RPM-based distros have now adopted.  Debian
was also the first with individually-upgradeable packages (the dpkg
system), although rpm came out not long after.  I think Debian was also
the first distro with dependencies.
</BLOCKQUOTE>
<BLOCKQUOTE>
But these all must be weighed against the much larger set of quirky
Debian technologies and policies which have not been universally
adopted.  Debian has very specific and complicated policies for how
software must be packaged, which files go where, how the application
must behave, etc -- these policies fill two whole books (the Debian
Policy Manual, the Developer's Reference, and we should add the New
Maintainer's Guide and the smaller doucments: Emacs policy, Perl policy,
Spelling Dictionaries and Tools policy, etc).  These provide a steep
learning curve for package maintainers, as well as for those who just
want to use dpkg for their own private software.  Automated tools exist
now to help with this, but they do so much magic it can be hard to
figure out what all they're doing.  Last time I tried to build a
package, you even had to make a PGP key to sign it with, as if that's
necessary for private packages.  All this complication regularly results
in (1) Debian packages with broken dependencies: e.g., packages that
depend on themselves, packages that depend on packages that don't exist,
(2) lots of fixer releases to get the minutae of the policies correct,
(3) months or years between releases, and (4) several-month periods
where you can't install two favorite packages simultaneously because one
uses a newer version of a library than the other.  Debian was my primary
OS for nine years, so I've had lots of experience with this.  When a
package is broken, you have to decide whether it's worth spending
several hours fixing the package, or spending the same several hours
building the upstream software locally and waiting for Debian to catch
up.  The latter is fine for really standalone programs, but it's a pain
if it's a library or program that lots of other packages depend on.
</BLOCKQUOTE>
<P><STRONG>
3. When Sarge goes maninstream, gonna set cron to update automatically any
packages that get security fixes.
</STRONG></P>
<BLOCKQUOTE>
[Raj] 
Again yum can be made to run from cron too.
</BLOCKQUOTE>
<BLOCKQUOTE>
Do not want to start a distro-flamewar, but yes most distros do provide
a very decent method of upgrading/installing packages now.  And some
utils do provide means to manage source installs too. (checkinstall is
one from the top of my head). Linux is out of the dark ages now 
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)" 
		height="24" width="20" align="middle">
</BLOCKQUOTE>

<blockquote><font color="#000066">Not that I recommend letting cron change how production systems work - or don't - every night.  brrrrrr...  I have enough cares when upgrading while a sysadmin <EM>is</EM> present.
 -- Heather</font></blockquote>
<BLOCKQUOTE>
[Mike] 
That may be safe with Debian Stable, but you definitely don't want to do
that with Unstable or you may wake up to a hosed computer.  I would
never let any distro automatically upgrade packages without me being on
hand to monitor for problems, not unless I'd had success with that same
package version on other computers, but if you really want to, you can
put "emerge sync" and "emerge world" in Gentoo's cron too.
</BLOCKQUOTE>
<P><STRONG>
can the others boast these wonderful qualities? Not sure I care, but it would
be good to know. I installed Suse, and about went to the bathroom to retch
when I realized I had installed a proprietary system. It is still there on my
hd, but I haven't used it.
</STRONG></P>
<BLOCKQUOTE>
[Mike] 
Some of us are like Linus: we care less if our computer is 100%
politically correct than if it has the software we need.  I strongly
prefer free software, but the BSD license is good enough for me; I don't
need GPL (or Lignux).  And I'm not against installing RealAudio or Wing
IDE/Komodo or a semi-commercial office suite if there's no adequate free
alternative.
</BLOCKQUOTE>
<P><STRONG>
[Jason] 
I don't understand this. The BSD license has <EM>less</EM> restrictions on use
than the GPL. Could you please elaborate?
</STRONG></P>
<BLOCKQUOTE>
[Mike] 
Bad wording on my part.  The GPL fanatics think the BSD license has holes big
enough to drive a proprietary truck through.  Users can make closed-source
derivatives of BSD-licensed products, and that really gets the free
software purists' goat.
</BLOCKQUOTE>
<BLOCKQUOTE>
As an example, last week in LWN there as an article
(<A HREF="http://lwn.net/Articles/106353"
	>http://lwn.net/Articles/106353</A>) about Jeff Merkey's (ex-Novell) offer
to buy a BSD-style license for a certain version of Linux (assuming
all the kernel copyright holders were locatable and agreed, which is
about as likely as Ben Okopnik selling you a bridge in Brooklyn).  That
would allow Microsoft to incorporate portions of Linux into Windows if
it desired.  There are rumors MS already did this with BSD code, in
Windows 95's TCP stack and telnet/FTP utilities.  Does that bother me?
No, I'm just glad they borrowed quality code rather than using whatever
homemade crap they might have come up with otherwise.  Actually, what
I care more about is compatibility and interoperability, and borrowed
code at MS has a better track record in that regard than homemade stuff.
</BLOCKQUOTE>
<BLOCKQUOTE>
I've made some contributions to Cheetah (<A HREF="http://cheetatemplate.org"
	>http://cheetatemplate.org</A>),
a template system for Python, which has a BSD-style license.  So nothing
is keeping MS from using Cheetah in MS Office or making a commercial
Cheetah derivative.  Does that bother me?  No, I thought about that
before I released the code.  Their making money off it doesn't hinder me
from using it for free, and I'm glad if it gets wider use, that's why I
wrote it.
</BLOCKQUOTE>

<blockquote><font color="#000066">Back to answering our reader...
 -- Heather</font></blockquote>
<BLOCKQUOTE>
[Mike] 
Why didn't you realize SuSE was "proprietary" before you installed it?
It's hardly a secret that its closed-source install/upgrade tools are
what make SuSE SuSE.  (Or does SuSE provide the source somewhere?  RH
provides the source to all its tools.) Or are you referring to the
third-party software SuSE bundles with a one-user license, software
which completely optional and in no way required for a functional SuSE
system?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Jason] 
<EM>nods</EM> What works, works. I'm don't use free softcare because it's free
("free" in the "free speech" sense of the word), I use it because it
isn't broken.
</BLOCKQUOTE>
<P><STRONG>
Thanks for the great articles!!
</STRONG></P>
<P><STRONG>
Ed
</STRONG></P>
<BLOCKQUOTE>
Thanks, Ed.  It's always good to hear from our readers.
</BLOCKQUOTE>
<BLOCKQUOTE>
I was really tempted not to pub this. It's lively, but our Gang aren't
really argumentative with each other about our choices, we just know
how to enjoy a juicy debate.  We know there are fans out there for
every distro.  Each one's got its good points, some of those are even
much the same.  And for others, "good" is in the mind of the beholder.
For users who crave the lumbar support that sitting in the driver's seat
of a commercial distro brings, we seem to have more of those every year.
A few of us will continue to enjoy our hot rods and race around in the
desert of really new software, trusting our experience to be our roll
bars, and expecting - some even enjoying the chance - to hit a few
potholes now and then.  Open source gives us that choice.
</BLOCKQUOTE>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">LG#105, "Fine-tuning SpamAssassin"</FONT></H3>
Sat, 16 Oct 2004 12:31:26 -0400
<BR>Ben Okopnik (<a href="mailto:gazette@linuxgazette.net?subject=%20Re%3A%20%5BLG%20108%5D%20mailbag%20%232">ben from linuxgazette.net</a>)


<P>
In spite of my recent hardware problems, there's been a very pleasant
and positive change in my computing experience over the past few months;
namely, the amount of spam that I have to "handle" (i.e., false
positives and negatives) has gone to nearly zero. I wanted to mention it
here, since Neil's article was responsible for getting me started down
this path.
</P>
<P>
Here's the snapshot of what it took:
</P>
<P><BLOCKQuote>
1. Followed the recommendations in the article, all except DNS
blocklists. Biggest surprise: the amount I could reduce the spam point
threshold (currently at 3.0) without <EM>any</EM> resulting false positives. I
could probably go even lower...
</BLOCKQuote></P>
<P>
2. Training the Bayesian filter on the odd false negatives became
trivial once I set up the Mutt macros:
</P>
<P><BLOCKQuote>
macro index \eb "|sa-learn --spam^M"
macro pager \eb "|sa-learn --spam^M"
</BLOCKQuote></P>
<P>
Other than that, I've built up its database by dumping my spambox into
it when it exceeds 100 emails:
</P>
<P><BLOCKQuote>
sa-learn --spam --mbox <TT>/var/mail/spam</TT>
</BLOCKQuote></P>
<P>
3. Whitelisted those of my friends who routinely BCC mails to me.
</P>
<P>
As a result of all of the above, plus a very simple procmail recipe -
other than basic sorting into my various mailboxes, it considers as spam
anything that is not sent to one of my valid addresses - the last 1000
emails have resulted in 0 false positives and 2 false negatives. Given
that 57%+ of the total (so says a quick analysis of my
<TT>/var/log/procmail</TT>) was spam, those are pretty impressive results.
</P>
<P>
Thanks for the initial push, Neil!
</P>
<BLOCKQUOTE>
[Neil] 
I'm pleased to have been some help.
</BLOCKQUOTE>
<BLOCKQUOTE>
A couple of things I've learnt since I posted the article.
</BLOCKQUOTE>
<BLOCKQUOTE>
SpamAssassin has a maximum database size and frequently expires tokens in the
database, so the database won't grow too large. this size can be tuned with
the  bayes_expiry_max_db_size setting in the configuration. The value seems
to be the number of tokens, rather a size in bytes.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you've misclassified something and you need to relearn it there's no need
to use sa-learn --forget. If you've classified ham as spam, sa-learn --spam
will automatically forget the learning as ham when told to learn it as spam
and vice-versa.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Mike] 
Good to know, I've been meaning to look at SA's scoring more closely.
</BLOCKQUOTE>
<BLOCKQUOTE>
My ISP recently went to rejecting mail with more than fifty recipients in
the headers, and that alone cut down my spam by 75%.  They also use
Postini, but there was a huge shrinkage in my Postini spambox after they
did this.  As in, down from a thousand messages a month to fifty.
</BLOCKQUOTE>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Re: How to Reset forgotten Root passwords</FONT></H3>
Fri, 22 Oct 2004 21:18:07 -0400
<BR>Suramya Tomar (<a href="mailto:gazette@linuxgazette.net?subject=%20Re%3A%20%5BLG%20108%5D%20mailbag%20%233"><em>LG</em> Article Author</a>)
<BR>Additional Info from Ihar 'Philips' Filipau (filia from softhome.net)

<P>
Got this email from Philips with some additional information about my
article in LG 107 on how to reset root passwords. He talks about a
special case where the process I described wouldn't work.
</P>
<P>
He has graciously give me permission to share this with you and since I
think you might find this interesting I am cc'ing this to the TAG.
</P>
<P>
What do you think, would it be too hard to reset passwords on SELinux?
</P>
<P>
- Suramya
</P>
<BLOCKQUOTE>
[Ben] 
Nope. Just as you would pass "init=/bin/bash" or whatever on the command
line, you could pass "selinux=0" to completely disable the SELinux
features. You said it in your article: "physical access equals root
access."
</BLOCKQUOTE>
<BLOCKQUOTE>
Sure, there are things you can do that would definitely prevent somebody
from modifying your <TT>/etc/shadow</TT> - a large rusty axe vigorously applied
to the hard drive comes to mind (encrypting the entire HD would be a
close modern equivalent) - but we're talking about very rare exceptions.
People who run specialized secured systems but haven't built up a kit of
tools to take care of the now-different set of problems have only
themselves to blame, while the rest of us laugh at them.
</BLOCKQUOTE>
<P><STRONG>
Thing here, it wasn't something specialized, but rather normal setup
of Fedora Core 2.
</STRONG></P>
<P><STRONG>
People didn't knew a thing about SELinux, besides <TT>/promotion/</TT> on RH
site that FC2 is secure as it wasn't ever before. Then just realized
week later that they have forgotten root password. I did precisely what
you have said with 'init=/bin/bash' (I beleive selinux=0 was a default,
<TT>/etc/rc.d/rc</TT> was activativating and configuring SELinux before anything
else - it has  a flag in <TT>/etc/sysconfig</TT>) and after reboot no-one was
able to login into system.
</STRONG></P>
<P><STRONG>
Everything worked Ok with disabled SELinux.
</STRONG></P>
<P><STRONG>
If any-one wants to make a correction to article, best of all is to
warn users that some security systems a-la SELinux do store checksums on
files, what can make file unaccessible if it was changes outside of
given security system. To make file accessible again they will need to
consult manuals on how to do that.
</STRONG></P>
<HR width="10%" align="center">
<BLOCKQUOTE>
Hi,
Thanks for emailing me with this info. I haven't yet tried SELinux so
I wasn't aware of this problem. Apparently whats happening is that
changing the password file trips a checksum or something in SELinux
stoping people from hacking the system.
</BLOCKQUOTE>
<BLOCKQUOTE>
I think it would still be possible to get past it by disabling SELinux
at statup, changing the password and then do a proper password reset and
then activate SELinux. We could also try edting the sudo file to give a
particular user su rights and then use that login to change the root
password.
</BLOCKQUOTE>
<P><STRONG>
You would not do that on system, where you do care about security. Wouldn't you?
</STRONG></P>
<BLOCKQUOTE>
Would you mind if I posted your comments on my site as followup on the
article? I will of-course credit you for it but I think that this info
would be useful to others also. I would also like to post this to the LG
TAG mailing list so that they know about this too and who knows this
might show up in next months LG as reader feedback.
</BLOCKQUOTE>
<P><STRONG>
Do what ever you like at your discretion.
Spell checking is welcome 
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)" 
		height="24" width="20" align="middle">
</STRONG></P>
<HR width="10%" align="center">
<blockquote><font color="#000066">SELinux notes by "Ihar 'Philips' Filipau" 
</font></blockquote>
<P><STRONG>
On <A HREF="http://linuxgazette.net/107/tomar.html"
	>http://linuxgazette.net/107/tomar.html</A> you wrote:
</STRONG></P>
<P><STRONG><BLOCKQuote>
* Boot into single-user mode (easiest, least risky)
* Boot using a boot disk and edit the password file
* Mount the drive on another computer and edit the password file
</BLOCKQuote></STRONG></P>
<P><STRONG>
On SELinux enabled system, all this methods will make system unusable.
Have had negative experience with  on one of the Fedoras - due to
some kind of bug/feature, SELinux was refusing to accept foreignly
modified <TT>/etc/passwd</TT> - no-one was able to read <TT>/etc/passwd.</TT> I believe
that was one of the problems why Fedora removed SELinux from default
installation.
</STRONG></P>
<P><STRONG>
I cannot be sure how to fix that, since I didn't manage to repair
those Fedora. Fedora's FAQ has command to repair file label (whatever it
is called in SELinux, used to track file modifications) - but it was
failing for me. Another option was to turn off SELinux, but I
(mischieviously) used this problem as reason to <TT>/upgrade/</TT> system to
<A HREF="http://www.suse.com/">SuSE</A> And it worked 
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)" 
		height="24" width="20" align="middle">
</STRONG></P>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Re: stunnel article in the Linux Gazette</FONT></H3>
Sat, 23 Oct 2004 20:11:30 +0100
<BR>Barry O'Donovan (<a href="mailto:gazette@linuxgazette.net?subject=%20Re%3A%20%5BLG%20108%5D%20mailbag%20%234"><em>LG</em> Article Author</a>)
<BR>Additional Info from Michal Trojnara (Michal.Trojnara from mirt.net)


<P>
Hey guys,
</P>
<P>
When ever I write an article on something I usually send an e-mail to
the developers/maintainers/webmasters/etc of whatever I write about
letting them know it's on the Gazette in case they wish to link to it.
In the case of last months stunnel I e-mailed the author of stunnel
(Michal Trojnara) to which he replied below (and gave his permission to
have it reproduced in Mailbag if Heather so wishes).
</P>

<hr width="10%" align="center">
<p>
Michal Trojnara, Saturday 23 October 2004 19:31
</P>
<P><STRONG>
Barry,
</STRONG></P>
<P><STRONG>
Your article is just great.  It's very clear and easy for beginners.
</STRONG></P>
<P><STRONG>
Some hints could possibly be added like:
</STRONG></P>
<BLOCKQuote><STRONG>
- disabling the Nagle algorithm for improved performance
</STRONG></BLOCKQuote>
<P><STRONG>
<blockquote><code><font color="#000033"><br>     socket = l:TCP_NODELAY=3D1
<br>     socket = r:TCP_NODELAY=3D1
</code></blockquote>
<blockquote><strong>
   - creating special user/group just for stunnel instead of nobody
</strong></blockquote>
<p><strong>
Best regards,
<br>Mike
</strong></p>

<blockquote> [Barry]
By the way: Nagle's algorithm is used to decrease the number of packets
sent over a connection by buffering smaller messages so that only a
single packet will be transmitted instead of one for each message.
Although "nagling" addresses some network problems it can be
undesirable in highly interactive environments.
</blockquote>
<blockquote>
Thanks again for your comments Mike - and your permission to print.
</blockquote>
<blockquote>
Kind regards,
<br>Barry
</blockquote>
<blockquote>
[Ben]
Nice! I always like getting the comments "from the horse's
mouth"; much like historical research using primary sources, it has good
solid authority behind it. Thanks for forwarding it, Barry - it'll make
a nice Mailbag item (and adds the benefit of knowing that your article
was vetted by *the* expert.)
</blockquote>
<blockquote>
It's actually a really good idea in general, on reflection. I've added
it, as a suggestion (original idea credited to you) to the bottom of the
author FAQ.
</blockquote>


<!-- end 4 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GAZETTE MATTERS</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#gaz.1"
	><strong>Promote LG</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Promote LG</FONT></H3>
Thu, 21 Oct 2004 00:41:49 +0100
<BR>Jimmy O'Regan (<a href="mailto:gazette@linuxgazette.net?subject=%20Re%3A%20%5BLG%20108%5D%20gazette%20matters%20%231">The <em>LG</em> Answer Gang</a>)


<P>
Any webmasters or bloggers out there who want to help promote LG can do
so easily with our new, shiny Javascript.
</P>
<P>
Simply add this to your site/blog:
</P>
<P><BLOCKQuote>
&lt;script language="javascript" type="text/javascript"
src="<A HREF="http://linuxgazette.net/lg.js"
	>http://linuxgazette.net/lg.js</A>"&gt;&lt;/script&gt;
</BLOCKQuote></P>
<P>
and rejoice as javascript-enabled browsers are provided with a list of
articles from the current issue of Linux Gazette.
</P>
<P>
Comments, complaints, etc. are welcome.
</P>

<blockquote><font color="#1F1F1F"><EM>Nice</EM>, Jimmy. This might be something to note in, what, Gazette
Matters? Our adoring fans will want to know. Might be worth adding right
after your RDF, etc. notes on the front page, too.
 -- Ben</font></blockquote>

<blockquote><font color="#000066">It's added there too, now.  Thanks Jimmy!
 -- Heather</font></blockquote>

<!-- end 1 -->
<hr>
<CENTER><Font face="Helvetica"><STRONG>
This page edited and maintained by the Editors of <I>Linux Gazette</I><br>HTML script maintained by <A HREF="mailto:star@starshine.org">Heather Stern</a> of Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</STRONG></Font></CENTER>
<hr>

</p>



<!-- *** BEGIN author bio *** -->
<!-- *** END author bio *** -->




<div id="articlefooter">




<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="lg_answer"></a>
<h1>The Answer Gang</h1>


</b>
</p>


<p>
<!--startcut  ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<META NAME="generator" CONTENT="lgazmail v1.4G.w">
<TITLE>Linux Gazette 108: The Answer Gang (TWDT)</TITLE><link href="../lg.css" rel="stylesheet" type="text/css" media="screen,
projecti
+on"  />
<title>The Answer Gang 108: </title>
<style type="text/css" media="screen, projection">
<!--
.articlecontent {
        position:absolute;
        top:143px;
}
-->
</style>

</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!--endcut  ==============================================-->
<TABLE width="100%" BORDER><TR><TD WIDTH="200">
<A HREF="http://linuxgazette.net/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD>
<center>
        <img src="../gx/dennis/qbubble.gif" alt="(?)"                           
	                border="0" align="left">
<A NAME="answer"><BIG><BIG><STRONG><FONT COLOR="maroon"
	>The Answer Gang</FONT></STRONG></BIG></BIG></a>
	<img src="../gx/dennis/bbubble.gif" alt="(!)"                           
	                border="0" align="right"><BR>
<STRONG>By Jim Dennis, Karl-Heinz Herrmann, Breen, Chris, and...
        (<a href="../tag/bios.html">meet the Gang</a>) ...
	        the Editors of <i>Linux Gazette</i>...
		        and 
			<a href="../tag/ask-the-gang.html">You</a>! 
</STRONG></BIG> </TD></TR>
</TABLE>
<P>

<!-- END header -->

<center><p>
<br>We have guidelines for <a href="../tag/ask-the-gang.html">asking</a> and <a
href="../tag/members-faq.html">answering</a> questions.  Linux questions only, please.
</STRONG>
<br><em><font color="#7F0000">We make <b>no guarantees</b> about answers, but you can be <b>anonymous</b> on request.</font></em>
<br>See also: The Answer Gang's 
<a href="../tag/kb.html">Knowledge Base</a>
and the <i>LG</i> 
<a href="http://linuxgazette.net/search.html">Search Engine</a>
</center>
<br></p></center>

<HR>
<!-- BEGIN message -->
<H3>Contents:</H3>
<dl>
<dt><a href="#tag/greeting"
	><strong>&para;: Greetings From Heather Stern</strong></A></dl>

<DL>
<!-- index_text begins -->
<dt><A HREF="#tag.1"
	><img src="../gx/dennis/qbub.gif" height="28" width="50"
	  alt="(?)" border="0"
	><strong>Automatically selecting matched lines.</strong></a>
<dt><A HREF="#tag.2"
	><img src="../gx/dennis/qbub.gif" height="28" width="50"
	  alt="(?)" border="0"
	><strong>Exim with Dynamic IP - 2 Questions</strong></a>
<dt><A HREF="#tag.3"
	><img src="../gx/dennis/qbub.gif" height="28" width="50"
	  alt="(?)" border="0"
	><strong>Re: Question re; Fvwm xintric</strong></a>
<dt><A HREF="#tag.4"
	><img src="../gx/dennis/qbub.gif" height="28" width="50"
	  alt="(?)" border="0"
	></a>http://linuxgazette.net/107/TWDT.html#tag.3 --or--
<dd><A HREF="#tag.4"
	><strong>Cannot talk using "talk"</strong></a>
<br>unless we tell it to?
<!-- index_text ends -->
</DL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag/greeting"><HR WIDTH="75%" ALIGN="center"></A>
<H3 align="left"><img src="../gx/dennis/hbubble.gif" 
	height="50" width="60" alt="(&para;) " border="0"
	>Greetings from Heather Stern</H3>
<!-- begin hgreeting -->
<p>Greetings, and welcome once again to the world of The Answer Gang, give 
or take that incredible moon we have spinning round it.  If you missed the 
<a href="http://www.space.com/spacewatch/041022_eclipse_guide.html">lunar 
eclipse</a> I'm sorry to hear it, the time in shadow looks only a smidge 
brighter than a new moon, and the red penumbra is... well, if you're a 
<a href="http://www.unitedmedia.com/comics/peanuts/">Peanuts</a> fan I 
suppose the Great Pumpkin really did rise over the patch this year, only a 
few days off.
</p>
<p>Far from being the "final frontier" in the space of open source, 
A trip to freshmeat.net's 
<a href="http://freshmeat.net/browse/134/">Astronomy</a>  topic shows
more cool apps for astronomy fans than you can spot with a telescope.
The night may be an ephemeral thing, but I say go enjoy it sometime this
month.  Look outward, upward, and remember there's a reason your cellphone
works, we can get IRC in half our deserts, and ships actually get to where
they're going while carrying the trade goods of all nations.
</p>
<p>Politics aside, it's a smaller world than we think.  We could use a few more 
of them, but so far, it's the only one we've got.  Sharing's a good thing -
and the typical open sorceror knows this without thinking about it.  I'm glad 
we've a few juicy threads to share with you this month.  Enjoy!</p>  
<!-- end hgreeting -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.1"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif" 
	height="50" width="60" alt="(?) " border="0"
	>Automatically selecting matched lines.</H3>


<p><strong>From Thomas Adam 
</strong></p> 
<p></strong></p>

<p align="right"><strong>Answered By:  Tim Chase
</strong></p>

<font color="red"><blockquote><em>This is a question that I posted to the Vim mailing-list. Tim Chase was
kind enough to reply, and in some detail, so it ends up here. Thanks, Tim!

<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
 -- Thomas Adam</em></blockquote></font>
<P><STRONG>
Hello, all -
</STRONG></P>
<P><STRONG>
I'm trying to get Vim to automatically select (hilight) lines in a file
that start with a particular phrase. Basically, I want it then to run a
command over the selected text. Doing this manually is not a problem, but
I am having a lot of trouble trying to automate it.
</STRONG></P>
<P><STRONG>
I was under the impression that "V%" is what I was after, yet each time I
try it, Vim responds with: "V% is not an editor command". I'm overlooking
something, but what?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Tim] 
I don't think Vim supports disjoint selecting like what I
understand you want to do...in a single pass. However, each
disjoint piece can be passed to your external program if you
want. Perhaps something like:
</blockQuote>

<blockquote><pre>:g/^\s*\n&gt;/+,/^&gt;\@!/-1! extern_command
</pre></blockquote>
<blockQuote>
Broken down, that's:
</blockQuote>

<blockquote><pre>:g on every line that matches

^\s*\n&gt; an empty line followed by a "&gt;" on the next line

+ begin a range on the next line (the one with the "&gt;")
, through

/^&gt;\@!/ the next line that doesn't begin with a "&gt;"

-1 adjust the 2nd range argument to be the previous line
because the previous search found the next line that
doesn't have a leading "&gt;" so we have to backup a line

! pass the contents of the range through
external_command and replace the original contents with the
output of "external_command"

Thus, if you wanted to make your quotations in the mail-file all
sound like B1FF (assuming you have the bsd-games collection
installed), you could do

:g/^\s*\n&gt;/+,/^&gt;\@!/-1! b1ff
</pre></blockquote>
<blockQuote>
Any Ex command can take the place of "! b1ff" there, so if you
just want to do normal Vi/Ex commands instead, they all work. If
you want to indent those ranges one shift-width, you can do
</blockQuote>

<blockquote><pre>:g/^\s*\n&gt;/+,/^&gt;\@!/-1&gt;
</pre></blockquote>
<blockQuote>
Or if you want to delete all quotations, you can do
</blockQuote>

<blockquote><pre>:g/^\s*\n&gt;/+,/^&gt;\@!/-1d
</pre></blockquote>
<blockQuote>
You can even selectively search and replace only in quotations
with something like
</blockQuote>

<blockquote><pre>:g/^\s*\n&gt;/+,/^&gt;\@!/-1 s/foo/bar/g
</pre></blockquote>
<blockQuote>
All sorts of handy combinations of things.
</blockQuote>
<blockQuote>
Or maybe I didn't understand your original post correctly, and
all this is just a pedantic exercise in the joy of Ex 
<IMG SRC="../gx/dennis/smily.gif" ALT=";)" 
		height="24" width="20" align="middle">
</blockQuote>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.2"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 2 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif" 
	height="50" width="60" alt="(?) " border="0"
	>Exim with Dynamic IP - 2 Questions</H3>


<p><strong>From Balbir Thomas 
</strong></p> 
<p></strong></p>

<p align="right"><strong>Answered By:  Neil Youngman
</strong></p>
<P><STRONG>
Dear Answer Gang,
</STRONG></P>
<P><STRONG>
I am using exim to deliver mail form my local host. I have a dynamic
IP address and am using zoneedit as my dns server. So mail to
my userID@my.domain is delivered straight to me. However I have trouble
sending mail to certain address as their ISPs/Postmasters have decided
to block emails originating from dynamic IP address to reduce spam.
For example AOL. I would be greatfull if you could suggest means to
solve this problem, short of paying for a static IP (which I don't
need but for this reason). Talking to my ISP (RoadRunner) has been
a waste of time.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Neil] 
It's certainly possible. The Exim FAQ at
<A HREF="http://exim.org/exim-html-4.30/doc/html/FAQ_3.html"
	>http://exim.org/exim-html-4.30/doc/html/FAQ_3.html</A> has an example of setting
up routers to send local mail to hosts on the local network and everything
else to a smarthost. this should be easy to adapt to do what you want.
</blockQuote>
<blockQuote>
If all else fails read the documentation. The Exim documentation, though
large, is very informative. You just need to read it selectively and pick the
relevant chapters.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
My second question is how to set up postmaster at my local host.
My current exim config accepts mail sent to postmaster@my.domain
however it does not accept mail to
<A HREF="mailto:postmaster@dhcp-xxx-xxx-xxx-xxx.columbus.rr.com"
	>postmaster@dhcp-xxx-xxx-xxx-xxx.columbus.rr.com</A>
which is my hostname assigned by my isp. The xxx being the ip
address which can change. Is there a way to make exim accept mail
sent to this email address such that the ip address (i.e.
in this case domain name) part is updated automatically.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Neil] 
I don't know about getting it to update the address automatically, but you can
have it match a pattern like <A HREF="mailto:postmaster@dhcp"
	>postmaster@dhcp</A>-*.columbus.rr.com on the basis
that it's unlikely anyone else's postmaster mail will be directed to your IP.
Frankly I wonder who would send postmaster email to an address like that
anyway.
</blockQuote>
<blockQuote>
In the default exim 4 config this is accepted by the rules:
</blockQuote>

<blockquote><pre>  domainlist local_domains =@

  accept  local_parts   = postmaster
          domains       = +local_domains
</pre></blockquote>
<blockQuote>
According to the documentation '@' ... 'is a special form of entry which means
the name of the local host, so this should normally match, but I guess
your system is set up to use "my.domain" as the hostname, instead of the
RoadRunner host name.
</blockQuote>
<blockQuote>
As an alternative, it may be that adding dhcp-$interface_address.columbus.rr.com or some variation thereon to local-domains will achieve what you want. I have not tried this, so I can't be sure it will work. If you try it, be sure to let us know whether it
worked.
</blockQuote>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif" 
	height="50" width="60" alt="(?) " border="0"
	>Re: Question re; Fvwm xintric</H3>


<p><strong>From Jay Hamilton 
</strong></p> 
<p></strong></p>

<p align="right"><strong>Answered By:  Thomas Adam
</strong></p>

<font color="red"><blockquote><em>The following was an e-mail sent to me, having read my article in the
linuxgazette from a few months ago.
 -- Thomas Adam</em></blockquote></font>
<P><STRONG>
My new.xintric file says
</STRONG></P>

<pre><strong>xterm -geometry 80x24+2211+1792 -title FvwmConsole -name FvwmConsole -e
/usr/X11R6/lib/X11/fvwm2/FvwmConsoleC &amp;
/usr/X11R6/bin/xconsole -notify -nostdin -verbose -exitOnFail -ic
-geometry 384x110+0-0 &amp;
qinternet -geometry 0x0+532+781 &amp;
fvwm
DeskTopSize 5x5
</strong></pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
I see you're using FvwmSaveDesk or FvwmDesk modules to save the layout of
your windows? No?
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
That last bit I added hoping that it would make it a default however it
seems to have no effect at all.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
Not quite. What you're wanting to do is have all those applications start,
and <EM>then</EM> load fvwm. However, there are two things which you must be
aware of:
</blockQuote>
<blockQuote><BLOCKQuote>
*) new.xinitrc is only specific if you have certain Fvwm modules loaded.
If you don't the file is not read [1].
*) The last two commands you have there -- "fvwm" and "DesktopSize 5x5"
are out of context here.
</BLOCKQuote></blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
So- I must misunderstand something.  I believed that I could add
instructions to this file and they would become the default that didn't
happen so I got it wrong.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
What you want, then (and you were close) is to move all your commands to
~/.xsession [2], so that it looks something like this:
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/sample-xinitrc.txt">sample-xinitrc.txt</a></tt></p>
<blockQuote>
Having saved that file as "~/.xsession", you should ensure that you run
the command "chmod 700 ~/.xsession". What this will do is when you login
(via startx, or some DM) this file is read and will execute all of the
above, including the launching of fvwm.
</blockQuote>
<blockQuote>
All that this leaves is the last command you had "DesktopSize 5x5". The
reason it was out of context both in your modification of 'new-xinitrc'
and indeed <EM>any</EM> ~/.x{session,init} file is because it is specific to
Fvwm. That is, only Fvwm itself will understand what you're meaning. It is
not a command. You should therefore add "DesktopSize 5x5" somewhere within
your ~/.fvwm/fvwm2rc file.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Also when in xconsole I type FvwmBacker Black [or black] the screen
background turns blue- yet I can get a black background via gnome
settings.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
I am not planning to cover the use of Modules for a while yet. However,
there are a number of ways you can do what you want. If you want all of
your pages for all of your desks to have the same colour, then you need to
do two things:
</blockQuote>
<blockQuote><BLOCKQuote>
1. In your ~/.fvwm/fvwm2rc file, you'll see a function called
'StartFunction' and it looks like something like this:
</BLOCKQuote></blockQuote>

<blockquote><pre>AddToFunc StartFunction
+ I Exec exec xsetroot -solid gray66
+ I Test (Init) Module FvwmForm Login
+ I Test (Init) Exec exec unclutter
</pre></blockquote>
<blockQuote>
When fvwm loads, apart from locating its configuration file, one of the
first things it does is to look for this function and execute whatever is
within it. So here, you can see that I have told it to load "xsetroot"
(which does more or less what FvwmBacker does), and a few other things.
What you want is to add to this definition and add:
</blockQuote>

<blockquote><pre>+ I Module FvwmBacker
</pre></blockquote>
<blockQuote>
for your own StartFunction definition. If you're wondering what the syntax
means, then:
</blockQuote>

<blockquote><pre>"+". I think of as meaning "belonging to" a function or definition.
"I". This stands for 'Immediate' and means that it will execute
immediately once the function is invoked. There are other types of
attributes which I won't cover here.
"&lt;command&gt;". Whatever follows after that is a command to be run.
</pre></blockquote>
<blockQuote>
But this is not enough -- all you have done by adding the above line to
"StartFunction" is tell Fvwm to load the module. You haven't told it what
to do with the module. For that, we have to configure the module. The way
that is done is like this:
</blockQuote>

<blockquote><pre>DestroyModuleConfig FvwmBacker: *
*FvwmBacker Command (Desk *, Page * *) -solid grey66
</pre></blockquote>
<blockQuote>
You can add that directly into the file as-is if you like. What it does is
sets every page on every desk to a solid colour of darkgrey (grey66). You
can replace 'grey66' with whatever colour you want.
</blockQuote>
<blockQuote>
When you have done all that, restart fvwm, and all (hopefully) should be
well.
</blockQuote>
<blockQuote>
Hope That Helps,
</blockQuote>
<blockQuote>
[1] This is only if new.xinitrc is not a symlink to ~/.xinitrc or
~/.xsession, of course.
</blockQuote>
<blockQuote>
[2] The reason why I'm advocating ~/.xsession over ~/.xinitrc is that
startx will default to ~/.xsession if no ~/.xinitrc file exists. This has
advantages when using XDM as a display manager, etc.
</blockQuote>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.4"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 4 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif" 
	height="50" width="60" alt="(?) " border="0"
	>Cannot talk using "talk"</H3>
<H4 ALIGN="center">unless we tell it to?</H4>


<p><strong>From Jaye Inabnit ke6sls 
</strong></p> 
<p></strong></p>

<p align="right"><strong>Answered By:  Thomas Adam, Benjamin Okopnik, Kapil Hari Paranjape
</strong></p>
<!-- ::
Cannot talk using "talk"
~~~~~~~~~~~~~~~~~~~~~~~~
unless we tell it to?
:: -->
<P><STRONG>
Hey guys:
</STRONG></P>
<P><STRONG><BLOCKQuote>
I'm just getting 'round to reading this months Gazette.  Anyway, about the
'talk' and 'talkd' issue, make sure you also mention that probably every
distribution these days disables 'messages', which means that users wouldn't
even be notified that someone is trying to 'talk' with them.  Check it with
an xterm or in console:
</BLOCKQuote></STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
Actually, it is the default for it to be on, for any Linux system that I
have come across, but I am not going to argue the point.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	>
</STRONG></P>

<pre><strong>jaye@librabogus:~$ mesg
is y
jaye@librabogus:~$
</strong></pre>
<P><STRONG>
The way I <EM>fixed</EM> this issue was to modify my global preference file
'<TT>/etc/profile</TT>' (within <A HREF="http://www.debian.org/">Debian</A> systems):
</STRONG></P>

<pre><strong>EDITOR=/usr/bin/vim
PAGER=/usr/bin/less

umask 002

mesg y
</strong></pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
Adding it to <TT>/etc/profile</TT> is not something <EM>I</EM> would do - it should not
be a system-wide policy - making it a local user issue is a better idea.
Leave your poor users alone.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
WHOOPS. As Thomas has already pointed out, this is a <EM>very</EM> poor
practice in most cases. There's not much wrong with setting the PAGER to
"less", but making "vim" the default editor means that new users can get
horribly confused by an unresponsive beeping application that they don't
know how to exit. Worse yet, setting the umask to 002 sets up a security
risk every time a user creates a file - one of which they will usually
be unaware. These things should not be set by <EM>policy</EM> (i.e., in
<TT>/etc/profile</TT>) but via an <em>  informed,   per-user   decision;  </em> that's why
individual .profile mechanisms exist.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
By adding the last line to your 'profile', users messages are turned on by
default.  I also modify my local '~/.bash_profile' file with the same entry
since <A HREF="http://www.kde.org/">KDE</A> and friends sometimes don't play nice with the global settings 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
Admittedly, setting a global "mesg y" is not something that'll
accidentally destroy the world, but tweaking <TT>/etc/profile</TT>, as a rule of
thumb, is to be approached with much forethought, trepidation, and a
stout shock prod.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
As to why KDE is ignoring this, you need to make sure that you either
start $SOME_TERMINAL_EMULATOR invoked as a login shell, so that the
global files are read. Or, alternatively, source ~/.bashrc from
~/.x{session,initrc}
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
Thomas, to the best of my knowledge, <TT>/etc/profile</TT> is read as soon as you
log in, as long as your login shell is anything that had the Bourne
shell in its family tree. The question of whether you ran an xterm or
not shouldn't even be applicable. Do you have some information to the
contrary?
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
It is if you login to a console -- <EM>not</EM> via a DM. Kdm and friends are
notorious for this. This is why so many people get confused as to why
their nice $PS1 prompts don't appear in xterms and the like.
</blockQuote>
<blockQuote>
So you either force the shell to be a login-shell, or if you have
defined various environment vars in ~/.bashrc, to source this from
within ~/.x{session,initrc}
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
Wow, <EM>evil</EM>. I've got to say that I'm a bit shocked - why the heck would
they break a working system that way?
</blockQuote>
<blockQuote>
All the more reason I'm glad I've avoided *dm for all these years,
then...
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
Break? No, That's <EM>exactly</EM> the way it should be, Ben. Sure, when you
open up an xterm, the subshell is supposed to be inheriting environment
variables from somewhere, but then that's why the user sets it up.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
The broken part is, why would it have to be set up twice? If I've spent
time configuring my CLI environment, it shouldn't change if I decide
that I now want to start X via *dm. Sure, sourcing the rc files from
~/.xsession isn't that hard - but you have to know enough to do it.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] 
The X startup files are <EM>not</EM> supposed to source anything shell related such
as <TT>/etc/profile</TT> by default. Why? It has no reason to -- <EM>that</EM> operation
is to do with shells only.
</blockQuote>
<blockQuote>
Of course, as I have said, this is where ~/.xsession shines. 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
Except that, by allowing the user to log in <EM>without</EM> doing so, it now
changes his environment without any reason for it - and violates the
programming principle of doing "the least unexpected" thing.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
As far as I can see, this is one of those "active developer/backward
compatability" (AD/BC) issues. The AD wanting to move to GUI (yes, it
<EM>was</EM> a while ago but we CLI types don't die easy 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">) Unfortunately,
when the "shell" was designed it was assumed (ah-ha!) that no one would
run programs (except daemons) other than from the command-line or from
other running programs and so on recursively.
</blockQuote>
<blockQuote>
One solution. Have a file say $HOME/.environ and ensure that it is
sourced at all session-startups CLI or GUI.
</blockQuote>

<font color="#660000"><blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Thomas] But this is why /etc/environment is used. If PAM is setup to use it, then it will. We're fortunate that /etc/environment in this instance is the only shell-agnostic file available. So it is ideal for these sorts of situations. Although it should not be mis-used. It's also not very portable.
</blockquote></font>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
So why not use $HOME/.profile instead. Not because of (t)csh folks 
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)" 
		height="24" width="20" align="middle">
The problem would be that a .profile could do a number of CLI specific
thnigs---in fact shell users have had extremely complicated .profile's in
the past. It is a mess as any AD/BC issue generally is.
</blockQuote>
<blockQuote>
The problem with TLU thing is to decide who the target user is---the one
who read the part of the manual which said "keep .profile simple" or the
one who read the juicy bits about all the fancy features of the latest
shell and didn't enclose those in "if [ -n "$PS1" ] ... fi". The latter's
X session will probably crash if her/his .profile is sourced.
</blockQuote>
<blockQuote>
I think there was long thread on Debian once about <TT>/etc/environment</TT> but
IIRC the idea was dropped. Perhaps (I tremble to start another war here)
PAM's session mechanism could be used to setup session variables.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Heh, I avoided *dm's too until I started back to scewl (~40ish hippie strikes
again).  I was using pure Debian, then I upgraded entire system hardware and
decided to use <A HREF="http://www.libranet.com/">LibraNet</A>.  I was so pleased with Libranet that I put it on my
new-2-me laptop too.
</STRONG></P>
<P><STRONG>
This has been an interesting thread.  Thanks for the responses.
</STRONG></P>
<P><STRONG>
One trick I learned about for KDE's Konsole is adding
"%i %m -ls" to the Command stanza on the Execute tab (Properties).  With this
little tweak, the .rc files are read on launch.  My brother added some very
handy Debian-centric stuff that I'm lost without these days, and it's nice to
be able to use Konsole with its tabbing capabilities.  If I was a better
person, I'd spend some time to learn what each of those little dewhickymobobs
do!
</STRONG></P>

<!-- end 4 -->
<P> <hr> </p>
<div id="articlefooter">
<H5 align="center">This page edited and maintained by the Editors
        of <I>Linux Gazette</I>
<br><a href="http://linuxgazette.net/copying.html"
        >Copyright &copy;</a> its authors, 2004
<BR>Published in issue 108 of <I>Linux Gazette</I> November 2004</H5>
<H6 ALIGN="center">HTML script maintained by
        <A HREF="mailto:star@starshine.org">Heather Stern</a> of
        Starshine Technical Services,
       <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6>
</div>
<!-- end: articlecontent -->
</div>
<!--startcut ======================================================= -->
</BODY></HTML>
<!--endcut ========================================================= -->

</p>



<!-- *** BEGIN author bio *** -->
<!-- *** END author bio *** -->




<div id="articlefooter">




<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="lg_bytes"></a>
<h1>News Bytes</h1>
<p id="by"><b>By <A HREF="../authors/conry.html">Michael Conry</A></b></p>


</b>
</p>


<p>
<p>
</p><center>
<table cellpadding="7"><tbody><tr><td>
<img src="../gx/bytes.gif" border="1" alt="News Bytes">
</td><td>
<h3>Contents:</h3>
<ul>
<li><a href="#leg">Legislation and More Legislation</a>
</li><li><a href="#links">Linux Links</a>
</li><li><a href="#general">News in General</a>
</li><li><a href="#distro">Distro News</a>
</li><li><a href="#commercial">Software and Product News</a>
</li></ul>
</td></tr></tbody></table>

<strong>Selected and formatted by  <a href="mailto:michael.conry@softhome.net">Michael Conry</a></strong>
</center>
</center>


<p> Submitters, send your News Bytes items in 
<font size="+2"><strong>PLAIN TEXT</strong></font>
format.  Other formats may be rejected without reading.  You have been
warned!  A one- or two-paragraph summary plus URL gets you a better
announcement than an entire press release. Submit items to
<a href="mailto:bytes@linuxgazette.net">bytes@linuxgazette.net</a>

<BR CLEAR="all">

<p></p><hr><p>
<a name="leg"></a>
</p><center><h3><font color="green">Legislation and More Legislation</font></h3></center>
<p>
<!-- ========= --><p></p><hr><P></P>
<h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> DMCA </font></h3>
<p>
As reported some time ago, Lexmark has been attempting to use the
DMCA to prevent other manufacturers from producing compatible ink
cartridges for Lexmark printers.  Essentially, the DMCA comes
into this business due to the inclusion of electronic protections
into the actual cartridges.  To produce a replacement cartridge
a manufacturer must, obviously, circumvent this technological
protection: an action that exposes them to potential attack under
the DMCA.
<p>
<a href="http://www.theregister.co.uk/2004/10/28/lexmarkvsscc/">
The Register has reported</a> that on October 26th the US Courts
of Appeals, Sixth Circuit, has overturned an earlier decision and
will allow SCC to continue to sell replacement cartridges pending
the final resolution of the case.  The Electronic Frontier
Foundation has
<a href="http://www.eff.org/legal/cases/Lexmark_v_Static_Control/">
an online archive of documents relevant to the case</a>.

<!-- ========= --><p></p><hr><P></P>
<h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> e-Voting </font></h3><p>
Well, this is a time when voting is on everybody's mind (not just
in the US).  It will be interesting to see how the disparate
voting and vote-counting systems in use across the States perform
and their relative robustness.  Of course, many informed
observers in the technology community, and in particular the FOSS
community, recognise the importance of having open standards and
verifiable methodologies in e-voting systems.  
<a href="http://www.theregister.co.uk/2004/10/28/evote_source_stunt/">
The Register reports</a>
that US manufacturers are inching towards <em>appearing</em> to
provide the kind of verifiability and accountability required
from systems at the heart of democratic infrastructure.  I
recommend you read the article yourself to see how far short of
an adequate solution the companies' suggestions fall.

</p><p></p><hr><p>
<a name="links"></a>
<!-- ========== -->
</p><center><h3><font color="green">Linux Links</font></h3></center>
<!-- ========= -->
<p>
OSDir.com takes a look at
<a href="http://osdir.com/Article2159.phtml">
KDE's desktop network protocol handlers</a>.
<p>
Steve Ballmer says
<a href="http://seattlepi.nwsource.com/business/197085_msftlinux28.html">
Windows is better than Linux</a>
<p>
<a href="http://www.linuxtimes.net/modules.php?name=News&file=article&sid=145">
An interview with Linus Torvalds</a> at Linux Times.
<p>
<a href="http://seattlepi.nwsource.com/business/193873_attlinux06.html">
ATT&amp;T considers move to Linux</a>.
<p>
LWN has a nice 
<a href="http://lwn.net/Articles/104179/">
article on the Linux OOM (Out Of Memory)</a> handling mechanism.
Also interesting (in a humorous way) from LWN is a quick
<a href="http://lwn.net/Articles/99240/">
analysis of the presence of swear words</a>
in Linux source code.
<p>
A team at Reykjavik University has
<a href="http://netlab.ru.is/exception/LinuxCXX.shtml">
implemented  a complete kernel level run-time support for C++ in
the Linux kernel</a>.
<p>
<a href="http://www.onlamp.com/pub/wlg/5828">
O'Reilly has an analysis</a> of the recent malware RedHat-hoax
email that has been circulating, and what this might mean for the
future of GNU/Linux security.  There is 
<a href="http://www.newsforge.com/article.pl?sid=04/10/27/0351205">
a longer analysis</a> at NewsForge.
<p>
Wired has written
<a href="http://www.wired.com/wired/archive/12.11/linux.html">
an account of the ascendancy of Free and Open Source
Software</a> in Brazil, and how this relates to broader social
traditions and trends in this huge nation.


<p></p><hr><p>
<a name="general"></a>
<!-- ========== -->
</p><center><h3><font color="green">News in General</font></h3></center>

<!-- ========= -->
<p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">Linux Focus</font></h3>
<p>
<a href="http://www.linuxfocus.org/">Linux Focus</a>, an online
GNU/Linux magazine that we have linked-to regularly in the past,
has made a few changes in their publishing style.  From now on,
the magazine will switch from its bimonthly publishing schedule
to a new continuous publishing model.  So now you've even more
reason to take a regular look at this fine publication.

<!-- ========= -->
<p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">Linux Kernel</font></h3>
<p>
The latest release of 
<a href="http://www.kernel.org/">
the Linux kernel</a>, version
<a href="http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.9">2.6.9</a>,
was released on October 18.


</p><p></p><hr><p>
<a name="distro"></a>
<!-- ========== -->
</p><center><h3><font color="green">Distro News</font></h3></center>

<!-- ========= -->
<p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> Kanotix </font></h3>
<p>
Distrowatch has a review of the Debian/Knoppix-based lived-CD Kanotix:
<a href="http://distrowatch.com/dwres.php?resource=review-kanotix">
KANOTIX - Putting the Pizzazz on Debian</a>.

<!-- ========= --><p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> SuSE </font></h3>
<p>
<a href="http://www.suse.com/us/private/products/suse_linux/prof/">
SuSE Linux Professional 9.2</a>
has been released.  You can read 
<a href="http://geektimelinux.com/?q=node/view/25">
a review at GeekTime Linux</a>, or see the 
<a href="http://linux.slashdot.org/article.pl?sid=04/10/29/0054213&tid=143&tid=187&tid=1&tid=106">
release discussed at Slashdot</a>.
<p>
<hr width="20%" noshade>
<p>
It was also
<a href="http://linux.slashdot.org/article.pl?sid=04/10/29/0054213&tid=143&tid=187&tid=1&tid=106">
highlighted on Slashdot</a>
that SuSE and Dell are 
<a href="http://www1.us.dell.com/content/topics/global.aspx/corp/pressoffice/en/2004/2004_10_27_rrwa_000">
extending their partnerships</a> to provide GNU/Linux platforms
to customers.  Also of interest in this context is
<a href="http://linux.dell.com/blog/">
the Dell Linux blog</a>.
<p>
<hr width="20%" noshade>
<p>
OSNews has
<a href="http://www.osnews.com/story.php?news_id=8699">
reviewed the SuSE Linux 9.2 LiveCD</a>.

<!-- ========= -->
<p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> Ubuntu </font></h3>
<p>
<a href="http://www.ubuntulinux.org/">Ubuntu Linux</a>
is a new Linux distribution based on the architecture of Debian.
The aim is to have a new release every six months, and in this
way to continuously have an up-to-date stable distribution.  This
distribution is aimed particularly at desktop users.
<p>
Ubuntu can be
<a href="http://www.ubuntulinux.org/download/">
downloaded for free</a>,
or alternatively
<a href="http://shipit.ubuntulinux.org/">
you can order free CD-ROMS</a>.


<!-- ========= -->
<p></p><hr><P></P><h3><img alt=" " src="../gx/bolt.gif">
<font color="green"> Vector </font></h3>
<p>
Mad Penguin has
<a href="http://www.madpenguin.org/cms/html/47/2784.html">
reviewed VectorLinux 4.3</a>,
a Slackware-derived distribution that aims to make the most of
older hardware.


<a name="commercial"></a>
<p></p><hr><p>
</p><center><h3><font color="green">Software and Product News</font></h3></center>

<!-- ========= -->
<p></p><hr><P></P><h3>
<img alt=" " src="../gx/bolt.gif">
<font color="green"> Mozilla </font></h3>
<p>
<a href="http://www.mozilla.org/">The Mozilla project</a> 
has released the first 
<a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.0rc1/">
release-candidate of the Firefox browser</a>.  This marks another
step towards the imminent release of the long-awaited
version&nbsp;1.0.  Another component in the run-up to this
release has been 
<a href="http://www.prweb.com/releases/2004/10/prweb169813.php">
a campaign to place a full-page advertisement in the New York
Times</a>.  This effort turned into a stunning success, and over
10 days 10,000 people 
<a href="http://www.spreadfirefox.com/?q=node/view/4891">
collectively donated $250,000</a>.
The <a href="http://www.spreadfirefox.com/">
Spread Firefox</a> website has more information on the efforts
being made to give the Firefox launch as much coverage as
possible.

</p>



<!-- *** BEGIN author bio *** -->
	<P> Mick is LG's News Bytes Editor.

<!-- *** BEGIN bio *** -->
<hr>
<P>
<IMG ALIGN="LEFT" VALIGN="top" ALT="[Picture]" SRC="../gx/2002/tagbio/conry.jpg" WIDTH="128" HEIGHT="158" class="bio">
<em>
Born some time ago in Ireland, Michael is currently working
as a lecturer in the Department of Mechanical Engineering, University
College Dublin. The topic of his PhD research was the use of Lamb
waves in nondestructive testing. GNU/Linux has been very useful in
this work, and Michael has a strong interest in applying free
software solutions to other problems in engineering.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/conry.html">Michael Conry</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="anonymous"></a>
<h1>GRUB boot diskette for Knoppix</h1>
<p id="by"><b>By <A HREF="../authors/anonymous.html">Anonymous</A></b></p>


</b>
</p>


<p>

<p>
GRUB cannot boot the Knoppix CD if booting from the CD-ROM is disabled.
This is a feature that the GRUB developers should consider adding. See <a
href="../107/anonymous.html">my previous article</a> in the October 2004
Linux Gazette.

<p>
However, GRUB (current version 0.95) can generate a floppy to boot Knoppix
after a full install to hard disk - something LILO may have problems with,
due to its inability to find files, and due to the kernel and initial
RAMdisk growing past diskette size.

<p>
Assume Knoppix is installed to hard disk but that its partition is not
bootable, for whatever reason.  You need a floppy to boot Knoppix, and here
is how to make it with GRUB:


<h3>General case: disk visible to BIOS</h3>

<p>
You can use a simple GRUB diskette that boots to a GRUB command line. From
this command line, you can issue commands to boot your Knoppix on the
non-bootable partition.

<p>
This simple GRUB boot diskette can be prepared with the
<code>grub-floppy</code> script. It is very quick to prepare, but does not
carry a filesystem, so you cannot do much with it. You cannot write to it,
and you will have to type quite a bit after booting to the GRUB prompt.

<p>
A more comfortable solution is given by the script
<code>grub-install</code>, which requires a formatted diskette. A
DOS-formatted diskette will do, and you will be able to modify it from DOS
- quite an advantage. Mount the diskette, e.g., to /floppy, and issue the
command:

<pre>
grub-install --root-directory=/floppy fd0
</pre>

<p>
The script will create /floppy/boot/grub and copy to it the image files
required for booting. Some of them can be deleted, since you do not need
support for half a dozen filesystems.

<p>
Now, the best part of it is that you can write to /floppy/boot/grub a text
file by the name of <code>menu.lst</code>, which is the configuration file
for GRUB.  Here, you put all the instructions you want for booting your
Knoppix, and that's it. (The endline sequence may be DOS-style or
Linux-style.) It boots fairly quickly - or rather, it boots very quickly if
you reduce the timeout to 1 sec and suppress the menu.

<h3>Abnormal case: disk not visible to BIOS</h3>

<p>
Let us now get around to a conjurer trick that looks a bit puzzling.

<p>
The hard disk where Knoppix is installed is not visible to the BIOS. Why
not? Because the disk is explicitly set to 'none' in the BIOS, for some
peculiar reason. Or because the old BIOS cannot see partitions past 8GB.

<p>
Wonder: Linux can boot, see the disk even though it is invisible to the
BIOS, and plant its root on it.

<p>
The preparation of the GRUB diskettes for the trick goes actually the same
way as before, but some additional fiddling is required.

<p>
Let us focus on the case where a DOS-formatted boot diskette has been
prepared with <code>grub-install</code>.

<p>
First, you copy your Linux kernel (name it vmlinuz) to a hard disk visible
to the BIOS, e.g., the first hard disk, first partition, which GRUB call
(hd0,0).

<p>
Second, you must guess the proper Linux designation for the Knoppix
partition, when Linux is running. Remember that Linux calls the SCSI disks
/dev/sda, dev/sdb, etc., and the IDE disks /dev/hda, /dev/hdb, etc. The
partitions are then appended to them as numbers, e.g., /dev/hda1,
/dev/hda2, etc. It can get complex, depending on the devices you have in
your PC. In any event, you must find the proper designation for the Knoppix
partition, since it is invisible to the BIOS and GRUB. Assume for the sake
of an example that the correct Linux designation is /dev/hdb1.

<p>
Now, write <code>menu.lst</code> to the floppy, directory
<tt>/boot/grub</tt>, as follows:

<pre class="code">
# start of menu.lst
# GRUB boot for Knoppix 3.6/kernel 2.6.7
# Knoppix is installed to hdb1
# hdb1 is not bootable, indeed not seen by BIOS

# By default, boot the first entry
default 0

# Boot after 1 second, no menu
hiddenmenu
timeout 1

# first and unique entry
title knoppix36267
kernel (hd0,0)/vmlinuz root=/dev/hdb1

# Should an initial RAMdisk be required,
# the last line would be, for instance:
# kernel (hd0,0)/vmlinuz root=/dev/hdb1 initrd=/initrd/ird.gz
# end of menu.lst
</pre>

<p>
We are not finished yet. GRUB has on the floppy an auto-generated file
device.map, listing all devices known to it. In this abnormal case, it is a
good idea to check the map file; it may need revision by hand. Indeed, it
must include that device unknown to the BIOS but destined to carry the
root. Note that the map file is simply a translation between GRUB device
names and Linux device names.

<p>
That's it. Boot the GRUB diskette and it will pull vmlinuz from your first
hard disk: vmlinuz will run and will recognize and use the partition
<tt>/dev/hdb1</tt> even though <tt>/dev/hdb</tt> is unknown to the BIOS.

<p>
Can anyone explain it? If the kernel can see partitions invisible to the
BIOS, why can't GRUB?  GRUB has in the boot sector a tiny program called
<code>stage1</code> that does nothing but trigger <code>stage2</code>.
Since <code>stage2</code> is more than 100K, shouldn't it be able to detect
available devices the same way the kernel does?


</p>



<!-- *** BEGIN author bio *** -->
	<!-- ============================================================= -->
<!-- *** BEGIN bio *** -->
<hr>

<!--
<p>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png" class="bio">
<em>
</em>
<br CLEAR="all">

-->
<!-- *** END bio *** -->

<!-- ============================================================= -->


<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/anonymous.html">Anonymous</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="bilbrey"></a>
<h1>Using a Non-Default GUI (in RHEL and kin)</h1>
<p id="by"><b>By <A HREF="../authors/bilbrey.html">Brian Bilbrey</A></b></p>


</b>
</p>


<p>
<p>GUI is an acronym for Graphical User Interface. You can choose
your GUI in Linux. The working title for this topic was
Non-Standard GUI Desktops, but two things are true: First, choice
is sometimes good. Second, in many people's minds, "Non-Standard"
often implies sub-standard. Nothing can be further from the
truth.</p>

<p>In most other popular operating systems, the GUI is both
mandatory and relatively fixed. In Microsoft Windows&reg;, you
have... well, Windows. You can apply themes and styles, and make a
few changes to appearances, but the system is designed to run only
in the provided graphical interface. You can't really change out
the Windows interface for some third-party layer. Apple Computer
is, as far as I know, much the same way, with its new Aqua&reg;
desktop GUI over the top of OS X&reg; (I will admit complete
ignorance of the <em>Apple way</em>. It's entirely possible that
Aqua is just a window manager running on top of the X server
running as an application over the Mach-derived core, but I don't
know the first thing about it).</p>

<p class="editorial"><em>Rick Moen comments: Aqua is actually the
name of the look and feel effect, resulting from running a
proprietary "Display PDF"-oriented 2D display engine named Quartz
(as well as 3D extensions dubbed "Quartz Extreme") &mdash; a direct
descendant of NeXTStep's Display PostScript engine. There are only
a limited number of third-party tweaks one can make to the Quartz
framework. E.g., a friend has retrofitted one to restore the
ability he enjoys in Linux to have virtual desktops. The important
thing to remember is that Quartz is not X11 at all, though recent
versions have added the ability to seamlessly image X11
applications using an integrated copy of XFree86 for PPC. (I
believe this bundle starts something called "quartz-wm" as default
display manager, but that you can change it.) I'm not 100% clear on
details, because I run my iBook almost entirely in Ubuntu Linux,
instead. Note: Because the term "X" is such an overloaded term in
the Mac OS X context, the Unix-standard X Windows System is most
often referred to as X11 to disambiguate it, despite the extremely
small amount of inaccuracy entailed.</em></p>

<p>When it comes to the GUI, Linux really is different. Display
servers provide the interface between the GUI and the hardware
(video card). Then there are window managers and desktop
environments that are the graphical presentation layer within which
applications run. There are many choices for each of these
categories. Let me guide you through these options, before we talk
about changing the way you work in the GUI.</p>

<h2>Display Servers</h2>

<p>A display server performs the basic functions of working with
the video display hardware, as well as pointing devices (mice,
touchscreens, tablets, etc.) and keyboards. It encompasses both the
operating system interface and drivers necessary to talk to
specific video hardware. Linux display servers are variants of the
X Window System (X), which originated at MIT in 1984, long before
Linux itself. X has spawned many children, some open source and
some proprietary. The most popular X server software for Linux,
through the first quarter of 2004, was the XFree86 server (<a href=
"http://www.xfree86.org/">http://www.xfree86.org/</a>). Due to a
licensing change and developer conflicts, most Linux distributions
(including Fedora Core 2) at this writing are migrating to the
X.org server (<a href="http://www.x.org/">http://www.x.org/</a>),
an open source fork of the XFree86 codebase. I strongly recommend
that you stay with the vendor-recommended X server software for
your distribution: Migrating to a new display server is not for the
faint of heart.</p>

<p>Way back in the late 1990s, it was taken for granted that Linux
would not run the latest, fastest, hottest video cards. It would
take 6 to 12 months for some dedicated soul to engineer a driver to
use the special functions of a new video card, usually without any
help whatever from the card manufacturer. As Moore's Law trebled
itself in the video card arena, two things changed: First, video
chipsets gained capabilities so quickly that open source developers
couldn't keep pace. Second, the field of manufacturers narrowed
dramatically. Skip forward to today. There are two main players:
Nvidia and ATI. Both provide capable video cards, and, more
wonderfully, both provide drivers that work with current kernels
and display servers to interface Linux to almost all of the hottest
new cards. These binary-only drivers have compiled interfaces that
allow the drivers to be used with current kernels and X servers. In
addition, both manufacturers appear to be working with open source
coders to provide stronger support for cards that are no longer top
of the line (thus avoiding perceived competitive disadvantage).</p>

<h2>Window Managers</h2>

<p>A window manager (WM) provides basic services for GUI
applications running on a display. An application window is framed
and usually has a title bar with widgets for opening, closing,
minimizing, and what-not. Windows have focus (to be typed into) and
other attributes as well. Finally, a WM provides application menus
of some kind, and settings for such things as themes, styles, and
backgrounds. Some window managers handle more capabilities, like
tabbed windows, or extreme customizability, desktop icons,
taskbars, and even scripting capabilities. At the "low end" there
is the minimalist window manager, which is said to provide a place
to display multiple xterms, and use the mouse to point at the one
to type in. Blackbox, Fluxbox, and OpenBox all fit into this end of
the pool, as does TWM, the first X window manager. The most extreme
light WM I know of is called RatPoison, and is designed to be used
keyboard-only. The best advantage of light window managers is that
they add very little load to the system for the services that are
provided, both in terms of CPU and memory usage. Speed is good.</p>

<p>In the middle bit of the pool are such window managers as IceWM,
AfterStep, and WindowMaker. These are variously similar to
interfaces provided on other operating systems, and are more
customizable, while staying lean and trim with regards to system
resources. The single most powerful WM I've experienced is FVWM2.
It is agile, mutable, scriptable, and overall a real joy to work
in, once I've wrapped my head around it properly. But when I'm not
experimenting with other options, I come home to Fluxbox.</p>

<p>Desktop Environments</p>

<p>Also known as an Integrated Desktop Environment (IDE), these are
the Galaxy-class workspaces for the Linux GUI. Not nimble, and
desirous of as much processor and memory as you can throw at them,
IDEs provide capabilities similar to that of the latest Windows and
Apple operating environments. There are two players in this space:
KDE and Gnome. Okay, Gnome and KDE! I've said it with BOTH first,
in order to keep the flamage to a minimum. Asking the "Gnome or
KDE?" question on the wrong mailing list is a bit like asking "vi
or Emacs?", and nothing at all like asking "cake or ice cream?"</p>

<p>The correct answer to that last question is, of course,
"Both!"</p>

<p>KDE was the first of the IDE projects. Based upon a widget
toolkit called Qt, KDE 1.0 was the first look at the future of
Linux desktops, and many people liked what they saw. But some
people saw a dark cloud around that silver lining: At the time, the
Qt libraries weren't "free" in the open source (aka Free Speech)
sense. This problem lead to the creation and fast ascendence of the
GNOME Project, an alternative IDE build upon the underpinnings of
the GTK+ toolkit, free and powerful. After some heavy competition
on capabilities and equally heavy flame-wars on a number of mailing
lists, blogs, and other fronts, an important event took place:
TrollTech, the creators of Qt, made Qt available under the
OSI-certified QPL license. Had this taken place earlier, GNOME
would never have been. But the race between them has benefitted
both, by many measures (although some commentators have noted that
the sheer energy of duplicated effort might have been better spent
elsewhere). Today, with some noisy exceptions, there is
considerable work going on to integrate the deep ends of both
environments, so that applications created for one can participate
more easily in the other.</p>

<p>KDE and GNOME each provide a lot of features. These start at the
surface, with lots of eye candy like translucent menus, tooltips,
desktop file managers, and deeply extreme customization. Under the
surface, both GNOME and KDE offer variations on CORBA/DCOM-type
capabilities. This permits inter-application communications and
control, application and document embedding, and many other
features. If your goal is to come up to speed as quickly as
possible in Linux, when you've already had lots of time in front of
Windows machines, then either KDE or GNOME will suit you fairly
well, with possibly the lowest of learning curves.</p>

<p>Of course, almost every distribution has "chosen sides", and
preferentially load one or the other IDE as default. Red Hat, in
both the commercial and open versions, offers up GNOME by default,
themed with a package called Blue Curve. Optionally, you can
install KDE and select it as your default desktop. Blue Curve is
the default theme there, too. Debian leans towards GNOME, too,
while SUSE, Mandrake, and others choose KDE as primary. In some
cases, what makes a distribution special is coded explicitly for a
particular environment: This is true of Xandros and its
customization of KDE.</p>

<h2>Making Changes</h2>

<p>Now I'll show you the options you have for selecting GUI
desktops other than GNOME, and how to install them in Fedora Core,
the example Linux for this book. Briefly, at the end of this
section, I'll discuss ways of installing alternate window managers
and desktops in a few other distributions. For the purposes of this
discussion, I'm using a clean install of Fedora Core 2, Workstation
configuration. I'll grant you the desire for a GUI on a server, but
not the need to spend time mucking around with alternatives there:
Use the RH GNOME and associated tools, there. They are designed for
and work best in that environment, and best emulate the experience
you'll have if you use the RHEL family of products.</p>

<h3>KDE</h3>

<p>Installing KDE in Fedora is a snap, in a couple of different
ways. First, of course, you can easily select it during the
installation. First, after the package configuration step, select
the option to customize your package selections. Then continue to
the Package Group Selection dialog, as shown in illustration 1.</p>

<p align="center"><a href="misc/bilbrey/ndgui.png"><img src=
"misc/bilbrey/thumb_ndgui.png" width="200" height="150" border="0"
hspace="10" vspace="10" alt="Fedora GUI Selection"></a><br>
Illustration 1<br>
Select KDE during Fedora installation</p>

<p>Then, once the installation is complete, KDE is one of the
options from the initial login screen (in the list of available
sessions). But that's assuming that you're doing a clean install of
Fedora Core. What if you've already installed, and now you want to
add KDE?</p>

<p>Log in to Fedora as your normal user. Click on the menu icon in
the task bar (by default, that distinctive red Fedora), then choose
System Settings, then Add/Remove Applications. After filling in the
password prompt box to get administrative access, the Add/Remove
Applications dialog box appears, looking virtually identical to the
Package Group Selection dialog shown above. From there, check the
KDE box, and have a look at the Details link to see if you want to
add the KDE Administrative Tools. They're omitted from the
defaults, but I recommend it. Continue with the installation, and a
set of packages for KDE and supporting cast are installed. My only
gripe was having to swap twice: First disc 2, then disc 1, then
back to disc 2. When all is said and done, log out, then back in
again. This time, before putting in the password, look at the
options revealed by clicking on the Sessions link at the bottom of
the login screen. There's KDE, ready to be selected. Do so, then
login. Spend some time spelunking around in the interface and
through the menu trees. Observe the differences, and the
similarities. Of all the Linux distributions, Red Hat puts the most
effort into making KDE and GNOME as nearly alike as possible, on
the surface, anyway. Now let's have a look at something from the
Atkins-friendly side of the menu....</p>

<h3>Xfce4</h3>

<p>I can hear it now. "That isn't one of the window managers he
wrote about a couple of pages back!" Yup, you're right. But it is
the only other one that is included with Fedora Core 2, besides
GNOME and KDE. So instead of using the Application manager to try
to find and install it, I'll drop down to the command line and use
the tools that underpin the network updates and application package
management for Fedora Core: yum.</p>

<p>Note: Yum is short for Yellow Dog Updater, Modified, originally
from the Yellow Dog PowerPC Linux distribution. Yum adds a layer of
dependency checking and a number of other handy tools atop the RPM
package layer. Type <strong><code>man yum</code></strong> at any
command prompt to learn more.</p>

<pre>
[root@gael root]# <strong>yum install xffm\* xfwm4\* xfce\* xfdesktop</strong>
Gathering header information file(s) from server(s)
 . . .
.Dependencies resolved
I will do the following:
 . . .
Is this ok [y/N]: <strong>Y</strong>
</pre>

<p>Then the appropriate packages are downloaded from the official
Fedora mirror sites, checked, and installed without further ado. A
note of thanks: I picked up the yum shorthand for this particular
installation from an article on FedoraNews.org. Two files need to
be created, for the login session manager to pick up XFCE. Use your
favorite text editor.</p>

<p>In <em>/etc/X11/dm/Sessions/xfce.desktop</em>:</p>

<pre>
[Desktop Entry]
Encoding=UTF-8
Name=XFCE4
Comment=This session logs you into XFCE4
Exec=startxfce4
Icon=
Type=Application
</pre>

<p>In <em>/etc/X11/gdm/Sessions/XFCE</em>:</p>

<pre>
#!/bin/bash
exec /etc/X11/xdm/Xsession XFCE4
</pre>

<p>Both files need to have their permissions set properly:</p>

<pre>
[root@gael /]# <strong>chmod 755 /etc/X11/gdm/Sessions/XFCE</strong>
[root@gael /]# <strong>chmod 755 /etc/X11/dm/Sessions/xfce.desktop</strong>
</pre>

<p>This sets read/write/execute for the file owner (root), and
read/execute for everyone else. Then you can log out, and select
XFCE from the Session manager during login. It loads much more
quickly than the two desktop environments, so what's missing? Well,
all of the Fedora-specific menus, for one. To use this on a daily
basis, I'll need to heavily customize the menu system to match what
I need from the installed Red Hat administrative utilities. But
there's more good news!</p>

<p>What a difference a lighter WM makes! Just after reboot and
login each time, with one terminal window and one SSH session
running, here are the respective memory usages for the three
choices we have:</p>

<table border="1" width="80%" align="center">
<tr>
<td width="25%" align="center"><em><strong>WM vs.
Mem</strong></em></td>
<td width="25%" align="center">Gnome</td>
<td width="25%" align="center">KDE</td>
<td width="25%" align="center">Xfce4</td>
</tr>

<tr>
<td width="25%" align="center">MemTotal</td>
<td width="25%" align="right">257072 kB</td>
<td width="25%" align="right">257072 kB</td>
<td width="25%" align="right">257072 kB</td>
</tr>

<tr>
<td width="25%" align="center">MemFree</td>
<td width="25%" align="right">2284 kB</td>
<td width="25%" align="right">3852 kB</td>
<td width="25%" align="right">56480 kB</td>
</tr>

<tr>
<td width="25%" align="center">Buffers</td>
<td width="25%" align="right">21316 kB</td>
<td width="25%" align="right">22404 kB</td>
<td width="25%" align="right">20804 kB</td>
</tr>
</table>

<p>In a 256 MB environment, both KDE and GNOME fill things right
up. That's not all of the available data, of course: There wouldn't
be room to write any more prose on the topic if I duplicated the
memory and CPU data to demonstrate full load characteristics. But
clearly, Xfce4 uses less memory for the desktop, leaving more room
for running applications before resorting to swap. In a severely
memory constrained machine, I'd seriously consider not running X at
all (in the <em>/etc/inittab</em> file, this line:
"id:5:initdefault:", change the '5' to a '3', and reboot) to
conserve resources. When I tested this, I came up with 181 MB of
free RAM. Of course, the better choice there is to get a more
powerful machine, or at least more RAM. How do you value your
time?</p>

<h3>IceWM</h3>

<p>Why one more window manager? The best reason is that this one is
compiled from external sources, built locally, and installed using
the package manager for ease of future updating. So it's a great
example for lots of concepts. First, go to the home page for IceWM
(<a href="http://www.icewm.org/">http://www.icewm.org/</a>) and
follow the links to pull down the latest stable source file for the
product. At this writing, the stable revision is 1.2.14. Put the
file into <em>/tmp</em>, open a terminal window, type
<strong><code>su -</code></strong> and the right password to become
the root user. Then use these commands:</p>

<pre>
[root@gael root]# <strong>cd /tmp</strong>
[root@gael tmp]# <strong>rpmbuild -ta icewm-1.2.14.tar.gz</strong>
 . . .
</pre>

<p>Feign an unconcerned demeanor, as warnings and apparent compile
errors fly past your eyes. It only matters that the job completes
&mdash; most of the warnings are put there by the program's author
to remind him of places in the code that still need work. This step
can take quite a few minutes, depending on processor and available
RAM. When it's done, the last few lines of the job tell you where
the RPM files were written. That's where we're going next, to
install the freshly built RPMS.</p>

<pre>
[root@gael tmp]# <strong>cd /usr/src/redhat/RPMS/i386/</strong>
[root@gael i386]# <strong>rpm -ivh icewm*</strong>
</pre>

<p>How did I know that was going to work...? Usually there are
dependency problems, no? I knew that the packages built to
completion, so they must have built in the context of the required
other software being present. Otherwise, the compile would have
failed with a hopefully useful message telling me what was missing.
There was no problem this time. Next, again, we have to create and
set permissions for the following files:</p>

<p>In <em>/etc/X11/dm/Sessions/icewm.desktop</em>:</p>

<pre>
[Desktop Entry]
Encoding=UTF-8
Name=IceWM
Comment=This session logs you into IceWM
Exec=/usr/bin/icewm
Icon=
Type=Application
</pre>

<p>In <em>/etc/X11/gdm/Sessions/ICEWM</em>:</p>

<pre>
#!/bin/bash
exec /etc/X11/xdm/Xsession IceWM
</pre>

<p>The results I see after a reboot and login are a clear
improvement even over Xfce4, nearly 20 MB more free. But the same
issue with Red Hat menu integration exists.</p>

<h2>Pros and Cons</h2>

<p>The real upside for many people in installing a non-default GUI
on their machine is about control. It has been said many times that
Linux is about choice, and people who run and live in Linux like
making those choices for themselves. Additionally, a large number
of users don't want all of the eye candy and other "features" that
seem to stand between them and getting the job done. If the CPU is
bouncing a little deforming icon up and down, then it's not hard at
work starting your application, is it? That brings up the other big
advantage of light window managers: loading speed. If you're in and
out of the box all day, the time spent waiting for the GNOME and/or
KDE environments to completely initialize can be excruciating.
Light == Fast == Good.</p>

<p>The downside is that most distributions, and the Red Hat /
Fedora ones in particular, heavily customize the preferred
environments to match and support the GUI management tools they've
implemented. A perfect example of this lies in the Xfce4
implementation. Yes, it ships on the disks with the rest of Fedora
Core 2. But it doesn't have any of the menu customizations that
give easy access to the administrative tools. They're not hard to
discover independently, by looking into the menus for KDE or GNOME,
but you're on your own.</p>

<p>Other distributions like Debian and Gentoo are much more
desktop-agnostic than the big commercial distributions. There, it's
easy to install so many desktops, window managers, IDEs and things
to work with them, that it is hard to get any work done at all if
you're not careful. While it is relatively easy and fun to
experiment with adding desktops and associated utilities, it's
important to remember that you're working with a tool for getting a
job done. It doesn't matter what the paint job on the delivery van
looks like each day: If four hours of each day is spent repainting
part of the van, then it's not out making money or doing anything
productive during that time. Balance is important. Experiment for
yourself, make a decision, and stick to it... for a while, at
least!</p>

</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<IMG ALT="picture" SRC="../gx/authors/bilbrey.jpg" align="left"  hspace="10" vspace="10" class="bio">
Brian is a SysAdmin and Author, occasionally human, and a recent convert
to the Church of TAG.

<em>
<p>Brian Bilbrey is thoroughly Californicated, being the third generation
born in that state of unreality in 1961. The Kennedy assasination rumors
aren't true - there was no stroller on the grassy knoll that fateful day,
and besides, he was in a completely different time zone. Growing up in the
San Francisco Bay Area, Brian became a voracious reader, as well as a Star 
Trek and Monty Python fan. He first got into programming with an early TI 
calculater. His first "real" computer was an IMSAI 8080, although he was
never able to contact WOPR in Cheyenne Mountain with it.</p>

<p>After a checkered career in college (mostly at the lovely yet dangerous
UC Santa Cruz campus), Brian started working in assorted technical fields,
and gravitated naturally into Systems Administration and other
computer-assisted fields such as CAD and CAE. He and his spice, Marcia,
committed a rightward move in 2002, landing in Bowie, Maryland, just
outside the Washington DC beltway. His current employment is at 
(nfr)(security) as SysAdmin for a collection of Linux, OpenBSD and Windows
boxen.</p>

<p>Brian has been using Linux since early Yggdrasil days. He
currently runs Gentoo Linux on his main home workstation, Xandros Linux on
the laptop, Debian Linux on the home file server, White Box Enterprise
Linux on the backup server, and OpenBSD on the test hardware. That isn't
obsessive, is it?</p>

</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/bilbrey.html">Brian Bilbrey</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="nielsen"></a>
<h1>Preparing For My Interviews Part 1: MySQL and Perl</h1>
<p id="by"><b>By <A HREF="../authors/nielsen.html">Mark Nielsen</A></b></p>


</b>
</p>


<p>
<center>
<h2><font color="#800000">Preparing For My Interviews Part 1: MySQL and Perl<br>
</font></h2>
</center>
<center>
<h4>By Mark Nielsen</h4>
</center>
<p>
</p>
<ol>
  <li><a href="#Introduction">Introduction</a></li>
  <li><a href="#perl1">Multiple Inheritance module Class::Inheritance</a></li>
  <li><a href="#real">A quick Python script to play my mp3's for Real Player.</a></li>
  <li><a href="#cert">MySQL Certification</a></li>
  <li><a href="#prep">Preparation for Advanced MySQL Certification</a></li>
  <li><a href="#install">Installing MySQL 4.1</a></li>
  <li><a href="#python">My Python script to execute sample code for Certification</a></li>
  <li><a href="#using">Using MySQL 4.1</a></li>
  <li><a href="#next">Next Month: Clustering, Master/Slave, Stored Procedures
in MySQL</a></li>
  <li><a href="#conclusion">Conclusion</a></li>
</ol>
<hr>
<h3><a name="Introduction"></a>Introduction</h3>
I got laid off, so I am doing a couple of things to ready myself for interviews:
<ol>
<li>A lot of Perl interviews involve questions about multiple inheritance.
Even though nobody ever uses multiple inheritance, interviewers always like
to ask questions about it.  Thus, I decided to make a module to answer any
and all questions about multiple inheritance for a given class in Perl. If
anybody asks me questions about multiple inheritance, I will just show them
the Perl module I wrote.  This Perl module will probably be called
Class::Inheritance if it gets accepted into CPAN. I already started the
process for it. 
</li>
<li> I needed a quick script to play my mp3s in random order. </li>
<li> I am studying for the MySQL Professional Certification, so I decided
to do two things regarding the exam:
<ol>
<li> Make a bash script to install MySQL over and over again. In the future, 
all I have to do is just change the version number and the script should
install new versions automatically. I always like to download and install
software instead of using RPMs; I want to know how they built the stuff.</li>
<li> Write a Python script to execute a bunch of commands that represent
similar things to the ones asked during the MySQL Professional Exam. This helps
me to remember the commands, and hopefully will give other people a good
idea of the type of commands they need to practice to learn MySQL.</li>
</ol>
</li>
</ol>

Thus, this article is centered around my experience studying for 
MySQL certification and what I did to help me out during Perl interviews.
<p>
(<strong>UPDATE</strong>: I ended up passing the MySQL Professional Exam. The examples I made
really helped out a lot. Also, I ended up placing my 
<a href="http://www.perl.com/CPAN/modules/by-authors/id/N/NI/NIELSEN/">Class::Inheritance</a>
module in 
<a href="http://www.perl.com/CPAN/modules/">CPAN</a> under the 
<a
href="http://www.perl.com/CPAN/modules/by-category/06_Data_Type_Utilities/Class/">06_Data_Type_Utilities/Class</a>
category.  It's somewhat crude, but it's a good start. I plan on redoing
it completely because of some ugly code.) 

<hr><h3><a name="perl1"></a>Multiple Inheritance module Class::Inheritance</h3>
After going through a few interviews, I decided to write a module to answer
any and all questions about multiple inheritance given a class and method. 
If someone asks me anything about multiple inheritance, I will just
show them the module I wrote for CPAN. This module probably has very little
use outside of interviews; however, I do plan on adding a bunch of methods
to the module to make it so you can debug multiple inheritance issues
easily and maybe even manipulate the inheritance environment. 
<p>
This module is just in its baby stages. In the future, it should be at
<a href="http://cpan.perl.com">http://cpan.perl.com</a>. 
<p>
How does multiple inheritance work in Perl? Well, when you use inheritance
in Perl, you need to create a package.  A package is more a less a bunch of
functions put together to form a "class" (or multiple classes).
A class is more or less a name for a bunch of functions (and sometimes
variables). Your class is what is used to create objects in Perl. 
<p>
So what is inheritance? Let's say you create a package called "package1"
and it has a bunch of functions (methods). You want your second
package "package2" to have all the functions of the first package but
you don't want to rewrite them all. When you use inheritance, that is exactly
what you do: you grab all the functions (methods) from the first package
and absorb them into the second package without having to rewrite the 
functions. You do this by specifying the name of the first package in the
"@ISA" array.
<p>
So what is multiple inheritance? Well, it's what you get when you get your
functions from more than one package.
<p>
So when you inherit the functions (methods) from multiple packages, how
does Perl choose the method if there's more than one with the same name? It
grabs the function (method) from the first package in the "@ISA" list which
has that function and stops there. Thus, how you list your packages in the
"@ISA" list will determine which packages get looked at first to find a
function. 

<p> By the way, what is a method? A function that is part of a class.

<p>
Where is this @ISA thingy defined? It is defined in each package. Each
package has its own @ISA list. It is effectively empty if you don't do
anything to it. If you define it to contain any number of package names, 
your package will inherit methods from those packages. 
<p> If I have a huge chain of packages inheriting from one another, will the
last package get all the functions (methods) from its parents, grandparents, 
great grandparents, etc? Yes, but it will "climb" up the family tree and stop
at the first relative that has the function (method). 

<p> For the files listed below, we have two chains relative to package
"package6". Package6 contains two packages it inherits from: package5 and
package5_2. Each of these packages inherits from package4, which inherits
from package3, which inherits from package2, which inherits from package1,
which inherits from CGI. 
<p> The whole goal of the script "Inherit_Test.pl" is to show the
family tree of the package "package6" and to show where package6 gets the
method "param" from. You can modify it to suit your own needs. 
<p>
Download all the files below and then execute 
"perl Inherit_Test.pl package6 param". You can change "package6" to any
package name and you can change "param" to any function name. It will
error out properly if no package or function exists. 
<p>
Try the following:
<pre>
perl Inherit_Test.pl package6 param
perl Inherit_Test.pl package4 param
</pre>

<p>
The expected results for "perl Inherit_Test.pl package4 param":
<pre>
We assume the filename for the package is in 'package4.pm'.  Looking at the
function (method) 'param' in class 'package4', we learn that function
'param' comes from class 'CGI'.

Parent Tree is: package3 package2 package1 CGI 

Original sources (defined) for 'param' are: CGI
</pre>
<p>
The expected results for "perl Inherit_Test.pl package6 param":
<pre>
We assume the filename for the package is in 'package6.pm'.
Looking at function (method) 'param' in class 'package6'.

Function 'param' comes from the class 'package5'.

Parent Tree is: package5 package4 package3 package2 package1 CGI package5_2 package4 package3 package2 package1 CGI 

Original sources (defined) for 'param' are: package5 CGI package5_2 CGI
</pre>

Here are a list of files you need to save. 
<ol>
<li><a href="misc/nielsen/Inheritance.pm">Class/Inheritance.pm</a></li>
<li><a href="misc/nielsen/Inherit_Test.pl">Inherit_Test.pl</a></li>
<li><a href="misc/nielsen/package1.pm">package1.pm</a></li>
<li><a href="misc/nielsen/package2.pm">package2.pm</a></li>
<li><a href="misc/nielsen/package3.pm">package3.pm</a></li>
<li><a href="misc/nielsen/package4.pm">package4.pm</a></li>
<li><a href="misc/nielsen/package5.pm">package5.pm</a></li>
<li><a href="misc/nielsen/package5_2.pm">package5_2.pm</a></li>
<li><a href="misc/nielsen/package6.pm">package6.pm</a></li>

</ol>

<hr><h3><a name="real"></a>A quick Python script to play my mp3's for Real Player</h3>
I only wrote this script because my website, <a
href="http://myopenradio.com">http://myopenradio.com</a>, got moved to a
much better computer and rather than figuring out if the website was 
working, I just wanted to make a quick Python script which would let me play
my mp3s in a random order. The file "/usr/local/RealPlayer8/realplay.bat"
does two things:
<ol>
<li> Executes my Python script to create a "/tmp/temp1.smil" file which is
a listing of my mp3s in a order random order.</li>
<li> Then it executes RealPlayer and points it to that file.</li>
</ol>

This script shows you how to use regular expressions, how to get a list
of files in a directory, how to filter the list of files using the
regular expression, and how to loop through a list in a random order. 
Also, you could combine it with known URLs of NPR radio shows or other
media streams and mix them in with your mp3s; that's how you can create
your own radio. Your radio could play a list of songs, then some shows, 
and then more songs, etc. Perhaps, if you can stream it legally to customers, 
you could include ads. 

<ol>
<li>
<pre>
# NEW FILE:
### Save this as /usr/local/RealPlayer8/realplay.bat
/usr/local/RealPlayer8/realplay.py
/usr/local/RealPlayer8/realplay /tmp/temp1.smil
</pre>
</li>

<li><a href="misc/nielsen/realplay.py">realplay.py</a></li>
</li>
</ol>

<hr><h3><a name="cert"></a>MySQL Certification</h3>
There are two different levels of MySQL Certification. The Core certification
covers general SQL and as well as MySQL specific stuff. For a senior
DB person, it doesn't take much studying to pass. However, for the MySQL
Professional Certification, you really do want to study all the commands,
even the ones that you will never use, because the exam is going to cover
them. Studying for the exam gives you a nice overview of MySQL and makes
you take notice of stuff you would never have bothered with. 
<p>
Getting MySQL-certified now is good because there aren't that many people
listed. After you pass an exam, it might take a couple of weeks before you
get publicly listed. After you pass your exam, you need to log in and let
people view which exams you have passed. 

<a
href="http://www.mysql.com/training/certification/candidates.php?exam=professional">You
find the list of the MySQL Professionals here</a>.

<hr><h3><a name="prep"></a>Preparation for the Advanced MySQL Certification</h3>
<p>
I highly recommend you get the study guide from MySQL Press; it's a
good book. Usually certification books contain a lot of garbage, but this
one is actually very useful (in my opinion).
<p>
After you have passed the Core Certification and you are ready for the
Professional Certification, you should execute the scripts I list below.
The "Compile_MySQL.bat" script is just a bash script. It will blow away any
previous installation in case you want to run the script multiple times.
The "Post_Mysql.py" script will create a log of all the commands it executes
so that you can go back and do them one-by-one on your own. It would take
too long to explain what each command does, so I strongly advise you to
read the <a href="http://dev.mysql.com/doc/mysql/en/index.html">online
MySQL Documentation</a> or the <a
href="http://www.mysql.com/training/certification/studyguides/">study guide
</a> to understand what each command does.  

<hr><h3><a name="install"></a>Installing MySQL 4.1</h3>
The purpose of this script is to show you how you can install MySQL
easily. Basically, in the future, all you have to do is change some of the
"export" variables in the script when a new version of MySQL comes out,
and it should install the new versions just fine. A similar approach
can actually be taken to install any piece of software, like Apache, Perl,
Python, Zope, etc. I usually make an installation script, and later when I
need to upgrade, I backup all my data and software, modify the script
slightly, and then execute it. Often, if you don't write down all your
commands as a script, it becomes very painful to figure out how you
installed the software last time. 

<p>
The script should execute as long as you don't have any missing software. 
First, download the 3 config
files and then download this script. Execute the script as follows:
<br>
bash Compile_MySQL.bat
<p>
<ol>
<li><a href="misc/nielsen/my.cnf">my.cnf</a>
<li><a href="misc/nielsen/Start_MySQL">Start_MySQL</a>
<li><a href="misc/nielsen/Stop_MySQL">Stop_MySQL</a>
<li><a href="misc/nielsen/Compile_MySQL.bat">Compile_MySQL.bat</a>
</ol>

<hr><h3><a name="python"></a>My Python script to execute sample code for Certification</h3>
The purpose of this script to execute commands after a fresh installation
to test a list of MySQL commands for the MySQL Professional Exam. 
I really didn't explain each command, but it's all clarified in the 
Study Guide and the online documentation I've recommended above.
<p>
This script will alter the MySQL environment. It will run a series of example
commands and restart the MySQL service which will require you to use the
new passwords when you try and connect to MySQL in the future. I suggest
you change the passwords for all accounts after you get done with this
script. 
<p>
After you run this script, you can connect as:
<br>mysql -u root -p'this is a dumb password, please change.'
<p>
Execute as follows:

<br>python Post_Mysql.py /usr/local/mysql4.1
<p>
using <a href="misc/nielsen/Post_Mysql.py">Post_Mysql.py</a>

<hr><h3><a name="next"></a>Next Month: Clustering, Master/Slave, Stored Procedures in MySQL</h3>
Title says is all, except for the fact I will be using MySQL 5.0 to test
the stored procedures. 

<hr>
<h3><a name="conclusion"></a>Conclusion</h3>
Class::Inheritance is a pretty cool module (please visit CPAN for the
latest version.) The one listed for this article was just a primer I used
to get myself started. By the time I got finished with this article, I
added a lot more stuff and fixed a few bugs. I am still unhappy with the
module and think there is a lot of work to do to make it more accurate and
efficient.  If you study the module and figure out how it works, you are
set for any multiple inheritance question an interviewer will throw at you.
I plan on adding a lot more methods to the module to do a bunch of more
stuff. 
<p>
About the Python script to play mp3s, I hope this little script helps
people understand how to use Python. Python is a very cool programming
language and is my language of choice. It has a lot of potential. 
<p>
About the MySQL scripts: I probably should have explained the MySQL
commands a little bit more in detail, but if you buy the book or read the
online documentation, you should be able to understand it. If you manage to
execute my scripts correctly, look at the log files in the Output directory
from where you run the Post_Mysql.py script. It should have a couple of
files with all the commands it executed so that you can go through them one
by one.  Ideally, you should execute the commands one by one and see what
they do.  You should also follow along in the study guide for MySQL (MySQL
Press) as you do so.  


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png" class="bio">
<em>
Mark Nielsen is enjoying his brief vacation and is spending time bettering
himself (certifications and stuff).
During his spare time, he uses Python heavily for mathematical and web
projects. You can reach Mark at his old website at
<a href="http://www.tcu-inc.com/Contact.pl">tcu-inc.com</a>.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/nielsen.html">Mark Nielsen</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="odonovan"></a>
<h1>Advanced Features of netfilter/iptables</h1>
<p id="by"><b>By <A HREF="../authors/odonovan.html">Barry O'Donovan</A></b></p>


</b>
</p>


<p>
<h3>Introduction</h3>
It is commonly known that netfilter/iptables is the firewall of the
Linux operating system. What is not commonly known is that iptables
has many hidden gems that can allow you do things with your
firewall that you might never have even imagined. In this article I
am going to introduce many of these features with some practical
uses. If you are not <em>au fait</em> with the basics of iptables
then you should read my previous article in the Gazette, "<a href=
"../103/odonovan.html">Firewalling with netfilter/iptables</a>".
<p>The following features are discussed:</p>
<ol>
<li>Specifying multiple ports in one rule</li>
<li>Load balancing</li>
<li>Restricting the number of connections</li>
<li>Maintaining a list of recent connections to match against</li>
<li>Matching against a string in a packet's data payload</li>
<li>Time-based rules</li>
<li>Setting transfer quotas</li>
<li>Packet matching based on TTL values</li>
</ol>
<p>All of the features discussed in this article are extensions to
the packet matching modules of iptables. I used only two of these
extensions in the previous article: the <code>--state</code> module
which allowed us to filter packets based on whether they were
<code>NEW</code>, <code>ESTABLISHED</code>, <code>RELATED</code> or
<code>INVALID</code> connections; and the <code>multiport</code>
extension, of which I will go into more detail on in this
article.</p>
<p>Some of the modules introduced in this article (marked with an
asterisk) have not made their way into the default Linux kernel yet
but a netfilter utility called "patch-o-matic" can be used to add
them to your own kernel and this will be discussed at the end of
the article.</p>
<h3>1. Specifying Multiple Ports with <code>multiport</code></h3>
The <code>multiport</code> module allows one to specify a number of
different ports in one rule. This allows for fewer rules and easier
maintenance of iptables configuration files. For example, if we
wanted to allow global access to the SMTP, HTTP, HTTPS and SSH
ports on our server we would normally use something like the
following:
<pre class="code">
-A INPUT -i eth0 -p tcp -m state --state NEW --dport ssh   -j ACCEPT
-A INPUT -i eth0 -p tcp -m state --state NEW --dport smtp  -j ACCEPT
-A INPUT -i eth0 -p tcp -m state --state NEW --dport http  -j ACCEPT
-A INPUT -i eth0 -p tcp -m state --state NEW --dport https -j ACCEPT
</pre>
Using the <code>multiport</code> matching module, we can now write:
<pre class="code">
-A INPUT -i eth0 -p tcp -m state --state NEW -m multiport --dports ssh,smtp,http,https -j ACCEPT
</pre>
It must be used in conjunction with either <code>-p tcp</code> or
<code>-p udp</code> and only up to 15 ports may be specified. The
supported options are:
<blockquote>
<dl>
<dt><code>--sports port[,port,port...]</code></dt>
<dd>matches source port(s)</dd>
<dt><code>--dports port[,port,port...]</code></dt>
<dd>matches destination port(s)</dd>
<dt><code>--ports port[,port,port...]</code></dt>
<dd>matches both source and destination port(s)</dd>
</dl>
</blockquote>
<p><code>mport</code><sup>*</sup> is another similar extension that
also allows you to specify port ranges, e.g. <code>--dport
22,80,6000:6100</code>.</p>
<h3>2. Load Balancing with <code>random</code><sup>*</sup> or
<code>nth</code><sup>*</sup></h3>
Both the <code>random</code> and <code>nth</code> extensions can be
used for load balancing. If, for example, you wished to balance
incoming web traffic between four mirrored web servers then you
could add either of the following rule sets to your
<code>nat</code> table:
<pre class="code">
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 0 \
    -j DNAT --to-destination 192.168.0.5:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 1 \
    -j DNAT --to-destination 192.168.0.6:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 2 \
    -j DNAT --to-destination 192.168.0.7:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m nth --counter 0 --every 4 --packet 3 \
    -j DNAT --to-destination 192.168.0.8:80
</pre>
or:
<pre class="code">
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m random --average 25 \
    -j DNAT --to-destination 192.168.0.5:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m random --average 25 \
    -j DNAT --to-destination 192.168.0.6:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW -m random --average 25 \
    -j DNAT --to-destination 192.168.0.7:80
-A PREROUTING -i eth0 -p tcp --dport 80 -m state --state NEW \
    -j DNAT --to-destination 192.168.0.8:80
</pre>
The <code>nth</code> matching extension allows you to match the nth
packet received by the rule. There are up to 16 (0...15) counters
for matching the nth packets. The above four (<code>nth</code>)
rules use counter 0 to count every 4th packet. Once the 4th packet
is received, the counter is reset to zero. The first rule matches
the 1st packet (<code>--packet 0</code>) of every four counted, the
second rule matches the 2nd packet (<code>--packet 0</code>), and
so on.
<p>The <code>random</code> matching extension allows you to match
packets based on a given probability. The first rule from the set
of <code>random</code> rules above matches 25% (<code>--average
25</code>) of the TCP connections to port 80 and redirects these to
the first mirrored web server. Of the 75% of connections not
matching on the first rule, 25% will match the second and a further
25% will match the third. The remaining 25% will be caught by the
fourth rule.</p>
<p>Another use of the <code>random</code> extension would be to
simulate a faulty network connection to evaluate the performance of
networking hardware/software, etc.</p>
<h3>3. Restricting the Number of Connections with
<code>limit</code> and <code>iplimit</code><sup>*</sup></h3>
The <code>limit</code> matching extension can be used to limit the
number of times a rule matches in a given time period while the
<code>iplimit</code> extension can restrict the number of parallel
TCP connections from a particular host or network. These extensions
can be used for a variety of purposes:
<ul>
<li>to protect against DOS (denial of service) attacks such as
preventing a flood of HTTP requests to your web server while
ensuring all your customers have unlimited access;</li>
<li>to prevent a brute-force attack to guess passwords;</li>
<li>to limit Internet usage by staff during working hours;</li>
<li>and many many more.</li>
</ul>
Let's take the case where we want to limit the Internet usage of
our employees during working hours. We could use a rule like:
<pre class="code">
-A FORWARD -m state --state NEW -p tcp -m multiport --dport http,https -o eth0 -i eth1 \
    -m limit --limit 50/hour --limit-burst 5 -j ACCEPT
</pre>
This rule assumes that we are acting as a proxy server where the
external connection is via <code>eth0</code> and <code>eth1</code>
connects to our office network. The rule limits all of our internal
computers to only 50 new HTTP or HTTPS connections per hour and the
use of <code>--limit-burst</code> prevents any one employee from
using up all 50 in one go. Packets can be matched
<code>/day</code>, <code>/hour</code>, <code>/minute</code> or
<code>/sec</code>.
<p>The <code>--limit-burst</code> parameter can be quite confusing
at first. In the above example, it will ensure that if all
employees are trying to access the Internet throughout the hour
then only 5 connections are made every 5 minutes. If 30 minutes
pass with no connections and then there is a sudden rush for the
remaining 30 minutes, only 5 connections will be permitted every
2.5 minutes. I once heard it explained as follows:</p>
<blockquote><em>For every</em> <code>limit</code> <em>rule, there's
a "bucket" containing "tokens". Whenever the rule matches, a token
is removed and when the token count reaches zero, the rule doesn't
match anymore.</em>
<p><code>--limit</code> <em>is the bucket refill rate.</em><br>
<code>--limit-burst</code> <em>is the bucket size (number of tokens
that it can hold).</em></p>
</blockquote>
<p>The <code>iplimit</code> extension allows us to restrict the
number of parallel TCP connections from a particular host or
network. If, for example, we wanted to limit the number of HTTP
connections made by any single IP address to 5 we could use:</p>
<pre class="code">
-A INPUT -p tcp -m state --state NEW --dport http -m iplimit --iplimit-above 5 -j DROP
</pre>
<h3>4. Maintaining a List of <code>recent</code> Connections to
Match Against</h3>
By using the <code>recent</code> extension one can dynamically
create a list of IP addresses that match a rule and then match
against these IPs in different ways later. One possible use would
be to create a "temporary" bad-guy list by detecting possible port
scans and to then <code>DROP</code> all other connections from the
same source for a given period of time
<p>Port 139 is one of the most dangerous ports for Microsoft
Windows&reg; users as it is through this port that the Windows file
and print sharing service runs. This also makes this port one of
the first scanned by many port scanners or potential hackers and a
target for many of the worms around today. We can use the
<code>recent</code> matching extension to temporarily block any IP
from connecting with our machine that scans this port as
follows:</p>
<pre class="code">
-A FORWARD -m recent --name portscan --rcheck --seconds 300 -j DROP
-A FORWARD -p tcp -i eth0 --dport 139 -m recent --name portscan --set -j DROP
</pre>
Now anyone trying to connect to port 139 on our firewall will have
all of their packets dropped until 300 seconds has passed. The
supported options include:
<blockquote>
<dl>
<dt><code>--name name</code></dt>
<dd>The name of the list to store the IP in or check it against. If
no name is given then <code>DEFAULT</code> will be used</dd>
<dt><code>--set</code></dt>
<dd>This will add the source address of the packet to the list. If
the source address is already in the list, this will update the
existing entry.</dd>
<dt><code>--rcheck</code></dt>
<dd>This will check if the source address of the packet is
currently in the list.</dd>
<dt><code>--update</code></dt>
<dd>This will check if the source address of the packet is
currently in the list. If it is then that entry will be updated and
the rule will return true.</dd>
<dt><code>--remove</code></dt>
<dd>This will check if the source address of the packet is
currently in the list and if so that address will be removed from
the list and the rule will return true.</dd>
<dt><code>--seconds seconds</code></dt>
<dd>This option must be used in conjunction with one of
<code>--rcheck</code> or <code>--update</code>. When used, this
will narrow the match to only happen when the address is in the
list and was seen within the last given number of seconds.</dd>
<dt><code>--hitcount hits</code></dt>
<dd>This option must be used in conjunction with one of
<code>--rcheck</code> or <code>--update</code>. When used, this
will narrow the match to only happen when the address is in the
list and packets had been received greater than or equal to the
given value. This option may be used along with `seconds' to create
an even narrower match requiring a certain number of hits within a
specific time frame.</dd>
</dl>
</blockquote>
<h3>5. Matching Against a <code>string</code><sup>*</sup> in a
Packet's Data Payload</h3>
The <code>string</code> extension allows one to match a string
anywhere in a packet's data payload. Although this extension does
have many valid uses, I would strongly advise caution. Let's say,
for example, that our Linux firewall is protecting an internal
network with some computers running Microsoft Windows&reg; and we
would like to block all executable files. We might try something
like:
<pre class="code">
-A FORWARD -m string --string '.com' -j DROP
-A FORWARD -m string --string '.exe' -j DROP
</pre>
This has a number of problems:
<ul>
<li>if the '<code>.com</code>' or '<code>.exe</code>' is split
across two packets it will not be matched</li>
<li>if any packet being transmitted contains either of the stings
it will be dropped; this includes any packets from a web page
containing those strings, from an e-mail transmission, etc</li>
</ul>
<h3>6. Time-based Rules with <code>time</code><sup>*</sup></h3>
We can match rules based on the time of day and the day of the week
using the <code>time</code> module. This could be used to limit
staff web usage to lunch-times, to take each of a set of mirrored
web servers out of action for automated backups or system
maintenance, etc. The following example allows web access during
lunch hour:
<pre class="code">
-A FORWARD -p tcp -m multiport --dport http,https -o eth0 -i eth1 \
    -m time --timestart 12:30 --timestop 13:30 --days Mon,Tue,Wed,Thu,Fri -j ACCEPT
</pre>
Clearly the start and stop times are 24-hour with the format
<code>HH:MM</code>. The day is a comma-separated list that is case
sensitive and made up of <code>Mon</code>, <code>Tue</code>,
<code>Wed</code>, <code>Thu</code>, <code>Fri</code>,
<code>Sat</code> and/or <code>Sun</code>.
<h3>7. Setting transfer quotas with
<code>quota</code><sup>*</sup></h3>
Setting transfer quotas can be very useful in many situations. As
an example, a lot of broadband users will have download quotas set
for them by their ISP and many may charge extra for every megabyte
transferred in excess of this quota. You can use iptables to
monitor your usage and cut you off when you reach your quota (say
2GB) with a rule similar to the following:
<pre class="code">
-A INPUT -p tcp -m quota --quota 2147483648 -j ACCEPT
-A INPUT -j DROP
</pre>
You can then view your usage with the following command:<br>
<code>$ iptables -v -L</code>
<p>You would also need to reset the quota every month manually (by
restarting iptables) or with a cron job. Clearly your computer
would need to be 'always-on' for this example to be of any use, but
there are also any other situations where the <code>quota</code>
extension would be useful.</p>
<h3>8. Packet Matching Based on TTL Values</h3>
The TTL (Time-To-Live) value of a packet is an 8-bit number that is
decremented by one each time the packet is processed by an
intermediate host between its source and destination. The default
value is operating system dependant and usually ranges from 32 to
128. Its purpose includes ensuring that no packet stays in the
network for an unreasonable length of time, gets stuck in an
endless loop because of bad routing tables, etc. Once the TTL value
of a packet reaches 0 it is discarded and a message is sent to its
source which can decide whether or not to resend it.
<p>As an interesting aside: this is actually how the
<code>traceroute</code> command works. It sends a packet to the
destination with a TTL of 1 first and gets a reply from the first
intermediate host. It then sends a packet with a TTL of 2 and
receives a reply from the second intermediate host and so on until
it reaches its destination.</p>
<p>The usefulness of packet matching based on TTL value depends on
your imagination. One possible use is to identify
"man-in-the-middle" attacks. If you regularly connect from home to
work you could monitor your TTL values and establish a reasonable
maximum value at the receiving end. You can the use this to deny
any packets that arrive with a higher TTL value as it may indicate
a possible "man-in-the-middle" attack; someone intercepting your
packets, reading/storing them and resending them onto the
destination. There are of course "man-in-the-middle" methods that
wouldn't alter the TTL value but, as always, security is never
absolute, only incremental. TTL matching could also be used for
network debugging or to find hosts with bad default TTL values.</p>
<p>As a simple example, let's reject all packets from a specific IP
with a TTL of less than 40:</p>
<pre class="code">
-A INPUT -s 1.2.3.4 -m ttl --ttl-lt 40 -j REJECT
</pre>
You can also check for TTL values that are less than
(<code>--ttl-gt</code>) or equal to (<code>--ttl-eq</code>) a
particular value.
<h3>Patching Your Kernel with Patch-O-Matic (POM)</h3>
Some of the newer features introduced in this article are not
considered stable enough by the netfilter development team for
inclusion in the current Linux kernel. To use these you will need
to patch your kernel using a utility called patch-o-matic. This is
not for the faint of heart and I am not going to provide
step-by-step instructions here. I will simply cover patch-o-matic
and provide references to more information.
<p>Patch-o-matic can be downloaded from the netfilter homepage,
<a href="http://www.netfilter.org/">http://www.netfilter.org/</a>.
You will also need the source code for your kernel (if you are
using a kernel supplied with your distribution, install the
<code>kernel-source</code> package or install a new kernel by
downloading the latest kernel source code from <a href=
"http://www.kernel.org/">http://www.kernel.org/</a>) and the source
code for iptables which you can also download from the netfilter
homepage. Once you have these, unpack them and execute the
<code>runme</code> script from patch-o-matic as follows:<br>
<code>$ KERNEL_DIR=&lt;path to the kernel source code&gt;
IPTABLES_DIR=&lt;path to the iptables source code&gt; ./runme
extra</code></p>
<p>The script describes each new extension and asks whether or not
to patch the kernel for it. Once that is finished you will need to
recompile the kernel, the netfilter kernel modules and the iptables
binaries. This is outside the scope of this article but you will
find useful information on the following sites:</p>
<ul>
<li><a href=
"http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO.html">
Netfilter Extensions HOWTO</a></li>
<li><a href=
"http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html">Kernel
Rebuild Guide</a><br>
(<em>this was part of the <a href="http://www.tldp.org/">The Linux
Documentation Project</a> but was removed for review - this is the
latest version from that review process but it is still in
development</em>)</li>
</ul>



</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<p>
<! -- REPLACE THE FOLLOWING WITH AUTHOR'S ~200x200 PIC. -->
<img align="left" alt="[BIO]" src="../gx/authors/odonovan.jpg" class="bio">
<em>

<! -- BIO GOES HERE -->

Barry O'Donovan graduated from the National University of Ireland, Galway
with a B.Sc. (Hons) in computer science and mathematics. He is currently
completing a Ph.D. in computer science with the <a
href="http://www.ihl.ucd.ie/">Information Hiding Laboratory</a>, University
College Dublin, Ireland in the area of audio watermarking.

<p> Barry has been using Linux since 1997 and his current flavor of choice
is Fedora Core. He is a member of the <a href="http://www.linux.ie/">Irish
Linux Users Group</a>. Whenever he's not doing his Ph.D. he can usually be
found supporting his finances by doing some work for <a 
href="http://www.openhosting.ie/" title="An Irish based web hosting and web 
design company">Open Hosting</a>, in the pub with friends or running in the local 
park.
</em>
<br clear="all">
<!-- *** END bio *** -->


<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/odonovan.html">Barry O'Donovan</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="okopnik"></a>
<h1>Laptop review: Averatec 5400 series</h1>
<p id="by"><b>By <A HREF="../authors/okopnik.html">Ben Okopnik</A></b></p>


</b>
</p>


<p>
<h3>Peripatetic Contemplations on the State of Mobile Computing
<em>(a.k.a., How I Shop for Hardware)</em></h3>

<p> I've been looking for a laptop lately. Not just any laptop, but a
backup to my main, do-everything desktop-replacement machine (an Acer
2003WLMi, currently being replaced by Acer with a newer model due to being
a lemon) - which is also a laptop. The larger agenda here, however, is to
also find something to replace the Acer:  The machine itself, though
difficult to configure, works fine with Linux, but the company's tech
support/customer service has been consistently horrible and arrogant to
such a degree that I, with more than 20 years of experience in the computer
business, cannot recall anything equally appalling. So, in actuality, I'm
shopping for two laptops - and what makes the process quite pleasant is
that there's very little time pressure involved.

<p> In my shopping and comparison process, I found a number of Linux
laptop-related sites - all of which list a multitude of machines and the
configuration directions for them. What I found lacking on all of them were
<em>qualified opinions</em>, otherwise known as <strong>reviews</strong>.
Honestly, now - I don't expect a rant (<em>"this thing sucks The Rock of
Gibraltar through a mile of garden hose, and I would torture my worst enemy
by buying him one!"</em>) or an encomium to please the ears of the gods
(<em>"Now shall I sing of a Laptop, Great and Powerful, the sort that is
scarce to be found in the Earth but one which Vulcan himself would proudly
claim as his masterpiece..."</em>) - but basic statements like...

<ul type="circle">
<li> "easy, automatic Fedora installation plus Linux drivers on OEM's website - everything just worked!"
<li> "advanced Linuxers should have no problem with this machine, but newbies may have a difficult time." 
<li> "lots of proprietary hardware; Linux drivers do not exist and won't
unless the vendor changes his mind. Not recommended."
</ul>

...would go a long way toward helping people choose.  I plan to rectify this
with both explicit opinions - and <strong>boy</strong>, have I got a lot of
those! - and a 1-to-10 scale at the end of each of these articles, in the
hope of addressing this problem.

<p> As to my qualifications to do this kind of testing - after wearing out
a number of laptops over the years, I consider myself to be somewhat of a
connoisseur of the breed. Add to this the fact that I've been working on
computer hardware and software since the Elder Days, have a strong
preference for Linux, and possess a lifelong passion for finding out Who,
What, Where, When, Why, and How (and know the methods necessary to get
those answers), and you've got somebody who knows enough to ask the
persnickety questions that the manufacturers don't want asked - and has no
problem asking them. Given all of the above, this is definitely something I
can have fun doing.  Also, living aboard a sailboat as I do - particularly
one not attached to a dock with all those conveniences like shore power and
cable connections but swinging free at anchor, where I have to "make my
own" or do without - I ask quite a lot of my computer equipment; therefore,
I consider this to be an excellent test environment.

<p> <strong>Note:</strong> in this testing, I'm restricting myself to
brands that a) can be bought off the shelf in US stores, and b) have a
no-cost return policy. This rules out Dell, Gateway, and others of their
ilk (I may reconsider after checking their return policies a bit more
carefully, but for the moment, they're out - I'm not up for shipping
hassles.) However, this should still leave plenty to work with - and I plan
to keep hunting until I find something that satisfies me, both in terms of
the quality of the unit itself as well as its ease of configuration and (to
some degree) support under Linux.

<p>Dear readers, I invite your comments and recommendations. If you've got
a laptop that you use with Linux and have found to be easily configurable,
or know of one that fits the above restrictions and you think might be a
good one, please feel free to contact me with your experiences and
suggestions at <img src="../gx/authors/email/okopnik.png">.

<p> Now, let's dive into this first review...

<hr>

<h3>Hardware:</h3>

<ul>
<li><strong>Averatec 5400 series</strong> laptop (available only at Walmart), $999
<li>AMD Athlon XP-M 2800+
<li>40GB hard drive, ATA-100 Ultra-DMA support
<li>512MB DDR memory - 200-pin SDRAM SO-DIMM
<li>15" XGA TFT LCD screen (1024x768x16M colors), S3 UniChrome Pro IGP graphics processor
<li>DVD +/-RW burner
<li>Built-in 802.11g wireless
<li>Ports: VGA, Ethernet, modem, mic, headphone, 4 USB ports
<li>Pointing device: GlidePad touchpad
<li>Weight: ~8 lbs.
</ul>

<h3>OS/Software:</h3>

<ul>
<li>Debian (unstable release ("sid"))
<li>Kernel version: 2.6.8-rc3-bk4
<li>Host type: i386-pc-linux-gnu
<li>Build CC: gcc-3.3
<li>Compiler version: 3.3.4 (Debian 1:3.3.4-6)
</ul>

<h3>First impressions</h3>

When I first looked at this laptop in the store, my immediate take on it
was "simple but solid". This closely matched my idea of a backup laptop,
and given the price - quite good for the included hardware and the visible
quality of fit and finish - this machine seemed to be just what I was
looking for. I inquired about Walmart's return policy (15 days, no
restocking or other charges), had them open the box and hit the "on" button
to make sure I wasn't picking up a dead machine, plunked down my credit
card, and took the box home.

<p> One of the pleasant touches with this machine is that Averatec has
included a nice sturdy laptop carrying bag - not the fanciest thing in the
world, but quite adequate and then some. Conversely, the power supply is
large and heavy - and, as I found out a little later, runs quite hot. Some
laptop buyers may also find themselves at a loss when looking in the box:
laptop, bag, two CDs (Wind0ws XP and Averatec's recovery disc), and the power
supply is <strong>all</strong> they'll find. Oh yeah, there's a "Quickstart
Guide" page - one side of a glossy sheet. No manual (Averatec does provide
a <a href="http://www.averatec.com/customercare/5400dl.htm">PDF</a> of it
on their site along with the Wind0ws drivers), no bubbly "Welcome!" pages
designed by marketing, no cables, no "special offers" - nothing.
Personally, I liked it; some people might be disconcerted.

<h3>Hardware Specifics</h3>

<p> I popped out the HD that came with the machine, slipped in the
Debian-loaded HD that I'd kept when I sent the Acer off to the factory, and
booted up. Here was my first chance to find out what this machine was
<strong>really</strong> made of - the information I needed to make
intelligent buying decisions (which the manufacturers, for some silly
reason, usually hide, with a unanimity that approaches collusion. I've
never understood <em>why</em>.) Well, running "lspci" would expose all.

<pre class="code">
0000:00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 80)
0000:00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
</pre>

The USB system worked "right out of the box". One of the nicer things about
this machine is that it comes with 4 USB ports; considering that there are
very few other ports, this is an absolute necessity. Given that my usual
Net connection is via a USB cable connected to my cell phone, the
no-twiddling, "just works" hookup here made life quite pleasant.

<pre class="code">
0000:00:00.0 Host bridge: VIA Technologies, Inc.: Unknown device 0204
0000:00:00.1 Host bridge: VIA Technologies, Inc.: Unknown device 1204
0000:00:00.2 Host bridge: VIA Technologies, Inc.: Unknown device 2204
0000:00:00.3 Host bridge: VIA Technologies, Inc.: Unknown device 3204
0000:00:00.4 Host bridge: VIA Technologies, Inc.: Unknown device 4204
0000:00:00.7 Host bridge: VIA Technologies, Inc.: Unknown device 7204

0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI bridge [K8T800 South]
0000:00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge

0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge

0000:00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
</pre>

The "internals" - i.e., the resources necessary for the CPU to communicate
with the peripherals - all worked fine, despite the "Unknown device"
messages. In fact, it's been a very long time since I've seen Linux fail to
work well in this area, no matter what strange hardware I've thrown at it.

<pre class="code">
0000:00:09.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller (rev 01)
</pre>

Cardbus and PCMCIA worked out of the box as well; plugging in a CardBus
Ethernet card (a Netgear FA511) worked without a hitch. There's only one
PCMCIA slot, which could be insufficient for some situations - but, again,
given the number of USB slots and the built-in Ethernet port, I could
certainly cope with it.

<pre class="code">
0000:00:0b.0 Network controller: RaLink Ralink RT2500 802.11 Cardbus Reference Card (rev 01)
</pre>

RaLink provides tarballs with compilable source for this 802.11g wireless
LAN card <a href="http://www.ralinktech.com/supp-1.htm">on their website</a>
(well done, people!); however, compiling it required downloading a dozen MB
worth of Qt libraries, which I was not willing to do over a cell-phone
link. "<a href="http://ndiswrapper.sourceforge.net">ndiswrap</a>" once
again (in my experience) proved to be a great alternative in this
situation: I grabbed the source for it, compiled it, downloaded the Wind0ws
drivers, and ran the installation procedure. In the process of doing this,
I learned about "/etc/iftab" and "ifrename", which allow you to remap
interface names; I created the file, entered

<pre>
wlan* mac 00:04:23:72:F5:DC
</pre>

into it (the above being the MAC address of the interface as shown by
"ifconfig"), and - <em>voila!</em> - instead of "eth1", my wireless
interface was named "wlan0" when I brought it up. Unfortunately, I had no
way to test it: it's 802.11g-only, and there are no "g" access points
around here that I know of. However, every other test short of that showed
it to be up and working.

<pre class="code">
0000:00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235/8237 AC97 Audio Controller (rev 50)
</pre>

I compiled "snd_via82xx" as a module - that being what ALSA requires, which
also leaves the system flexible enough to recognize other sound hardware -
and everything came right up. I'll confess that I use "Timidity"
(essentially, a MIDI emulator) for playing MIDI files, so I did not test
that part of the sound system... but it works so well that I stopped caring
a long time ago. MP3s, WAVs, etc., worked fine; dumping AUs into "/dev/dsp"
produced the expected results. The top volume is about 80% of what I'd come
to expect of a laptop, but my "multimedia-enabled" Acer (built-in bass
speaker) has probably spoiled me in this respect.

<pre class="code">
0000:00:11.6 Communication controller: VIA Technologies, Inc. Intel 537 [AC97 Modem] (rev 80)
</pre>

I haven't tested this - I don't have a lot of use for modems these days -
but I'd imagine it works about as well (or as poorly) as any other AC97
(win)modem. There are drivers available for such things; I've used them in
the past. "They work" is about all one can say about them... that's not to
denigrate, in any way, the effort of the Linuxfolk who have put in their
time and effort; rather, it's a simple statement of fact: winmodems
<strong>suck</strong>.

<pre class="code">
0000:00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)
</pre>

Compiling a "via_rhine" module took care of this; "hotplug" automatically
detected it and loaded in on the next boot.

<pre class="code">
0000:01:00.0 VGA compatible controller: VIA Technologies, Inc.: Unknown device 3108 (rev 01)
</pre>

I didn't have any major problems with this, and only a couple of minor
ones. Obviously, this is a relatively new piece of hardware (the "unknown
device" message says that it doesn't have a description in the PCI
database); however, it worked OK "out of the box", at 1024x768 all the way
up to 32bpp. One odd note here is that instead of going blank whenever it
times out, the screen breaks into a weird medley of twitching color blobs
(X and console both) that makes me feel like it's about to blow up at any
second; somewhat unnerving, to say the least. Also - and some people may
find this much more important than I did - I simply could not get DRI/GLX
to work (resulting in relatively slow but still reasonable video rendering
for, e.g., DVD playing. There are also a number of games which will not run
without it.) I've seen <a
href="http://www.ravencode.com/content/article.php?a=averatec">a report</a>
of a successful DRI/GLX configuration for a similar machine with the same
video hardware, but didn't get that far myself. Perhaps it was the fact
that I was uninterested in investing quite that much effort in this area.

<h3>Other features and considerations</h3>

<p> The DVD-RW seems to work fine. I've burned a few CDs on it, and just
popped in a DVD of "Crouching Tiger, Hidden Dragon" to check the "video in"
end; seems OK. I've also mounted and read several data CDs without any
problems.

<p> The keys have good, definite action - unlike the mushy ones on my Acer,
which provides nearly zero feel. The touchpad is OK, if a bit odd -
selection by tapping doesn't follow the standard "word-line-none" cycle,
and there are no multi-finger gestures (i.e., pasting), although using the
buttons works fine. This may be resolvable by configuration, though.

<p> I've never had much luck with sleep or suspend under ACPI; however,
suspend-to-disk works just fine - unless you load the cdc_acm module (used
for USB modems - i.e., my cell phone.) Not this machine's fault, but
something to be aware of; trying to suspend, or even simply unload the
module freezes it solid. This has been so for the entire 2.6 kernel series,
unfortunately. Since this kernel is considered to be experimental, I can't
even submit a bug report unless I join the kernel-developers list.


<h3>Problems</h3>

The battery life in this machine is very poor. I timed it while running X
with a light-to-average load (reduced brightness, three xterms and a
Mozilla window, and doing nothing heavier than editing this article and
reading email in Mutt), and the charge, as reported by ACPI, went from a
high of 97% at 10:45a.m. to 50% at 11:17a.m and 2% at 11:48a.m.  Just as
bad is the fact that the battery takes several hours to recharge if you use
the machine while it's charging. This is not a fault in this specific
unit's battery or charger but seems standard for the model; I've actually
used two of these machines due to an odd concatenation of circumstances,
and both behaved identically.

<p> Other black marks: the 5400 has three fans (at least as reported by
ACPI), with one of them running immediately on startup and a second one
kicking in just seconds later. They are theoretically (hah!) controllable
via ACPI; I have not found it to be so in practice. The status is readable
but is not controllable (despite the fact that I can change the "off"
message for fan #3 to "on" - but cannot change any "on" settings to "off" -
it does nothing.) Moreover, on a warm Florida day (80 degrees Fahrenheit;
my boat has fans but no air conditioning), the machine will often pop up a
"going down now due to thermal overload: 88 degrees C!" (or similar)
message and immediately die, with no time to save or close anything.

<p> The physical design of the machine also has a slight but important
oddity: after carrying it in the bag with the power supply, I found a
number of vertical lines marked on the LCD screen. These went away with
careful cleaning, but made me realize that the distance from the screen
face to the keyboard was inadequate: when there was even a slight pressure
on the top of the machine (back of the screen), the display face pressed
against the keys!  In my estimate, this would wear into the plastic of the
LCD screen after a while - a completely unacceptable result. I suppose you
could retain the acrylic sheet that comes taped onto the display as a
screen protector, but this seems ridiculously makeshift for a brand-new
laptop.

<hr width="50%">

<h3>Final result</h3>

Despite the relative ease of system configuration and general Linuxability
of this machine, several of the factors - particularly the unreasonably
sensitive thermal shutdown (or high internal running temperature), the low
battery charge life, and the long recharge times - made it unusable, or
nearly so, for my purposes. For someone willing to mess around with the
internals of ACPI, or perhaps simply research the issues, some of these may
(or may not) be resolvable and worth the time to do so; for me, the overall
decision was "thumbs down".

<p>
<table align="center" width="80%">
<tr>
<td width="25%"><strong>Linuxability rating:</strong>
</td>
<td width="50%">
<img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star2.png" alt="-"><img src="misc/okopnik/star2.png" alt="-">
</td>
<td><strong>8/10</strong>
</td>
</tr>
<tr>
<td width="25%"><strong>Overall rating:</strong>
</td>
<td width="50%">
<img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star1.png" alt="*"><img src="misc/okopnik/star2.png" alt="-"><img src="misc/okopnik/star2.png" alt="-"><img src="misc/okopnik/star2.png" alt="-"><img src="misc/okopnik/star2.png" alt="-"><img src="misc/okopnik/star2.png" alt="-">
</td>
<td><strong>5/10</strong>
</td>
</tr>
</table>
<p>


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<IMG ALT="picture" SRC="../gx/authors/okopnik.jpg" align="left"  hspace="10" vspace="10" class="bio">
Ben is the Editor-in-Chief for Linux Gazette and a member of The Answer Gang.

<em>
<p>
Ben was born in Moscow, Russia in 1962. He became interested in electricity
at the tender age of six, promptly demonstrated it by sticking a fork into
a socket and starting a fire, and has been falling down technological
mineshafts ever since. He has been working with computers since the Elder
Days, when they had to be built by soldering parts onto printed circuit
boards and programs had to fit into 4k of memory. He would gladly pay good
money to any psychologist who can cure him of the recurrent nightmares.

<p>His subsequent experiences include creating software in nearly a dozen
languages, network and database maintenance during the approach of a
hurricane, and writing articles for publications ranging from sailing
magazines to technological journals. After a seven-year Atlantic/Caribbean
cruise under sail and passages up and down the East coast of the US, he is
currently anchored in St. Augustine, Florida. He works as a technical
instructor for Sun Microsystems and a private Open Source consultant/Web
developer. His current set of hobbies includes flying, yoga, martial arts,
motorcycles, writing, and Roman history; his Palm Pilot is crammed full of
alarms, many of which contain exclamation points.

<p>He has been working with Linux since 1997, and credits it with his complete
loss of interest in waging nuclear warfare on parts of the Pacific Northwest.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/okopnik.html">Ben Okopnik</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="oregan"></a>
<h1>Outliners and Mind mapping</h1>
<p id="by"><b>By <A HREF="../authors/oregan.html">Jimmy O'Regan</A></b></p>


</b>
</p>


<p>
<p>Outlining and mind mapping are two ways of representing
information. Both are useful for brainstorming and note taking
(among other things), but most importantly, both are excellent ways
of organising information. It should come as little surprise that
organising information is important to programmers, and, because
Linux is the operating system of choice for the discerning
programmer, there is a wealth of software available to assist with
these tasks.</p>

<p>I decided recently to get my life in order. Part of this was
accepting that not all self-help material is rubbish. (For as long
as I can remember, my father has been a devoted reader of self-help
-- reader, not follower -- so I've been soured on the whole concept
since my teenage years). Another part is simply organising
myself.</p>

<p>One of the habits I'm trying to break is the habit of keeping
notes on scraps of paper or in <a href=
"misc/oregan/mindmap.txt">random text files</a> scattered around
the place. Outliners and mind maps are useful in the quest to add
context and relationships to these otherwise random pieces of
information, and have been working out well for me so far.</p>

<h3>Outliners</h3>

<p>Outlining is a useful method for both note-taking and
brainstorming. An outline is a list of ideas, which are grouped by
sub-topic in a hierarchy. When writing an outline, only the key
points are used, which are later expanded upon if writing.</p>

<p>The above paragraph as an outline would look something like
this:</p>

<h4>Outlining</h4>

<ul>
<li>Uses:</li>

<li style="list-style: none">
<ul>
<li>Note taking</li>

<li>Brainstorming</li>
</ul>
</li>

<li>What is it?</li>

<li style="list-style: none">
<ul>
<li>List of ideas</li>

<li>Sub-topics</li>

<li>Hierarchy</li>

<li>Key points first</li>

<li>Expanded later</li>
</ul>
</li>
</ul>

<p>Outliners are a type of software that allow the user to write a
document as an outline, to add detail to each point, and to hide
that detail so further points may be added.</p>

<p>Most modern word processors have outline facilities -- the
"Headings" view in OOWriter's "Navigator", for example. Although
there are standalone outliners available, such as <a href=
"http://www.duke.edu/~pat4/think/">Think</a>, the most interesting
outliners around are those for Emacs and Vim.</p>

<h3>Emacs Outline mode</h3>

<img src="misc/oregan/emacs-outline.png" alt=
"XEmacs in Outline mode"> 

<p>Emacs comes with an outline mode. This uses a very simple text
format: headings begin with an asterisk, and any text between
headings is counted as the text belonging to that heading. If the
text of a subheading is folded, this is shown as an ellipsis (...)
after the heading's title. (<a href=
"misc/oregan/emacs-outline.txt">example</a>)</p>

<pre>
* Top Level Heading

** Sub heading

This text will be hidden if the sub-heading is folded.

** Sub heading 2
*** Sub subheading
</pre>

<h3>The Vim Outliner</h3>

<img src="misc/oregan/tvo.png" alt="Vim Outliner"> 

<p><a href="http://bike-nomad.com/vim/vimoutliner.html">The Vim
Outliner</a> is, in my opinion, the best outliner available for
Linux. (However, this is probably because I use Vim as my main
editor: I prefer Emacs, but not after the beating Mandrake gave
it). Like Emacs's outline mode, it uses a simple text format (<a
href="misc/oregan/outlines.otl.txt">example</a>):</p>

<pre>
Top Level
    Sub-heading
    | Text 
    Another sub-heading
        Sub-sub-heading
        | More text
</pre>

<p>Like Emacs's outline mode, TVO allows headings and subheadings
to be folded. (Well, it would have to: otherwise it wouldn't be
much of an outliner). Different heading levels are colour-coded;
it's best to name an outliner file with the extension
<tt>.otl</tt>, so Vim will know to do this.</p>

<p>While reading about outliners on the Net, I found a DOS
outliner, <a href=
"http://www.outliners.com/thinkTank2Pc">ThinkTank</a>, from 1987.
This uses a simple <a href="misc/oregan/thinktank.txt">text
format</a> that is easily <a href=
"misc/oregan/tt2otl.pl.txt">converted</a> for use with Vim
Outliner.</p>

<h3>Mind Mapping</h3>

<p>Mind mapping is a way of representing information developed by
Tony Buzan that takes advantage of several aspects of how the brain
processes information. At its most basic, a mind map is similar to
an outline in tree form -- a tree turned on its side, using roots
as well as branches, but still a tree.</p>

<p>A mind map starts at a central concept. Top-level sub-topics
branch out from that on either side, lower-level branches from
those, and so on. With a paper mind map, when you come to the edge
of the page, you simply glue a new page to that edge and
continue.</p>

<p>So far, not much different to an outline.</p>

<p>An effective mind map makes use of different colours for each
branch: This makes each main sub topic stand out more, and assists
the brain in processing the data. It's also recommended that, where
possible, a mind map should have pictures: "A picture is worth a
thousand words" may be a clich&eacute;, but it's true.</p>

<h3>OPML</h3>

<p>While I'm talking about outliners, I should probably mention <a
href="http://www.opml.org">OPML</a>, which is best known as the
standard format for swapping <a href=
"misc/oregan/feeds.opml.txt">feed subscriptions</a>.</p>

<p>OPML stands for Outline Processor Markup Language. It has a very
simple structure: As with HTML, there are "head" and "body"
sections. Also as with HTML, the head section is used for meta
information -- tags like "title", "dateCreated", "dateModified",
"ownerName", and "ownerEmail" are self-explanatory;
"expansionState" is used to contain a comma-separated list of the
outlines that are expanded by default; "vertScrollState" contains
the number of the line that is to be displayed (after outlines have
been expanded); "windowTop", "windowLeft", "windowBottom", and
"windowRight" are used to set the window state.</p>

<p>In the body section, there is only one tag - "outline", which
can contain other outline tags, for the various levels of headings.
The outline tag can have any attribute, though "text" is common.
Most of these tags are ignored by feed readers, though, because
they mostly look for a link and a title. I've included a <a href=
"misc/oregan/sample.opml.txt">sample</a>.</p>

<p>Vim Outliner comes with a Ruby script that converts OPML to its
own format - I've also included sample output: <a href=
"misc/oregan/feeds.otl.txt">feeds.opml</a>, <a href=
"misc/oregan/sample.otl.txt">sample.opml</a>.</p>

<h3>FreeMind</h3>

<img src="misc/oregan/freemind.png" alt="Freemind"> 

<p><a href=
"http://freemind.sourceforge.net/wiki/index.php/Main_Page">FreeMind</a>
is an open-source mind mapping program. It's written in Java, so it
runs fine on Linux. Freemind has several features that those who
are familiar with mind maps would expect; text and branch colours
may be changed, images may be added to nodes, and there are several
stock icons that can be added to branches or nodes as
mnemonics.</p>

<p>Although the developers say that FreeMind does not create mind
maps exactly according to Tony Buzan's original idea, it's close
enough as far as I remember. It does, however, add some extra
features that are not possible with paper-based mind maps: Branches
and their nodes may have hyperlinks attached to them, and mind maps
can be exported as HTML.</p>

<p><img src="misc/oregan/freemind-graphic.png" alt=
"Mindmap with embedded graphics"></p>

<p>FreeMind is easy to use: To add a node to a branch, press the
'Insert' key, and type. To change a node into a branch..., press
the 'Insert' key. Nodes and branches can be cut and pasted;
individual branches can be exported as HTML as well as the entire
mind map; all options for formatting the node/branch are available
by right-clicking on it. As with an outliner, branches can be
collapsed (or expanded) by pressing "Space", and nodes can be
easily navigated with the arrow keys.</p>

<p>Two things worth mentioning are that inserting a graphic (by
choosing <tt>Node-&gt;Set Graphic</tt> from the context menu, or by
typing <tt>Alt-K</tt>) replaces any text that was in the node; the
other is that you can show that two nodes are related, even if they
are in different branches, by holding <tt>Ctrl-Shift</tt> and
dragging and dropping one node on top of the other. This draws a
line between the two, which happily does not cover the text of any
nodes in the way.</p>

<p>I've included some examples which show how I've used FreeMind --
mostly for summarising information, like when I wanted to find out
about <a href="misc/oregan/SNIA_CIFS.mm.txt">CIFS</a>, or about <a
href="misc/oregan/ComedyWritingSecrets.mm.txt">comedy writing</a>
(though that, in turn, was based on an outline I found on the
Internet), though I also used it to represent the decision-making
process behind my <a href="misc/oregan/Hair.mm.txt">haircut</a>, to
represent <a href="misc/oregan/jimregan-orig.mm.txt">my
bookmarks</a> (see below), and to just have a set of <a href=
"misc/oregan/colours.mm.txt">ridiculous-looking bubbles</a>. I've
also added a second version of <a href=
"misc/oregan/ComedyWritingSecrets-links.mm.txt">comedy writing</a>
that shows the difference having links between different nodes
makes.</p>

<h3>Delicious Mind</h3>

<p>Delicious Mind is a Python script, available <a href=
"http://www.brownhen.com/2004_08_01_backhen.shtml#109162377529043354">
here</a> that converts entries in <a href=
"http://del.icio.us">del.icio.us</a> to a FreeMind mind map. (I've
included a <a href="misc/oregan/delicious_mind.py.txt">local
version</a> that follows del.icio.us's request that scripts
identify themselves, as well as <a href=
"misc/oregan/delicious_rdf.py.txt">my own version</a> that
generates <a href="misc/oregan/jimregan.rdf.txt">rdf</a> -- thanks
are due to <a href="http://www.brownhen.com/">Ian Oeschger</a>, who
for allowing me to publsih my version).</p>

<p>For those who don't know, del.icio.us is an online public
bookmarking system that has superceded the browser's built-in
bookmark facilities for many people. Del.icio.us entries are not
filed in folders like traditional bookmarks; instead, each entry is
tagged with keywords, from which delicious generates a list of
folders.</p>

<p>Del.icio.us also allows users to see who else has bookmarked
each entry, as well as providing folders of popular tags, which
contain items from each user who uses that tag. Del.icio.us also
provides feeds, so people can subscribe to each other's bookmarks.
Items may also be sorted by date, for a particular user, or for all
users, and the main page contains a list of the most recently added
bookmarks.</p>

<p>Del.icio.us provides a public API so people can easily access
and manipulate their own bookmarks from scripts. Delicious mind
takes advantage of this; it takes a list of tags, which are then
defined as second level branches, and populates them with nodes of
each bookmark in that category. (XML fans can rejoice: del.icio.us
sends its information as a simple XML format that can easily be
processed with some <a href="../106/oregan2.html#xsl">simple
xsl</a>).</p>

<p>As well as providing a way of visualising your bookmarks, this
can be coupled with FreeMind's HTML export to maintain a local copy
of your del.icio.us bookmarks -- like all popular Web sites,
del.icio.us tends to suffer occasional periods of down time. (Have
a look at the <a href="misc/oregan/jimregan.mm.html">HTML
export</a> of <a href="misc/oregan/jimregan.mm.txt">this file</a>
compared with the <a href=
"misc/oregan/delicious.html">del.icio.us</a> version).</p>


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2004/authors/oregan.jpg" class="bio">
<em>
Jimmy has been using computers from the tender age of seven, when his father 
inherited an Amstrad PCW8256. After a few brief flirtations with an Atari ST
and numerous versions of DOS and Windows, Jimmy was introduced to Linux in 1998
and hasn't looked back.

<p> Jimmy is a father of one, a techno-savvy seven year-old called Mark. 
When he isn't cutting pieces off himself at work, he likes to play guitar and
read -- not normally at the same time, but the picks make handy bookmarks.

<p> Jimmy likes to collect the off-topic threads that crop up on The Answer
Gang's mailing list, mainly because it's a good excuse for keeping these
threads going.

<p> Jimmy is currently job hunting.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/oregan.html">Jimmy O'Regan</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="oregan2"></a>
<h1>Screen scraping with Perl</h1>
<p id="by"><b>By <A HREF="../authors/oregan.html">Jimmy O'Regan</A></b></p>


</b>
</p>


<p>
<p>
Screen scraping is a relatively well-known idea, but for those who are not
familiar with it, the term refers to the process of extracting data from a 
website. This may involve sending form information, navigating through the
site, etc., but the part I'm most interested in is processing the HTML to
extract the information I'm looking for. 

<p>
As I mentioned in my <a href="oregan.html">article about outliners</a>, I've
been organising myself recently, and as part of that process of organisation
I've been writing several screen scrapers to reduce the amount of browsing
I do: repeatedly visiting news sites to see if they have been updated is a 
waste of anyone's time, and in these times of <a 
href="../105/oregan2.html">feed readers</a>, it's even less tolerable. 

<p>
<a href="http://liferea.sourceforge.net">Liferea</a>, my feed reader of 
choice, has a facility to read a feed generated by a command, and I have been
taking advantage of this facility. As well as reducing the amount of time
I spend reading the news from various sources, this also allows me to keep
track of websites I wouldn't normally remember to read.

<h3>Perl</h3>

<p>
In my article about feed readers I mentioned <a 
href="http://rssscraper.rubyforge.org/">RSSscraper</a>, a Ruby-based 
framework for writing screen scrapers. As much as I like RSSscraper, I've
been writing my screen scrapers in Perl. Ruby looks like a nice language,
but I find Perl's regexes easier to use, and <a 
href="http://www.cpan.org">CPAN</a> is filled with convenient modules to do
just about everything you can think of (and many more things you'd probably
never think of).

<p>
Most of my screen scrapers use regexes, mainly because Perl's regexes were
haunting me: there was a something I just wasn't grasping, and I wanted to
push past it (and I have, and now I can't remember what the block was :).
There are much better ways to write screen scrapers: Perl has modules like
WWW::Mechanize, HTML::TokeParser, etc., that make screen scraping easier.

<h3>Using regexes</h3>

<p>
First of all, here's a list of scrapers:

<ul>
<li><a href="misc/oregan/bill-bailey.pl.txt">bill-bailey.pl.txt</a>:
<a href="http://www.bill-bailey.co.uk/">Bill Bailey</a> is a British comedian, 
whose <a href="http://www.bill-bailey.co.uk/blog/index.php">blog</a> lacks
any sort of feed.</li>
<li><a href="misc/oregan/mmoore.pl.txt">mmoore.pl.txt</a>: <a 
href="http://www.michaelmoore.com/">Michael Moore</a> doesn't really need an 
introduction. His <a 
href="http://www.michaelmoore.com/words/diary/index.php">blog</a> is also
feedless.</li>
<li><a href="misc/oregan/sun-bizarre.pl.txt">sun-bizarre.pl.txt</a>,
<a href="misc/oregan/sun-viral.pl.txt">sun-viral.pl.txt</a>:
I read <a href="http://www.thesun.co.uk">The Sun</a>. There, I admitted it. I 
work in a factory, and it's good to keep up with the news that everyone else 
reads, but mostly it's because I like looking at pictures of scantily clad 
women. [shrug]. I also have <a 
href="misc/oregan/sun-pic.pl.txt">sun-pic.pl.txt</a>, which allows me to
bypass The Sun's annoying popups.</li>
<li><a href="misc/oregan/telsa.pl.txt">telsa.pl.txt</a>: <a 
href="http://www.linux.org.uk/~telsa/">Telsa</a>, wife of Alan Cox, keeps one
of the most interesting <a 
href="http://www.linux.org.uk/~telsa/Diary/diary.html">diaries</a> on the 
'net</li>
<li><a href="misc/oregan/tp.pl.txt">tp.pl.txt</a>: Grabs a list of Terry
Pratchett's Usenet posts from <a href="http://groups.google.com">Google
Groups</a> (Google does provide an API, but Google Groups isn't currently
available).</li>
<li><a href="misc/oregan/uf.pl.txt">uf.pl.txt</a>: Grabs the latest 
<a href="http://www.userfriendly.org">Userfriendly</a> comic strip.</li>
</ul>

<p>
Most of the scrapers work in exactly the same way: fetch the page using 
LWP::Simple, split the page into sections, and extract the blog entry from 
each section. <tt>sun-pic.pl</tt> is a dirty hackish attempt to bypass
popups, and The Sun's horrible site's tendency to crash Mozilla. It's
called with the address of the page, grabs the images from the popups, 
and puts them in a specific directory. It's not meant to be useful to anyone 
else, other than as an example of a quick and dirty script that's different
from the other examples here. If you're interested, read the comments in
the script.

<p>
I'll use Telsa's diary as an example, because the page layout is clear, 
and the script I wrote is one of the better examples (I'd learned to use
the <code>/x</code> modifier for clarity in regexes by then).

<pre>
   &lt;dt&gt;&lt;a name="2004-10-25"&gt;&lt;strong&gt;October 25th&lt;/strong&gt;&lt;/a&gt;&lt;/dt&gt;
   &lt;dd&gt;
    &lt;p&gt;
      <em>[Content]</em>
    &lt;/p&gt;
   &lt;/dd&gt;
</pre>

<p>... and so on. 

<p> Each entry starts with <code>&lt;dt&gt;</code>, so I use that as the 
point at which to split. From each entry, I want to grab the anchor name,
the title (between the <code>&lt;strong&gt;</code> tags), and everything
that follows, until the <code>&lt;/dd&gt;</code> tag.

<p> The script looks like this:

<pre class="code">
#!/usr/bin/perl -w

use strict;
use XML::RSS;
use LWP::Simple;
use HTML::Entities;

my $rss = new XML::RSS (version =&gt; '1.0');
my $url = &quot;http://www.linux.org.uk/~telsa/Diary/diary.html&quot;;
my $page = get($url);

$rss-&gt;channel(title       =&gt; &quot;The more accurate diary. Really.&quot;,
              link        =&gt; $url,
              description =&gt; &quot;Telsa's diary of life with a hacker:&quot; 
	      		     . &quot; the current ramblings&quot;);

foreach (split ('&lt;dt&gt;', $page))
{
	if (/&lt;a\sname=&quot;
             ([^&quot;]*)     # Anchor name
             &quot;&gt;
             &lt;strong&gt;
             ([^&gt;]*)     # Post title
             &lt;\/strong&gt;&lt;\/a&gt;&lt;\/dt&gt;\s*&lt;dd&gt;
             (.*)        # Body of post
             &lt;\/dd&gt;/six)
	{
		$rss-&gt;add_item(title       =&gt; $2,
			       link        =&gt; &quot;$url#$1&quot;,
		       	       description =&gt; encode_entities($3));
	}
}

print $rss-&gt;as_string;
</pre>

<p>
Most of the scrapers follow this general recipe, but the Michael Moore 
and Terry Pratchett scrapers have two important differences.

<p> Michael Moore's blog, unlike most blogs, has the links for each item on a
separate part of the page from the content that's being scraped, so I have
a function to scrape the content again for the link: 

<pre class="code">
sub findurl ($$)
{
	my $title = shift;
	my $pagein = shift;
	if ($pagein =~ /&lt;a href=&quot;(index.php\?id=[^&quot;]*)&quot;&gt;$title&lt;\/a&gt;/i)
	{
		return &quot;http://www.michaelmoore.com/words/diary/$1&quot;;
	}
}
</pre>

<p> It's important to have a unique URL for each item in a feed, because most 
feed readers use the link as a key, and will only display one entry for each
link. 

<p> The Terry Pratchett scraper is also different, in that instead of using
LWP::Simple, it uses LWP::Agent. Google wouldn't accept a request from my
script, so I used LWP::Agent to masquerade as a browser:

<pre class="code">
my $ie=&quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)&quot;;

my $ua = LWP::UserAgent-&gt;new;
$ua-&gt;agent($ie);
my $url = &quot;http://groups.google.com/groups?safe=images&amp;as_uauthors=Terry%20Pratchett&amp;lr=lang_en&amp;hl=en&quot;;
my $response = $ua-&gt;get ($url);

if ($response-&gt;is_success) 
{
	<em>[scrape as usual]</em>
}
else 
{
	die $response-&gt;status_line;
}
</pre>

<p> (The content of the page is held in <code>$response-&gt;content</code>).

<p> One thing I'm still looking at is getting the news from <a 
href="http://www.thesun.co.uk/section/0,,2,00.html">The Sun</a>. The problem
with this page is that it has some of the worst abuses of HTML I've ever seen.
This snippet uses HTML::TableExtract to extract most of the headlines. 

<pre class="code">
use LWP::Simple;
use HTML::TableExtract;

my $html_string = get (&quot;http://www.thesun.co.uk/section/0,,2,00.html&quot;);
my $te = new HTML::TableExtract(depth =&gt; 6);
$te-&gt;parse($html_string);
foreach $ts ($te-&gt;table_states) 
{
	print &quot;Table found at &quot;, join(',', $ts-&gt;coords), &quot;:\n&quot;;
	foreach $row ($ts-&gt;rows) 
	{
		print join(',', @$row), &quot;\n&quot;;
	}
}
</pre>

<p> HTML::TableExtract is a nice module that lets you extract the text 
content of any table. The "depth" option allows you to select a depth of 
tables within other tables (the page grabbed by this script has most of its 
headlines at a depth of 6 tables within tables, but there are others at a 
depth of 7 -- I think I'll come back to that one). You can also specify a
"count" option to tell it which table to extract from, or a "headers" option,
which makes the module look for columns with those headers.

<p> Lastly, I'd like to take a look at HTML::TokeParser::Simple. If I had 
known about this module when I started writing screen scrapers, they would
be a lot easier to understand, and more resiliant to change. The scraper for
Telsa's diary, for example, will break if the <code>&lt;a&gt;</code> tag
has a <code>href</code> attribute as well as a <code>name</code> attribute.

<p> HTML::TokeParser::Simple is, as the name implies, a simplified version
of HTML::TokeParser, which allows you to look for certain tags within a
file. HTML::TokeParser::Simple gives a number of methods with a prefix of
either "is_" or "return_" that tell you if a tag is a certain type or returns
it, respectively. HTML::TokeParser::Simple also inherits from 
HTML::TokeParser, so it has full access to HTML::TokeParser's methods.

<p> The Telsa scraper using HTML::TokeParser::Simple looks like this (<a 
href="misc/oregan/telsa-2.pl.txt">text version</a>):

<pre class="code">
#!/usr/bin/perl -w

use strict;
use XML::RSS;
use LWP::Simple;
use HTML::Entities;
use HTML::TokeParser::Simple;

my $rss = new XML::RSS (version =&gt; '1.0');
my $url = &quot;http://www.linux.org.uk/~telsa/Diary/diary.html&quot;;
my $page = get($url);
my $stream = HTML::TokeParser::Simple-&gt;new(\$page);
my $tag;

$rss-&gt;channel(title       =&gt; &quot;The more accurate diary. Really.&quot;,
              link        =&gt; $url,
              description =&gt; &quot;Telsa's diary of life with a hacker:&quot; 
	      		     . &quot; the current ramblings&quot;);

while ($tag = $stream-&gt;get_token)
{
	next unless $tag-&gt;is_start_tag ('a');
	next unless $tag-&gt;return_attr(&quot;name&quot;) ne &quot;&quot;;
	my $link = $tag-&gt;return_attr(&quot;name&quot;);
	$tag = $stream-&gt;get_token;
	next unless $tag-&gt;is_start_tag ('strong');
	$tag = $stream-&gt;get_token;
	my $title = $tag-&gt;as_is;
	$tag = $stream-&gt;get_token;
	next unless $tag-&gt;is_end_tag ('/strong');
	$tag = $stream-&gt;get_token;
	next unless $tag-&gt;is_end_tag ('/a');
	$tag = $stream-&gt;get_token;
	next unless $tag-&gt;is_end_tag ('/dt');
	$tag = $stream-&gt;get_token;
	#We've got whitespace; on to the next tag
	$tag = $stream-&gt;get_token;
	next unless $tag-&gt;is_start_tag ('dd');
	my $content = &quot;&quot;;
	$tag = $stream-&gt;get_token;
	until ($tag-&gt;is_end_tag('/dd'))
	{
		$content .= $tag-&gt;as_is;
		$tag = $stream-&gt;get_token;
		next;
	}
	$rss-&gt;add_item(title       =&gt; $title,
		       link        =&gt; &quot;$url#$link&quot;,
	       	       description =&gt; encode_entities($content));
}

print $rss-&gt;as_string;
</pre>

<p> This is more verbose than necessary, but does the same thing as the
regex version. A better version would use HTML::TokeParser's 
<code>get_tag</code> method (<a href="misc/oregan/telsa-3.pl.txt">text</a>):

<pre class="code">
#!/usr/bin/perl -w

use strict;
use XML::RSS;
use LWP::Simple;
use HTML::Entities;
use HTML::TokeParser::Simple;

my $rss = new XML::RSS (version =&gt; '1.0');
my $url = &quot;http://www.linux.org.uk/~telsa/Diary/diary.html&quot;;
my $page = get($url);
my $stream = HTML::TokeParser::Simple-&gt;new(\$page);
my $tag;

$rss-&gt;channel(title       =&gt; &quot;The more accurate diary. Really.&quot;,
              link        =&gt; $url,
              description =&gt; &quot;Telsa's diary of life with a hacker:&quot; 
	      		     . &quot; the current ramblings&quot;);

while ($tag = $stream-&gt;get_tag('a'))
{
	next unless $tag-&gt;return_attr(&quot;name&quot;) ne &quot;&quot;;
	my $link = $tag-&gt;return_attr(&quot;name&quot;);
	$tag = $stream-&gt;get_tag ('strong');
	$tag = $stream-&gt;get_token;
	my $title = $tag-&gt;as_is;
	$tag = $stream-&gt;get_tag ('dd');
	my $content = &quot;&quot;;
	$tag = $stream-&gt;get_token;
	until ($tag-&gt;is_end_tag('/dd'))
	{
		$content .= $tag-&gt;as_is;
		$tag = $stream-&gt;get_token;
		next;
	}
	$rss-&gt;add_item(title       =&gt; $title,
		       link        =&gt; &quot;$url#$link&quot;,
	       	       description =&gt; encode_entities($content));
}

print $rss-&gt;as_string;
</pre>

<p> There are plenty of other modules for manipulating HTML: a <a 
href="http://search.cpan.org">CPAN search</a> gave me 7417 results! 

<p> If you're hungry for more, I recommend reading these articles from
<a href="http://perl.com/">Perl.com</a>: <a 
href="http://www.perl.com/pub/a/2001/11/15/creatingrss.html">Create RSS 
channels from HTML news sites</a> and <a 
href="http://www.perl.com/pub/a/2003/01/22/mechanize.html">Screen-scraping 
with WWW::Mechanize</a>. As a parting shot, I've also included a <a 
href="misc/oregan/moz2del.pl.txt">script</a> that generates <a 
href="http://del.icio.us">del.icio.us</a>-like XML from a Mozilla bookmark 
file: watch out for next month's Linux Gazette to find out what it's for!

</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2004/authors/oregan.jpg" class="bio">
<em>
Jimmy has been using computers from the tender age of seven, when his father 
inherited an Amstrad PCW8256. After a few brief flirtations with an Atari ST
and numerous versions of DOS and Windows, Jimmy was introduced to Linux in 1998
and hasn't looked back.

<p> Jimmy is a father of one, a techno-savvy seven year-old called Mark. 
When he isn't cutting pieces off himself at work, he likes to play guitar and
read -- not normally at the same time, but the picks make handy bookmarks.

<p> Jimmy likes to collect the off-topic threads that crop up on The Answer
Gang's mailing list, mainly because it's a good excuse for keeping these
threads going.

<p> Jimmy is currently job hunting.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/oregan.html">Jimmy O'Regan</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="park"></a>
<h1>Bash Shell and Beyond</h1>
<p id="by"><b>By <A HREF="../authors/park.html">William Park</A></b></p>


</b>
</p>


<p>

<h2>Series Introduction</h2>

<p> In this monthly series, I will try to expose the power of the Bash shell.  In
particular, the readers will be introduced to <a
    href="http://freshmeat.net/projects/bashdiff/">Bash.Diff</a>
which is a collection of my patches incorporating many ideas from Ksh, Zsh, Awk,
Python, and other languages.

<p> Each article will focus on one theme or feature, which is not normally
thought of in shell context.  I will also make liberal use of shell functions,
standard builtins, dynamically loadable builtins, and advanced features patched
into Bash, in a format that can be easily sourced and maintained.


<h2>string.sh</h2>

<p> In C, &lt;string.h&gt; defines strcat(3), strcpy(3), strlen(3), and
strcmp(3) for string concatenation, copy, size, and test operations
respectively.  Such basic operations are needed constantly when programming in
any language, and shell scripting is no exception.


<h3>strcat() and strcpy()</h3>

For string copy and concatenation, you would do something like
<pre>
    a=abc
    a=${a}'123'			# a=abc123
</pre>
in shell.  This is simple variable assignment.  However, you can't have variable
reference on the left-hand side (LHS) of '='.  You have to either type the
LHS variable name explicitly as above, or use <tt>eval</tt>, as in
<pre>
    x=a
    eval "$x=abc"
    eval "$x=\${$x}'123'"
</pre>
to parse the "..." expressions twice.  It quickly becomes painful to call
<tt>eval</tt> all the time, especially when the variable names are parsed from a
file or a string.

<p> What is needed is a shell version of C functions strcat(3) and strcpy(3) which
can be called with equal ease and simplicity.  So, here they are:
<pre>
    strcat ()		# var+=string
    {
	local _VAR=$1 _STRING=$2 _a _b

	case $#.$3 in
	    2.) ;;
	    3.*:*) _a=${3%:*} _b=${3#*:}
		set -- `python_to_shell_range "$_a" "$_b" ${#_STRING}`
		_STRING=${_STRING:$1:$2}
		;;
	    *)  echo "Usage: strcat var string [a:b]"
		return 2
		;;
	esac
	eval "$_VAR=\${$_VAR}\$_STRING"
    }

    strcpy ()		# var=string
    {
	local _VAR=$1 _STRING=$2 _a _b

	case $#.$3 in
	    2.) ;;
	    3.*:*) _a=${3%:*} _b=${3#*:}
		set -- `python_to_shell_range "$_a" "$_b" ${#_STRING}`
		_STRING=${_STRING:$1:$2}
		;;
	    *)  echo "Usage: strcpy var string [a:b]"
		return 2
		;;
	esac
	eval "$_VAR=\$_STRING"
    }
</pre>
where 'var' is the name of variable you want to use to store the result.  The
above example, then, becomes
<pre>
    x=a
    strcpy $x abc		# a=abc
    strcat $x 123		# a+=123
</pre>


<h3>strlen()</h3>

<p> In C, strlen(3) gives you the size of a string.  In the shell, you would use
parameter expansion (i.e., <code>${#var}</code>):
<pre>
    a=abc123
    echo ${#a}			# 6
</pre>
Here is a shell version of C function strlen(3):
<pre>
    strlen ()		# echo ${#string} ...
    {
	for i in "$@"; do
	    echo ${#i}
	done
    }
</pre>
which has the additional ability of accepting multiple strings, e.g.
<pre>
    strlen abc123 0123456789		# 6 10
</pre>


<h3>strcmp()</h3>

<p> To compare two strings for equality, you use strcmp(3) in C.  In shell, you
would do something like
<pre>
    [ $a = abc123 ]
</pre>
Here is a shell version of C function strcmp(3):
<pre>
    strcmp ()		# string == string
    {
	local _STRING1=$1 _STRING2=$2 _a _b
      
	case $#.$3 in
	    2.) ;;
	    3.*:*) _a=${3%:*} _b=${3#*:}
		set -- `python_to_shell_range "$_a" "$_b" ${#_STRING1}`
		_STRING1=${_STRING1:$1:$2}
		set -- `python_to_shell_range "$_a" "$_b" ${#_STRING2}`
		_STRING2=${_STRING2:$1:$2}
		;;
	    *)  echo "Usage: strcmp string1 string2 [a:b]"
		return 2
		;;
	esac
	[ "$_STRING1" == "$_STRING2" ]
    }
</pre>
so that the above example becomes
<pre>
    strcmp $a abc123
</pre>


<h3>Python-style [a:b] substring</h3>

<p> Extracting substrings is another common operation.  In the shell, you would use
parameter expansion (i.e., <code>${var:a:n}</code>), where 'a' is starting index and 'n' is the
number of characters to extract.  So,
<pre>
    b=0123456789
    echo ${b:0:3} ${b: -3} ${b:1:${#b}-2}
</pre>
will print the first 3 chars, the last 3 chars, and all chars except the first and
the last, respectively.

<p> The main problem with this syntax is that 'n' is a relative number starting at
index 'a'.  Usually, absolute index is more convenient, not only because it's
more natural, but also because that's the way it is in C. Python has syntax
var[a:b], where 'a' and 'b' are indexes which can be positive, negative, or
omitted.  Although it's roughly equivalent to ${var:a:b-a} in shell, missing 'a'
and 'b' means the beginning and the end of string, and negative index means
offset from the end of string.

<p> The above shell functions strcat(), strcpy(), and strcmp() already support
Python-style [a:b] format, provided you source an internal function.
<pre>
    # string[a:b] --&gt; ${string:a:n}
    #
    # Convert Python-style string[a:b] range into Shell-style ${string:a:n} range,
    # where
    #	0 &lt;= a &lt;= b &lt;= size  and  a + n = b
    #
    python_to_shell_range ()
    {
	local -i size=$3
	local -i b=${2:-$size}
	local -i a=${1:-0}

	if [ $# -ne 3 ]; then
	    echo "Usage: python_to_shell_range a b size"
	    return 2
	fi

	[[ a -lt 0 ]] &amp;&amp; a=$((a+size))
	[[ a -lt 0 ]] &amp;&amp; a=0
	[[ a -gt size ]] &amp;&amp; a=$size

	[[ b -lt 0 ]] &amp;&amp; b=$((b+size))
	[[ b -lt 0 ]] &amp;&amp; b=0
	[[ b -gt size ]] &amp;&amp; b=$size
	[[ b -lt a ]] &amp;&amp; b=$a

	echo $a $((b-a))
    }
</pre>
to convert Python range to shell range.  It's not user-serviceable, but you can
try it out:
<pre>
    python_to_shell_range '' 3 10		# 0 3
    python_to_shell_range -3 '' 10		# 7 3
    python_to_shell_range 1 -1 10		# 1 8
</pre>
Now, you can specify a substring for strcat(), strcpy(), and strcmp() using
Python-style [a:b] range as the third parameter, like this:
<pre>
    b=0123456789
    strcpy x $b :3		# x=012
    strcpy y $b -3:		# y=789
    strcpy z $b 1:-1		# z=12345678
    echo $x $y $z
</pre>


<h3>Chaining of tests</h3>

<p> strcmp() tests two strings for equality.  When there is a chain of 2 or more
binary tests, like 'a &lt; c &gt; b' or '1 -lt 3 -gt 2', you have to break it up
and test each pair:
<pre>
    [[ a &lt; c ]] &amp;&amp; [[ c &gt; b ]]
    [ 1 -lt 3 ] &amp;&amp; [ 3 -gt 2 ]
</pre>
This breaks up the flow of your code, not to mention being error-prone.  Here is
a shell function which enables you to simply write down the chains on
command-line:
<pre>
    testchain ()		# string OP string OP string ...
    {
	if [ $# -lt 3 ]; then
	    echo "Usage: testchain string OP string [OP string ...]"
	    return 2
	fi
	while [ $# -ge 3 ]; do
	    test "$1" "$2" "$3" || return 1
	    shift 2
	done
    }
</pre>
where 'OP' is any binary operator accepted by <tt>test</tt> command.  You use it
much like <tt>test</tt> command:
<pre>
    testchain a '&lt;' c '&gt;' b
    testchain 1 -lt 3 -gt 2
</pre>


<h3>Summary</h3>

The source code for the 6 shell functions listed in this article is also available
from <a href="http://home.eol.ca/~parkw/string.sh">string.sh</a>.  To use it,
just source it,
<pre>
    . string.sh
</pre>

In the next article, we'll see how strcat(), strcpy(), strlen(), and strcmp()
shell functions can be written in C and compiled as builtin commands.
And <em>that</em> will be the first introduction to my patched Bash shell.
:-)


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<p>
<img align="left" alt="[BIO]" src="../gx/2002/note.png" class="bio">

<!-- 
If the author has sent his pic, save it to the right directory
and enable the line below.

<img align="left" alt="[BIO]" src="../gx/authors/pic.jpg" class="bio">

-->

<em>

I learned Unix using the original Bourne shell.  And, after my
journey through language wilderness, I have come full-circle
back to shell.  Recently, I've been patching features into Bash,
giving other scripting languages a run for their money.

Slackware has been my primary distribution since the beginning,
because I can type.  In my toolbox, I have Vim, Bash, Mutt, Tin,
TeX/LaTeX, Python, Awk, Sed.  Even my shell command line is in
Vi-mode.

</em>
<br clear="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/park.html">William Park</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="park1"></a>
<h1>Setting the Clock on Linux</h1>
<p id="by"><b>By <A HREF="../authors/park.html">William Park</A></b></p>


</b>
</p>


<p>
<h3>Background</h3>

<p> There are 3 protocols dealing with time: NTP (port 123), Time (port
37), and Daytime (port 13).  If you're connecting to the Internet
periodically, then synchronizing your clock when you dial up or from
crontab is good enough. This applies also to most Linux machines at home or
at work, even if they are connected all the time. Here is a short tutorial
on how to set your clock using these 3 protocols.

<p>
First, you need reference servers to obtain the time from. In Canada,
<ul>
    <li> tick.utoronto.ca	-- NTP (2)	(Toronto)
    <li> tock.utoronto.ca	-- NTP (2)	(Toronto)
    <li> time.nrc.ca		-- NTP (2), Time
    <li> time.chu.nrc.ca	-- NTP (2), Time
</ul>
and in the US, 
<ul>
    <li> time.apple.com		-- NTP (2)
    <li> time.windows.com	-- NTP (2)
    <li> time.nist.gov		-- NTP (1), Time, Daytime (Colorado)
    <li> time-nw.nist.gov	-- NTP (1), Time, Daytime (Microsoft, Washington)
    <li> time-a.nist.gov	-- NTP (1), Time, Daytime (Maryland)
    <li> time-b.nist.gov	-- NTP (1), Time, Daytime (Maryland)
</ul>
where the number after NTP indicates stratum level of server.  Primary NTP
(stratum 1) servers are reserved for secondary (stratum 2) NTP servers and
should not be used by end users. Of course, you should try to use servers
close to you.

<p>
The time you see displayed is the CMOS clock time corrected by the drift in
/etc/adjtime, so
<pre>
    hwclock --adjust
    hwclock --hctosys
</pre>
should be done at boot. Once running, the system clock can be set by any
one of the four following methods:
<ol>
    <li> NTP (port 123)
<pre>
    ntpdate time.nrc.ca time.apple.com time.windows.com
</pre>

    <li> Time (port 37)
<pre>
    netdate time.nrc.ca time.nist.gov time-nw.nist.gov
</pre>

    <li> Daytime (port 13)
<pre>
    set -- `nc time.nist.gov 13`
    date -u --set="$2 $3"
</pre>

    <li> Wall Clock
<pre>
    date --set="16:24:30"
</pre>
</ol>
On shutdown, set the CMOS clock with
<pre>
    hwclock --systohc
</pre>
which will update /etc/adjtime.


<h3>rc.clock</h3>

<p>
You can wrap it up as <tt>/etc/rc.d/rc.clock</tt>, with something like
<pre>
    #! /bin/sh

    [ -x /sbin/hwclock ] || exit 1

    case $1 in 
	start)
	    echo "Setting system time from hardware clock."
	    /sbin/hwclock --adjust
	    /sbin/hwclock --hctosys
	    ;;
	stop)
	    echo "Saving system time to hardware clock."
	    /sbin/hwclock --systohc
	    ;;
	sync)
	    /usr/sbin/ntpdate time.nrc.ca time.apple.com time.windows.com
	    ;;
	*)
	    echo "Usage: $0 {start|stop|sync}"
	    ;;
    esac
</pre>
Then, you can call 
<ul>
    <li> <tt>/etc/rc.d/rc.clock start</tt> on boot,
    <li> <tt>/etc/rc.d/rc.clock sync</tt> when you dialup, and
    <li> <tt>/etc/rc.d/rc.clock stop</tt> on shutdown.
</ul>


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<p>
<img align="left" alt="[BIO]" src="../gx/2002/note.png" class="bio">

<!-- 
If the author has sent his pic, save it to the right directory
and enable the line below.

<img align="left" alt="[BIO]" src="../gx/authors/pic.jpg" class="bio">

-->

<em>

I learned Unix using the original Bourne shell.  And, after my
journey through language wilderness, I have come full-circle
back to shell.  Recently, I've been patching features into Bash,
giving other scripting languages a run for their money.

Slackware has been my primary distribution since the beginning,
because I can type.  In my toolbox, I have Vim, Bash, Mutt, Tin,
TeX/LaTeX, Python, Awk, Sed.  Even my shell command line is in
Vi-mode.

</em>
<br clear="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/park.html">William Park</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="seymour"></a>
<h1>Design Awareness</h1>
<p id="by"><b>By <A HREF="../authors/seymour.html">Mark Seymour</A></b></p>


</b>
</p>


<p>
<h3>Type casting</h3>

<p> The display of text is so common that we rarely think about it, until something goes wrong. In spite of automated spell-checkers, typos [typographical errors, commonly misspelled words] still appear in newspapers and advertising, and poorly constructed sentences are rife, even in literate journals.

<p> Yet the proper display of words is more than just the use of correct spelling and grammar, and carefully lining up paragraphs, one above another. The choice of font is crucial to giving your words their proper meaning, but rarely do we see the 'perfect' font used for anything other than an art book. Even the gamut of fonts typically loaded into a web design program, as limited as it might appear relative to the thousands (if not tens of thousands) of fonts available in print, is rarely fully utilized.

<p> A paragraph in one font can seem quite different than in another. We'll use a portion of our trusty Gettysburg Address to illustrate the difference:

<p> <img src="misc/seymour/monospace.png" title="Gettysburg address in monospace">

<p> <img src="misc/seymour/verdana.png" title="Gettysburg address in verdana">

<p> <img src="misc/seymour/cursive.png" title="Gettysburg address in cursive">

<p> <img src="misc/seymour/serif.png" title="Gettysburg address in serif">

<p> This shows how the space occupied by the same words changes with the font, along with the 'feel' of the words themselves; the cursive font, of course, mimics the original handwritten Address, but even just the addition of serifs (the little flat bits at the ends of the letters, for those who didn't take graphic design in college) renders the words more 'antique' in feel.

<p> Size and style and color, as well, change our response to a given word or phrase. The simple word <i>fire</i>, set in the same font as the rest of the paragraph, hardly rates a second look, even in italics. But change a few attributes, and you can't miss it:

<div align="center">
<p> <font size="+7" color="#ff3300"><b>Fire!</b></font>
</div>

<p> Without context we don't know if you're being urged to leave the building because of an incendiary incident in another room, ordered to launch artillery into the next jurisdiction, or required to separate a member of your department from their paycheck, but at least it's a start. Note that, by moving it into the center of the line, we've also changed it from merely a very large line of red text into what appears to be a headline of some sort. The reader's natural expectation would be that this paragraph should have some connection to or explanation of what, exactly, this <i>fire</i> thing is all about. When playing with type, remember that you're also playing with the preexisting assumptions of your audience; give them a typographic cue that conflicts with the associated information, and they can either shake their heads (literally as well as figuratively) in bewilderment, or click out of your site in irritation. Break visual conventions if you dare, but determine the consequences before you put them where the world can see them.
		
<p> While columns or grids are the natural layout form in nearly all printed materials, the web has only recently been made column-friendly, and it's still far more difficult to prepare and reliably display multi-column pages in HTML than in print. (See last month's column for an in-depth analysis of the use of grid.) The single column web page is by far the most common form seen on the Internet, but even here there is a wide variety.
		
<p> The worst possible column structure is one wide column. Many websites are guilty of this, some of them designed by agencies and designers experienced enough to know better. (The Linux Gazette itself, for one, though it's constrained by the need to be compatible with text-only browsers and the visually impaired using text-to-speech translators.) It's easy and it's fast, but it's still wrong. The single wide column is a bad thing because of human eyesight and perception: our eyes and brain are wired to scan large sweeps of landscape and pick up moving targets, whether prey or threat. Focusing on long lines of minute bits of information, while possible, isn't what we're evolved to handle. It's why the monks transcribing religious texts in the Middle Ages went blind, why the accountants of Dickens' time wore glasses, and why your eyes hurt after staring at the computer screen all day.
		
<p> We process the visible world by both broad and subtle eye movements; holding our eyes still is unnatural. Stare at any single word on this screen for only a few moments, and notice how the text around it becomes unreadable. Yet move your eyes rapidly along a line of text, and even the words you're scanning are unreadable. It's not that you don't <i>see</i> the letters, it's that your brain can't process them into understandable words fast enough to keep up with your eyes. We see words by recognizing the shapes of groups of letters, rather than parsing them individually; that's why we can play the mind games of turning the internal letters of words around (the sheap of wrods bieng moer improtnat tahn teh acutal lettre oredr) or even obscuring the letters themselves (ax hxppxns whxn thx lettxrs in illxmxnatxd sixns go out). Note that it's easier to read words that have lost or misplaced their vowels rather than their consonants; that's because vowels all have the same height and general shape (aeiou), where consonants occupy more of the line space (bdfghjklpqty) and have more varied shapes (cmnrsvwxz).
		
<p> So what happens when you scan a long line length? Your brain loses its place. Your eyes get lost in the letter shapes, and often move up or drop down a line. Then your brain can't follow the word order, and the reading process comes to a halt. You have to restart farther back, where you can remember the words you're seeing, and try again.
		
<p> Let's look at some examples of how line length affects readability, again using Lincoln's words (though I've held the paragraphs to four lines to save space):
		
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation, so conceived, and so dedicated, can long endure.
		<blockquote>
			
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation, or any nation, so conceived...
			<blockquote>
				
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation...
				<blockquote>
					
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. Now we are engaged in a great...
					<blockquote>
						
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
						<blockquote>
							
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated...
							<blockquote>
								
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived...
								<blockquote>
									
<p> Four score and seven years ago our fathers brought forth...
								</blockquote>
							</blockquote>
						</blockquote>
					</blockquote>
				</blockquote>
			</blockquote>
		</blockquote>
		
<p> One of these paragraphs is the best readable length for the font size displayed on your screen; given all of the variables in OS and browsers, I couldn't possibly pick which one is the 'right' length. But just because highly technical text is commonly displayed using long lines and poetry is displayed with short ones, don't assume that either is 'correct'; pick the right length for your eye, no matter the subject matter.
		
<p> Another variable that affects readability is the alignment of the paragraphs themselves. Flush left, for non-Hebrew or -Arabic readers, is the most common alignment, with flush right used frequently for emphasis, while more than a few centered lines rapidly become confusing to the eye:
		<blockquote>
			
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
			<div align="right">
				
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
			</div>
		</blockquote>
		<div align="center">
			<blockquote>
				
<p> Four score and seven years ago our fathers brought forth, upon this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
			</blockquote>
		</div>
		
<p> Justified text, where the paragraphs are flush along both left and right edges with space added between words to make them so (as in newspapers and most magazines), can readily contribute to poor readability as line lengths gets longer; the lack of variability in the placement of the line endings makes keeping your place even harder. I would show you the difference, but HTML hasn't figured out how to easily make justified lines yet...

<p class="editorial">[ Actually, HTML 4.0 (and possibly earlier versions as well) specifies &lt;p align="justify"&gt; as one of the options. -- Ben ]

<p> Font size (along with the font itself) plays a huge role in how many characters can be displayed in the line, and thus the proper line length to use:
		
<p><img src="misc/seymour/sizes.png" title="Various font sizes">

<p> Just as many lines of the largest type would be hard to read, even a single line of the smallest would be impossible without a magnifier. (On the web, of course, you can cheat and rely on the magnification abilities of the browser, but it's not a pleasant way to read a page.)

<p> Many design books offer the 'right' number of characters to use in a given line, but the right number is the one that looks right. A particular font, in a particular weight and style and color, on a particular background (a color or pattern can seriously alter readability) will have its own proper character count for the perfect line. How often can you achieve perfection? Rarely. But you have to strike the proper balance, where the readability is high yet the text fits the available space. There's nothing worse than getting to the bottom of a page, whether print or web, and having words left over.

<p> Here are some URLs for sites that handle line lengths (column widths in the print world, tables or block indents in HTML) in very different ways; some of them handle it with CSS structures, and some with straight single columns. Use them to determine how you want to display the text in your next project:

<p><a href="http://www.mcsweeneys.net">http://www.mcsweeneys.net</a>
<p><a href="http://www.state.gov/secretary/rm/37487.htm">http://www.state.gov/secretary/rm/37487.htm</a>
<p><a href="http://www.nasm.si.edu/exhibitions/current.cfm">http://www.nasm.si.edu/exhibitions/current.cfm</a>
<p><a href="http://www.seal.com/bio/index.cfm">http://www.seal.com/bio/index.cfm</a>
<p><a href="http://www.stanford.edu">http://www.stanford.edu</a>
<p><a href="http://www.stevenseagal.com/aikido.html">http://www.stevenseagal.com/aikido.html</a>
<p><a href="http://www.caymanislands.co.uk/to_do/watersports.asp">http://www.caymanislands.co.uk/to_do/watersports.asp</a>
<p><a href="http://www.bartonpartners.com/BA_Links/BACareers.html">http://www.bartonpartners.com/BA_Links/BACareers.html</a>
<p><a href="http://www.fordvehicles.com/fordgt/bulletin_detail.asp?type=news&id=1">http://www.fordvehicles.com/fordgt/bulletin_detail.asp?type=news&amp;id=1</a>
<p><a href="http://www.britishairways.com/travel/baggag/public/en_gb?prim=custsupp">http://www.britishairways.com/travel/baggag/public/en_gb?prim=custsupp</a>
<p><a href="http://www.albinmarine.com/40cutter/40cutter.html">http://www.albinmarine.com/40cutter/40cutter.html</a>
<p><a href="http://www.nytimes.com">http://www.nytimes.com</a>


</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<p>
<img align="left" alt="[BIO]" src="../gx/authors/seymour.jpg" width="200" height="200" class="bio">

<em>
<p> I started doing graphic design in junior high school, when it was still
the Dark Ages of technology. Bill Gates and Steve Jobs were both eleven
years old, and the state of the art was typing copy on Gestetner masters.
I've worked on every new technology since, but I still own an X-acto knife
and know how to use it.

<p> I've been a freelancer, and worked in advertising agencies, printing
companies, publishing houses, and marketing organizations in major
corporations. I also did a dozen years [1985-1997] at Apple Computer; my
first Macintosh was a Lisa with an astounding 1MB of memory, and my current
one is a Cube with a flat screen.

<p> I've had a website up since 1997, and created my latest one in 2004. I'm
still, painfully, learning how web design is different from, but not
necessarily better than, print.

</em>
<br clear="all">
<!-- *** END bio *** -->


<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/seymour.html">Mark Seymour</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="youngman"></a>
<h1>An Introduction to JSPWiki</h1>
<p id="by"><b>By <A HREF="../authors/youngman.html">Neil Youngman</A></b></p>


</b>
</p>


<p>
<h2>The good, the bad, and the wiki?</h2>
<h3>Wikis</h3>
<p>In this article I explain what a Wiki is and how it is used, for
those readers who haven't come across Wikis before. I discuss why I
chose JSPWiki from the hundreds of Wikis out there, and I explain
how I set it up.</p>
<p>Wiki is a short form of WikiWikiWeb. Wikis are collaboratively
authored Web sites that are created and edited by their users.
Wikis provide a quick and simple way of generating a set of linked
Web pages. The emphasis is on collaboration and simplicity. Anyone
can contribute and it doesn't take long to get started.</p>
<p>According to <a href=
"http://www.jspwiki.org/Wiki.jsp?page=OneMinuteWiki">"One-Minute
Wiki"</a> WikiWiki is Hawaiian and means "quick".</p>
<p>Wikis can be used almost like a bulletin board to share
information and ask questions, but there is no concept of boards or
thread, just a set of interlinked pages.</p>
<p>Collaborative authoring means that pages aren't owned by any one
author. If you spot a mistake on a page, you can correct it there
and then and of course other people can correct your pages.</p>
<p>There are all sorts of uses for Wikis. They can be used anywhere
you need to share information among a large group of people. I have
seen them used for informal documentation within a development
project, question and answer sessions and even <a href=
"http://wikipedia.org">a collaboratively written encyclopedia</a>.
I also sometimes keep a set of notes on my Wiki, allowing me to
access them easily from multiple locations and share them with
anyone else that needs the same information.</p>
<p>Typically there is an edit option on each page, which allows a
user to alter the page and a simple convention for creating links
to another page. To create a new page, you just create a link and
that link allows you to edit the page.</p>
<p>You don't have to learn HTML to create and edit Wiki pages.
Instead, there are a set of simple conventions, e.g., in JSPWiki,
you create a new link simply by enclosing a phrase in square
brackets.</p>
<pre>
    [New Link]
</pre>
<p>Unfortunately, these conventions are not standardised, so, if
you use more than one Wiki, you may have to learn more than one set
of formatting conventions.</p>
<p>To try out a Wiki why not go to the <a href=
"http://www.jspwiki.org/Wiki.jsp?page=SandBox">JSPWiki Sandbox</a>
or take a look at <a href=
"http://en.wikipedia.org/wiki/Main_Page">Wikipedia</a>, a
collaboratively authored encyclopedia.</p>
<h3>Why JSPWiki?</h3>
<p>When I wanted to set up a Wiki for myself, I looked around and I
found that there are hundreds of <a href=
"http://c2.com/cgi/wiki?WikiClones">WikiClones</a> to choose from.
Many of them are still pre-release and I wanted something that
would be stable, reliable, easy to install, setup and use. JSPWiki
provides all of this plus authentication, version control,
attachments, and plugins.</p>
<h3>Ease Of Use</h3>
<p>Wikis are designed for ease of use, so this should not be a
major issue with any Wiki. The main differences in ease of use come
from choosing a mature and stable Wiki with simple formating
rules.</p>
<p>JSPWiki's mark up language seems relatively clear and simple to
me. Links are created simply by putting square brackets around the
link name. Headers can be created by putting an exclamation mark at
the start of the line and tables by dividing up the text with with
pipe characters. So, for example:</p>
<pre>
!!! This is an example

which links to [The Linux Gazette|http://linuxgazette.net]

and shows 

! a table

|plate|knife|fork
|mat|glass|cup

</pre>
<p>comes out looking like</p>
<h2><a name="section-SandBox-ThisIsAnExample" id=
"section-SandBox-ThisIsAnExample">This is an example</a></h2>
<p>which links to <a class="external" href=
"http://linuxgazette.net">The Linux Gazette</a><img src=
"http://www.jspwiki.org/images/out.png" class="outlink" alt=""></p>
<p>and shows</p>
<h4><a name="section-SandBox-ATable" id="section-SandBox-ATable">a
table</a></h4>
<table class="wikitable" border="1">
<tr>
<td>plate</td>
<td>knife</td>
<td>fork</td>
</tr>
<tr>
<td>mat</td>
<td>glass</td>
<td>cup</td>
</tr>
</table>
<p>JSPWiki can also be configured to allow people to enter HTML,
but this is strongly discouraged as insecure.</p>
<h3>Installation and Configuration</h3>
<p>Ease of installation was a big plus for JSPWiki. If you have a
suitable Java servlet container already installed, installation on
Red Hat is very simple. Jakarta Tomcat was set up on the machine I
wanted to use. Installation was a simple matter of creating a
directory called mywiki in the Tomcat webapps directory, unpacking
JSPWiki.war and JSPWiki-samplepages.zip in that directory, editing
the configuration file, and restarting Tomcat.</p>
<pre>
    mkdir /usr/local/jakarta-tomcat-5.0.19/webapps/mywiki
    pushd /usr/local/jakarta-tomcat-5.0.19/webapps/mywiki
    /usr/local/j2sdk1.4.2_04/bin/jar xvf JSPWiki.war
    unzip ~neily/JSPWiki/JSPWiki-samplepages.zip
    emacs -nw /usr/local/jakarta-tomcat-5.0.19/webapps/mywiki/WEB-INF/jspwiki.properties
    mkdir /usr/local/jakarta-tomcat-5.0.19/webapps/mywiki/attached
    /usr/local/jakarta-tomcat-5.0.19/bin/catalina.sh start
</pre>
<p>The configuration file is
webapps/mywiki/WEB-INF/jspwiki.properties; this is well commented,
so configuration is simple.</p>
The configuration was a simple matter of changing 3 or 4 settings
in jspwiki.properties. The comments in this file are generally
pretty clear and most of the settings can be left unchanged.
Properties you should set are jspwiki.applicationName,
jspwiki.pageProvider, jspwiki.fileSystemProvider.pageDir,
jspwiki.attachmentProvider,
jspwiki.basicAttachmentProvider.storageDir,
<p>Installation on other Linux versions may not be as simple. I
later installed JSPWiki on a Debian machine, and found that,
although installation with apt-get was very simple, it wouldn't run
outside the default directory without more configuration.</p>
<p>To get it to work on Debian in a directory called mywiki, I had
to create the file /var/lib/tomcat4/webapps/mywiki.xml, which was
an edited copy of /var/lib/tomcat4/webapps/jspwiki.xml.</p>
<h3>Authentication</h3>
<p>JSPWiki provides a simple authentication mechanism. This can be
supplemented by authentication methods available from the servlet
container under which it runs.</p>
<p>As I was setting up a Wiki on a small private network,
authentication was unlikely to be an issue, but choosing a Wiki
with support for authentication allows it to be added later if the
Wiki is abused or we wish to set up an external Wiki.</p>
<p>Setting up basic authentication in JSPWiki should be simple. Add
the lines</p>
<pre>
  jspwiki.authenticator = FileAuthenticator
  jspwiki.fileAuthenticator.fileName = /path/to/passwords.txt
</pre>
<p>and create the passwords.txt file, which will look something
like</p>
<pre>
  # The format is simply username = password
  # No encryption is used currently.
  # Comments are allowed; prepend with hash.
  user1 = pass1
  user2 = pass2
</pre>
<p>If you need more sophisticated authorisation look at the
<a href="http://www.jspwiki.org/Wiki.jsp?page=AuthorizationAndAuthenticationHOWTO">
Authorization And Authentication HOWTO</a> and the <a href=
"http://www.jspwiki.org/Wiki.jsp?page=AuthPlugin">Auth Plugin</a>.
If you still haven't found anything that meets your requirements,
you could consider writing your own <a href=
"http://www.jspwiki.org/Wiki.jsp?page=Authenticator">Authenticator</a>
or using the authentication provided by your servlet container,
e.g., Tomcat.</p>
<h3>Version Control</h3>
<p>Version control is a useful feature, which stores each version
of a page as it is updated. This allows you to restore pages which
are lost or damaged. JSPWiki supports RCS-based version control and
also implements its own mechanism as an alternative for platforms
without RCS.</p>
<p>This does not appear to be a well documented feature, but is
fairly easy to use. Every time you save a change to a page, a new
version is stored. There is "more info" link at the bottom of each
page, which provides a link to previous versions of the page. You
can select any previous version, which is then displayed, with a
message explaining that it is not the current version of the page
and a "restore this page" link.</p>
Version control is particularly important on a publicly accessible
Wiki. These can be defaced with advertising and worse. Version
control allows you to easily revert to an undamaged page.
<p>To use RCS-based version control set jspwiki.pageProvider =
RCSFileProvider and jspwiki.fileSystemProvider.pageDir =
/path/to/dir/for/RCS/files</p>
<h3>Attachments</h3>
<p>JSPWiki allows you to attach files to a page. This can be a good
mechanism for sharing documents. If you refer to a large document,
or a document in a non-text format, attaching it to the page
ensures that it is accessible to your readers.</p>
<p>To use attachments set jspwiki.attachmentProvider =
BasicAttachmentProvider and
jspwiki.basicAttachmentProvider.storageDir =
/path/to/dir/for/attached/files.</p>
<h3>Plugins</h3>
<p>JSPWiki can be extended with the use of plugins. JSPWiki plugins
are written in Java, like JSPWiki itself. If you don't want to
<a href="http://www.jspwiki.org/Wiki.jsp?page=WritingPlugins">write
your own</a>, take a look at <a href=
"http://www.jspwiki.org/Wiki.jsp?page=ContributedPlugins">the
plugins that have already been contributed</a>.</p>
<h3>Using JSPWiki</h3>
<p>Using JSPWiki is dead simple. Once you've got it installed and
setup with all the features you want to use, just go to the main
page, set up some links to new pages, and edit them. Voila, you
have a Wiki. Start off with a page describing who the Wiki is for
and what you want to achieve with it, then let your imagination run
riot.</p>

</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<p>
<img align="left" alt="[BIO]" src="../gx/authors/youngman.jpg" class="bio">

<em>

<p> Neil is a programmer, specialising in C++ on Unix and Linux. He has degrees
in Computer science and Next Generation Computing.

<p> Neil has worked on a wide range of systems from the control system for the
British Gas national grid to video servers for the Home Choice video on
demand service. He first programmed computers in 1980 with his school
General Studies class, which was allowed access to a mainframe at The
National Institute of Oceanography, programmed in Fortran on punch cards.

<p> A computer science degree followed at Queen Mary College, London, then Neil
worked for Logica for 3 years before taking an MSc in New Generation
Computing at Exeter University.

<p> The next 5 years saw Neil researching parallel simulation algorithms at the
Royal Signals and Radar Establishment, initially on transputers and
subsequently on SPARC based parallel systems. Since leaving RSRE, Neil has
mostly worked freelance and has worked on financial data feeds, video
servers and virus scanning proxies.

<p> Neil first used Unix at college in 1982 and started working on Linux in
1996.

<p> As of May 2004, Neil is working for Wirefast a global messaging company.

<p> Outside of computing, Neil is into motor sport, particularly Formula 1, the
World Rally Championship and the British Touring Car Championship. He
doesn't race himself. If you've seen Neil's driving, you'll understand why.

</em>
<br clear="all">
<!-- *** END bio *** -->



<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/youngman.html">Neil Youngman</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


<div class="content lgcontent">

<a name="lg_laundrette"></a>
<h1>The Linux Laundrette</h1>
<p id="by"><b>By <A HREF="../authors/oregan.html">Jimmy O'Regan</A></b></p>


</b>
</p>


<p>
<ul>
<li><a href="#laundrette.links">Links</a></li>
<ul>
<li><a href="#laundrette.halloween">Halloween</a></li>
<li><a href="#laundrette.oom">Out of Memory</a></li>
<li><a href="#laundrette.russiansvsms">Anti-Microsoft bias in classical Russian poetry</a></li>
</ul>
<li>Spam</li>
<ul>
<li><a href="#spam.jokes">Spam Jokes</a></li>
<li><a href="#spam.cute">Spam cuteness</a></li>
<li><a href="#spam.again">Again, regarding your request. Please reply.</a></li>
</ul>
<li><a href="#laundrette.succinct">Succinctly put...</a></li>
<li><a href="#laundrette.gremlins">Gremlins</a></li>
<li><a href="#laundrette.netiquette">Netiquette</a></li>
<li><a href="#laundrette.laptops">Laptop Juggling</a></li>
<li><a href="#laundrette.pipe">The Crack Pipe</a></li>
<li><a href="#laundrette.gouranga">Gouranga</a></li>
<li><a href="#wacko.guns">Wacko Topic: Guns &amp; Crime</a></li>
<ul>
<li><a href="#laundrette.fighting">Peaceful chat about fighting</a></li>
<li><a href="#laundrette.haircut">Jimmy's haircut</a></li>
<li><a href="#laundrette.trolling">Bobbing for apples, trolling for traffic...</a></li>
<li><a href="#laundrette.blackmail">Guns and Blackmail</a></li>
</ul>
<li><a href="#laundrette.nuclearjava">Java should not be trusted with nukes, Microsoft says</a></li>
<li><a href="#laundrette.moreandmore">More of... everything, really</a></li>
<li><a href="#laundrette.recursion">Recursion</a></li>
<li><a href="#laundrette.system">Getting the system out of your system</a></li>
<li><a href="#laundrette.standard">Standard</a></li>
<li><a href="#laundrette.c_loops">C Loops</a></li>
<li><a href="#laundrette.lottery">TAG Lottery</a></li>
<li><a href="#laundrette.procmail">Procmail</a></li>
<li><a href="#laundrette.english_words">English words appearing in the 20th century</a></li>
<li><a href="#laundrette.post_hurricane">Post-hurricane news</a></li>
</ul>

<p>
This month's Laundrette is somewhat generated (w00t!) using a silly
sed script. I don't think there are too many problems with this, and it has
certainly made compiling this easier.

<p>
One thing that every group of people I have had anything to do with has had
in common is a healthy collective sense of humour, and an appreciation for
the surreal. (I don't think I need to point out that the group of LG regulars
who have been mercilessly quoted here are no exception, but I guess I just
did). 
 
<blockquote>
<strong>[Dave Blackburn]</strong>
I appreciate your reply -- and so fast.

<p>
<strong>[Ben]</strong>
[grin] It happens sometimes, around here. Other times, nobody will say
anything until someone makes a comment a week down the road, and then -
oh, brother, take cover! We've been known to wander from rhubarb to US
history, taking a detour into European supermarkets and Cockney rhyming
slang along the way... but we usually get the question answered. Some
way or another.
</blockquote>

<p>
Because the off-topic threads tend to spawn other off-topic
threads, I've changed the format a little. Hopefully this will work out
better, as trying to find a way to show the different reply levels has been
a headache.

<p>
This means that the 'wacko topics' aren't cleanly separated from the humourous
messages: though I probably could move them around, I think it gives a bit
more of an insight into how our (twisted) minds work. Whether or not that's
a good thing is best judged in hindsight.

<p>
It does mean that our in-jokes are a little more transparent to any
unsuspecting newcomer; we can just throw out a link, and all is explained.
That's pretty important to us, because here at LG, the party is open to all
comers (just bring your own beer). 

<p>
(That said, I'm tempted to throw in something baffling: monkeys, toasters,
squid, school uniforms, tractors. A few of my co-workers should be in tears
of laughter by now :)

<a name="laundrette.links"></a>
<h3>Links</h3>

<p>
Danny O'Brien has been writing a column called "To Evil!". If you haven't been
reading it, you should start: '"To Evil!"'s house rule #1 states that 
corporations don't wreak evil; people wreak evil. Blaming Microsoft for doing 
bad is a bit like smacking your aluminum siding whenever your housemates 
steals some toast. No-one feels guilty, no-one gets blamed. You just hurt your 
hand.'

<p>
<a href="http://osdir.com/Article1765.phtml">Evil of September 2004</a><br>
<a href="http://osdir.com/News+index-catid-207.phtml">Index of Evil</a><br>
<a href="http://osdir.com/backend2.php?cat=207">RSS feed</a>

<p>
After last month's <a 
href="../107/lg_laundrette.html#laundrette.grocers">thread about 
"Grocer's"</a>, there was a similar thread on <a 
href="news:alt.fan.pratchett">afp</a> that pointed to the 
<a href="http://www.apostrophe.fsnet.co.uk/">Apostrophe Protection Society</a>
as well as <a href="http://kylet.co.uk/pictures/grocer/">these photos</a>.

<p>
Found while digging through my bookmarks:
<a href="http://parody.organique.com/">False Advertising - A Gallery 
of Parody</a>.

<p>
Why you shouldn't <a href="misc/laundrette/moz.png">use images hosted on
someone else's site</a> (at least, without their permission).

<p> 
Probably a bit late for Hallowe'en, but here's the <a 
href="http://whatis.techtarget.com/definition/0,,sid9_gci1018265,00.html">
Halloween Geek Test</a>, and a printable <a 
href="http://www.forbes.com/static_html/halloween/gates.shtml?partner=yahoo">
mask</a> to let you scare everyone you know!

<p>
<a href="misc/laundrette/halloween.jpg">Speaking of Hallowe'en...</a>

<p>
For some on-topic humour, try the <a 
href="http://humorix.org/articles/2004/10/sco-game/">SCO drinking game</a>, or
find out <a href="http://www.newsforge.com/article.pl?sid=04/10/30/1322227">What
your choice of Linux distribution says about you</a>.

<p>
This month, we've got some links that other TAGsters sent. Enjoy.
<hr width="60%">

<p>
<strong>[Brian]</strong>
I love this comic! Too bad about the site's expired digital
certificate, though  :-( 

<p>
<a href="https://secure.linuxports.com/TUX/">https://secure.linuxports.com/TUX/</a>

<p>
It's terrible that the author hasn't drawn any new releases since
2002, though - I would have loved to have seen how it was supposed to
end...
<hr width="60%">

<p>
<strong>[Sluggo]</strong>
<a href="http://www.azcentral.com/arizonarepublic/local/articles/1001hydrocar01.html">Solar 
truck</a>  made by high-school physics teacher.  It has a hydrogen fuel cell,
but it can also switch to conventional petrol power from the dashboard.

<p>
<a href="http://science.slashdot.org/science/04/10/07/1629200.shtml?tid=126&amp;tid=134">
Slashdot comments</a>, including the history of alternative car research at
the high school (in Phoeniz AZ).

<hr width="60%">
<a name="laundrette.halloween"></a>
<h3>Halloween</h3>

<blockquote><em>[
This was sent privately, but it has to be shared, what with Halloween
being so close to the publishing date, and the idiocy involved
]</em></blockquote>

<p>
<strong>[Sluggo]</strong>
<a href="http://seattlepi.nwsource.com/local/196371_spookban22.html">
http://seattlepi.nwsource.com/local/196371_spookban22.html</a><br>
Puyallup school district bans most Halloween symbols, says they might
offend Wiccans, for whom Halloween is a religious holiday and some of whom
are witches.

<blockquote><em>[
A few days later...
]</em></blockquote>

<p>
<strong>[Sluggo]</strong>
<a href="http://seattlepi.nwsource.com/opinion/196878_hallowed.html">
http://seattlepi.nwsource.com/opinion/196878_hallowed.html</a><br>
Wiccans protest the ban against halloween costumes!
One site calls it, "The grinch who stole Halloween."<br>
<a href="http://www.iamawitch.com/article.php?story=20041021215234185&amp;query=grinch">
http://www.iamawitch.com/article.php?story=20041021215234185</a><br>
"Despite a public appeal Monday night, school officials said the ban stands and
that kids who show up in costumes may be sent home." 
 
<hr width="80%">
 
<a name="laundrette.oom"></a>
<h3>Out of Memory</h3>

<p>
<strong>[Sluggo]</strong>
<a href="http://lwn.net/Articles/104179/">http://lwn.net/Articles/104179/</a>
Linux's overcommitting of memory compared to an airline flying with just
barely enough fuel for the average situation.

<p>
<strong>[Brad]</strong>
Hmmmmm.

<p>
I'd pay money to watch people get forcibly ejected from a plane  ;) 

<p>
<strong>[Ben]</strong>
For a closely-related demonstration, run "swapoff" on your machine and
fire up Gimp, Mozilla, and a kernel compile. Should make a nice 'whOOM'
sound.  :) 

<p>
<strong>[Sluggo]</strong>
 
It sounds like you've done this before.

<p>
<strong>[Ben]</strong>
Not me! It was, um, a friend.

<p>
<strong>[Thomas]</strong>
No -- you have that all wrong. Don't look at seeing how much RAM
processes waste, just try running KDE and keep <u>adding</u> more RAM until
it runs at a speed that is useable.  :)  [1]

<p>
[1] This is known as the OverLooking Other Memory.

<p>
<strong>[Ben]</strong>
 
Once you've satisfied KDE's memory requirements (and the truck from the
memory vendor's has left), everything else will run without a hitch -
even your infinite loops will compute in one-tenth their usual time.

<p>
<strong>[Heather]</strong>
I've got a 90Mb gimp file with um... a <b>lot</b> of layers, that just might do
it on its own.  But if you really want to do damage, have moz surf some
javascript developer archives and explore the working examples.  (Whether
they actually work is immaterial.)  That oughta do it.  K isn't required 
to play this game.  

<p>
But it kertainly helps...

<hr width="80%">
<a name="laundrette.russiansvsms"></a>
<h3>Anti-Microsoft bias in classical Russian poetry</h3>

<p>
<strong>[Ben]</strong>
You woudn't <u>think</u> it could happen, but...

<p>
Someone on anekdot.ru (a Russian humor site) noted that "bez okon, bez
dverey" - a line from Pushkin's famous description of Baba Yaga's hut -
can be translated as "no Wind0ws, no Gates".

<blockquote><em> [ 
<a href="http://www.oldrussia.net/baba.html">This page</a> has a overview
of Baba Yaga.
] </em></blockquote>

<p>
<strong>[Brad]</strong>
Creepy. I wonder if the author of that was a Russian cousin of Nostradamus...

<hr width="80%">
<a name="spam.jokes"></a>
<h3>Spam: Spam Jokes</h3>

<p>
A group was touring London, marveling at the historic buildings, art 
collections, and such. The group included people from many countries. During 
the tour of the Tower of London, a man from Prague and another man from 
Athens struck up a conversation about some point in history.

<p>
A small disagreement ensued, which rapidly became a large one. They decided 
to settle the matter then and there using the historical accouterments at 
hand. Donning armor and chain mail, they prepared for a battle to the death. 
This attracted the attention of the rest of the tour group, who crowded 
around for a better look. Inasmuch as the combatants were in period dress, 
the people couldn't tell one from another.

<p>
"Is that the Czech wearing the armor?" asked one tourist. "No," replied another, 
"The Greek is in the armor. The Czech is in the mail."
<hr width="60%">

<p>
I got a new car radio yesterday. It has voice recognition. You shout "soul" 
and it plays a soul station. You shout "rock" and it finds rock and roll for 
you. You shout "country" and it finds country music.

<p>
I was enjoying this new technology when some children ran in front of my car, 
causing me to swerve at the last second. I yelled out: "F&amp;**king kids!"

<p>
And my radio started playing Michael Jackson songs
<hr width="60%">

<p>
"Send someone over quickly!" the old woman screamed into the phone. "Two 
naked men are climbing towards my bedroom window!"

<p>
"This is the Fire Department, lady," the voice replied. "I'll have to 
transfer you to the Police Department."

<p>
"No, it's YOU I want!" she yelled. "They need a longer ladder!" 
<hr width="60%">

<p>
The CIA had an opening for an assassin.

<p>
After all of the background checks, interviews, and testing were done there 
were three finalists - two men and one woman. For the final test, the CIA 
agents took one of the men to a large metal door and handed him a gun.

<p>
"We must know that you will follow your instructions, no matter what the 
circumstances. Inside this room you will find your wife sitting in a chair. 
You have to kill her." The first man said. "You can't be serious. I could 
never shoot my wife." The agent replies, "Then you're not the right man for 
this job."

<p>
The second man was given the same instructions. He took the gun and went into 
the room. All was quiet for about five minutes. Then the agent came out with 
tears in his eyes. "I tried, but I can't kill my wife." The agent replies, 
"You don't have what it takes. Take your wife and go home."

<p>
Finally, it was the woman's turn. Only she was told to kill her husband. She 
took the gun and went into the room. Shots were heard, one shot after another. 
They heard screaming, crashing, banging on the walls. After a few minutes, 
all was quiet. The door opened slowly and there stood the woman. She wiped the 
sweat from her brow and said, "You guys didn't tell me the gun was loaded with 
blanks. So I had to beat him to death with the chair." 

<hr width="60%">

<p>
A young blonde was on vacation in the depths of Louisiana. She wanted a pair 
of genuine alligator shoes in the worst way, but was very reluctant to pay 
the high prices the local vendors were asking.

<p>
After becoming very frustrated with the "no haggle" attitude of one of the 
shopkeepers, the blonde shouted, "Maybe I'll just go out and catch my own 
alligator so I can get a pair of shoes at a reasonable price!"

<p>
The shopkeeper said, "By all means, be my guest. Maybe you'll luck out and 
catch yourself a big one!" Determined, the blonde turned and headed for the 
swamps, set on catching herself an alligator.

<p>
Later in the day, the shopkeeper was driving home, when he spotted the young 
woman standing waist deep in the water, shotgun in hand. Just then, he saw a 
huge 9-foot alligator swimming quickly toward her. She took aim, killed the 
creature, and with a great deal of effort hauled it on to the swamp bank. 
Lying nearby were several more of the dead creatures. The shopkeeper watched 
in amazement. Just then the blonde flipped the alligator on its back, and 
frustrated, shouts out, "Damn it, this one isn't wearing any shoes either!"

<hr width="60%">

<p>
Two blondes were going to Disneyland when they came to a fork in the road. The 
sign read: "Disneyland Left."

<p>
So they went home. 

<hr width="80%">
<a name="laundrette.succinct"></a>
<h3>Succinctly put...</h3>

<p>
<strong>[Brian]</strong>
...thus someone named Robert becomes the brother of my parent.
<hr width="80%">
<a name="laundrette.gremlins"></a>
<h3>Gremlins</h3>
<blockquote><em>[
Those damned <a href="../107/lg_laundrette.html#svn">Gremlins</a> are at it
again.
]</em></blockquote>

<p>
<strong>[Ben]</strong>
<pre>
It may well be that the bad experience I've had was due to that
particular unit and not the make/model/flavor/serial number/gremlin that
                                                            ^^^^^^^
</pre>

<p>
<strong>[Jimmy]</strong>
<pre>
I'll say no more... for now. Remember - no bright lights, no water, and don't 
                                                             ^^^^^
feed them after midnight. 
</pre>

<p>
<strong>[Ben]</strong>
I think you've spotted the problem. <b>That's</b> why there are always
gremlins on boats!

<p>
"Ve are gremlins/From ze Kremlin..."
 -- from a wonderful WWII Warner Brothers cartoon

<p>
<strong>[Jimmy]</strong>
Aha. Water makes them multiply. D'oh -- I've got the theme music from the 
movies stuck in my head now.
<hr width="80%">
<a name="laundrette.netiquette"></a>
<h3>Netiquette</h3>

<p>
<strong>[Ben]</strong>
<pre>
On Wed, Sep 29, 2004 at 02:13:16AM +0000, Muhammad Firdaus Muhammad Firdaus wrote:

&gt; To whom it may concern,
</pre>

<p>
Let's see - you've sent your email to:

<blockquote><em>[
Several people
]</em></blockquote>

<p>
Thanks for spamming me along with everyone else you could think of. I'm
sure other people will treat your "request" with the same amount of
individual attention you've shown in making it.

<p>
I'll quote someone who's made the point more calmly, politely, and
pleasantly than I presently care to (full credit to Rick Moen. Well
said, sir.):

<hr width="60%">

<p> 
(You cross-posted your request for help to multiple newsgroups, or
mailing lists.)

<p>
I was going to help you, until I noticed your cross-post. Now, I'll
spend that time assisting someone else, who's not being a pain in the
ass.

<p>
A large and growing number of otherwise helpful people are ignoring you
in exactly this way. Watch and see. Unlike most, I'm taking the trouble
(through referring you to this text) to tell you what's going on.

<p>
I could advise you to avoid cross-posting because it's rude to the
on-line community, but saying that just conveys the message that the
Internet community rewards rudeness. No, I'm suggesting you should post
to a single forum at a time because you'll get more, better, quicker
answers -- because you won't be widely boycotted and ignored. Yes, it's
true that "other people do it". They're getting worse help and less
help. They just haven't yet figured it out.

<p>
Don't clean up your act to please me. Yes, I'd prefer that you avoid
acting clueless and rude on the Net, because I care about the Net, but
(like many others) can and will deal with the immediate problem by
disregarding your crossposted question.
 
<hr width="60%">

<p>
For more on [1] Netiquette, see any of thousands of resources on the
Net.

<p>
[1] You can stop wondering; yes, the wordplay is intentional.

<hr width="80%">
<a name="laundrette.laptops"></a>
<h3>Laptop Juggling</h3>

<p>
<strong>[Kapil]</strong>
I would have said I would wait for the laptop that you give up on and
the retailers then sell at half price  :-)  --- but then I would also know
that it doesn't run Linux well, so that it wouldn't be worth a lot!

<p>
<strong>[Ben]</strong>
Nope. But you could wait until I find one that's hitting on all 12
cylinders, or at least runs smoothly, is fuel-efficient, and has nice 
upholstery; I'll be reporting on every one I test. Hmm, maybe an
occasional article series...

<p>
<strong>[Breen]</strong>
Hmm. Jon Corbet's got the copyright on "Grumpy Editor", but maybe he'd
be willing to share...

<p>
<strong>[Ben]</strong>
[grin] We could always do a time-share on it. Say, why don't I email
10,000 of my closest editor (hm, typed 'closet editor' at first... makes
me <b>really</b> wonder) friends about this special, exciting one-time offer?

<p>
That'll get me on their spam lists, they'll never darken my email
gateway again. Hmmm, this may bear considering at some future point.

<p>
<hr width="80%">
<a name="laundrette.pipe"></a>
<h3>The Crack Pipe</h3>

<p>
<strong>[Ben]</strong>
(Is it time for another hit on the crack-pipe yet? Oh, goody.)

<p>
<strong>[Vince]</strong>
You say your pipe is cracked??  A good friend of mine of the Lacota Nation
makes pipes that don't break &lt;G&gt;  Made from stone...  good pipe..

<p>
<strong>[Jimmy]</strong>
Reminds me of a Denis Leary riff, something like "Marijuana doesn't lead
to harder drugs -- it leads to DIY. Dude, we could make a great bong out
of your head".

<p>
I once read a magazine that had instructions for making a pipe out of
the ground :)
<hr width="80%">
<a name="spam.cute"></a>
<h3>Spam: Spam cuteness</h3>

<p>
<strong>[Ben]</strong>
Well, now - here's an interesting one. In one of my "Perl One-Liner of
the Month" articles, I predicted that spammers would eventually catch on
to the hex-encoding method I'd used to obscure email addresses. Didn't
take long, did it?

<p>
<pre>
---------------------------------------------------------------------
From: Smith Barney &lt;custservice.ref.num1615018258@smithbarney.com&gt;

To: <em>[address removed]</em>
Cc: 
Bcc: 
Subject: <b>****SPAM****</b> Smith Barney Notification
Reply-To: 

<p>
&lt;html&gt;&lt;p&gt;&lt;font face="Arial"&gt;&lt;A hREF="https://www.smithbarney.com/cgi-bin/login/confirm.cgi"&gt;
&lt;map name="FPMap0"&gt;&lt;area coords="0, 0, 639, 336" shape="rect" 
href="http://%32%30%39%2E%31%32%2E%31%31%34%2E%31%33%39:%38%37/%73%62/%69%6E%64%65%78%2E%68%74%6D"&gt;
&lt;/map&gt;&lt;img SRC="cid:part1.03030205.07080805@identifdep_op32255487058@smithbarney.com" border="0" 
usemap="#FPMap0"&gt;&lt;/A&gt;&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#FFFFF3"&gt;Sterling Marlin in 1985 Dragonball in 
1882 Cindy Margolis a collect call Just tell Jennifer Lopez Come on! Horoscopes cats and dogs I can't 
get through in 1801 Gladiator Penthouse Bible pretty much. Dragonball in 1841 Sites Thanks for visit 
Try to connect you Websites Windows 2000 Love Poems &lt;/font&gt;&lt;/p&gt;&lt;/html&gt;
---------------------------------------------------------------------
</pre>

<p>
The above flips to "http://209.12.114.139:87/sb/index.htm", which
resolves to some company based in Arizona. I've become so used to these
things coming out of China that it seems, well, <b>weird</b> to see this.
What's even more interesting is the port they're using (87): Mozilla is
smart enough that it pops up an "Access to this port has been disabled
for security reasons", but Dillo and w3m go right to chewing on the
thing (anybody want to make a bet on IE behavior for this?) 

<p>
It's quite cute; if it wasn't for their stupid little trick with the
random text, it would look fairly real (there's a GIF of an
official-looking, "Smith Barney wants you to click this" note attached
to the original email.) It just ain't safe to be gullible these days.

<hr width="80%">
<a name="spam.again"></a>
<h3>Spam: Again, regarding your request. Please reply.</h3>

<p>
<strong>[Brian]</strong>
<pre>
Corinne Vega wrote:
Hi again,

This is Corinne Vega. I am writing to you to confirm that we have
accepted your mortgage application.
</pre>

<p>
How thoughtful to accept my application from your future, in my past.

<pre>
Our office has confirmed that you can get a $220,000 loan for as low
as $352.00 per month payment.
</pre>

<p>
Now, is the mortgage for Ben's boat that I'm taking out, or is it for
the newly beach-front property in Florida, or perhaps that holiday home
I just built on the flanks of Mt. St. Helens. 

<p>
<strong>[Sluggo]</strong>
Yeah yeah yeah, I couldn't let Ben and his hurricanes have all the fun.

<p>
<strong>[Brian]</strong>
Ooooo, errr... Now, with
those payments, you haven't specified a loan rate, so lessee here. At 0%
interest, that's a 52 year loan. Lucky for you my family tends to live
into the three digits, or you'd be SOL sooner or later.

<p>
<strong>[Ben]</strong>
Why, Brian! You missed the salient factor, the very fact that makes this
The Offer Of The Century: since they've reversed the flow of time, as
you noted above, the interest is <b>negative</b> - that is, they pay you for
taking out the loan. 

<p>
<strong>[Jason]</strong>
So it's sort of like how you pay for a meal at the restaurant at the
end of the universe?

<p>
<strong>[Ben]</strong>
In fact - the calculations are a bit difficult, but
bear with me - eh, carry the 9, divide by the prime rate on 10/29/29,
subtract the number of polar bears in Zimbabawe, raise to the power of
the tea index in China, drop the first seven digits... there we are.
You'll have it paid off in about 1.03453464557 microseconds, give or
take a century. 

<p>
<strong>[Jason]</strong>
Well, yes, but that figure is useless unless you perform a simple test
to see if the lender is running a scam. Just fill out the application
forms, and then look to see if the DOB given is yesterday.

<p>
<strong>[Ben]</strong>
Best of all, you can borrow the money for the payments
from Corinne - the interest from that second loan will easily pay for
the first one, and leave you enough cash to start a loan company of your
own! 

<p>
Now, that's what <b>I</b> call high finance. Must have required snorting
several grams of funny white powder <u>and</u> smoking a couple of pounds of
radioactive waste to come up with a "special offer" like that one...

<p>
<strong>[Brian]</strong>
<pre>
The approval process takes no longer than a minute, so please fill
out the form on our website:
</pre>

<p>
I'm sure that it's easier for you to just copy my data from the
application that I will fill out in the future and send back to you
somehow. Remit payment to the same swiss bank account that's been
flogged about in this mailing list recently. I'll find a way to get the
funds drawn from there, perhaps with the KIND ASSISTANCE OF ALL MY NEW
FREIEIENDS ON THE NIGERIAN INTERNET.

<pre>
http://rygig.jlfbkmne.info/?dqLwLxdeNhkK.xdYXQVY
</pre>

<p>
nice URL, did you pay much for it? I can sell you a better name, cheap!

<pre>
Corinne Vega
First Account Manager
</pre>

<p>
I'm not sure you're senior enough to represent your firm to this entire
list. Can we speak to a second account manager?

<p>
Sigh. Isn't there more to life? 

<p>
<strong>[Ben]</strong>
All right, congratulations! Maybe you won't have to take Corinne up on
her offer after all.

<p>
<strong>[Brian]</strong>
Oh, yes, there is. I just got a new gig.
I'll be the Sysadmin at (nfr)(security), starting later this month. That
makes up for the fall on the stairs two weeks ago, and the little dog we
own that laid open my lip to the tune of 5 stitches last Thursday. Her
new name is FaceBiter.

<p>
<strong>[Ben]</strong>
OW! Gotta watch out for those little ratweilers. There's a tiny little
chihuahua-like critter over by my yoga studio that thinks it's bigger
and tougher than my motorcycle; just launches into the most
vicious-sounding, hysterical barking whenever it hears my engine. Even
revving to 10 grand doesn't discourage the damn thing (certainly drowns
it out, though.  :)  I might have to start carrying a water pistol.

<hr width="80%">
<a name="laundrette.gouranga"></a>
<h3>Gouranga</h3>

<blockquote><em>[
I'm including this because it's bizarre 
]</em></blockquote>

<p>
<strong>[NitaiGouranga]</strong>
Call out Gouranga be happy!!!<br>
Gouranga Gouranga Gouranga ....<br>
That which brings the highest happiness!!

<hr width="80%">
<a name="wacko.guns"></a>
<h3>Wacko Topic: Guns &amp; Crime</h3>

<p>
<strong>[Sluggo]</strong>
I was talking with an NRA fan last night, and he said guns were banned
in the UK only a few years ago, crime has increased fourfold since then,
and London now has a worse crime rate than New York City.  Sounds far
fetched but could there be some truth in it?

<p>
<strong>[Pete Jewell]</strong>
Sounds like absolute rubbish to me.  There has been gun controls in place as 
long as I can remember - perhaps there wern't any at the beginning of the 20th 
century.  Not sure where your fan got their crime figures - were they talking 
about a particular type of crime, or overall?

<p>
If anything there has been a tightening of gun laws over the last two decades, 
especially after the tradegy in Hungerford. 

<p>
<blockquote><em>[
<a href="http://en.wikipedia.org/wiki/Hungerford_Massacre">
http://en.wikipedia.org/wiki/Hungerford_Massacre</a>
]</em></blockquote>

<p>
<strong>[Neil]</strong>
Someone is severely twisting the facts to fit an argument here. We've had gun 
controls for as long as I can remember and OK they were tightened beyond what 
I would consider reasonable in the wake of the Hungerford shootings, but 
we've never had anything like the American gun culture. 

<p>
A fourfold increase in crime in a few years? Hey, you'd think I might have 
noticed, living in Britain as I do. Certainly there's been an increase in gun 
crime over the last couple of decades, but that hasn't been affected in any 
way by the change in the law AFAICT. The apparent size of the increase in 
relative terms is probably down to starting from a very low base at least in 
comparison to the USA. In absolute terms, I believe we still have a very long 
way to go to catch up with the US in terms of murders/shootings per head of 
population (that statement made without checking any facts).

<p>
<strong>[Ben]</strong>
Interesting. I'd imagine the peak of this has passed, but does the above
take into account 30 years (or so) of IRA battles? I would think that
the figures for the UK would be quite high as compared to New York - or
any other part of the US.

<p>
Just to keep parity, I haven't checked any facts either.  :) 

<p>
<strong>[Neil]</strong>
 
30 years or so of IRA battles didn't really amount to a fraction of what you 
seem to think. ISTR that statistically more people are killed on the roads in 
a year than were killed in the whole of "the troubles". 

<p>
<strong>[Ben]</strong>
OK; I did say that I hadn't checked. However, comparing murder stats to
car accident stats is anything but complimentary to the former; there
are a HUGE number of car-related deaths. The fact that no one is going
to do anything about them doesn't make the number low.

<p>
<strong>[Neil]</strong>
OK. I was just trying to put the whole IRA thing into some kind of 
perspective. I have the possibly mistaken impression that most Americans 
believe that Britain during the troubles was a dangerous place and that 
London was far too dangerous to visit.

<p>
<strong>[Ben]</strong>
I'm not sure about "dangerous" on an absolute scale, WRT that
perception; more dangerous by some small measure, surely, but lots of
people continue to visit Israel - which is in the middle of a war. I
don't think London lost much in a way of tourism due to it; a quick look
at Net resources says that it grew pretty steadily, up to 5 mil last
year.

<p>
IMO, most Americans see London as a romantic and historically
fascinating place; I doubt that anyone who had the time, the interest,
and the money to travel there would seriously consider that sort of
"danger".

<p>
<strong>[Sluggo]</strong>
People have visions of bombs going off every day in Northern Ireland;
most people would not even consider visiting it.  However, I've never
heard of anybody putting off travel to Britian because of the few
isolated bombings there.

<p>
<strong>[Neil]</strong>
I grew up in London during that period and there were occasional bombs, I even 
missed a couple by an hour or two, but really it had little impact on the 
mainland, except for a few unlucky people who were in the wrong place at the 
wrong time. The effects in Northern Ireland were far nastier and more 
pernicious, even if the actual number of deaths were low.

<p>
<strong>[Sluggo]</strong>
A lot of yanks viewed it in terms of British colonialism/imperialism;
that they were interfering in Ireland for their own advantage the way
they had meddled in our country.  Of course, nobody stopped to ask what
exactly what the Crown would gain from such a policy; NI is not exactly
a financial powerhouse, nor does it export any goods not available
elsewhere.  People viewed it as "having territory for bragging rights".
And of course, ppl couldn't really relate to terrorism before 9/11; it
was too abstract, too unimaginable.

<p>
<strong>[Jimmy]</strong>
A big part of the problem is that a lot of people in Ireland, North and 
South, on both sides, have been fed a load of bullshit packaged as history. 
I won't go into this in detail, because it's too tiring. I proofread part 
of a very good (though more than slightly biased towards the British side) 
account, written at the time that Irish Home Rule was being discussed, for 
Distributed Proofreaders, which debunks several of the myths of Irish 
"history". I'll send you a link when it's posted. 

<p>
<strong>[Sluggo]</strong>
That's what I thought when I went to NI, but I left with a very 
different impression, that it was a "made in Ireland" problem.  I
visited Scotland and England immediately afterward and found the Brits,
rather than anxious about losing the territory and their prestige,
instead wishing the NI problem would just go away.  As my friend in
Bristol (a British nationalist) put it, "I'd be happy to give Northern
Ireland independence <b>today</b> if it meant no more subsidies from our
treasury."

<p>
<strong>[Jimmy]</strong>
It's not really a made in Ireland problem, as such. There's a bit of the 
same sentiment in Scotland. 

<p>
<strong>[Sluggo]</strong>
Of course, these views would be obvious to anybody putting the Irish
and British newspapers side by side.  However, most yanks have never
even gone into the foreign section of a newsstand, never heard the 
BBC, etc.

<p>
<strong>[Ben]</strong>
<b>What</b> foreign section of the newsstand? It's you tofu-eating,
tree-hugging, Prius-driving, Kerry-voting West Coast liberal types that
have access to such things; the rest of America gets the Fox News
version ("OK, there's a country called Russia. And maybe another one
called Iraq. We'll let you know, once a week, whether they're good or
bad.")

<p>
<strong>[Sluggo]</strong>
After the Good Friday Agreement and subsequent events, there was more
of an acceptance in America that there's two sides to the issue.
Nevertheless, I continue to see disurbing graffiti in pub bathrooms,
"IRA all the way" and the like.

<p>
Regarding the forefold increase, my NRA friend said it was Australia,
not Britian.

<p>
Dunno if they excluded political crimes from the crime statistics, but
I think they should have.  Whether location X was bombed doesn't tell
me anything about whether a mugger is likely to stalk me, which is what
I want to know.

<p>
<strong>[Jimmy]</strong>
Just FYI: there has <i>never</i> been an incident of IRA sponsored gunfire in
Britain. It has always been explosives.

<p>
<strong>[Ben]</strong>
Interesting. I wonder what the rationale behind it was. More bang for
the buck, probably - and the evidence mostly destroys itself, which
isn't the case with firearms.

<p>
<strong>[Jimmy]</strong>
I had an argument on Wikipedia once, with someone who wanted to remove the 
word "terrorist" (to be replaced with "freedom fighter") from any articles 
relating to the IRA (one of the oddities of Wikipedia's Neutral POV policy 
- since then, the article on the Provisional IRA has had a footnote added 
which justifies the use of that word at great length - see 
<a href="http://en.wikipedia.org/wiki/Provisional_Irish_Republican_Army#Footnotes">
here</a>).

<p>
Basically, the P-IRA wanted to flex its muscles at the British government, 
but did not usually wish to harm "civilians" - they used to phone ahead, 
using a codeword, and give advance warnings so civilians could be evacuated. 

<p>
<strong>[Ben]</strong>
I did become curious about the above comparison, though. Seems that,
according to your own Telegraph, the number <u>has</u> at least doubled
recently.

<p>
<a href="http://www.telegraph.co.uk/news/main.jhtml?xml=%2Fnews%2F2004%2F03%2F21%2Fnmurd21.xml">
http://www.telegraph.co.uk/news/main.jhtml?xml=%2Fnews%2F2004%2F03%2F21%2Fnmurd21.xml</a>

<p>
<strong>[Neil]</strong>
Interesting. It seems worse than I thought, but that particular statistic 
could be a bit of a freak. I'd be interested in whether the full year figures 
have doubled.

<p>
<strong>[Jimmy]</strong>
A friend, who has studied both Irish Law (heavily based on British Common Law, 
even more so than American law) and History &amp; Politics, tells me that British 
law was changed in the past few years with regard to the reporting of crime -- 
if I were to report something stolen, for example, and then discover it had 
merely been misplaced, it would still be reported as a crime -- so that even 
minor crimes, even those that are <i>not</i> crimes, are reported as incridents of
crime. With this in mind, it's not surprising that crime in Britain seems to 
be on the rise. 

<p>
<strong>[Ben Whyte]</strong>
Also mobile phone companies require you to report your phone lost to the 
police which gets recorded as a crime even if you loose it.

<p>
Same applies to wallets, credit cards etc. 

<p>
<strong>[Ben]</strong>
Not from what I saw; however, criminologists in the UK and the US both
are pointing out that murders are on the rise on your side of the pond,
while property crimes have long been higher than the US. The
conservatives (European ones, anyway) like to point to the influx of
foreigners and the formation of minority gangs. I don't know enough to
say one way or the other, myself.

<p>
<strong>[Neil]</strong>
Just looking back at the Telegraph article, the figures in it show a drop, 
followed by a rise. Although it seems to have doubled over a 1 year period, 
the rise over 3 years is 50%, still too much, but nothing like the 4 times 
increase over a couple of years implied by the original message. The 
statistics in the article are:

<pre>
Q4 2000: 40 murders 
Q4 2001: 43 murders 
Q4 2002: 31 murders 
Q4 2003: 61 murders
</pre>

<p>
I don't think that establishes a definite trend.

<p>
<strong>[Ben]</strong>
Some commentators are indeed tying it to disarming the population, and
pointing out that, e.g., New Hampshire - where the average truck driver
carries more firepower than entire EU armies - has a <u>very</u> low crime
and murder rate. Kennesaw county (Georgia) which had (and probably still
does) a <b>mandatory gun possession requirement</b> maintained a zero violent
crime count for many years. The Swiss probably don't do too bad either.

<p>
<blockquote><em>[
<a href="http://www.kennesaw.ga.us/CodeOfOrdinances.aspx">Gun Law 
Ordinances</a>

<p>
Sec. 34-1 Heads of households to maintain firearms.

<p>
(a) In order to provide for the emergency management of the City, and further 
in order to provide for and protect the safety, security and general welfare 
of the city and its inhabitants, every head of household residing in the City 
limits is required to maintain a firearm, together with ammunition therefore.

<p>
(b) Exempt from the effect of this section are those heads of households who 
suffer a physical or mental disability, which would prohibit them from using 
such a firearm. Further exempt from the effect of this section are those heads 
of households who are paupers or who conscientiously oppose maintaining 
firearms as a result of beliefs or religious doctrine, or persons convicted 
of a felony.

<p>
<a href="http://www.kennesaw.ga.us/PoliceDepartment_CrimeStatistics.aspx">Crime 
statistics</a>
]</em></blockquote>

<p>
<strong>[Neil]</strong>
Well tying British changes in crime rate to disarming the population is 
bullshit. The British population has never had much in the way of guns. I 
don't think anybody I know has ever owned a more powerful weapon than an air 
pistol. (Not quite true, I once knew someone with a crossbow.)

<p>
As for the wider issues the correlation between gun ownership and violent 
crime just isn't there. You can find examples of high guns, high crime, high 
guns, low crime and low guns, low crime. I'm wouldn't expect there to be any 
low guns, high gun crime examples out there, but that may depend on what you 
are counting. Illegal guns are ususally much harder to count than legal ones 
and definitions of what constitutes high gun crime may vary.

<p>
<strong>[Ben]</strong>
There's a bit of circular reasoning in the above... no, you're not going
to have high gun crimes in a society with a low gun count. By the same
exact token, then, you can't tie the number of murders in, say,
Washington DC, to the availability of guns. The US, in places, is a
violent society; guns are certainly not a cause - although they may be
part of the effect.

<blockquote>
"Fear no man, no matter what his size<br>
Just call on me and I will equalize"<br>
 -- stamped on the first Colt models
</blockquote>

<p>
<strong>[Ben]</strong>
Laws only affect the law-abiding.

<p>
<strong>[Neil]</strong>
Even criminals obey a lot of laws and laws may have indirect effects on 
criminals. No doubt the NRA would argue that Kennesaw County was an example 
of the latter.

<p>
<strong>[Ben]</strong>
By definition, they do not obey the laws which make them into criminals.
A murderer may not have too many traffic tickets - but this does not
make him any less of a murderer.

<p>
We all live in societies that allow - in fact, reward - murder when it
is done under the auspices of the government, as warfare. If it is
moral then, why would it be immoral otherwise?... by such a model of
"morality", which has now been trained into thousands of young men and
women by Bush, Blair, and the rest, we've just created a large pool of
people who are restrained from murder by a very thin veneer of
civilization.

<p>
As if we hadn't learned enough from Vietnam...

<p>
<strong>[Sluggo]</strong>
Egads, and a neoconservative told me recently, "The protesters think it's
still 1968 and never learned the main lesson of Vietnam: all dissent
STOPS when war is declared."

<p>
<strong>[Ben]</strong>
... well, no, that's not <u>the</u> most stupid thing I've ever heard. I can
think of one that was worse. Two, if I concentrate really hard.

<p>
Dissent only exists and makes sense when there's something to dissent
<b>from</b>. Nobody needs to march in the streets and shout for the sun to
shine. And the <b>main</b> lesson of Vietnam was that our politicians are
perfectly willing and fully able to casually murder our young men and
women - as well as those of "the enemy" - based on outright lies, and
are perfectly capable of abandoning them after shoving them into an
inferno. Cam Ranh Bay, WMDs - the lie can change, but the basic facts
remain.

<p>
For that matter, I wish it <u>was</u> the late '60s in political terms: 

<p>
"In his inaugural address, President Richard M. Nixon asked the American
people to lower their voices, to search for unity instead of
divisiveness, for harmony instead of discord. The speech struck a
responsive note in an exhausted nation that had just lived through a
year of violence and turmoil..."<br>
 -- Collier's Year Book

<p>
<strong>[Sluggo]</strong>
Funny, I learned a completely different lesson from Vietnam.  That is,
"Be suspicious of anything your government is doing."

<p>
<strong>[Ben]</strong>
Odd how you're not the only one who learned that lesson... to my sorrow,
not enough people have learned it, though. Although the current
administration is doing all they can to drive it home.

<p>
<strong>[Neil]</strong>
The source of the increases we have had is probably enormous quantities of 
cheap weapons being exported from the the former Soviet Union. Changes in the 
law have made no difference that I can see, other than closing down 
legitimate shooting clubs, due to public hysteria.

<p>
Is London crime worse than New York? Well New York is supposed to have 
improved enormously, but there are few areas of London I would feel unsafe 
walking in at night. How about New York?

<p>
<strong>[Sluggo]</strong>
My totally subjective impression has been the following:

<p>
<pre>
  - Menacing, as in watch your back:
    - Moscow (1995/1996)
    - London (1998/2000/2002)
    - Los Angeles (2001)

  - Safe:
    - NYC (2003/2004, although I didn't venture into Harlem or the Bronx)
    - Chicago (2002/2003, although I didn't venture to the south side projects)
    - San Francisco (1998/2003/2004)
    - St Petersburg (1995/1996)
    - Rheinland in Germany, Liege in Belgium (2000)
    - Portland, Seattle, Vancouver BC, Toronto, Halifax, and everywhere smaller
    - England (Bristol, Manchester, Brighton, Blackpool, Cambridge -- 2002)
      Although my mate has had trouble in Bristol.
    - Scotland (1998/2000/2002)
    - Ireland, N Ireland (2000)
</pre>

<p>
Daytime/nighttime doesn't seem to make much difference.  The menace I've
felt is mostly in the daytime; e.g., in Hollywood and south LA you never
know when some tough might appear who wants to mug/gangbang you.  London
has that same sense sometimes, or at least parts of it do.
 
<a name="laundrette.fighting"></a>
<h3>Peaceful chat about fighting</h3>

<p>
<strong>[Sluggo]</strong>
... although I'd still list DC as a "safe" place.  Never been to
Baltimore.

<p>
<strong>[Ben]</strong>
[laugh] Especially when the two of us ambled down the street, discussing
martial arts and such. Not that DC hasn't seen anything like that
before, but you can pretty much bet that some people were whispering
"ohshit, cops!" and fading into alleys.

<p>
<strong>[Sluggo]</strong>
And you said 'tis nobler to run away than fight, and one should fight
only if the person persues you and leaves you no other choice.  That
blew my mind, even though I recognized the martial arts philosophy
behind it.  The western (ahem, skinhead) mindset is quite different,
"Fight immediately and never run away."  

<p>
My philosophy is somewhere between the two.

<p>
<strong>[Jimmy]</strong>
You know my philosophy on this: it's better to make them think they'd 
rather not start a fight after all  :) 

<p>
<strong>[Ben]</strong>
"Listen, we can both walk away from this and go home - dinner,
girlfriends, quiet night's sleep, and so on. The other choice is where
one of us can go to the emergency room or the morgue, and the other one
gets hauled off by the Gardai for inhuman cruelty, vicious mutilation,
and possibly cannibalism. Let's just do the first one instead of ruining
each other's lives, OK?"

<p>
[grin] Something like that, Jimmy?

<p>
<strong>[Jimmy]</strong>
Something like that, except it's not so much what I say -- I like to be 
more subliminal^Wsubtle than that.

<p>
<strong>[Sluggo]</strong>
Wanna elaborate for the benefit of TAG?

<p>
<strong>[Jimmy]</strong>
Sending conflicting messages with body language is a major part of it -- 
for example, when someone doesn't want a fight, they put their hands up, 
palms open and facing outward to show that they're not a threat. I do 
this, but move into a fighting stance. I also keep my hands at throat 
height, fingers pointing at the throat -- if I only get one shot, it's 
going to count, and I don't mind telegraphing that.

<p>
Another aspect is facial expression and voice tone -- with both, I try 
to express surprise that someone wants to start a fight with me; my 
words say "I'm sure we can work this out" while my face and tone of 
voice say "because you <i>really</i> don't want to fuck with me".

<p>
I don't want to give away <b>all</b> of my secrets though :) (There's at 
least one thing that's hard to explain anyway (I only put the pieces 
together a couple of days ago, and even harder to reproduce).

<a name="laundrette.haircut"></a>
<h3>Jimmy's haircut</h3>

<p>
<strong>[Jimmy]</strong>
I cut most of my hair off Friday though, and it seems I won't have as 
much need to use that set of mind tricks as frequently as I used to.

<p>
<strong>[Ben]</strong>
 
JPEG! JPEG!

<p>
<strong>[Sluggo]</strong>
Ben's beard is next....

<p>
It's about time.  Get a haircut and get a job.  Do we get to see a pic
of the new Jimmy?

<blockquote><em>[
See my bio picture, below
]</em></blockquote>

<p>
<strong>[Ben]</strong>
Ye Ghods. Jimmy, did your son recognize you after, or did he start
crying when the strange-looking man showed up?

<p>
<strong>[Jimmy]</strong>
Nah. He was there while my sister cut my hair. He did let out a startled 
gasp when he saw me with my beard cut off though.

<p>
<strong>[Ben]</strong>
Oh, and you're right about the above. Just think about the lovely side
effect, one I try hard to cultivate (with only indifferent success, I'm
afraid) - there are going to be a number of people out there who will
presume that your "corporate lawyer" appearance means that you're
<b>harmless</b> ... It's a nice advantage to have.

<p>
You've read my "combat mentality" rap; in fact, I wrote it when you
asked me for details. To be precise, my philosophy is more like "talk
until it's not an option anymore" - where the other person closes off
the option by showing unmistakeable signs of physical aggression - at
which point you take them down as hard as necessary. Running away isn't
an option for me: I'm not much of a runner.

<p>
<strong>[Jimmy]</strong>
Running away mentioned without a pTerry quote?

<blockquote>
'Haven't you noticed that by running away you end up in more trouble?'

<p>
'Yes, but you see, you can run away from that, too,' said Rincewind.
'That's the beauty of the system. Dead is only for once, but running
away is for ever.'

<p>
'Ah, but it is said that a coward dies a thousand deaths, while a hero
dies only one.'

<p>
'Yes, but it's the important one.'<br>
      -- Terry Pratchett, "The Last Continent" 
</blockquote>

<a name="laundrette.trolling"></a>
<h3>Bobbing for apples, trolling for traffic...</h3>

<p>
<strong>[Rick]</strong>
Mike, you wouldn't be trolling for list traffic, would you?  ;-&gt;

<p>
<strong>[Sluggo]</strong>
Who, me? 

<p>
<strong>[Ben]</strong>
You forgot the innocent [blink, blink] tag, Mike. After all, this is
text-mode communication, and the subtler shades of meaning are easily
lost; you wouldn't want people to assume you weren't being <b>sincere</b>...

<a name="laundrette.blackmail"></a>
<h3>Guns and Blackmail</h3>

<p>
<strong>[Vince]</strong>
I do not like weapons but I live in the country and I must have two weapons...  
a 22 cal. Springfield and an H&amp;K 12 gauge shotgun...  I do not hunt but from 
time to time I have to dispose of an injured or sick animal...  as a last 
option...

<p>
<strong>[Ben]</strong>
[blink] A 12-ga is a hell of a mercy weapon. I've found that a 22
suffices for anything of that sort; back in the days when I hunted, I
used my Ka-Bar knife when a <i>coup de grace</i> was necessary (only once, as
I recall; I'm quite a good shot.)

<p>
<strong>[Jimmy]</strong>
My guess is the 22 is the mercy weapon, and the shotgun is used to chase 
away scavengers - a shotgun is a standard piece of farming equipment over 
here too. 

<p>
<strong>[Vince]</strong>
BTW none of my weapons are registered...  both were bought many years ago...  
the Springfield rifle was bought before WWII

<p>
<strong>[Ben]</strong>
Ahem. I presume you realize you've just announced that on a public list?
Not that we have any intention of publishing it... heh, heh, heh...

<p>
(I'll contact you later with the Swiss bank account number; you can
transfer the million dollars into it anytime during the next three
days.)

<p>
<strong>[Vince]</strong>
So I placed it on a public list...  no biggie... local law enforcement know me 
and know my weapons...  I mean they were bought before the second world 
war...  

<p>
<strong>[Ben]</strong>
I'm picturing Vince with a 75-caliber blunderbuss.

<p>
"Heck, Sheriff, these ain't <b>really</b> what you'd call dangerous weapons - I
mean, an Uzi, <b>that's</b> a dangerous weapon!"

<p>
<b>*</b> BOOOMMM!!! <b>*</b>

<p>
"Ooops. Spark from my cigarette musta fallen in the pan. You didn't need
that arm anyway, didja, Sheriff?"

<p>
<strong>[Vince]</strong>
As for the 12 gauge...  I use a one once slug almost exclusively  leaves less 
to dig a hole for...

<p>
<strong>[Ben]</strong>
[nod] I always wondered about those folks who went deer-hunting during
the shotgun season. Sure, there are such things as sabots, but most of
the ones I'd talked to were just using slugs. What did they do, go
scrape the deer off the trees afterwards and freeze the puree for the
winter?

<p>
<strong>[Vince]</strong>
If you are in a situation of a screwed up bull moose or bear... a 22 don't cut 
it...  Generally I borrow my neighbors 50 caliber for that...

<p>
<strong>[Ben]</strong>
Nice. Black powder, I presume? I've seen a few firearms that would toss
the modern .50 a few miles, but those are pretty expensive and somewhat
unusual. Sure would stop a moose, though...

<p>
Speaking of meese, here's one from Russia - this is the kind of thing
they've got wandering around Siberia and such.

<p>
<a href="http://okopnik.freeshell.org/img/russian_hunter.jpg">russian_hunter.jpg</a>

<p>
<strong>[Vince]</strong>
As for the Swiss bank account &lt;heh&gt;  glad your doing so well...  unfortunately 
I just paid my property tax ($6K)  and I am broke... and don't expect to get 
a landfall of much more than snow....  even my Linux box is made of throw out 
parts from several sources...

<p>
<strong>[Ben]</strong>
Yeah, well - those imaginary Swiss accounts are pretty cheap. I can get
you a few hundred of them at a discount, if you want; I know the guy who
thinks'em up.

<p>
<strong>[Vince]</strong>
p.s.  did I hear you guys might need proof readers???  I can read but I have 
no proof...  

<p>
<strong>[Ben]</strong>
I've got no proof either - at least when I'm not hanging out with my
Russian friends. Then, if I get cut, they have to call the fire
department.

<p>
<strong>[Jimmy]</strong>
Uh... Ben... Here's a writing exercise: construct a sentence using these 
four words -- "advice", "your", "follow", "own". 

<p>
<strong>[Ben]</strong>
Shhh! If you don't say it too loud, nobody will notice. At least I
<b>think</b> that's how this email stuff works, anyway. Besides, I didn't
publish the account number - I put it in a Micr0s0ft Wallet, where it'll
be secure forever and ever! They <b>SAID</b> so!

<p>
<strong>[John]</strong>
Hmm, what's the new name for Carnivore?  The FBI should be contacting you 
shortly.  ;^&gt;

<p>
<strong>[Vince]</strong>
Have you ever sat back and tried to create, hypothetically, a system that 
monitors all Internet actions?  And all individual actions on the internet?

<p>
Let's see... there are a limited amount of Cray computers in this world and..

<p>
&lt;HEH&gt;

<p>
<strong>[Ben]</strong>
Heck, <u>that's</u> not the point. Who will watch and decide on the
information presented by those Crays? And, even more importantly, who
will watch <b>them?</b> It's an infinite progression.

<p>
As Thomas' recent .sig noted, it's not a new problem.

<blockquote>
  Quis Custodiet Ipsos Custodes? (Who will watch the watchers themselves?)<br>
   -- Juvenal (Decimus Iunius Juvenalis, 55-127 A.D.)
</blockquote>

<hr width="80%">

<p>
<strong>[Sluggo]</strong>
Testing my Lgang access.

<p>
<strong>[Ben]</strong>
We can't see you.

<p>
<strong>[Sluggo]</strong>
But we can build you.

<p>
(Allusion to Philip K Dick story title.)

<p>
<blockquote><em>[
"Gentlemen, we can rebuild him. We have the technology. ... Better than he 
was before. Better, stronger, faster."
]</em></blockquote>

<hr width="80%">
<a name="laundrette.nuclearjava"></a>
<h3>Java should not be trusted with nukes, Microsoft says</h3>

<p>
<strong>[Jason]</strong>
I was looking through the Microsoft EULA[1] to see what kind of disclaimer
they had and found pretty much the standard stuff. (ie, "We could use
this software to kill your cat, and it wouldn't be our fault.") But
there was one clause that I found...interesting:

<p>
9. NOTE ON JAVA SUPPORT. THE SOFTWARE PRODUCT MAY CONTAIN SUPPORT FOR
PROGRAMS WRITTEN IN JAVA. JAVA TECHNOLOGY IS NOT FAULT TOLERANT AND IS
NOT DESIGNED, MANUFACTURED, OR INTENDED FOR USE OR RESALE AS ON-LINE
CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF JAVA
TECHNOLOGY COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
PHYSICAL OR ENVIRONMENTAL DAMAGE.

<p>
Interesting, no?

<p>
[1] Specifically, this was the EULA that Midtown Madness, a Microsoft
game, shipped under.

<p>
<strong>[Jimmy]</strong>
Actually, no. This is part of Java's licence. Microsoft licenced Java 
from Sun, rather than writing their own implementation, which is why Sun 
were able to sue them for making changes to their version of Java.

<p>
<strong>[Ben]</strong>
Amusingly, I wrote an article for Java Developer's Journal a couple 
of years ago - "Java Under Linux: Ten Feet Tall and Bullet-Proof" -
that began with the very clause you quote, and made that very point.
Got quite a number of comments about it, too.
 
<blockquote><em>[
<a href="http://okopnik.freeshell.org/articles/JDJarticle.html">
http://okopnik.freeshell.org/articles/JDJarticle.html</a>
]</em></blockquote>

<hr width="80%">
<a name="laundrette.moreandmore"></a>
<h3>More of... everything, really</h3>

<p>
<strong>[Ben]</strong>
<b>Back on the net, hi-ho!</b> 

<p>
...at least for the moment. I can only hope that this machine will give
less trouble than the old one; it's scarcely possible to give <u>more.</u>

<p>
<strong>[Jimmy]</strong>
And there you go tempting fate again. It's getting to be a hobby.

<p>
<strong>[Ben]</strong>
Where did you think pTerry got the idea of the guy standing on a
mountaintop in copper armor during a thunderstorm and shaking his middle
finger at the sky? I'm <b>the</b> original prototype.

<p>
<strong>[Brian]</strong>
You? YOU?!? Put these concepts together in a single brain: Toshiba 64M
laptop, Wireless PCMCIA card, Windows XP Home. 

<p>
<strong>[Ben]</strong>
Ah. I <b>was</b> just wondering how they measured the length of, e.g., the
Mesozoic era. The above setup makes it trivial: turn it on, and when
it's finished booting - voila! - continental drift and such have
occurred in not only measurable but gross amounts.

<p>
<strong>[Brian]</strong>
Stir in one college age
owner of said box, coat evenly and scream. The gods TRULY are bastards.

<p>
<strong>[Ben]</strong>
And our capacity for self-torture is nearly infinite as well... Perhaps
I <b>am</b> getting a bit wiser as I get older, but I'm becoming rather aware
of the "tar babies" in my life, and am quite emphatic about shedding
them or even avoiding getting involved with them in the first place.
This, of course, presumes the ability to afford such solutions.

<p>
<strong>[Brian]</strong>
I had to come home, compile some software, then use gdb and strace to
try to get it working, just to get rid of the shakes.

<p>
Given that we had our tornado in California (anyone else remember the
Mary Avenue touchdown in Sunnyvale, about 4 years ago? Half a block
away!), earthquakes a-plenty, hurricane Isabel last year here on the
right coast ... Volcanos are next on the list, and after working on that
Windows box, I might welcome the change.

<p>
<strong>[Ben]</strong>
I find that hurricanes often suffice to put an end to nasty electronic
creatures that refuse to die in any other way; I've just replaced a
10-year old GPS that sang its swan song (reasons unknown) during the
last one. Oh, my hand-held GPS went along - misery loves company, I
suppose - and so did my iPaq handheld. They say that hurricanes are
necessary because they strip the coating of old, dead organisms off the
coral beds, which allows the coral to breathe and grow; I can assure you
that it strips old electronics off boats just as efficiently.
Presumably, this allows GPS manufacturers to breathe and grow...

<p>
<strong>[Brad]</strong>
Maybe he can scare fate away with a Perl One-Liner that draws an ASCII
monster  ;-) 

<p>
<strong>[Jimmy]</strong>
Not Perl, but...

<p>
<pre>
$ cowsay -f daemon 'Boo!'
 ______
&lt; Boo! &gt;
 ------
   \         ,        ,
    \       /(        )`
     \      \ \___   / |
            /- _  `-/  '
           (/\/ \ \   /\
           / /   | `    \
           O O   ) /    |
           `-^--'`&lt;     '
          (_.)  _  )   /
           `.___/`    /
             `-----' /
&lt;----.     __ / __   \
&lt;----|====O)))==) \) /====
&lt;----'    `--' `.__,' \
             |        |
              \       /
        ______( (_  / \______
      ,'  ,-----'   |        \
      `--{__________)        \/ 
</pre>

<p>
<strong>[Ben]</strong>
Excuuuuse me? Whaddaya mean, "not Perl"?

<p>
<pre>
ben@Fenrir:~$ file `which cowsay`
/usr/bin/cowsay: perl script text executable
</pre>

<p>
[grin] We Are Everywhere.

<p>
<strong>[Jimmy]</strong>
&lt;backpedal&gt;
erm...
I meant "not a Perl one-liner"
&lt;/backpedal&gt;

<p>
Though if you really need one:
<pre>
perl -e 'print`cowsay -f daemon "Boo!"`' 
</pre>

<p>
<strong>[Jimmy]</strong>
I had this in the Laundrette draft:

<p>
<a href="http://www.news.com.au/common/printpage/0,6093,11009375,00.html">
Murphy's Law has been formalised</a>

<p>
((U+C+I) x (10-S))/20 x A x 1/(1-sin(F/10))

<p>
where U=urgency, C=complexity, I=importance, S=skill, A=aggravation, and
F=frequency; each is a value between 1 and 9, except A, which is set at 0.7.

<p>
"There is, of course, a Sod's Law factor to the equation. If you judge your 
ratings wrongly, you might become too optimistic - and calamity will strike." 

<p>
<strong>[Ben]</strong>
Just as it will if you base anything important on the above formula.
Never forget that Murphy's Law is <u>also</u> subject to Murphy's Law.

<p>
<strong>[John]</strong>
I.e., it's recursive! 

<p>
<strong>[Brian]</strong>
Thus a close relative of the GNU/Linux clan: A self-referential,
empirically reentrant and recursing formula. Yes, recursing.

<p>
<strong>[Ben]</strong>
<b>Precisely</b> the word that fits the situation, on occasion (when simply
cursing isn't enough.)

<p>
<strong>[Brian]</strong>
Wasn't there a whole section of Hofstadter's GEB devoted to this?

<p>
<strong>[Ben]</strong>
I need to pick up a copy; it's probably about time. Certain books should
be reread every few years. As an example, I've just reread Pirsig's
ZATAOMM - my fourth reading of it or so - and was struck, <b>again</b>, by
how much that book has influenced my life and attitudes in general since
the first time. More so with the passing years.
 
<p>
<strong>[Jimmy]</strong>
Yep. That didn't stop me from trying to brush up my C with two versions of a 
program to calculate that  :) 

<p>
<strong>[Ben]</strong>
Heh. Makes sense to play with with the simpler stuff before you dive
into the dark depths of Moria (watch out for that Balrog; he's still
wandering around somewhere down there.)

<p>
<strong>[Jimmy]</strong>
Here's the <a href="misc/laundrette/murphy-simple.c.txt">short version</a>.
(<a href="misc/laundrette/murphy-getopt.c.txt">Long version</a>)

<p>
<strong>[Ben]</strong>
Let me give it a shot - I haven't done any Perl for a while now, too
bloody long.

<pre>
#!/usr/bin/perl -w

@vals = qw/urgency complexity importance skill frequency/;

die "5 arguments required: (@vals)\n" unless @ARGV == 5;

for (@ARGV){
        die "Each argument must be between 1 and 9\n" unless /^[1-9]$/;
}

 # YANETUT
@v{ map chr ord, @vals } = @ARGV;

printf "%3.3f\n", ( ( $v{u} + $v{c} + $v{i} ) * ( 10 - $v{s} ) ) / 20 *
        0.7 * ( 1 / ( 1 - sin( $v{f} / 10 ) ) );
</pre>
 

<p>
There. I figure <u>that's</u> the short version...  :) 

<p>
<strong>[Jimmy]</strong>
Or, the Perl NQ1L
<pre>
perl -e'@i=@ARGV;print((($i[0]+$i[1]+$i[2])*(10-$i[3]))/20*0.7*(1/(1-sin($i[4]/10))))' 5 6 7 8 9
</pre>

<p>
<strong>[Ben]</strong>
Oh. Well, heck, if we're going to do <u>that...</u>

<p>
 
<pre>
perl -alne'print((($F[0]+$F[1]+$F[2])*(10-$F[3]))/20*.7*(1/(1-sin($F[4]/10))))'
1 2 3 4 5
2.42040302288669
</pre>

<p>
Or we could just eliminate "print" altogether, just for fun - although
the first version is shorter:

<pre>
perl -alpe's#.*#((($F[0]+$F[1]+$F[2])*(10-$F[3]))/20*.7*(1/(1-sin($F[4]/10))))#e'
1 2 3 4 5
2.42040302288669
</pre>

<p>
...or, shortest yet:

<pre>
perl -alpe'$_=((($F[0]+$F[1]+$F[2])*(10-$F[3]))/20*.7*(1/(1-sin($F[4]/10))))'
</pre>

<p>
Oh yeah - and we can get rid of all that LISP-looking stuff, too.

<pre>
perl -alpe'$_=($F[0]+$F[1]+$F[2])*(10-$F[3])/20*.7*(1/(1-sin$F[4]/10))'
</pre>

<p>
<b>Now</b> it's shortest. I think.  :)  It's somewhere around the 18th hole of
Perl golf, anyway.

<p>
<strong>[Brad]</strong>
I wonder if Woomert or Frink would ever alias this in their ~/.bashrc...

<p>
<strong>[Ben]</strong>
Woomert would probably spotted the tortured math stuff and made it even
shorter thereby:

<pre>
perl -pale'$_=($F[0]+$F[1]+$F[2])*(10-$F[3])/20*.7/(1-sin$F[4]/10)'
</pre>

<p>
Other than that, it could happen...

<p>
<blockquote><em>[
Meanwhile, back in the main thread...
]</em></blockquote>

<p>
<strong>[Ben]</strong>
Acer has replaced my previous lemon^Wlaptop with a newer model, 

<p>
<strong>[Sluggo]</strong>
A computer that looks like a lemon...  Maybe it'll be the next iMac
design.  Bright yellow for lemon, bright green for lime. 

<p>
<strong>[Ben]</strong>
Actually, I'd expect it to be "bright yellow for Golden Delicious,
bright green for Granny Smith", if anything. I mean, the company's
called <u>Apple,</u> for Ghu's sake. The <b>last</b> thing they'd want to imply is
that they were selling lemons.

<p>
I've actually considered buying an Apple, primarily because of their
history (in my experience and reports from others) of reliability. On
the other hand, I understand that Linux on Macs still has a few rough
edges... and having seen the spindled, folded, and mutilated version of
BSD used by OS/X, I'm not willing to go that way, either.

<p>
(Yeccch. It was that much nastier because I actually <u>like</u> BSD.)

<p>
<strong>[Ben]</strong>
an
Aspire 2012... although I'd be hard-put to say anything especially
exciting and wonderful about it. Yeah, the video controller is different
(an RV350/Radeon 9600 instead of the 9200 that was in it previously);
other than that, it's missing the LCD one-line display and the weird
"multimedia" setup that (theoretically) allowed you to play CDs, DVDs,
etc. without actually booting the machine (I've mentioned this; it was a
tiny Linux partition with "mplayer".) [shrug] No loss, AFAIC. On the
other hand, the Intel wireless 2100 interface has been upgraded to a
2200G - which handles A, B, and G, something I do see as an improvement.
They also seem to have resolved the extremely weird "key delay" problem
that the Aspire 2003 had (if you typed too quickly, pressing 'b'
immediately after 'a' would result in a second 'a'!) Otherwise, it looks
and acts much the same as the old gadget.

<p>
Let's see how this one holds up...

<hr width="80%">
<a name="laundrette.recursion"></a>
<h3>Recursion</h3>

<p>
<strong>[Ben]</strong>
Searching the Net for recursion-related bits in the GEB, I found the
following:

<blockquote>
  If you already know what recursion is, just remember the answer.<br>
  Otherwise, find someone who is standing closer to Douglas Hofstadter
  than you are; then ask him or her what recursion is.<br>
   -- Andrew Plotkin 
</blockquote> 

<p>
<strong>[Jay]</strong>
Recursion: see recursion.  See also tail recursion.

<p>
Tail recursion: see recursion.

<p>
<strong>[Ben]</strong>
Both of the above are listed.  :) 

<p>
<strong>[Jay]</strong>
Yeah.   :-)   Where <b>did</b> you find that?

<p>
<strong>[Ben]</strong>
Google for 'Hofstadter GEB recursion', then grab the Wiki entry near the
top of the page. If this fails to satisfy, think of a better set of
search strings and... ooops, sorry, never mind. :)))

<p>
<blockquote><em>[
<a href="http://c2.com/cgi/wiki?DouglasHofstadter">http://c2.com/cgi/wiki?DouglasHofstadter</a>
]</em></blockquote>
<hr width="80%">

<a name="laundrette.system"></a>
<h3>Getting the system out of your system</h3>

<p>
<strong>[Kapil]</strong>
Failing this of course, you can go run a marathon, climb a mountain,
read a good book, play the flute, prove the Riemann Hypothesis --- in
other words do <b>anything</b> that will get the "need" out of your system.

<p>
<strong>[Ben]</strong>
I like the way you think, Kapil.  :)  Geeks of the world, untie! [1]

<p>
[1] Sure, the dyslexics too. However, they don't need the impetus of
Kapil's options.

<p>
<hr width="80%">
<a name="laundrette.standard"></a>
<h3>Standard</h3>

<p>
<strong>[Thomas]</strong>
[1] While awk, perl, etc, reside in /usr/bin, they are not standard or
essential to get a system operating and working. They're simply a
convenience.

<p>
<strong>[Ben]</strong>
Depends on the meaning of 'essential', I suppose. Perl is my OS of
choice; Linux just happens to be the best VM to run it under. :)))
<hr width="80%">
<a name="laundrette.c_loops"></a>
<h3>C Loops</h3>
<blockquote><em>[

Yep, something that's on-topic. Just for variety, y'understand

]</em></blockquote>

<p>
<strong>[Jason]</strong>
<pre>
"Jimmy O'Regan" wrote:
&lt;snip&gt;
	for (i=0,j=1;i&lt;5,j&lt;6;i++,j++)
		in[i] = atoi(argv[j]);
</pre>
 

<p>
Wouldn't be simpler just to say
<pre>
 
for(i = 0; i &lt; 5; ++i)
       in[i] = atoi(argv[i+1]);
 
</pre>

<p>
<strong>[Jimmy]</strong>
Yeah, but I'm trying to get my head around C again, and wanted to juggle 
two variables in the for loop to see if I got it right.

<p>
<strong>[Ben]</strong>
Beware the Fencepost Error, son -
The j's that bite, the i's that catch...

<p>
Me, I dislike even the idea of loops where you have to keep the index
manually; I think that the concept itself is broken (and yes, it's a
requirement in C, given its data structures - and the right thing to
practice if you're going to be using it.) 

<p>
<strong>[Jason]</strong>
I agree; I really think it should be the compiler's job to figure where
something starts and ends, and how we can iterate over each element in
turn. It's not hard. But this is C we're talking about:

<pre>
&gt; Beware: you could be talking to a minor. Some say that such immoral
&gt; material (C code) should be kept away from the impressionable minds of
&gt; The Children (tm).
 
That is why, when you mention the C language in front
of a child, you should <b>spell</b> the name...
		-- Hal E. Fulton on comp.lang.ruby
</pre>

<p>
 :-) 

<p>
<strong>[Ben]</strong>
This may or may not be
indicative, but I haven't used a loop of the above type - even though
Perl supports it - ever since I learned Perl, except to explain them
(and deprecate their use) to my students. If I <b>had</b> to use it for some
reason, I'd at least let the compiler handle the exit condition:

<pre>
for (i=6; i;) in[i] = atoi(argv[i--]); 
</pre>

<p>
<strong>[Jason]</strong>
Just looking at this, I can't figure out what it's supposed to do. What
is the value of "i" when used as "in[i]"? Does it get the old value of
"i" or the new value?  I think it's undefined how C should handle this.
At least gcc doesn't like it:

<pre>
~/prog/c$ cat post-increment-operator.c
#include &lt;stdio.h&gt;

int main() {
        int i = 0;
        printf("i: %d, i++: %d\n", i, i++);
        return 0;
}
~/prog/c$ gcc -Wall post-increment-operator.c -o post-increment-operator
</pre>

<p>
<strong>[Ben]</strong>
[shrug] "-Wall" is a maiden aunt on the edge of a nervous breakdown.
IMO, most of what it complains about never comes to pass. 

<p>
That's not to
say that it's not useful at times, but paying scrupulous attention to
every one of its hysterical pronouncements of doom isn't a good
strategy. As an example, I've <u>never</u> seen a kernel compile that didn't
generate a stack of warnings - and yet, all but one or two worked fine.

<p>
<strong>[Jason]</strong>
Or, for that matter, compiling almost any large software project seems
to generate a pile of warnings. And, yes, most of the time, everything
works fine.

<p>
<strong>[Brad]</strong>
I use -Wall because I can't stand streams of silly warnings; they
force me to write better code and more maintainable code. This, IMO,
is a Good Thing.

<p>
<strong>[Ben]</strong>
Oh, I'm all for enabling warnings - I don't write Perl code (other than
Perl Golf) without "-w" or "use warnings", and anything over 10 lines
gets "use strict" as well. I just think that "-Wall" goes <u>way</u>
overboard... but I guess it's more of a response to the way that C
itself is rather than twitchiness on the part of the developers.
Whenever blowing your nose has a perceptible chance of destroying the
entire Universe, a bit of reticence becomes understandable.

<p>
<strong>[Jason]</strong>
<pre>
post-increment-operator.c: In function `main':
post-increment-operator.c:5: warning: operation on `i' may be undefined
~/prog/c$ ./post-increment-operator 
i: 1, i++: 0
~/prog/c$ 
</pre>

<p>
NOTE: The program "runs fine". But the minute you try it on a different
compiler, you're probably going to get different results.

<p>
<strong>[Ben]</strong>
<pre>
ben@Fenrir:/tmp$ cc foo.c; ./a.out&gt;sample_run.txt
ben@Fenrir:/tmp$ for n in `apropos "C[+ ]*compiler"|awk '{print $1}'`
do $n foo.c; echo $n: $?; ./a.out|diff sample_run.txt -; done
c++: 0
c89: 0
c99: 0
cc: 0
g++: 0
g++-3.3: 0
gcc: 0
gcc-3.3: 0
i386-linux-g++: 0
i386-linux-g++-3.3: 0
i386-linux-gcc: 0
i386-linux-gcc-3.3: 0
i486-linux-g++-3.3: 0
i486-linux-gcc-3.3: 0
no makefile or Makefile found
ccmakedep: 1
</pre>

<p>
Whups, 'ccmakedep' snuck in where only compilers belong. Otherwise,
seems like none of them had a problem - and the program output was
exactly the same in all cases.

<p>
<strong>[Jason]</strong>
When I said "different compiler", I had in mind non-gcc based compilers.
So, just to see what a different compiler would do, I downloaded <a 
href="http://fabrice.bellard.free.fr/tcc/">tcc </a> and compiled the program. 
Exactly the same output as gcc. Hmmm.

<p>
So, I'll change my assertion from "the minute" to "five years into a
project, after you've ported it to 10 platforms, you're probably going
to get different results."  :-) 

<p>
<strong>[Ben]</strong>
[grin] Sounds reasonable.

<p>
<strong>[Jason]</strong>
But seriously, I think that if you're using C, you should avoid that
type of construct, because you don't know how the compiler is going to
define it. You can find out how <b>this</b> compiler defines it, and maybe
all the compilers you use do it the same way. But maybe it will change
in the new version; maybe you need to use a different compiler.

<p>
Coding in C is like playing with fire. You do one thing wrong, and BAM!
Segfault, or worse, obscure bug, or worse yet, undetected security hole.
I think using a construct whose behavior is undefined makes it more
likely that you'll get "one thing wrong".

<p>
Just my 2 cents.

<p>
<strong>[Ben]</strong>
Oh, I agree. It's why I avoid coding in C anymore; haven't done it for
years now. I've come to believe that the terms "fragile" and
"programming" shouldn't be allowed near each other, whereas C plans the
wedding, sends out the invitations, and writes the piranha-infested
prenuptial agreement.

<p>
<strong>[Jason]</strong>
Heh heh, I keep forgetting that the best possible C coding practice is
"Don't".

<p>
<strong>[Ben]</strong>
On the other hand, I won't be writing any device drivers in Perl.
(Contrariwise, one of my former students designed a website back-end
database that uses "grep" plus an odd directory structure, and it turned
out to be consistently faster than MySQL. Go figure.)

<p>
<strong>[Jimmy]</strong>
<a href="http://www.andromeda.com/people/ddyer/topten.html">
The Top 10 Ways to get screwed by the "C" programming language:</a>

<p>
(which has 17 ways)

<p>
<strong>[Ben]</strong>
The poor bugger used C to count, obviously.

<p>
<strong>[Sluggo]</strong>
"There must be fifty ways to leave your lover....

<p>
 You just slip out the back, Jack<br>
 Make a new plan, Stan<br>
 You don't need to be coy, Roy<br>
 Just get yourself free<br>
 Hop on the bus, Gus<br>
 You don't need to discuss much<br>
 Just drop off the key, Lee<br>
 And get yourself free" 

<p>
Paul Simon, "50 Ways to Leave Your Lover" 

<p>
<strong>[Brian]</strong>

<p>
I can't let you inject THAT song into my brain, turning what little
is left into gibbermushingfrooms without appropriate revenge:

<p>
In the middle of the earth in the land of the Shire<br>
lives a brave little hobbit whom we all admire.<br>
With his long wooden pipe,<br>
fuzzy, woolly toes,<br>
he lives in a hobbit-hole and everybody knows him 

<p>
Bilbo! Bilbo! Bilbo Baggins<br>
He's only three feet tall<br>
Bilbo! Bilbo! Bilbo Baggins<br>
The bravest little hobbit of them all

<p>
...

<p>
The Ballad of Bilbo Baggins ( Leonard Nimoy 1968)

<p>
on and on, ad nauseum. Take that! At least it wasn't the Carpenters...
AAAAAAAAAAAaaaaaaaaaaaaaaaaa...

<p>
<strong>[Jimmy]</strong>
Close to yo-ou 

<p>
<strong>[Ben]</strong>
Ah - ear worms. Be glad that no one has invoked the Barney Song; that
one trumps all, and requires a large drill press and a long sharp
extractor bit to remove from the sufferer's head.

<p>
<strong>[Brad]</strong>
<pre>
do {
"This is the song that never ends,
It goes on and on my friends!
Someone started singing it not knowing what it was,
and they'll continue singing it forever just because,"
}
while (1);
</pre>

<p>
<strong>[Ben]</strong>
<blockquote> 
 - "You can write a Perl script to do <b>anything</b>."<br>
 - "Hah! I'd like to see you write a Perl program to cut down a Redwood with
    a banana!"<br>
 - "Easy."

<p>
1 while 'banana';   # wait for the tree to rot and fall over

<p>
 -- several of the wizards in C.L.P.M.
</blockquote>

<p>
I suspect that your version would cause it to rot and die <b>much</b> faster.

<p>
<strong>[Breen]</strong>
There are advantages to not being a TV-watcher. I've managed not ever 
to have heard that tune.

<p>
I plan to keep it that way, too...

<p>
<strong>[Jimmy]</strong>
You lucky bastard. That's one of the biggest disadvantages of being a 
parent -- the rubbish that kids watch [1]. Most recently, I told my son 
I'd take him to the cinema and regretted it -- I thought he'd want to 
see "Shark Tale", but instead he made me sit through "YuGiOh - The 
Movie" (a movie based around a lesser Magic: The Gathering clone with 
dialogue that serves only to explain the game and the properties of each 
card).

<p>
<strong>[Brian]</strong>
Linux tie-in: <a href="http://www.theregister.co.uk/2004/04/19/hp_hollywood/">
HP off-site rendering on Linux-based HP Utility Rendering Service</a>

<p>
<strong>[Jimmy]</strong>
My son has become a mini-Linux advocate since he found out that it was 
used to make the Harry Potter films :)

<p>
<strong>[Jimmy]</strong>
[1] Though obviously not the programmes I watched when I was a kid -- we 
had quality TV in my day[2].

<p>
<strong>[Brian]</strong>
I've a number of friends who assure me that Shark Tale is quite good. At
least one such, sadly unburdened by rug rats, still has gone to see it
at least three times.

<p>
<strong>[Jimmy]</strong>
Yeah. Both Pixar and Dreamworks have made some great computer animated 
films. "Finding Nemo" is probably the best of the bunch. "Toy Story" was 
great, but it'll forever be marred for me, because of the guy who was 
sitting in the same row as my then-girlfriend and me who was enjoying it 
a bit too much.

<p>
<strong>[Jason]</strong>
I don't know about the rest of you, but whenever I see a CG movie, I
can't help thinking things like: "Wow! Look how good they did the
water!" or "Haha! It's just a flat textured surface!"

<p>
<strong>[Brian]</strong>
I've assured him that the next time I go to see a cartoon in the movies,
it'll be an hour plus of collected Wylie Coyote shorts. Effectively that
means never, as there are too many non-PC references, making Warner's
lawyers alternate between quivering in fear and salivating at the
prospective fees, win or lose.

<p>
<strong>[Jimmy]</strong>
Most, if not all, of them are available on VHS, so that + TV tuner card 
+ DVD burner + <a href="../issue83/stoddard.html">issue83/stoddard.html</a> 
= Wile E. Coyote, the collected works.

<p>
<strong>[Jimmy]</strong>
[2] I'm too young to be using phrases like "in my day" -- another 
disadvantage.

<p>
<strong>[Brian]</strong>
You're NEVER too young to use the phrase "in my day". For instance, in
the third grade, when your brother is coming into first grade for his
first day, this is appropriate: "In my day, they used to glue your
thingy closed if you asked to go to the bathroom too many times. You'll
be fine, I"m sure..." I think he's blocked out the memory of that day.

<p>
<strong>[Jimmy]</strong>
Good point. My youngest sister started Secondary school this year and 
had to be briefed on the various things my brothers and I did so she 
wouldn't be surprised about the extra surveillance.

<p>
<strong>[Brian]</strong>
There are times, however, when it's not prudent: At the birth of your
daughter's first child, "In my day we just screamed a few times, popped
the babies out, and went back to work in the fields." Remember that
she's lying in an OR setting with plenty of sharp instruments around.

<p>
<strong>[Jimmy]</strong>
Heh. Reminds me of when my son was born - I was, until then, blissfully 
unaware of such things as vacuum deliveries or episiotomies and in the 
hour-long seconds when my newly delivered little boy spent showing no 
signs of life I had measured the distances between me, nearest sharp 
object, and doctor's throat.

<p>
<strong>[Brian]</strong>
Then there's the "In my day" sayings that refer to times that should be
forever forgotten: "In my day we wore white polyester and vinyl, and we
were happy to do so." Statements like that are conversation killers.

<p>
<strong>[Jimmy]</strong>
Erm... yes.

<p>
/me slowly backs away.

<p>
<strong>[Brian]</strong>
.brian (who remembers to add the X-Gazette-Tag about 50% of the time)

<p>
<strong>[Jimmy]</strong>
I think we're off-topic enough for that to not matter :)

<p>
<blockquote><em>[
Earlier in this thread...
]</em></blockquote>

<p>
<strong>[Ben]</strong>
or, since this is a "single-use" loop (as I recall it) -

<pre>
int i = 6;
while (i) in[i] = atoi(argv[i--]);
</pre>

<p>
<strong>[Jason]</strong>
Essentially the same loop as before, so the same problem. I'm not 100%
sure that the C standard says it's undefined, but at the very least, it
strikes me as not the best coding style for C.

<p>
<strong>[Ben]</strong>
[grin] Oh, certainly not. It's just me and my prejudices.

<p>
<strong>[Jason]</strong>
Oh! Do you mean, that because of our different (programming) language
background, we would of course code in C using styles from the other
language that we are most familiar?

<p>
<strong>[Ben]</strong>
Computers are supposed to work hard so we don't have to, dammit.

<p>
<strong>[Jason]</strong>
C is not my "first language", so I don't try to take too many shortcuts,
for fear of getting lost. For instance:

<pre>
~/prog/c$ grep '!= 0' *.c
atime-check.c:          if(stat(filename, &amp;fileinfo) != 0) {
atime-check.c:          if(stat(filename, &amp;fileinfo) != 0) {
findmagic.c:        if(stat(filename, &amp;fileinfo) != 0) {
findmagic.c:                if(strcmp(filetype, "data") != 0)
link.c: if(syscall(__NR_link, argv[1], argv[2]) != 0) {
listdir.c:      DIE_IF(closedir(d) != 0);
loop.c: if(pipe(fds) != 0)
~/prog/c$ 
 
</pre>

<p>
It doesn't really make sense to say that in C ever because true is
basically defined as "not zero".  And yet I say it anyway, because I
always have to think twice whenever I see

<pre>
if(variable)
        do_stuff();
</pre>

<p>
&lt;shrug&gt; It's a style issue. I don't think correct behavior should be a
side-effect.

<p>
<strong>[Ben]</strong>
Heh. No, it's supposed to be a language-enforced feature, in something
supposedly as clearly-defined as C. In practice, well, that's a
different story.

<p>
<strong>[Brad]</strong>
As you said, it's a CodingStyle thing, but I find that "when in doubt,
use prefix". It tends to help when you SIGSEGV in a loop and can't
figure out why  ;) 

<p>
<strong>[Jason]</strong>
Yeah, I try to use the prefix form as much as I can. When I <b>want</b>
strange side effects, I'll <b>ask</b> for it, thankyouverymuch.  :) 

<p>
<strong>[Ben]</strong>
Yup. "When in doubt, write it out" is not a bad strategy for avoiding a
certain class of problems in C coding. This, of course, is
self-defeating to a degree - more lines means more debugging and
increases the chance of a typo - but that's what "lint", "-Wall" and so
on are for.

<hr width="80%">
<a name="laundrette.lottery"></a>
<h3>TAG Lottery</h3>

<p>
<strong>[Kapil]</strong>
I know this is linux-questions-only and so on but here goes:

<p>
<strong>[Sluggo]</strong>
It's just a question of whether you win the TAG lottery.  Answering
questions gives you good karma, which makes it more likely you can ask
a Windows question without getting flamed.

<hr width="80%">
<a name="laundrette.procmail"></a>
<h3>Procmail</h3>
<strong>[Jay]</strong>
Yeah.  Gmail massages the reply-to on outgoing mail to force a carbon
to the sender, and puts that <b>first</b>, screwing up my mutt save-file.

<p>
I wish they'd add it at the <b>end</b>.

<p>
<strong>[Ben]</strong>
You could always "mung it back to normal" in your ~/.procmailrc.
Shouldn't be too hard, I'd think.

<p>
<strong>[Jay]</strong>
If I were running procmail.  :-}

<p>
<strong>[Ben]</strong>
Well, yes, you <u>would</u> have to purchase this expensive piece of
software, wait for it to be shipped to you, agree to the shrink-wrap
EULA, attach the special enabler dongle to your serial port, get the
coded, limited-time key from the vendor after paying the per-seat fee,
spend several years configuring the incredibly complex operation of
it, perhaps buy a new computer because the current one isn't powerful
enough... it <u>is</u> quite the hassle, I understand. :/

<p>
<strong>[Jay]</strong>
Well, clearly that was sarcasm.

<p>
Except for the "incredibly complex ... configuration" part.   :-) 

<p>
But that <b>does</b> entail mindreading, and I so hate that.

<p>
<strong>[Ben]</strong>
Nah, no mindreading necessary. Installing a single package fits, without
any odd corners sticking out, into "Shouldn't be too hard, I'd think."

<p>
<strong>[Jay]</strong>
No, my point was that there are <b>sometimes</b> good reasons to put an
added reply-to first: TAG ourselves, for example.

<p>
But gmail's reasons aren't good.  IMHO.

<p>
<strong>[Kapil]</strong>
As far as I can see, this is one of those "active developer/backward
compatability" (AD/BC) issues. The AD wanting to move to GUI (yes, it
<b>was</b> a while ago but we CLI types don't die easy :)) Unfortunately,
when the "shell" was designed it was assumed (ah-ha!) that no one would
run programs (except daemons) other than from the command-line or from
other running programs and so on recursively (*).

<p>
(*) Hofstader-ise that one.

<p>
<strong>[Ben]</strong>
Naw, a recursive statement of a recursive problem is beautiful just as
it is. Why spoil a good thing?  :) 

<hr width="80%">
<a name="laundrette.english_words"></a>
<h3>English words appearing in the 20th century</h3>

<p>
<strong>[Sluggo]</strong>
<a href="http://news.bbc.co.uk/2/hi/uk_news/magazine/3755482.stm">
http://news.bbc.co.uk/2/hi/uk_news/magazine/3755482.stm</a>

<p>
<strong>[Jimmy]</strong>
Not quite - the list has "awesome", "hip", "acid", and "cool", which 
definitely existed before the 20th century. The article picks words that 
sum up something about the year (miniskirt in 1965, 9/11 in 2001), or 
that were used in their current sense long before most would guess (hip 
in 1904, pop in 1921).

<hr width="80%">
<a name="laundrette.post_hurricane"></a>
<h3>Post-hurricane news</h3>

<p>
<strong>[Ben]</strong>
FYI, folks - I'm alive and well. Don't know about the boat yet - I've
spent the hurricane over at a friends' house. I'll see what's up
tomorrow, but I'm assuming it's all good; I've got good anchors, and the
winds in St. Augustine shouldn't have gone much above hurricane force,
if at all.

<p>
<strong>[Jimmy]</strong>
Glad to hear it. Also glad to hear that this isn't an  
<a href="http://64.233.183.104/search?q=cache:vafyyC1Jkq8J:www.cnn.com/2004/TECH/internet/09/25/email.dead.ap/+&amp;hl=en&amp;lr=lang_en">
email from beyond the grave</a>

<p>
<strong>[Ben]</strong>
Two people have been reported dead, so far - one of them from alcohol
poisoning during a hurricane party. Just wanted to reassure everyone
that it's not me, despite the amount of vodka consumed in this house in
the past day (yep, these friends are Russian. :)

</p>



<!-- *** BEGIN author bio *** -->
	<!-- *** BEGIN bio *** -->
<hr>
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2004/authors/oregan.jpg" class="bio">
<em>
Jimmy has been using computers from the tender age of seven, when his father 
inherited an Amstrad PCW8256. After a few brief flirtations with an Atari ST
and numerous versions of DOS and Windows, Jimmy was introduced to Linux in 1998
and hasn't looked back.

<p> Jimmy is a father of one, a techno-savvy seven year-old called Mark. 
When he isn't cutting pieces off himself at work, he likes to play guitar and
read -- not normally at the same time, but the picks make handy bookmarks.

<p> Jimmy likes to collect the off-topic threads that crop up on The Answer
Gang's mailing list, mainly because it's a good excuse for keeping these
threads going.

<p> Jimmy is currently job hunting.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

<!-- *** END author bio *** -->




<div id="articlefooter">



<p>
Copyright &copy; 2004, <A HREF="../authors/oregan.html">Jimmy O'Regan</A>. Released under the
<a href="http://linuxgazette.net/copying.html">Open Publication license</a>
</p>



<p>
Published in Issue 108 of Linux Gazette, November 2004
</p>

</div>

</div>

<div id="navigation">

<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>

<div id="breadcrumbs">

<a href="../index.html">Home</a> &gt;
<a href="index.html">November 2004 (#108)</a> &gt;
TWDT

</div>


<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>

<br />


</body>
</html>