File: issue69.html

package info (click to toggle)
lg-issue69 2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,996 kB
  • ctags: 141
  • sloc: perl: 131; sh: 59; sql: 49; makefile: 45
file content (8334 lines) | stat: -rw-r--r-- 318,966 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> Linux Gazette Table of Contents LG #69</TITLE>
<META NAME="robots" CONTENT="noindex, nofollow">
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000" >
<center>
<!-- A HREF="http://www.linuxgazette.com/">
<H1><IMG SRC="../gx/newlogo.jpg" ALT="LINUX GAZETTE" border="0"></H1></A> --> 
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png" 
	WIDTH="600" HEIGHT="124" border="0"></H1></A> 
<H2>August 2001, Issue 69 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Published by <I>Linux Journal</I></H2> 

<A HREF=../index.html>Front Page</A> &nbsp;|&nbsp;
<A HREF=../index.html>Back Issues</A> &nbsp;|&nbsp;
<A HREF=../faq/index.html>FAQ</A> &nbsp;|&nbsp;
<A HREF=../mirrors.html>Mirrors</A> &nbsp;|&nbsp;
<A HREF=http://www.linuxgazette.com/search.html>Search</A>
</center>

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

<table>
<TR>
<TD COLSPAN="3" WIDTH="100%" BGCOLOR="#000000"><IMG
SRC="../gx/hammel/cleardot.gif" ALT="" HSPACE=30 VSPACE=2 HEIGHT=1
WIDTH=1 ALIGN=LEFT></TD>
<TD></TD>
</TR>
<tr><td>
<table>
<tr>
<td VALIGN="top"><H1><font color="#BB0000">Visit Our Sponsors:</font></H1></td></tr>



<!-- *** BEGIN sponsors *** -->
<TR><TD>
	<A HREF="http://www.penguincomputing.com"><IMG ALT="Penguin Computing" SRC="../gx/sponsors/penguincomputing.gif" BORDER="0" VSPACE="10"></A>
</TD></TR>

<TR><TD>
	<A HREF="http://www.linuxnetworx.com"><IMG ALT="Linux NetworX" SRC="../gx/sponsors/linuxnetworx.gif" BORDER="0" VSPACE="10"></A>
</TD></TR>


<!-- *** END sponsors *** -->




</table>
</td>
<!--==================================================================-->
<TD ROWSPAN="3" WIDTH="2" BGCOLOR="#000000" NOSAVE><IMG
SRC="../gx/hammel/cleardot.gif" ALT="" HSPACE=1 HEIGHT=1 WIDTH=1%></TD>
<td VALIGN=top>
<H1><font color="#BB0000">Table of Contents:</font></H1>




<!-- *** BEGIN toc *** -->
<UL>
	<LI>  <a HREF="lg_mail69.html">The MailBag</A> 
	<LI>  <a HREF="lg_bytes69.html">News Bytes</A> 
	<LI>  <a HREF="lg_answer69.html">The Answer Gang</A> 
	<LI>  <a HREF="lg_tips69.html">More 2-Cent Tips</A> 
	<LI>  <a HREF="collinge.html">HelpDex</A> , <EM>by Shane Collinge</EM>
	<LI>  <a HREF="henderson.html">Make Your Virtual Console Log In Automatically</A> , <EM>by Bryan Henderson</EM>
	<LI>  <a HREF="mathew.html">Creating a Kernel Driver for the PC Speaker</A> , <EM>by Cherry George Mathew</EM>
	<LI>  <a HREF="nielsen.html">Combining Perl and PostgreSQL, Part 2: Procedures with PL/pgSQL</A> , <EM>by Mark Nielsen</EM>
	<LI>  <a HREF="okopnik.html">Learning Perl, part 5</A> , <EM>by Ben Okopnik</EM>
	<LI>  <a HREF="orr.html">DMCA in the news: Russian programmer arrested, nerds protest for his release</A> , <EM>by Mike Orr</EM>
	<LI>  <a HREF="peda.html">Installing Tomcat on Linux</A> , <EM>by Allan Peda</EM>
	<LI>  <a HREF="qubism.html">Qubism</A> , <EM>by Jon "Sir Flakey" Harsem</EM>
	<LI>  <a HREF="spiel.html">Numerical Workbenches</A> , <EM>by Christoph Spiel</EM>
	<LI>  <a HREF="lg_backpage69.html">The Back Page</A> 
</UL>

<!-- *** END toc *** -->




</td>
</tr>
<TR>
<TD COLSPAN="3" WIDTH="100%" BGCOLOR="#000000"><IMG
	SRC="../gx/hammel/cleardot.gif" 
	ALT="-------------------------------------------------------------" 
	HSPACE=30 VSPACE=2 HEIGHT=1 WIDTH=1 ALIGN=LEFT></TD>
<TD></TD>
</TR>
</table> <!-- ******************************************* -->

<H3 ALIGN="center"><EM>Linux Gazette</EM> Staff and The Answer Gang</H3>
<BLOCKQUOTE>
<STRONG>Editor:</STRONG> Michael Orr<BR>
<STRONG>Technical Editor:</STRONG> Heather Stern<BR>
<STRONG>Senior Contributing Editor:</STRONG> Jim Dennis<BR>
<STRONG>Contributing Editors:</STRONG>
Ben Okopnik, Dan Wilder, Don Marti
</BLOCKQUOTE>

<TABLE WIDTH="100%"><TR>
<TD WIDTH="100%" BGCOLOR="#000000"><IMG
SRC="../gx/hammel/cleardot.gif" ALT="" HSPACE=30 VSPACE=2 HEIGHT=1
WIDTH=1 ALIGN=LEFT></TD>
</TR></TABLE>

<P> <!-- ************************************************** -->
<table>
<tr><td>
<A HREF="issue69.txt.gz">TWDT 1 (gzipped text file)</A><BR>
<A HREF="issue69.html">TWDT 2 (HTML file)</A><BR>
are files containing the entire issue: one in text format, one in HTML. 
They are provided 
strictly as a way to save the contents as one file for later printing in
the format of your choice; 
there is no guarantee of working links in the HTML version.
 </td></tr>
<!--==================================================================-->
<TR>
<TD COLSPAN="3" WIDTH="100%" BGCOLOR="#000000"><IMG
SRC="../gx/hammel/cleardot.gif" ALT="" HSPACE=30 VSPACE=2 HEIGHT=1
WIDTH=1 ALIGN=LEFT></TD>
<TD></TD>
</TR>
<tr><td>
<center>
<I>Linux Gazette</I><img alt="[tm]" src="../gx/tm.gif">, 
<A HREF="http://www.linuxgazette.com/">http://www.linuxgazette.com/</A><BR> 
This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>
<P> 
<H5>Copyright &copy; 1996-2001 Specialized Systems Consultants, Inc.</H5>
</center>
</td></tr>
<TR>
<TD COLSPAN="3" WIDTH="100%" BGCOLOR="#000000"><IMG
SRC="../gx/hammel/cleardot.gif" ALT="" HSPACE=30 VSPACE=2 HEIGHT=1
WIDTH=1 ALIGN=LEFT></TD>
<TD></TD>
</TR>
</table>
<center>
<H1><A NAME="wanted"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/mailbox.gif">
The Mailbag</A></H1> <BR>
<!-- BEGIN wanted -->

</center>
<P> <hr> <P>
<!-- =================================================================== -->
<center><H3><font color="maroon">HELP WANTED : Article Ideas</font></H3></center>
<P>
<P> Send tech-support questions, answers and article ideas to The Answer Gang
&lt;<A HREF="mailto:linux-questions-only@ssc.com"
	>linux-questions-only@ssc.com</A>&gt;.  Other mail (including
questions or comments about the <EM>Gazette</EM> itself) should go to
&lt;<A HREF="mailto:gazette@ssc.com">gazette@ssc.com</A>&gt;.  All material
sent to either of these addresses will be considered for publication in the
next issue.  <EM>Please send answers to the original querent too, so that s/he
can get the answer without waiting for the next issue.</EM>

<P> Unanswered questions might appear here.  Questions with
answers--or answers only--appear in The Answer Gang, 2-Cent Tips, or here,
depending on their content.  There is no guarantee that questions will
<em>ever</em> be answered, especially if not related to Linux.

<P> <STRONG>Before asking a question, please check the
<A HREF=../faq/index.html><I>Linux Gazette</I> FAQ</A> to see if it has been
answered there.</STRONG>

<P> <HR> <P>
<!--====================================================================-->

<!-- BEGIN HELP WANTED : Article Ideas -->

<UL>
<!-- index_text begins -->
<li><A HREF="#wanted/1"
	><strong>Compact Flash Card</strong></a>
<li><A HREF="#wanted/2"
	><strong>Booting x86 from flash using initrd as root device</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">Compact Flash Card</FONT></H3>
Wed, 20 Jun 2001 12:20:27 +0800
<BR>Kamal (<a href="mailto:linux-questions-only@ssc.com?cc=kamal@eutech.slt.lk">kamal from eutech.slt.lk</a>)

<P>
I have a problem in adding a new file system in to a device called
mediaEngine. It is a product of brightstareng.com
There is slot for a Compact Flash. I bought a compact flash and added
it, but thenit does not recognise the card. it says there isan i/o
error. the mke2fs does not work properly. I am not able to mount even.
</P>
<P>
pleaese help me regarding this.
</P>
<P>
thanking you inadvance
</P>
<P>
kamalakanth
</P>

<!-- 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">Booting x86 from flash using initrd as root device</FONT></H3>
Mon, 09 Jul 2001 18:50:25 +0530
<BR>S. Manohar (<a href="mailto:linux-questions-only@ssc.com?cc=manohar@hclt.com">manohar from hclt.com</a>)

<P>
Hello Everybody,
</P>
<P>
I am trying to develop a x86 target which boots from Flash. I have
taken the BLOB bootloader  (taken from LART
project based on ARM processor.)  and  am modifying it for X86. So far I
am able to get the Linux kernel booted. But when it
comes to the mounting of rootfile system I am stuck. ( The blob
downloads the kernel image and initrd image  into RAM from
Flash/through serial line).
</P>
<P>
1. I am getting the compressed  kernel image  in RAM at 0x100000 through
serial line.
</P>
<P>
2. I am getting the compressed ramdisk  image(initrd)  in RAM at
0x400000 through serial line.
</P>
<P>
3. The kernel gets uncompressed and boots correctly till the point of
displaying the message
</P>
<P>
RAMDISK: Compressed image found at block 0.
and then hangs.
</P>
<P>
4. After debugging I have found that control comes till gunzip function
inlinux/lib/inflate.c  but never comes out of the function.
</P>
<P>
5. The parameters I have set at the begining of setup_arch function in
linux/arch/i386/kernel/setup.c are as follows
</P>

<blockquote><pre>         ORIG_ROOT_DEV = 0x0100
         RAMDISK_FLAGS = 0x4000
         INITRD_START = 0x400000
         INITRD_SIZE =  0xd4800    (size of compressed  ram disk image)
         LOADER_TYPE = 1
</pre></blockquote>
<P>
Has anyone faced such problem before?  If so what needs to be done?
</P>
<P>
Are the values for the  parameters mentioned above correct? Are they the
only information to be mentioned to the kernel for
locating and uncompressing the RAMDISK image and make it boot?
</P>
<P>
Is there any bootloader readily available for x86 platform for booting
from Flash also with serial downloading facility?
</P>
<P>
Please help
</P>
<P>
With Kind Regards,
<br>manohar
</P>

<!-- end 2 -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<H5 align="center">This page edited and maintained by the Editors
	of <I>Linux Gazette</I> 
<a href="http://www.linuxgazette.com/copying.html"
	>Copyright &copy;</a> 2001
<BR>Published in issue 69 of <I>Linux Gazette</I> August 2001</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>
<!-- *** END copyright *** -->
<a name="mailbag"></a>
<P> <hr> <P>
<!-- =================================================================== -->
<center><H3><font color="maroon">GENERAL MAIL</font></H3></center>
<P> <HR> <P>
<!--====================================================================-->

<!-- BEGIN GENERAL MAIL -->

<UL>
<!-- index_text begins -->
<li><A HREF="#mailbag/1"
	><strong>KEEP UP THE GOOD WORK !!!!</strong></a>
<li><A HREF="#mailbag/2"
	><strong>not happy</strong></a>
<li><A HREF="#mailbag/3"
	><strong>Blinking Icons</strong></a>
<li><A HREF="#mailbag/4"
	><strong>question</strong></a>
<li><A HREF="#mailbag/5"
	><strong>"Those were the days"</strong></a>
<li><A HREF="#mailbag/6"
	><strong>RE: Linux Gazette Kernel Compile Article.</strong></a>
<li><A HREF="#mailbag/7"
	><strong>Parrallel processing</strong></a>
<li><A HREF="#mailbag/8"
	><strong>response to: Yet Another Helpful Email</strong></a>
<li><A HREF="#mailbag/9"
	><strong>anser guy</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">KEEP UP THE GOOD WORK !!!!</FONT></H3>
Mon, 9 Jul 2001 09:53:21 -0700
<BR>badjooda (<a href="mailto:gazette@ssc.com">badjooda from yahoo.com</a>)

<P><STRONG>
Remember when you said :
</STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM><BLOCKQuote>
WinPrinter Work-around
From harmbehrens on Sat, 01 May 1999
</BLOCKQuote></EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#006633"><EM>
Hello, is there any work-around to get a gdi printer (Star Wintype 4000) to
work with Linux :-?
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#006633"><EM>
Harm
</EM></FONT></STRONG></P>
<P><CODE>
. . .
</CODE></P>
<P><STRONG><FONT COLOR="#000066"><EM>
I presume that these are NOT what you wanted to hear. However, there is no
way that I know of to support a Winprinter without running drivers that are
native to MS Windows (and its GDI --- graphics device interface --- APIs).
</EM></FONT></STRONG></P>
<P>
What about using one of the Windows emulators like <A HREF="http://www.winehq.com/">WINE</A>
(<A HREF="http://www.winehq.org"
	>http://www.winehq.org</A>) ? -- Mike
</P>
<P>
Actually, a very few GDI- aka "winprinters" are supported - some Lexmarks.
I saw them first as debian packages but I'm pretty sure Linuxprinting.org
has more details.  The notes said that rumor has it some other GDI printers
work with those, but it's a bit of effort and luck.  Rather like winmodems...
-- Heather
</P>
<P><STRONG>
I Agree 100% about the GDI printers!  (I refer to them as Goll Damn M$
Imitators).  Unfortunately, until the recent developments on the federal
court case M$ has not been checked at all.  Some parts of what they, as
a Monopoly have done has been good for the IT commmunity, while other
things have really crapped on people WHO THINK!
</STRONG></P>
<P><STRONG>
Thank GOD !!!!!  Linux is around to be a thorn in their side ...
</STRONG></P>
<P><STRONG>
THe other incidious thing printer manufacs have done is stop building
as many Postscript printers.  They are all using the friggin Windows
drivers to do everything ...  .  So I have begun to play the stinkin game
by mounting SMALL 468-DX266 16 Megs Linux Print Servers running SAMBA.
THe newest ver of SAMBA even does PDC correctly.
</STRONG></P>
<P><STRONG>
Linux has been my savior in many times of need!  I have been able to
use thos stinking 386 boat anchors as LRP routers or firewalls, the
small 90 Pent to 166 Pent are becoming LTSP Linux Xwindow Terminals.  I
still have stinking  problems from time to time, yet I DON'T HAVE TO
REBOOT EVERY 24 [&amp;^%$!#]* days PER TECHNET(M$ answer to internal
pay support) FOR NT SERVERS!  I have Linux servers with uptimes of 200 +
days IN PRODUCTION!
</STRONG></P>
<P><STRONG>
I'll sign off , enough rambling and ranting for one email.  I just
found your stuff through linuxdoc.org, and I thought you HIT THE NAIL ON
THE HEAD!
</STRONG></P>
<P><STRONG>
KEEP UP THE GOOD WORK!
</STRONG></P>
<P>
The real question is, is it worth spending 50 bucks instead of 200 or more,
when you're going to spend a bunch of time making sure your driver is wired
up right?   I have an unfair advantage, since I live where these things are
sold readily, but I get to say no ... I can spend about 80 bucks on a color
printer which is actually listed as fully supported.
</P>
<P>
You may be able to mail order a good printer at a decent price.  On the other
hand, if exploring how these things all tie together under the hood is fun,
then you can improve the state of the art for such printers, and maybe some
fine day folks will be able to easily use "the GDI printer that came with
their MS windows" without having to fight with it like this.
</P>
<P>
-- Heather
</P>

<!-- 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">not happy</FONT></H3>
Thu, 5 Jul 2001 09:08:47 -0700
<BR>32009318 (<a href="mailto:gazette@ssc.com">32009318 from snetmp.cpg.com.au</a>)


<!-- sig -->

<P>
On Wed, Jul 04, 2001 at 09:26:35PM +1000, 32009318 wrote:
</P>
<P><STRONG>
i know how annoyed you guys at the linux gazette must feel as i have
been reading many back issues of the gazette and finding lots of cool
tips and trick but the question always comes up
</STRONG></P>
<P><STRONG>
CAN YOU SOLVE WINDOWS PROBLEMS
people just dont get it youre called the linux gazette and you help with
linux questions
</STRONG></P>
<P>
Unfortunately, we also have no idea where they find the reference to us that
gives them the impression we do anything in Windows... more's the pity, since
we can't beg the webmaster to take the link down.
</P>
<P>
They can certainly trip on us in search engines though, especially the worse
ones.  I can imagine someone frustrated with some Windows networking matter
tripping over our many notes about Samba, since the point is to link up to
some MSwin boxes... -- Heather
</P>
<P><STRONG>
(you do it very well i should add)
</STRONG></P>
<P>
Oh thank you, we like to hear that! -- Heather
</P>
<P>
The problem is, most people who ask Windows questions found the submission
address via a search engine, and have no idea the address belongs to Linux
Gazette or even know what Linux Gazette is.  Perhaps we should have used
an address like linux-questions-only, but we can't stop honoring the old
addresses since they are published in so many back issues and some are on
CD-ROMs that we can't change. -- Mike
</P>
<P><STRONG>
You should clearley state this in youre next issue or be humorous and
rename yourself The Not Windows Gazette
</STRONG></P>
<P>
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> They're not the only odd ones out - we've had IRIX, PC-MOS, and other
odd OS users crop up before too.
</P>
<P>
<FONT COLOR="purple">
[Ben] Even had someone trying to get root access to their rhubarb, recently...
</FONT>
</P>
<P>
Funny you should mention a name change though.  We <EM>have</EM> changed the name
of the Answer Gang mailing list to "<A HREF="mailto:linux-questions-only@ssc.com"
	>linux-questions-only@ssc.com</A>"  -- Heather
</P>
<P>
Many TAG threads have humorous comments and/or rants about off-topic
questions.  Heather also tries to guide people in her "Greetings from
Heather Stern" blurb about how to ask a good question and how not to ask
a bad question.  Finally, I have started making fun of off-topic questions
on the Back Page of the past few issues.  There's now a section on the
Back Page called "Not The Answer Gang", as well as "Wackiest Topic of the
Month".  -- Mike
</P>
<P><STRONG>
keep up the good work with linux
</STRONG></P>
<P>
Thanks bunches, we're glad you enjoy the read!  -- Heather
</P>

<!-- 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">Blinking Icons</FONT></H3>
Wed, 18 Jul 2001 14:13:14 -0400
<BR>David Martinez (<a href="mailto:gazette@ssc.com">d_martinez7 from hotmail.com</a>)


<!-- sig -->

<P><STRONG>
I love reading LG every month, especially TAG, and 2cent tips.  But the new
blinking question and exclamation icons are somwhat annoying.  Any chance of
going back to the old ones? 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</STRONG></P>
<P><STRONG>
thanks for all the good work!
</STRONG></P>
<P>
blinking?  They're not supposed to blink.  In fact, if they are it's been
that way for <EM>YEARS</EM> ... since I first provided .gif files with the ! and ?
in them in blue, instead of with those stupid "!" and "?" that nobody could
read.
</P>
<P>
It would mean I accidentally had layers in them.  But there's no loop command,
so even if you see that briefly it should stop.  Is that what you are seeing,
or does it continue to blink?  Did you change browsers at all recently?  If
so to which one?
</P>
<P>
We have been trying to improve browser compatability lately anyway 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> Thanks
for bringing it up.
</P>
<P>
[ turning to my fellow editor ] Mike, did anybody run any scripts against the
graphic images recently that I need to know about?
</P>
<P>
-- Heather
</P>
<P>
No, we haven't changed those images.  I've threatened to change all .gif's
to .png or .jpg and change all the links, but haven't done it yet.  I've only
used blinking text once or twice and that wasn't in the TAG column.
</P>
<P>
Also, LG is probably the only site in the world that requires NON-ANIMATED
logo images from its sponsors.  Because I personally have a strong
intolerance for unnecessary animations.
</P>
<P>
-- Mike
</P>
<P>
The "blinking Icons" are actually three layer gifs with one backround (white
bubble) and 0ms display time and two layers (question mark and shadow) with
100ms display time in combine mode (will be overlayed over the previous one).
</P>
<P>
opera5.0/Linux displays them on a strange blue background (seems to have a
gif problem, also with other gifs not only these little ones).
</P>
<P>
If you want a scriptable tool (besides gimp) there is a program called
pngquant which can do the color (and size) reduction on png files which
convert will not do.
</P>
<P>
-- K.-H.
</P>
<P><DL><DT>
Mike didn't find the utility in <A HREF="http://www.debian.org/">Debian</A> but its homepage is:
<DD><A HREF="http://www.libpng.org/pub/png/apps/pngquant.html"
	>http://www.libpng.org/pub/png/apps/pngquant.html</A>
</DL></P>
<P>
-- Heather
</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">question</FONT></H3>
Tue, 3 Jul 2001 19:16:24 EDT
<BR>Mattybiz (<a href="mailto:gazette@ssc.com">Mattybiz from aol.com</a>)

<P><STRONG>
Everyone I know is having the same problem. Not only is the Telnet completely
outdated, but it simply does not work for people off campus in most
areas...
</STRONG></P>
<P>
Hint: putty, one of the ssh clients for Windows that we keep pushing, is also
a better "normal telnet" client for Windows. -- Heather
</P>
<P><STRONG><FONT COLOR="#000066"><EM>
And last weekend I discovered that the public library in Halifax, Nova Scotia,
has putty as the <EM>default</EM> terminal emulator on their public Windows
terminals!!!  Way to go, library!  And switching between telnet and ssh in
putty is easy: just choose one radio button or the other.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Unkudos to the Second Cup cybercafe in Halifax.  The Start menu has a
special item for Telnet but when you choose it, you get a dialog saying,
"this operation is prohibited by the system administrator".  -- Mike
</EM></FONT></STRONG></P>
<P><STRONG>
you call yourself the "answer guy" and all you know how to be is a
sarcastic little bastard..
</STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
If you saw the hundreds of messages we receive every month and the high
percentage of them that are questions totally outside our scope, you
might become a sarcastic little bastard too.  -- Mike
</EM></FONT></STRONG></P>
<ol>
<li> He didn't call himself The Answer Guy -- that's what Marjorie named the
column, and the title clung to him.  It's an okay title but there could
be better ones - none of which stuck long enough to be worth changing the
column title.

<li> It's a whole bunch of people now - has been for months - so it's The
Answer Gang.  Which member of the Gang are you whining about? 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">

<br>
I'll assume Jim Dennis, for the moment.


<li>"all he knows how to be is..." - yeah, that's why he has a well paying
job in the Silicon Valley, and a published book (from a normal publishing
house, so yes, it's been spell checked), and speaking engagements at
conferenees.  Because he doesn't know anything.
</ol>
<P>
We all have our good days, and our sarcastic days, and the point of our
column is that we're real people, answering in just the same way we would
if you asked us at the mall while we were buying a box of the latest
Linux distro.
</P>
<P>
A particular thing to note is very few of us are Windows people.  Most of
us not at all - and others have had bad real-life experiences with the OS
you presently favor.  So not everyone will be cheer and light towards things
we consider to be poor sysadmin practices.  Especially things which would
be poor sysadmin practices even in an all Microsoft corporate netcenter.
</P>
<P>
At least two of us have enough WIndows experience to attempt answers in
that direction -- but this is the LINUX Gazette.  If your questions are
not about LINUX at least partially, then we really didn't want to hear
from you... so you should be glad you got any answer at all...
</P>
<P>
... and curiously enough, some Windows people have gotten real answers
for themselves in Linux documents once we point them the right way.
</P>
<P>
The practice of running an open service needs more care than just "clicking
Yes" on the NT service daemon, and some of these services only make sense
in a locked up environment.
</P>
<P>
Many but not all of The Answer Gang feel that telnet is now one such service.
By mailing us you ask our opinion, and that opinion is real, so we say it.
You do not have to like our opinions.  We don't have to like yours.  We
can still share computing power.
</P>
<P align="center">
<em>A free society is one where it is safe to be unpopular.</em>
</P>
<P><STRONG>
you make yourself seem very unintelligent to me and
have you ever heard of "If you can't say anything nice.don't say it at all?"
</STRONG></P>
<P>
As if calling us a bastard is nice, yet you bothered to say <EM>that</EM>.  You know
absolutely nothing of the parentage of any member of this group unless you
read our Bios (<A HREF="../issue67/tag/bios.html"
	>http://www.linuxgazette.com/issue67/tag/bios.html</A>) ...
</P>
<P>
... and we know that you have not because you only speak to one person.
</P>
<P>
Parentage (or lack of one) doesn't necessarily lead to being technologically
clued, but having technical or scientifically inclined parents seems to help.
</P>
<P><STRONG>
Apparently not. The question Nellie asked was a valid one. Too bad she does
now all the mumbo jumbo computer jargon...maybe the next time you should self
proclaim yourself as the "Smart-ass Guy" instead.
Miriam Brown
</STRONG></P>
<P>
I believe "curmudgeon" is the term you're looking for, and yes, Jim Dennis
labels himself to be one.  Proudly.
</P>
<P>
Interestingly, a querent this month has asked where to read up on the techy
mumbo jumbo words so they can learn more about Linux and speak more freely
with their geeky friends.  Our answers to that will actually be useful to
many readers.
</P>
<P>
Poor english is tolerated to a fair degree on the querent's side.
(that is, if we can't figure out what querents are saying, it's hard to
even <EM>try</EM> to answer them).  Each Answerer's personal style is mostly
kept - so some are cheerful, some are grumpy.
</P>
<P><STRONG>
PS...Don't answer guys usually use spell check?
</STRONG></P>
<P>
It is not required to know how to use a spell checker, in order to know how
to rebuild a kernel.  You have delusions of us being some glossy print
magazine like <EM>Linux Journal</EM>.  (ps.  Our host, SSC publishes that.  It
does get spell checked and all those nice things.  Go subscribe to it if
you like.  End of cheap plug.)
</P>
<P>
Nobody here is paid a dime for working on the <EM>Gazette</EM> specifically, so
our editorial time is better spent on link checking and finding correct
answers... er, well, we try... than spellos.  We have occasionally had
people complain about this point very clearly and loudly, but there is
not room in the publishing schedule for them to squish themselves in
between and still meet deadline.  We suggested that they make their own
site carry the past issue after fixes (our copyright allows this) but
the people have then always backed down and gone away.  We'd almost
certainly merge their repairs if they made some, but nobody has taken
up on that offer yet.  Oh well.  Let us know if you want to start the
Excellent Speller's Site - we'll cheer for you.  Maybe some other docs
in the <A HREF="http://www.linuxdoc.org/">Linux Documentation Project</A> (LDP) could stand a typo scrub too.
</P>
<P>
Oddly, many people read <EM>LG</EM> religiously because it's written in 
person to
person mode and doesn't spray gloss all over the articles and columns that
way.   You will get ecstatic excitement at successes and growling at bad
ways to do things and every emotion in between.
</P>
<P>
No, many of the querents don't spell check either, but we still answer
<EM>them</EM>.
</P>
<P>
I hope you enjoyed your time flaming, but we have people asking questions
about Linux to get back to.
</P>

<!-- end 4 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag/5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">"Those were the days"</FONT></H3>
Wed, 11 Jul 2001 14:20:42 -0500
<BR>Pete Nelson (<a href="mailto:gazette@ssc.com">pete.nelson from serversolved.com</a>)

<P>
I have this dream of contributing something wonderfully useful to the
Gazette, but it ain't going to happen today. . .
</P>
<P>
No, I noticed the ravings on The Back Page of issue 67, and had to send
you the lyrics of "Those were the days":
</P>
<h4>For the way Glen Miller Played</h4>
<p>. . .
<br>(It looks like the rest was pretty good up til the last verse)
<br> . . .
<br>Didn't need no welfare state
<br>Everybody pulled his weight
<br>Gee, our old LaSalle ran great 
<br>Those were the days.
</P>
<P>
But better yet, is the Simpsonized version --
</P>
<P>
For the way the BeeGees played
<br>Films that John Travolta made
<br>Guessing how much Elvis weighed
<br>Those were the days
</P>
<P>
And you knew where you were then
<br>watching shows like Gentile Ben
<br>Mister we could use a man like Sheriff Lobo again
</P>
<P>
Disco Duck and Fleetwood Mac
<br>Coming out of my eight-track
<br>Micheal Jackson still was black,
<br>Those were the days
</P>
<P>
Maybe next time I write in, I'll have something more useful.
</P>
<P>
--
Pete Nelson
</P>
<p><em>Thanks, Pete, glad we could amuse.  I think we need a linux version,
or maybe a BSD one... -- Heather</em></p>

<!-- end 5 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag/6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">RE: Linux Gazette Kernel Compile Article.</FONT></H3>
Wed, 1 Jan 1997 00:06:40 +0200
<BR>Zwane Mwaikambo (<a href="mailto:gazette@ssc.com">zwane from linux.realnet.co.sz</a>)


<!-- sig -->

<P>
Hi,
</P>
<P>
First i must commend you on providing a service to all the Linux users
out there trying to get started on rolling their own kernel. I would just
like to point out a few things i found somewhat confusing about your
article.
</P>
<P>
You compiled in "math emulation" support even though you have a CPU with a
built in maths co-processor, in this case the math emulation will never be
used and essentially wastes memory. secondly, you selected SMP support for
your uniprocessor (UP) system. This on some occasion can cause problems with
specific UP motherboards causing them not to boot or certain kernel modules
not loading, in addition to being slower and taking up more memory than a
non-SMP kernel. Also as you might want to break apart your build procedure
by using double ampersands. i.e. "make dep &amp;&amp; make bzImage &amp;&amp; make modules
&amp;&amp; make modules install ....."
</P>
<P>
That aside, it's great that you're willing to share your experiences and
knowledge with the rest of the Linux community.
</P>
<P>
Regards,
<br>Zwane
</P>

<!-- end 6 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag/7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Parrallel processing</FONT></H3>
Tue, 3 Jul 2001 12:22:08 -0700
<BR>UCT Student - stvchu001 (<a href="mailto:gazette@ssc.com">stvchu001 from mail.uct.ac.za</a>)

<P><STRONG>
I would like to contact the uuthor of the above article which appeared
in the april 2001 edition of your magazine .
</STRONG></P>
<P>
The author's name in all our articles is a hyperlink to his e-mail
address.  Rahul Joshi's is <A HREF="mailto:jurahul@hotmail.com"
	>jurahul@hotmail.com</A> -- Mike
</P>

<!-- end 7 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag/8"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">response to: Yet Another Helpful Email</FONT></H3>
Tue, 10 Jul 2001 17:39:19 -0700
<BR>Bryan Henderson (<a href="mailto:gazette@ssc.com">bryanh from giraffe-data.com </a>)

<P>
I was pleased to see a letter by Benjamin D Smith that compares
learning Windows to learning Unix by drawing a mental graph of the
respective learning curves, because I thought it would set straight
a lot of people who misuse the term "steep learning curve."
</P>
<P>
But then Smith went ahead and misused the term himself, in a way
wholly inconsistent with the picture he drew.
</P>
<P>
To set the record straight, allow me to explain what a learning
curve is, and in particular what a steep one is all about.
</P>
<P>
The learning curve is a graph of productivity versus time.  As time
passes, you learn stuff and your productivity increases (except in
weird cases).
</P>
<P>
Windows has a steep learning curve.  You start out useless, but with
just a little instruction and messing around, you're already writing
and printing documents.  The curve rises quickly.
</P>
<P>
Unix has a very shallow learning curve.  You start out useless, and
after a day of study, you can still do just a little bit.  After
another day, you can do a little bit more.  It may be weeks before
you're as productive as a Windows user is after an hour.
</P>
<P>
Smith's point, to recall, was that the Windows learning curve, while
steep, reaches a saturation point and levels off.  The Unix curve,
on the other hand, keeps rising gradually almost without bound.  In
time, it overtakes the Windows curve.
</P>
<P>
--
Bryan Henderson
</P>

<!-- end 8 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag/9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">anser guy</FONT></H3>
Wed, 18 Jul 2001 11:57:36 -0700 (PDT)
<BR>Heather (<a href="mailto:gazette@ssc.com">star from betelgeuse.starshine.org</a>)

<P><STRONG>
Are you still the answer guy, and do you still answer questions? If so, I
have one that's been bugging me for a year now. Just let me know,
</STRONG></P>
<P><STRONG>
Thanks!
</STRONG></P>
<P>
It's an Answer Gang now.  Jim Dennis is still one of us.
</P>
<P>
We answer <EM>some</EM> of the hundred of linux questions we get every month.
Questions which are not about Linux get laughed about, but have a much lower
chance of ever geeteting an answer.  They <EM>might</EM> be answered in a linux
specific way.
</P>
<P>
So if you've a linux question, send it our way 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</P>

<!-- end 9 -->
<a name="gaz"></a>
<P> <hr> <P>
<!-- =================================================================== -->
<center><H3><font color="maroon">GAZETTE MATTERS</font></H3></center>
<P> <HR> <P>
<!--====================================================================-->

<!-- BEGIN GAZETTE MATTERS -->

<UL>
<!-- index_text begins -->
<li><A HREF="#gaz/1"
	><strong>Mistake</strong></a>
<li><A HREF="#gaz/2"
	><strong>An lgbase question</strong></a>
<li><A HREF="#gaz/3"
	><strong>About which list is which</strong></a>
<li><A HREF="#gaz/5"
	><strong>Re: email distribution of the Gazette?</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">Mistake</FONT></H3>
Thu, 28 Jun 2001 18:16:59 +0100
<BR>Xavier (<a href="mailto:gazette@ssc.com">Xavier from aemiaif.lip6.fr</a>)

<P>
I just look at your issue 41 (I know that is not really recent ...) but
in the article of Christopher Lopes which is talking about CUP, there is
a mistake...
</P>
<P>
I tested it and I see that it didn't walk correctly for all the cases. In
fact it is necessary to put a greater priority to the operator ' - ' if not,
we have 8-6+9 = -7 because your parsor realizes initially (6+9 = 15) and
after (8-15= -7). To solve this problem it is enough to create a state
between expr and factor which will represent the fact that the
operator - has priority than it +.
</P>
<P>
Cordially.
</P>
<P>
Xavier Prat.
MIAIF2.
</P>
<p>See attached <a href="misc/mailbag/issue41-fix.CUP.txt">misc/mailbag/issue41-fix.CUP.txt</a></p>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz/2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">An lgbase question</FONT></H3>
Mon, 2 Jul 2001 12:10:20 -0500
<BR>Chris Gianakopoulos (<a href="mailto:gazette@ssc.com">pilolla from gateway.net</a>)

<P><STRONG>
I want to install all of the newest Linux Gazette issues on one of our
Linux machines at work.  Sounds easy enough.
</STRONG></P>
<P><STRONG>
Consider that I have approximately 12 month's worth of Linux Gazette
issues AND each lgbase that I download with each issue.  Is the lgbase
file cumulative?  In other words, can I install the latest and greatest
lgbase, and then install (you know -- copy them to the LDP/LG directory
tree) all of the Linux Gazette issues.
</STRONG></P>
<P>
Yes.  There's only one lg-base.tar.gz, which contains shared files for all
the issues.  So you always want the latest lg-base.tar.gz.
</P>
<P>
However, once you've installed it, you don't have to download it again
every month.  Instead, you can download the much smaller lg-base-new.tar.gz,
which contains only the files that are new or changed since the previous
issue.  But if you miss a month, you'll need to download the full
lg-base.tar.gz again to get all the accumulated changes.
</P>
<P>
Always untar lg-*.tar.gz files in the same directory each month.  They will
unpack into a subdirectory lg/ with everything in the correct location.
</P>
<P><STRONG>
Thanks Mike,
</STRONG></P>
<P><STRONG>
You've saved me a lot of time.  The system (<A HREF="http://www.suse.com/">SuSE</A> 7.0 distribution) had an
up-to-date base up until March last year. Your answer saved me lots of
untarring operations.  And yes, I do put the stuff in the same directory
each month on my home system.
</STRONG></P>
<P><STRONG>
Thanks for our fine magazine, and again keep up the good work (all of
you),
</STRONG></P>
<P><STRONG>
Chris G.
</STRONG></P>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz/3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">About which list is which</FONT></H3>
Mon, 16 Jul 2001 09:52:00 -0700
<BR>Hylton Conacher  (<a href="mailto:gazette@ssc.com">hylton from global.co.za</a>)

<P>
[Resent because Majordomo thought it was a command.  You have to watch that
word  s-u-b-s-c-r-i-b-e near the top of messages. -- Mike]
</P>
<P>
----- Forwarded ------
</P>
<P><STRONG>
Hi Heather,
</STRONG></P>
<P><STRONG>
Sorry, just another dumb newbie question. I have recently signed up to
the tag-admin list but not the tag list. I want  to be subbed to the Tag
list and as a result I have just tried to subscribe to tag by sending
the following to <A HREF="mailto:majordomo@ssc.com"
	>majordomo@ssc.com</A>:
</STRONG></P>
<P><STRONG><BLOCKQuote>
subscribe tag <A HREF="mailto:hylton@global.co.za"
	>hylton@global.co.za</A>
</BLOCKQuote></STRONG></P>
<P>
Given the pattern for the other one, I'm guessing that sending the word
</P>
<P>
subscribe
</P>
<P>
to the address
</P>
<P>
<A HREF="mailto:tag-request@ssc.com"
	>tag-request@ssc.com</A>
...should work too.
</P>
<P><STRONG>
I, as yet, haven't recd any notifications that a new Linux Gazette has
been added to the files area.
</STRONG></P>
<P>
For that, you don't want tag nor tag-admin, you want to send a note to
<A HREF="mailto:lg-announce-request@ssc.com"
	>lg-announce-request@ssc.com</A> and subscribe to lg-announce.  That doesn't
say much except that the gazette is posted.
</P>
<P>
What you will find here on tag-admin are precursor discussions;  talk about
what should or shouldn't get published, need to tweak deadlines, and some
other things that are either water-cooler talk or "infrastucture" matters.
</P>
<P><STRONG>
Do the announcements of the new Linux Gazettes come out on the TAG-Admin
list or only on Tag?
</STRONG></P>
<P>
Neither.
</P>
<P>
If you join the TAG list, you will be inundated with a large number of newbie
and occasional non-newbie computing questions, not all linux-related... and
a certain amount of spam that slips the filters, not all of it in English...
and a certain number of utterly dumb questions with no relation at all to
computing (apparently a side effect of the word "homework" being used so
often here).  I'd dare say most of the spam is not in English.  Since we
sometimes get linux queries in non-English languages we can't just chop
them off by character set from the list server, but they're easy to spot and
delete.
</P>
<P>
You will also see the answers flow by from members of the Gang, and efforts
to correct each other.  If you only visit the magazine once a month, you see
less answers, some of them get posted in 2c Tips, and they have been cleaned
up for readability.
</P>
<P>
So I can see reasons why someone who doesn't feel like answering questions
might want to join the TAG list and lurk, but I'm not sure which of these
you wanted.
</P>
<P><STRONG>
Puzzled.
</STRONG></P>
<P><STRONG>
Hylton
</STRONG></P>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz/4"><HR WIDTH="40%" ALIGN="center"></A> <P>

<!-- sig -->

<P><STRONG>
Thank you Heather,
</STRONG></P>
<P><STRONG>
You as a member of TAG have certainly answered my questions.
</STRONG></P>
<P>
<IMG SRC="../gx/dennis/smily.gif" ALT=":D" 
		height="24" width="20" align="middle">
</P>
<P><STRONG>
There has been a message sent to <A HREF="mailto:majordomo@ssc.com"
	>majordomo@ssc.com</A> to unsub/scribe from
both the TAG and TAG-Admin lists as I do not want to receive idle
watercooler chat as I cannot reply immediately, in a watercooler
fashion, due to my countries telecoms monopolistic provider.
</STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
ob TagAdmin: if Mylton has no objection, this message will go in the mailbag
this month.
</EM></FONT></STRONG></P>
<P><STRONG>
Hylton has no objection so please FW to the necessary people provided
some idea is given of how to ascertain when a new Linux Gazette is
published.
</STRONG></P>
<P>
Send an email, with the subject containing a magic word which mailing list
software enjoys.... please take the slash out though... my sysadmin warns
me if I utter this word in too short a mail, the mail goes to majordomo's
owner and not to you.
</P>
<Pre>
subject:  sub/scribe
to:	<A HREF="mailto:lg-announce-request@ssc.com">lg-announce-request@ssc.com</A>

(body text)
sub/scribe

--
(optionally your sig file)
</Pre>
<P>
...mentioning it in the body text should be unnecessary.  That -- keeps
it from trying your sig as a command too.
</P>
<P>
The result will be your membership on a list which sees mail about once a
month, saying when the Gazette is posted.
</P>
<P>
Because you are in another country you might want to look at the Gazette
Mirrors listing and find a site which is closer to you.  Your bandwidth
cost might be the same but hopefully your download time won't cost as much.
<A HREF="../mirrors.html"
	>http://www.linuxgazette.com/mirrors.html</A>
</P>
<P>
Thx for your permission to publish 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</P>

<!-- end 4 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz/5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Re: email distribution of the Gazette?</FONT></H3>
Tue, 3 Jul 2001 15:28:31 -0700
<BR>Hylton Conacher (<a href="mailto:gazette@ssc.com">hylton from global.co.za</a>)

<P><STRONG><FONT COLOR="#000066"><EM>
Please direct me towards a place where I can sign up to receive the
Linux Gazette on a monthly or weekly basis when they become available.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
I would like this to be a free service.
</EM></FONT></STRONG></P>
<P><STRONG>
You don't "receive" Linux Gazette.  You read it on the web or download
the FTP files.  LG is published monthly on the first of the month, although
occasionally we have mid-month extra issues. -- Mike
</STRONG></P>
<P>
We do have an announce list, though.  Write to <A HREF="mailto:lg-announce-request@ssc.com"
	>lg-announce-request@ssc.com</A>
</P>
<P>
I suppose you could use the Netmind service (<A HREF="http://mindit.netmind.com"
	>http://mindit.netmind.com</A>) if
you don't like ours 
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":(" 
		height="24" width="20" align="middle">
</P>
<P>
Sending large files via email, regularly, is really, really-really, an
incredibly bad idea.  Just come get it via ftp when it's ready!  Our ftp
site is free: <A HREF="ftp://ftp.ssc.com/pub/lg"
	>ftp://ftp.ssc.com/pub/lg</A>
</P>

<!-- end 5 -->
<!--              . . . . . . . . . . . . . . . . . . .              -->
<HR WIDTH="40%" ALIGN="center">

<P><STRONG><FONT COLOR="#000066"><EM>
Heather,
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Thank you for the response regarding my query.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
May I suggest that the service of email distribution of the gazettes be
investigated and provided to those people who sign up for them.
</EM></FONT></STRONG></P>
<P>
Please read our FAQ: we have considered it, and the answer is No.
</P>
<P>
Sending huge email attachments around is an undesirable burden on our own
mail servers as well as major MX relay points;
</P>
<P><STRONG><FONT COLOR="#000066"><EM>
I personally have made note of the ftp site but here in South Africa I
can only afford a dial-up connection the site has therefore been added
into a list to visit in the future. The problem comes in when I want to
know if there are any new tutorials on the ftp space since my last
visit. It would therefore be much more handy for me, and possibly
others, if they were allowed to request and start receiving the gazettes
via email.
</EM></FONT></STRONG></P>
<P>
You may subscribe to the announce list.  When you get the announcement,
visit the FTP site... or a local mirror.
</P>
<P><DL><DT>
There are many mirror sites in South Africa - please use one:
<DD><A HREF="../mirrors.html#south_africa"
	>http://www.linuxgazette.com/mirrors.html#south_africa</A>
</DL></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Not everyone needs to receive it, just the ppl signed up to the
distribution list.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Please?
</EM></FONT></STRONG></P>
<P>
Please use the internet's resources wisely.  The whole thing is clogged
up enough, without help from us.
</P>

<STRONG><FONT COLOR="#000066"><EM>
<P>
Hi Heather,
</P>
<P>
OK, OK, I give up.  It was just a suggestion.
</P>
<P>
The Internet is so slow already what with video clips going via email
that I do not feel anything in using a little of it to increase my
knowledge.
</P>
<P>
I have signed up to the announcement list and will use a mirror closest
to me.
</P>
<P>
Is it possibly possible to use Linux wget feature to retrieve all the
bulletins if I so wanted?
</P>
<P>
Hylton
</P>
</EM></FONT></STRONG>

<p>Yes!  That's the spirit! -- Heather</p>

<!-- end 6 -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<H5 align="center">This page edited and maintained by the Editors
	of <I>Linux Gazette</I> 
<a href="http://www.linuxgazette.com/copying.html"
	>Copyright &copy;</a> 2001
<BR>Published in issue 69 of <I>Linux Gazette</I> August 2001</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>
<!-- *** END copyright *** -->
<H4 ALIGN="center">"Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<HR>

<center>
<table cellpadding=7><tr><td>
<IMG SRC="../gx/bytes.gif" border=1  ALT="News Bytes">
</td><td>
<H3>Contents:</H3>
<ul>
<li><a HREF="#distro">Distro News</A>
<li><a HREF="#general">News in General</a>
<li><a HREF="#software">Software Announcements</a>
</ul>
</td></tr></table>

<STRONG>Selected and formatted by  <A HREF="mailto:michael.conry@softhome.net">Michael Conry</A>
and <A HREF="mailto:gazette@ssc.com">Mike Orr</A></STRONG>
</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.





<P> <hr> <P> 
<!-- =================================================================== -->

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<font color="green">
August 2001 <I>Linux Journal</I>
</font>
</H3>

<IMG ALT=" "   SRC="misc/bytes/lj-cover88.png" WIDTH=200 HEIGHT=268
ALIGN="left" HSPACE="20">

<P> 
The August issue of <A HREF="http://www.linuxjournal.com/"><I>Linux
Journal</I></A> is on newsstands now.
This issue focuses on Platforms.  Click 
<A HREF="http://www.linuxjournal.com/lj-issues/issue88/index.html">here</A>
to view the table of contents, or 
<A HREF="http://www.linuxjournal.com/subscribe/index.html">here</A> 
to subscribe.

<P>
<FONT COLOR="green">All articles through December 1999 are available for
public reading at 
<A HREF="http://www.linuxjournal.com/lj-issues/mags.html">http://www.linuxjournal.com/lj-issues/mags.html</A></FONT>.  
Recent articles are available on-line for subscribers only at 
<A HREF="http://interactive.linuxjournal.com">
http://interactive.linuxjournal.com/</A>.  

<BR CLEAR="all">


<P> <hr> <P> 
<!-- =================================================================== -->

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<font color="green">
July/August 2001 <I>Embedded Linux Journal</I>
</font>
</H3>

<IMG ALT=" "   SRC="misc/bytes/elj-cover04.png" WIDTH=200 HEIGHT=268 
ALIGN="left" HSPACE="20">

<P> 
The July/August issue of 
<A HREF="http://embedded.linuxjournal.com/"><I>Embedded Linux Journal</I></A> 
has been mailed to subscribers.  This issue focuses on Platforms.  Click 
<A HREF="http://embedded.linuxjournal.com/magazine/issue04/">here</A>
to view the table of contents.  Articles on-line this month include
<A HREF="http://embedded.linuxjournal.com/magazine/issue04/4624/">Embedded Linux
on the PowerPC</A>, 
<A HREF="http://embedded.linuxjournal.com/magazine/issue04/4714/">Will It Fly? Working toward Embedded Linux Standards:
theELC's Unified Specification Plan</A>, 
<A HREF="http://embedded.linuxjournal.com/magazine/issue04/4773/">Boa: an
Embedded Web Server</A>,
and more.

<P> US residents can subscribe to <I>ELJ</I> for <STRONG>free</STRONG>; just
<A HREF="http://www.linuxjournal.com/subscribe/index.html">click here</A>.
Paid subscriptions outside the US are also available; click on the above link
for more information.  

<BR CLEAR="all">





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


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">SuSE
</FONT>
</H3> 

<P> <a href="http://www.suse.de/en/">SuSE</a> Linux 
<a href="http://www.suse.de/en/produkte/susesoft/enterprise/index.html">
Enterprise Server</a> for
the 32-bit architecture by Intel was 
<a href="http://www.suse.de/en/news/PressReleases/mySAPcom.html">
awarded</a> the status "Generally
Available for mySAP.com". This certification now enables companies all
over the world to utilise 
<a href="http://www.mySAP.com/">mySAP.com</a> on SuSE Linux Enterprise Server
and take advantage of services and support from SAP AG.
For further information see <a href="http://www.sap.com/linux/">
http://www.sap.com/linux/</a>
<hr noshade width="20%">

<P>SuSE Linux, 
<a href="http://www.suse.de/en/news/PressReleases/firewall.html">
presented</a> a
new Linux solution for professional deployment at the LinuxTag expo in
Stuttgart, Germany. The "SuSE Linux Firewall on CD" offers 
protection for Internet-linked companies' mission-critical data and IT
infrastructure.
SuSE Linux Firewall is an application level gateway combining high
security standards of a hardware solution with the flexibility of a
software firewall. 
Instead of being installed on the hard disk, SuSE Linux Firewall is
so-called a live system that enables the operating system to be booted
directly from a read-only CD-ROM. Since it is impossible to manipulate
the firewall software on CD-ROM, the live system constitutes a security
gain.
The configuration files for the firewall, such as the ipchains packet
filter settings, are placed on a write-protected configuration floppy.


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

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Upcoming conferences and events 
</FONT>
</H3> 

<P> Listings courtesy <EM>Linux Journal</EM>.  See <EM>LJ</EM>'s
<A HREF="http://noframes.linuxjournal.com/events/">Events</A> page for the
latest goings-on.


<!-- *** BEGIN events table [this line needed by Linux Gazette events.py *** -->

<table cellpadding=5 border=0 width=100%>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
	<b>O'Reilly Open Source Convention</b><BR>
	<td valign=top>July 23-27, 2001<BR>San Diego, CA<BR>
	<A HREF="http://conferences.oreilly.com/" target=_blank>
	http://conferences.oreilly.com</A><BR>
	</td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>10th USENIX Security Symposium</b><BR>
        <td valign=top>August 13-17, 2001<BR>Washington, D.C.<BR>
        <A HREF="http://www.usenix.org/events/sec01/" target=_blank>
        http://www.usenix.org/events/sec01/</A><BR>
        </td></tr> 

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>HP World 2001 Conference & Expo</b><BR>
        <td valign=top>August 20-24, 2001<BR>Chicago, OH<BR>
        <A HREF="http://www.hpworld.com" target=blank> 
        http://www.hpworld.com</A><BR>
        </td></tr>      

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>Computerfest</b><BR>
        <td valign=top>August 25-26, 2001<BR>Dayton, OH<BR>
        <A HREF="http://www.computerfest.com/" target=_blank>
        http://www.computerfest.com</A><BR>
        </td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top> 
	<b>LinuxWorld Conference & Expo</b><BR>
	<td valign=top>August 27-30, 2001<BR>San Francisco, CA<BR>
	<A HREF="http://www.linuxworldexpo.com" target=blank>
	http://www.linuxworldexpo.com</A><BR>
	</td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>Red Hat TechWorld Brussels</b><BR>
        <td valign=top>September 17-18, 2001<BR>Brussels, Belgium<BR>
        <A HREF="http://www.europe.redhat.com/techworld" target=_blank>
        http://www.europe.redhat.com/techworld</A><BR>
        </td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>The O'Reilly Peer-to-Peer Conference</b><BR>
        <td valign=top>September 17-20, 2001<BR>Washington, DC<BR>
        <A HREF="http://conferences.oreilly.com/p2p/call_fall.html" 
	target=_blank>
        http://conferences.oreilly.com/p2p/call_fall.html</A><BR>
        </td></tr> 

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
	<b>Linux Lunacy<br>Co-Produced by <i>Linux
	Journal</i> and Geek Cruises</b><BR>
        <A HREF="http://www.linuxjournal.com/lunacy/cruise.html" target=_blank>
        Send a Friend <i>LJ</i> and Enter to Win a Cruise!</A><BR> 
	<td valign=top>October 21-28, 2001<BR>Eastern Caribbean<BR>
	<A HREF="http://www.geekcruises.com/" target=_blank>
	http://www.geekcruises.com</A><BR>
	</td></tr> 

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>LinuxWorld Conference & Expo</b><BR>
        <td valign=top>October 30 - November 1, 2001<BR>Frankfurt, Germany<BR>
        <A HREF="http://www.linuxworldexpo.de" target=_blank>
        http://www.linuxworldexpo.de</A><BR>
        </td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>5th Annual Linux Showcase & Conference</b><BR>
        <td valign=top>November 6-10, 2001<BR>Oakland, CA<BR>
        <A HREF="http://www.linuxshowcase.org/" target=_blank>
        http://www.linuxshowcase.org/</A><BR>
        </td></tr> 

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>Strictly e-Business Solutions Expo</b><BR>
        <td valign=top>November 7-8, 2001<BR>Houston, TX<BR>
        <A HREF="http://www.strictlyebusinessexpo.com/" target=_blank>
        http://www.strictlyebusinessexpo.com</A><BR>
        </td></tr> 

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>  

<tr><td valign=top>
        <b>LINUX Business Expo</b><BR>Co-located with COMDEX<br>
        <td valign=top>November 12-16, 2001<BR>Las Vegas, NV<BR>
        <A HREF="http://www.linuxbusinessexpo.com" target=_blank>
        http://www.linuxbusinessexpo.com</A><BR>
        </td></tr>

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>

<tr><td valign=top>
        <b>15th Systems Administration Conference/LISA 2001</b><BR>
        <td valign=top>December 2-7, 2001<BR>San Diego, CA<BR>
        <A HREF="http://www.usenix.org/events/lisa2001/" target=_blank>
        http://www.usenix.org/events/lisa2001</A><BR>
        </td></tr>  

<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr> 


</table>
<!-- *** END events table [this line needed by Linux Gazette events.py *** -->




<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Teamware and Celestix to co-operate
</FONT>
</H3> 

<P> 
<a href="http://www.teamware.com/">
Teamware Group</a>, and 
<a href="http://www.celestix.com/">
Celestix Networks GmbH.</a>, a
supplier of Linux-based server appliances have 
<a href="http://www.teamware.com/pressreleases/celestix.htm">
signed</a> a global agreement
according to which 
<a href="http://www.teamware.com/linux/linux_office-fs.htm">
Teamware Office-99</a> for Linux groupware will be
distributed and sold with the Celestix 
"<a href="http://www.celestix.com/product_aries.php">
Aries</a>" micro servers. Supporting a
wireless standard the new system is the first wireless groupware server
offered for small businesses.


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">PostgreSQL: The Elephant Never Forgets
</FONT>
</H3> 
<P> 
<a href="http://www.opendocspublishing.com/">
Open Docs Publishing
</a> has announced today that they plan to ship their
sixth book entitled 
"<a href="http://www.opendocspublishing.com/entry.lxp?lxpe=92">
PostgreSQL: The Elephant Never Forgets</a>" by the first
week of August 2001. This title will include community version of 
<a href="http://www.postgresql.org/">
PostgreSQL</a>
version 7.1, the PostgreSQL Enterprise Replication Server (eRserver) and the
LXP application server. This will offer to companies the security of a
replication server, data backup services, disaster recovery, and business
continuity solutions previously limited to more costly commercial Relational
Database Management System (RDBMS) packages. Who could ask for more? 
The
book will fully document installation procedures, administration techniques,
usage, basic programming interfaces, and replication capabilities of
PostgreSQL. A complete reference guide will also be included.
The book is now 
<a href="http://www.opendocspublishing.com/entry.lxp?lxpe=92">
online</a> for development review and feedback.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Total Impact's new "briQ" network appliance
</FONT>
</H3> 

<P> 
<a href="http://www.totalimpact.com/">Total Impact</a>'s 
new network appliance computer, 
<a href="http://www.totalimpact.com/briQ.html">the briQ</a>
weighs in at 32 ounces, and has been 
<a href="http://www.totalimpact.com/june27.html">
selected</a> as 
<a href="http://www.ibm.com/">IBM</a>'s first 
<a href="http://www.chips.ibm.com/products/powerpc/linux/">PowerPC Linux</a> 
Spotlight
<a href="http://www.chips.ibm.com/products/powerpc/linux/linux-spotlight-briq.html">
feature product</a>. As a featured product, the briQ
and its benefits
are profiled in the June edition of IBM's Microprocessing and PowerPC Linux
website, and may be reviewed at the above link, or at Total Impact's
<a href="http://www.totalimpact.com/">website</a>.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">LinuxWorld San Francisco to showcase embedded linux
solutions
</FONT>
</H3> 



<P>
<a href="http://www.idg.com/">IDG</a> 
<a href="http://www.idgworldexpo.com">World Expo</a> announced today that the
upcoming 
<a href="http://idg.com/www/events.nsf/EventsByProductLineForm?OpenForm&region=WW&product=LinuxWorld">
LinuxWorld Conference & Expo</a>, to be held August 28-30, 2001 at San
Francisco's Moscone Convention Center, will feature an Embedded Linux
Pavilion to educate attendees on the growing opportunities for Linux in
embedded computing.
The Pavilion will be sponsored by the 
<a href="http://www.embedded-linux.org/">
Embedded Linux Consortium (ELC)</a>, a
vendor-neutral trade association dedicated to promoting and implementing the
Linux operating system throughout embedded computing.   





<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Linux Links
</FONT>
</H3> 
<P>
<a href="http://www.thedukeofurl.org">
the Duke of URL</a>  has the following which may be of interest:
<ul>
<li>A <a href="http://www.thedukeofurl.org/reviews/systems/pogoveronap4">
review</a> of Pogo's sub-$1000 Pentium 4 Linux box, the Pogo Verona P4.
<li>A <a href="http://www.thedukeofurl.org/reviews/misc/xsentry15">
review</a> of Trustix XSentry Firewall 1.5 a high-end firewall for both
Linux and Windows produced by Trustix, the makers of Trustix Secure Linux.
The review covers the technology behind the firewall, installation,
configuration and more.
<li>A <a href="http://www.thedukeofurl.org/reviews/misc/promisehowtorh71">
HowTo</a> for the Promise FastTrak 66/100 on Red Hat Linux 7.1. which
covers the basics, including instructions for both the Promise driver 
and an open source one
<li>A <a href="http://www.thedukeofurl.org/reviews/video/abitsiluromx400">
review</a> of Abit's Siluro MX400 (based on the GeForce2 MX400 chipset)
The review covers benchmarks of both Linux and Windows performance.
<li>A <a href="http://www.thedukeofurl.org/reviews/misc/engarde101/">
review</a> of EnGarde Secure Linux 1.0.1, a unique brand of Linux with a
focus on security, e-commerce, and servers.
<li> A <a href="http://www.thedukeofurl.org/reviews/misc/yellowdog20">
review</a> of Yellow Dog Linux 2.0, which is based on Red Hat 7.0 and is
designed for the PowerPC platform, along with IBM's RS/6000 CPUs.
</ul>

<P> <a href="http://www.onlamp.com/">ONLamp.com</a> have an article on
<a href="http://www.onlamp.com/pub/a/apache/2001/06/19/apache_2.html">
migrating</a> a site from Apache 1.3 to 2.0.



<P>
The <a href="http://www.wsj.com">Wall Street Journal</a>'s 
<a href="http://www.ptech.wsj.com/">
Personal Technology</a> section has
<a href="http://ptech.wsj.com/archive/ptech-20010705.html">
News</a> of an unsettling nature about Windows XP registration, and a
<a href="http://slashdot.org/articles/01/07/05/1526255.shtml">
discussion</a>
of same on Slashdot.

<P>Other <a href="http://www.microsoft.com/">Microsoft</a> news indicates that
MS may
<a href="http://www.softwareuncovered.com/news/cgram-20010716.html#1">
help</a> create .NET for Linux. 
Microsoft told ComputerWire it would provide technical assistance to
<a href="http://www.ximian.com/">
Ximian Inc.</a> in its work on the 
<a href="http://www.ximian.com/tech/mono-index.php3">
Mono Project</a>, to develop a version of .NET
for Linux and Unix using open source development. 
This story was 
<a href="http://slashdot.org/article.pl?sid=01/07/16/128223&mode=nested">
highlighted</a> on
<a href="http://slashdot.org/">Slashdot</a>

<p> I don't want to seem MS obsessed, or anything ;-), but
<a href="http://lwn.net/">Linux Weekly News</a> has a
<a href="http://lwn.net/2001/0712/a/esr-viral.php3">critique</a> by Eric
Raymond on Microsoft's attacks on so-called "viral licences".

<p> More PostgreSQL news:
<A HREF="http://www.ca.postgresql.org/docs/hw_performance">PostgreSQL
Performance Tuning</A>.

<P> An OO approach to the classic 
<A HREF="http://groups.google.com/groups?ic=1&th=8a31b51350a5fcc9,1">
how to place eight queens on a chessboard so that none can attack any other</A>
problem, in Python.

<p>
If you are troubled by spam
<a href="http://combat.uxn.com/">http://combat.uxn.com/</a> might be of
interest to you.

<p> The TRS-80, the world's first laptop, 
<A HREF="http://www.sfgate.com/cgi-bin/article.cgi?file=/chronicle/archive/2001/07/22/BU160803.DTL">
is still in use</A>.

<p>
For the loser^H^H^H^H^Hgeek who has everything, 
<A HREF="http://slashdot.org/books/01/07/31/1412224.shtml">The Joy of Linux</A>
has tons of insider trivia.  As the 
<A HREF="http://slashdot.org/books/01/07/31/1412224.shtml">Shashdot review</A>
begins, "It's 2001. Do you love your operating system?"


<a name="software"></a>
<P> <hr> <P> 
<!-- =================================================================== -->
<center><H3><font color="green">Software Announcements</font></H3></center>


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Linux NetworX launches ClusterWorX 2.0 cluster 
management software
</FONT>
</H3> 

<P>
<a href="http://www.linuxnetworx.com">Linux NetworX</a>, 
a provider of  Linux cluster computing solutions, has 
<a href="http://www.linuxnetworx.com/news/6.26.2001.48-Linux_NetworX_L.html">
announced</a> the launch
of its cluster management software 
<a href="http://www.linuxnetworx.com/products/clusterworx.html">
ClusterWorX 2.0</a>.
The latest version of ClusterWorX includes new features such as secure
remote access, thorough system and node monitoring and events, and easy
administrator customisation and extensibility. 


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">IBM database  news
</FONT>
</H3> 

<a href="http://www.ibm.com/">IBM</a>
has 
<a href="http://www1.internetwire.com/iwire/release_clickthrough?release_id=28404&category=Technology">
claimed</a> three database firsts:
Industry's First Database Software Supporting InfiniBand; Direct Access
File System; And New Itanium-Based SystemsDB2 Universal Database version
7.2. 
These have been demonstrated on 
<a href="http://www-4.ibm.com/software/data/db2/linux/">
DB2</a> running on Linux.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">DocParse HTML to XML/SGML converter
</FONT>
</H3> 

<P><a href="http://www.commandprompt.com">Command Prompt, Inc.</a> 
have released 
<a href="http://www.commandprompt.com/products_DocParse.lxp">
DocParse 0.2.6</a>. DocParse is a
tool for technical authors who maintain a large amount of HTML based
documentation. DocParse will take any HTML document and convert it into a
valid DocBook XML/SGML document. From the XML or SGML format a user can
easily convert the document to XHTML, HTML, RTF(MS Word Format) and even
print ready postscript.  DocParse currently runs on x86 Linux only. They will
release for YellowDog Linux (PPC) and MacOS X shortly.  There are per seat
and subscription based licensing models available for immediate purchase.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">StuffIt for Linux and Solaris ships
</FONT>
</H3> 

<P><a href="http://www.aladdinsys.com/">Aladdin Systems</a>, 
has shipped its award winning compression software, 
<a href="http://www.aladdinsys.com/products/stuffit/">
StuffIt</a> for  Linux and Sun's Solaris operating systems, making 
StuffIt available on Windows, Macintosh, Linux, and Solaris platforms.
StuffIt for Linux and Solaris can be used to 
create Zip, StuffIt, Binhex, MacBinary, Uuencode, Unix Compress, 
self-extracting archives for Windows or Macintosh platforms and it 
can be used to expand all of the above plus bzip files, gzip, arj, 
lha, rar, BtoAtext and Mime.
StuffIt for Linux can be 
downloaded at: 
<a href="http://www.stuffit.com/">www.stuffit.com</a>.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Great Bridge announces enhanced PostgreSQL 7.1 package
</FONT>
</H3> 

<P>
<a href="http://www.greatbridge.com/">
Great Bridge</a>, who today
<a href="http://www.greatbridge.com/about/press.php?content_id=63">
announced</a> the launch of 
<a href="http://www.greatbridge.com/shop/item.php?prod=11">
Great Bridge PostgreSQL 7.1</a>, the latest version of
the world's most advanced open source database. 
Great Bridge has packaged the release with a graphical installer, leading
database administration tools, professional documentation and an
installation and configuration support package to help application
developers quickly and easily deploy the power of PostgreSQL in advanced
database-driven applications.

<P> [There are at least two other entries about PostgreSQL in this News
Bytes column.  Can you find them?]

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Timesynchro
</FONT>
</H3> 

<a href="http://www.timesynchro.com">Timesynchro.com</a>
have a free utility for download which can be used to manage your system
time. It is essentially a configuration script, using dialog and
some standard stuff, for netdate.
It incorporates a database of 100 servers to connect to, and the program
allows to test servers and add or delete them before using them for real
(some may no longer be available).

When you start 'timesynchro' it automatically chooses to start in German, but
selecting "Sprache" gives you the option to switch to English.
You get a rather easy menu structure to choose time servers.

<p> Thank you to Frank for summarising the website and features.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Surveyor Webcamsat
</FONT>
</H3> 

<P> 
<a href="http://www.surveyor.com/">
Surveyor Corporation</a>, makers of the  WebCam 32 webcam
software, has just announced a family of webcam servers that
addresses the need for increased control over web content.
Surveyor's 
Webcamsat (Web Camera Satellite Network -- Linux-based)
family of webcam servers give website operators a new level of control
over their streamed audio and video, allowing them the flexibility to
control multiple cameras with greater ease.


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Kaspersky Labs anti-virus software
</FONT>
</H3> 

<P> The latest version of Kaspersky Anti-Virus affords customers the opportunity
of additionally installing a centralized anti-virus defense for file servers
and application servers operating on OpenBSD (version 2.8) and Solaris 8
(for Intel processors) systems, and also for exim e-mail gateways (one of
the five most popular e-mail gateways for Unix/Linux).
Development of this anti-virus package came about as a result of responding
to the needs of mid-size and large corporate customers using Unix, and
particularly Linux.

<P> Currently, Kaspersky Anti-Virus can be utilized on
Linux, FreeBSD, BSDi, OpenBSD, and Solaris operating systems, and also
contains a ready-made solution for integration into sendmail, qmail,
postfix, and exim e-mail gateways.  The package includes the scanner, daemon
and monitor anti-virus technology, and also includes automatic anti-virus
database updates via the Internet, an interactive parameter set-up shell and
a module for generating and processing statistic reports.

<P> <A HREF="http://www.kaspersky.com/">www.kaspersky.com</A> (Russia)



<!-- *** BEGIN copyright *** -->
<P> <hr> <P> 
<H5 ALIGN=center>
Copyright &copy; 2001, Michael Conry and 
the Editors of <A HREF="mailto:gazette@ssc.com"><I>Linux Gazette</I></A>.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->

<center>
<H1><A NAME="answer">
	<img src="../../gx/dennis/qbubble.gif" alt="(?)" 
		border="0" align="middle">
	<font color="#B03060">The Answer Gang</font>
	<img src="../../gx/dennis/bbubble.gif" alt="(!)" 
		border="0" align="middle">
</A></H1> 
<BR>
<H4>By Jim Dennis, Ben Okopnik, Dan Wilder, Breen, Chris, and the Gang,
	the Editors of Linux Gazette... 
	and You!
<br>Send questions (or interesting answers) to
	<a href="mailto:linux-questions-only@ssc.com"'
		>linux-questions-only@ssc.com</a>
</H4>
<p><em><font color="#990000">There is no guarantee that your questions
	here will <b>ever</b> be answered.  Readers at confidential sites
	must provide permission to publish.  However, you can be published 
	anonymously - just let us know!
</font></em></p>
</center>

<p><hr><p>
<!--  endcut ======================================================= -->
<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>
Hello, everyone, and welcome once more to the world of the Linux Gazette
Answer Gang.
</p><p>
The peeve of the month having been Non-Linux questions for a few too many
weeks in a row,  The Answer Gang has a new address.  Tell your friends:
</p><h3 align="center">
	linux-questions-only
</H3><p>	
...at ssc.com is now the correct place to mail your questions, and your
cool Linux answers.  It's our hope this will stop us from getting anything
further about pants stains, U.S. history, etc.  Cross platform matters with
Linux involved are still fine, of course.
</p><p>
For some statistics... there were over 31 answer threads, 25 tips (some
were mini threads) and over 600 messages incoming - and that's <em>after</em>
I deleted the spam that always leaks through. 200 more messages than last
month.  I'm pleased to see that the Gang is up to the task.
</p><p>
Now at this point I bow humbly and beg your forgiveness, that, being a 
working consultant with more clients than usual keeping me busy, I wasn't 
able to get all of these HTML formatted for you this time.  In theory
I can put a few as One Big Column but the quality is worse and we drive
the search engines crazy enough already.  I can definitely assure you that
next month's Answer Gang will have <em>tons</em> of juioy answers.
</p><p>
Meanwhile I hope I can mollify you with some of the Linux tools that have
been useful or relevant to me during my overload this month.
</p><p>
Mail configuration has been a big ticket item here at Starshine.  You may 
or may not be aware that by the time we go to press, the MAPS Realtime 
Blackhole List is now a paid service.  That means folks who have been 
depending on the RBL and its companion, the Dialup List, have to pay for 
the hard work of the MAPS team... and their bandwidth.   You can find other
sources of blacklisting information, or start enforcing your own policies
... but I would like to make sure and spread the news that they aren't 
going exclusively to big moneybags - file for hobbyist, non-profit or 
small site usage and you don't have to pay as much.  Maybe nothing.  But 
you do have to let them know if you want to use it, now.
</p><dl>
<dt>Mail Abuse Prevention System:
<dd>	<a href="http://www.mail-abuse.org/"
		>http://www.mail-abuse.org/</a>
</dl><p>
My fellow sysadmins had been seeing this coming for a long time.  Many 
actually prefer to know what sort of things are being blocked or not, 
anyway.  Censorship after all, is the flip side of the same coin. 
Choosing what's junk TO YOU is one thing, junking stuff you actually need
is entirely another.  If others depend on you then you have to be much more
careful.  Plaintext SMTP isn't terribly secure but it's THEIR mail, unless
you have some sort of contract with them about it.
</p><p>
So, I've been performing "Sherriff's work" for at least one client for a 
long while now anyway - just tweaking the filter defenses so that the kind of
spam which gets in, stays out next time.  There's a fairly new project on 
Sourceforge called Razor, which aims for anti-spam by signatures, the same 
way that antivirus scanners check for trojans and so on.  I haven't had time
to look into it, but I think they're on the right track.
</p><dl>
<dt>Razor:
<dd>	<a href="http://razor.sourceforge.net/"
		>http://razor.sourceforge.net/</a>
</dl><p>
Procmail (my favorite local delivery agent) has this great scoring mechanism;
it can help, or it can drive you crazy (depending on whether you grok their
little regex language - I like it fine).  I definitely recommend taking a
look at "junkfilter" package of recipes for it even if you are planning to
roll your own.  The best part is that it is <strong>not</strong> just one
big recipe - it's a bunch of them, so you can choose which parts to apply.  
</p><p>
Do make sure you have at least version 3.21 of procmail though. It's actually
gotten some improvement this month.
</p><dl>
<dt>Procmail:
<dd>	<a href="http://www.procmail.org/"
		>http://www.procmail.org/</a>
</dl><dl>
<dt>Junkfilter:
<dd>	<a href="http://junkfilter.zer0.org/"
		>http://junkfilter.zer0.org/</a>
</dl><p>
Folks who hate this stuff can try Sendmail's milters, Exim's filtering 
language, or possibly, do it all at the mail clients after the mail has
been delivered to people.
</p><p>
Whether your filters are mail-client, local-delivery, or MTA based, making
them sanity check that things are coming really to you, and from addresses
that really exist, can have a dramatic improvement.  The cost is processing
power and often, a certain amount of network bandwidth, but if you're really
getting hammered, it's probably worth it.  Besides if my 386 can deal with
just plain mail your PentiumIII-700 can actually do some work for a living
and probably not even notice, until your ethernet card starts complaining.
More on that 386 in a bit...
</p><p>
I've got a client who just switched from University of Washington's IMAP
daemon over to Courier.  The Courier MTA is just terrible (we tried, but
ended up thoroughly debugging a sendmail setup instead, and the system is
MUCH happier).  But the IMAP daemon itself is so much better it's hard
to believe.  He's convinced that it is more than the switch to maildirs
that makes it so incredibly fast.   He does get an awful lot of mail, so
I suspect Maildirs is what made the difference noticeable.  We may never 
know for sure.
</p><dl>
<dt>Courier-IMAP:
<dd>	<a href="http://www.inter7.com/courierimap/"
		>http://www.inter7.com/courierimap/</a>
</dl><p>
The world of DNS is getting more complicated every month, and slower.  
This has been clearly brought to light for me by two things - my client
at last taking over his own destiny rather than hosting through an ISP,
and my own mail server here at Starshine.
</p><p>
It used to be that there was only one choice for DNS, so ubiquitous
it's called "the internet name daemon" - BIND, of course.  And I'm very 
pleased to see that its new design seems to be holding up.  Still it has
the entire kitchen sink in it, and that makes it very complicated for 
small sites, even though there are a multitude of programs out there
to help the weary sysadmin.
</p><p>
A bunch of folks - including some among the Gang - really enjoy djbdns, 
but you have to buy into DJ Bernstein's philosophy about some things in 
order to be comfortable with it.  Its default policies are also a bit 
heavy handed about reaching for the root servers, which are, of course,
overloaded.  Still it's very popular and you can bet the mailing list 
folks will help you with it.
</p><dl>
<dt>djbdns:
<dd>	<a href="http://cr.yp.to/djbdns.html"
		>http://cr.yp.to/djbdns.html</a>
</dl><p>
However, his stuff (especially his idea of configuration files and "plain
english" in his docs) gives me indigestion, so I kept looking.  There are so
many caching-only nameservers I can't count them all.  It's a shame that
freshmeat's DNS category doesn't have sub categories for dynamic-dns, 
authoritative, and caching only, because that sure would make it easier 
to find the right one for the job.
</p><p>
However, I did find this pleasant little gem called MaraDNS.  It was 
designed first to be authoritative <em>only</em>, uses a custom string
library, and is trying to be extra careful about the parts of the DNS spec
it implements.  It was also easy to set up; zone files are very readable.
It looks like the latest dev version allows caching too... though whether
that's a creeping-feature is a good question.
</p><dl>
<dt>MaraDNS:
<dd>	<a href="http://www.maradns.org/"
		>http://www.maradns.org/</a>
</dl><p>
For years I've been pretty proud that we can run our little domain on a
386.  (Ok, we are cheating, that's not the web server.)  But I could just
<strong>kick myself</strong> for forgetting to put a DNS cache on it 
directly.  So the poor thing has been struggling with the evil internet's
timeouts lately and bravely plugging on...  occasionally sending me "sorry
boss, I couldn't figure out where to send it" kind of notes.  (No, it's not
qmail. I'm translating to English from RFC822-ese.) 
</p><p>
So I look at the resolv.conf chain.  No local cache.  What was I thinking?
(or maybe: What?  Was I thinking?  Obviously not.)
</p><p>
I tried pdnsd, because I liked the idea of a permanent cache... much more 
like having squid between you and the web, than just having a little memory
buffer for an hour or two.
</p><p>
However, the binary packages didn't work.  I wasn't going to compile it 
locally at the 386.  I'll get to reading its source maybe, but if anyone 
has successful experiences with it, I'd enjoy seeing your article in the 
<em>Gazette</em> someday soon.  I don't think I've tried very hard yet, 
but I had hoped it would be easier.
</p><p>
Meanwhile I had no time left and Debian made it a snap to have bind in cache
only mode.  Resolutions during mail seem to be much happier now.
</p><dl>
<dt>pdnsd:
<dd>	<a href="http://home.t-online.de/home/Moestl/"
		>http://home.t-online.de/home/Moestl/</a>
</dl><p>
There are also more mailing list managers out there than plants in my garden.
I've got a big project for a different client where the "GUI front end" is 
being dumbed down for the real end users, and I get to cook up a curses front 
end in front of the real features, for the staff to use.  It's very customized
to their environment.  I do hope they like it.
</p><p>
If you're working on a mailing list project, I beg, I plead, try and have 
something in between the traditional thrashing through pools of text files, 
and the gosh-nobody-wants-security-these-days web based administration.   
That way I can take less time to make the big bucks, and folks are a little 
bit happier with Linux. 
</p><p>
However, if you have in mind to do anything of the sort on your own, and you
prefer to work with shell scripts, I recommend Dialog.  Make sure you get a
recent version though.  There are a gazillion minor revisions and brain damaged
variants like whiptail.  Debian seemed to have the newest and most complete
amongst the distros I have lying around, so I ended up grafting its version
into another distro.  But, I finally tripped across a website for it that 
appears to be up to date. Use the "home" link to read of its muddied past.
</p><dl>
<dt>Dialog:
<dd>	<a href="http://www.AdvancedResearch.org/dialog/left-frame.html"
		>http://www.AdvancedResearch.org/dialog/left-frame.html</a>
</dl><p>
Lastly, Debian potato for Sparc isn't nearly as hard as I thought it was
going to be, but configuring all those pesky services on a completely fresh
box, that's the same pain every time.  It wouldn't be, if every client had
the same network plans, but - you know it - they don't!
</p><p>
I also had no ready Sparc disc 1, but a pressing need to get it, and my link
is not exactly the world's speediest.
</p><p>
Debian's pseudo image kit is a very strange and cool thing.  It's a bit clunky
to get going - you need to fetch some text files to get it started, and tell
it what files are actually in the disc you're going to put together.  But, 
once you've fed it that, it creates this "dummy" image which has its own 
padding where the directory structures will go, amd the files go in between. 
If some of them don't make it, oh well.  But you can get them from anywhere
on the mirror system ... much closer to home, usually,  Leave the darn thing 
growing a pseudo image overnight, then come back the next day and run rsync
against an archive site that allows rsync access to its official Debian CDs.
Instead of a nail-biting 650 MB download, 3 to 20 MB or so of bitflips and
file changes  If you either can't handle 650 MB at a time anyway, or like 
the idea of the heavy hit on your bandwidth allocation just being that last
clump of changes, it's a very good thing.
</p><p>
All it needs now is to be even smarter, and programmatically be able to 
fetch newer copies of the packages, then compose a real directory structure 
that correctly describes the files.  If someone could do that, you'd only
have to loopback mount the pseudoCD and re-generate Packages files, to 
have a current- instead of an Official disc, including all those security 
fixes we need to chase down otherwise.  Making it bootable might be more
tricky, but I'd even take a non-bootable one so I can give clients a 
mini-mirror site just by handing them a CD.
</p><dl>
<dt>Debian CD images information site:
<dd>	<a href="http://cdimage.debian.org/"
		>http://cdimage.debian.org/</a>
</dl><p>
So, I hope some of you find this useful.  I'm sure I'll see a number of 
you, and possibly some other members of the Answer Gang, at LinuxWorldExpo.  
</p><p>
'Til next time -- Heather Stern, The Answer Gang's Editor Gal
</p>
<!-- end hgreeting -->
<center>
<H1><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.jpg">
More 2&cent; Tips!</A></H1> <BR>
<!-- BEGIN tips -->

Send Linux Tips and Tricks to <A HREF="mailto:gazette@ssc.com">gazette@ssc.com</A></center>
<UL>
<!-- index_text begins -->
<li>Subscribe to Tech tips from
	<A HREF="http://noframes.linuxjournal.com/subscribe/lja-sub.html"
		><I>Linux Journal's</I> Weekly News Notes</A>
</ul>
<ul>
<li><A HREF="#tips/2"
	><strong>bin/cue - iso files</strong></a>
<li><A HREF="#tips/3"
	><strong>Segmentation Faults -- At odd times.</strong></a>
<li><A HREF="#tips/4"
	><strong>editing shell scripts</strong></a>
<li><A HREF="#tips/5"
	><strong>2.2.20 kernel?</strong></a>
<li><A HREF="#tips/6"
	><strong>Linux on Sun Sparc??</strong></a>
<li><A HREF="#tips/7"
	><strong>Routing Mail</strong></a>
<li><A HREF="#tips/8"
	><strong>Command to read CMOS from running Linux system</strong></a>
<li><A HREF="#tips/9"
	><strong>linux ftp problem</strong></a>
<li><A HREF="#tips/10"
	><strong>Self extracting shell script</strong></a>
<li><A HREF="#tips/11"
	><strong>Cannot Format Network Drive</strong></a>
<li><A HREF="#tips/13"
	><strong>Wu-FTP and Linux Newbie</strong></a>
	A source of confusion.
<li><A HREF="#tips/14"
	><strong>Root Password</strong></a>
<li><A HREF="#tips/15"
	><strong>RH7.1 switch to KDE login as default</strong></a>
<li><A HREF="#tips/16"
	><strong>3d linux</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">bin/cue - iso files</FONT></H3>
Thu, 21 Jun 2001 12:46:24 +0000
<BR>Andrew Higgs (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: "M.Mahtaney" &lt;mahtaney from pobox.com&gt;
</P>
<P><STRONG><BLOCKQuote>
hi james
</BLOCKQuote></STRONG></P>
<P><STRONG>
i came across your website while looking for some help on file
compression/conversion
</STRONG></P>
<P><STRONG>
i downloaded an archive in winrar format - which then decrompressed to bin/cue
files
</STRONG></P>
<P><STRONG>
i'm not sure what to do with that now - i've converted it to an iso file, but
i need to basically open it up to gain access to the application that was
downloaded.
</STRONG></P>
<P><STRONG>
i'm a little lost on how to do that - can you help?
</STRONG></P>
<P><STRONG>
thanks,
mgm.
</STRONG></P>
<P>
Hi MGM,
</P>
<P>
Have you tried to mount the iso image and copy the files out? There maybe
another way but this worked for me.
</P>
<P><CODE>
mount -o loop -t is09660 file.iso /mnt
<br>ls /mnt
</CODE></P>
<P>
should then give a list of the files in the iso image.
</P>
<P>
Hope this helps.
</P>
<P>
Kind regards
Andrew Higgs
</P>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Segmentation Faults -- At odd times.</FONT></H3>
Wed, 18 Jul 2001 15:03:33 -0700
<BR>Mike Orr (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: "Jon Coulter" &lt;jon from alverno.org&gt;
</P>
<P><STRONG>
I've recently upgraded the ram on my linux box in an attempt to wean some of
the memory problems that have been occurring
</STRONG></P>
<P>
What were the previous problems.  Just running out of memory?  Or other
things.
</P>
<P><STRONG>
, and now get "Segmentation
Fault"'s on almost every program about 80% of the time (if I keep trying and
keep trying to run the program, it eventually doesn't Segmentation Fault for
one time... sometimes then segmentation faulting later in its execution). My
question is: Is there anything I can do about this?!? But seriously, is
there any chance that a kernel upgrade would help fix this (my current
kernel is 2.4.2)? I just don't understand why a memory <EM>upgrade</EM> would cause
problems like this. I've run memtest86 test on the ram to ensure that it
wasn't corrupted at all.
</STRONG></P>
<P>
Frequent segfaults at random times usually indicate a hardware problem,
as you suspected.  A buggy kernel or libraries can throw segfaults left and
right too, but if you didn't install any software at the time the faults
started occurring, that rules that out.
</P>
<P>
Does <TT>/etc/lilo.conf</TT> have a "MEM=128M" number or something like that in it?
Some BIOSes require this attribute to be included, other's don't.  But if
it's specified, it must be correct.  Especially, it must not be larger
than the amount of RAM you have: otherwise it <EM>will</EM> segfault all over the
place and you'll be lucky to even get a login prompt.  Remember to run
lilo after changing lilo.conf.
</P>
<P>
Try taking out the memory and reseating it.  Also check the disks: are the
cables all tight and the partitions in order?  Since memory gets swapped to
disk if swap is enabled, it's possible for disk problems to masquerade as
memory problems.
</P>
<P>
If you put back your old memory, does the problem go away?  Or if you're
mixing old and new memory, what happens if you remove the old memory?
Are the two types of memory the same speed?  Hopefully the faster memory
will cycle down to the slower memory, but maybe the slower memory isn't
catching up.  What happens if you move each memory block to a different
socket?
</P>
<P>
I'm running 2.4.0.  There are always certain evil kernels that must be
avoided, but I don't remember any such warnings for the 2.4 kernels.
Whenever I upgrade, I ask around about the latest two stable kernels, and
use whichever one people say they've had better experiences with.
</P>
<P>
Good luck.  Random segfaults can be a very irritating thing.
</P>
<HR width="10%" align="center"><P>
More From:  Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

</P>
<P>
Take a look at the Sig 11 FAQ: &lt;<A HREF="http://www.bitwizard.nl/sig11/&gt"
	>http://www.bitwizard.nl/sig11/&gt</A>;.
</P>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">2c tip : editing shell scripts</FONT></H3>
Tue, 24 Jul 2001 09:24:02 -0400 (EDT)
<BR>Matt Willis (<a href="mailto:linux-questions-only@ssc.com">willis_matthew from yahoo.com</a>)

<P>
For shell scripts it's a common error to accidentally include a space
after the line-continuation character. This is interpreted as a
literal space with no continuation; probably not what you want. Since
spaces are invisible, it can also be a hard error to spot. If you use
emacs, you can flag such shell script errors using fontification. Add
this code to your ~/.emacs file:
</P>
<pre>
;;; This is a neat trick that makes bad shell script continuation
;;; marks, e.g. \ with trailing spaces, glow bright red:
(if (eq window-system 'x)
  (progn
    (set-face-background 'font-lock-warning-face "red")
    (set-face-foreground 'font-lock-warning-face "white")
    (font-lock-add-keywords 'sh-mode
      '(("\\\\[ \t]+$" . font-lock-warning-face)))
  )
)

</Pre>
<p>Matt Willis</P>
<HR width="10%" align="center"><P>
More From: Dan Wilder (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)
</P>
<P>
And in vi,
</P>
<Pre>:set list</Pre>
<P>
reveals all trailing spaces, as well as any other normally
non-printing characters, such as those troublesome leading tabs
required in some lines of makefiles, and any mixture of tab-indented
lines with space-indented lines you might have introduced into Python
scripts.
</P>
<Pre>:set nolist</Pre>
<P>
nullifies the "list" setting.
</P>
<HR width="10%" align="center"><P>
More From: Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

</P>
<P>
Good tip, Matt! I'll add a bit to that: if you're using "vi", enter
</P>
<Pre>:set nu list</Pre>
<P>
in command mode to number all lines (useful when errors are reported),
show all tabs as "^I", and end-of-lines as "$". Extra spaces become
obvious.
</P>
<P>
In editors such as "mcedit", where selected lines are highlighted,
start at the top of the document, begin the selection, and arrow (or
page) down. The highlight will show any extra spaces at line-ends.
</P>

<!-- end 4 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">2.2.20 kernel?</FONT></H3>
Thu, 19 Jul 2001 18:34:21 -0400
<BR>Heather Stern (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<p>
Question From: Ben Okopnik
</p>

<P>
Where can I get one? I've looked at kernel.org, and they only go up to
.19...
</P>
<P>
Ben
</P>
<P><STRONG>
Glad you asked, Ben, now I have an excuse to cough up a 2c Tip.
</STRONG></P>
<P>
Cool. Thanks!
</P>
<P><STRONG>
The two places to look for "the rest of it" if you really want a bleeding
edge kernel are:
</STRONG></P>
<P><STRONG><dl>
<dt>For Linus' tree -
<dd> <A HREF="http://www.kernel.org/pub/linux/kernel/testing"
	>http://www.kernel.org/pub/linux/kernel/testing</A>
</dl></STRONG></P>
<P>
Nope; just 2.4.x stuff.
</P>
<P><STRONG><dl>
<dt>For Alan's tree -
<dd> <A HREF="http://www.kernel.org/pub/linux/kernel/people/alan"
	>http://www.kernel.org/pub/linux/kernel/people/alan</A>
</dl></STRONG></P>
<P><STRONG>
Alan keeps subdirectories in there which should help you figure things
out.  In the moment I type this, his 2.4.6 patch is at ac5 and his
2.2.20pre is at 7.
</STRONG></P>
<blockquote><em>
As of press time, 2.4.7 patch is at ac3 and 2.2.20pre is at 8. -- Heather
</em></blockquote>
<P><STRONG>
These are of course patches that you apply to the standard source
after you unpack the tarball.
</STRONG></P>
<blockquote>
<em>
For a last tidbit, the web page at <A HREF="http://www.kernel.org/"
	>http://www.kernel.org</A> keeps track
of the current Linus tree, listing both the released version number
and the latest file in the <TT>/testing</TT> area.
</em>
</blockquote>

<!-- end 5 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Linux on Sun Sparc??</FONT></H3>
Thu, 26 Jul 2001 08:53:42 -0700 (PDT)
<BR>Heather Stern (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: Danie Robberts  &lt;DanieR from PQAfrica.co.za&gt;
</P>
<P><STRONG>
Is there a way to install this. I can see the Sparc64 architecture under
/usr/src/linux/arch
</STRONG></P>
<P><STRONG>
Booting from the slackware 8 cd does not work, and it seems as if
<A HREF="http://www.slackware.org/">Slackware</A>'s Web site is "unavailable"
</STRONG></P>
<P><STRONG>
Please, any pointers!
</STRONG></P>
<P><STRONG>
Cheers
Danie
</STRONG></P>
<P>
Sure.
</P>
<P>
The  <A HREF="http://www.lwn.net/">Linux Weekly News</A>  just wrote that Slackware is no longer supporting
their Sparc distro.  There's a sourceforge project to take over the code:
<A HREF="http://sourceforge.net/projects/splack"
	>http://sourceforge.net/projects/splack</A>
</P>
<P>
Entirely possible that some decent community interest would boost it nicely,
but if so, why'd Slackware have to let go of it... dunno...
</P>
<P>
Maybe you want to try another distro that builds for Sparc - RH's sparc build
isn't well regarded amongst a few non-Intel types I know locally... I think
in part because they get to Sparcs last.  But you've lots of choices anyway.
The search engines (keywords: sparc distribution) reveal that Mandrake and
<A HREF="http://www.suse.com/">SuSE</A> both have Sparc distros, Rock Linux (a distro that builds from sources
- <A HREF="http://www.rocklinux.org"
	>http://www.rocklinux.org</A>) builds successfully on it, and of course there's
my personal favorite, <A HREF="http://www.debian.org/">Debian</A>.
</P>
<P>
The Sparc-HOWTO adds <A HREF="http://www.caldera.com/">Caldera</A> OpenLinux and <A HREF="http://www.turbolinux.com/">TurboLinux</A> to the mix.  I know
that Caldera is really pushing to support the enterprise  but that points
to openlinux.org and appears to be an unhappy weblink - I only did a spot
check, but didn't see "Sparc" on Caldera's own pages.  One may safely
presume that someone who wants Caldera's style of enterprise level support
for Linux will be getting Sun maintenance contracts for their high end Sparcs,
right?
</P>
<P>
Anyways the reasons that Debian is my personal favorite in this regard are:
</p>
<ol>
<li>It's the only distro that I've tried on a Sparc
<li>It worked just as smoothly as on a PC
<li><tt>apt-get install</tt> &lt;package name here&gt;
</ol>
<P>
But you don't have to take my word for it 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> There's a bunch of folks at
<A HREF="http://www.ultralinux.org"
	>http://www.ultralinux.org</A>
</P>
<P>
who pay attention to how well things work on ultrasparcs, and they've
helpfully gathered a bunch of pointers into the arcvhives and subscribe
methods for the lists maintained by the major vendors in this regard.  So
check out what people who really use Sparcs have been saying about 'em!
Using your model number as a search key may narrow things down, too.
</P>

<!-- end 6 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Routing Mail</FONT></H3>
Thu, 19 Jul 2001 08:50:47 -0700
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: Danie Robberts (DanieR from PQAfrica.co.za)
</P>
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
I am trying to set my environment up so that I can use Star Office on my
<A HREF="http://www.slackware.org/">Slackware</A> 8 Laptop, and send mail via our Exchange Servers.
The problem is that the IIS Department has only allowed my Suna Workstation
to Send mail to their List server. I think it is limited by IP @.
</STRONG></P>
<P><STRONG>
Is there a way to configure a type of mail routing agent, so that my sending
adress in S/O will be the IP@ of my Sun Workstation, and the receiving will
be the exchange server (At the moment I can only receive e-mail)
</STRONG></P>
<P><STRONG>
Here is the IP Setup:
</STRONG></P>

<pre><strong> List Server:	196.10.24.112
 Exchange 	196.10.24.33
 Laptop:		192.168.102.241
 Sun:		192.168.102.44
</strong></pre>

<P><STRONG>
Thanx
<br>
Danie
</STRONG></P>
<P>
Not directly, while your Sun workstation is online.  You'd have to give
your Linux workstation the Sun's IP number.  Two hosts with the same IP
on the same network is a recipe for trouble!
</P>
<P>
If you've full control of your Sun, you could arrange to use
it as your email relay host, for an indirect solution.
</P>
<P>
It looks like StarOffice can be configured to use two different
mail servers, one for outgoing, one for incoming.  Set the outgoing
server to the Sun, and the incoming to the exchange server.
Configure the MTA on the Sun (sendmail, I expect) to relay for
you, and you're all set.
</P>
<P>
To test the Sun,
</P>

<blockquote><pre>telnet sun 25
helo linux.hostname
mail from: &lt;you@your.domain&gt;
rcpt to: &lt;somebody@reasonable.domain&gt;
data
some data
.
quit
</pre></blockquote>
<P>
"linux.hostname" is the hostname of your linux system
"<A HREF="mailto:you@your.domain"
	>you@your.domain</A>" is your return email address
"<A HREF="mailto:somebody@reasonable.domain"
	>somebody@reasonable.domain</A>" is some reasonable recipient
</P>
<P>
If you don't get a refusal, and the email goes through, the
Sun is set up to relay.
</P>

<!-- end 7 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/8"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Command to read CMOS from running Linux system</FONT></H3>
Wed, 20 Jun 2001 09:01:11 +0000
<BR>Andrew Higgs (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: Paul Kellogg (pkellogg from avaya.com)
</P>
<P><STRONG>
To "The Answer Gang":
</STRONG></P>
<P><STRONG><BLOCKQuote>
I am looking for a program I can run on my Linux machine that will
display the CMOS settings and CPU information.  I would like to avoid
rebooting to display the information.  Have you heard of a program that will
work for this?  And if so, do you know where I can get it?  If not, do you
have some suggestions for where to start if I wanted to write such a program?
I am working with a RedHat 6.2 system on a intel platform.
</BLOCKQuote></STRONG></P>
<P><STRONG>
Thanks - Paul.
</STRONG></P>
<P>
Hi Paul,
</P>
<P>
Try `<TT>cat /proc/cpuinfo`</TT> for information regarding the CPU. I am not to sure
about the CMOS info. It depends what you are looking for?
</P>
<P>
Look at the files in <TT>/proc</TT> and see if you can find what you are looking for.
</P>
<P>
I hope this will help in some small way.
</P>
<P>
Kind regards
</P>

<!-- end 8 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">linux ftp problem</FONT></H3>
Thu, 21 Jun 2001 12:18:42
<BR>Thomas Adam &lt;<A HREF="mailto:n6tadam@users.purbeck.dorset.sch.uk">The Weekend Mechanic</A>&gt; 

<P>
Question From: Brad Webster (webster_brad from hotmail.com)
</P>
<P><STRONG>
ok heres the deal, im having a heck of a time with the ftp client on my
linux server. im running red hat 6 and i can connect fine, but then it will
not accept the username  and password for any of the users. the worst part
is the same username and passwords will connect through telnet?
any suggestions would be very appriciated
</STRONG></P>
<P><STRONG>
bard webster
</STRONG></P>
<P>
Hello,
</P>
<P>
First off, I shall begin by saying, please in future send your e-mail in
plain-text format and NOT in HTML. Poor Heather will have a hell of a time
trying to extract the important information from the e-mail 
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)" 
		height="24" width="20" align="middle">
</P>
<blockquote><em>
It's easier than quoted printable, but, yeah, it's a pain. -- Heather
</em>
</blockquote>
<P>
So, to your problem. There are a number of things that you can check.
Firstly, when using FTP, do you make use of the hidden files ".netrc", in
each of your users home directory? In that file, you can store the ftp
machine, and the username and password of the user. Typically, it would look
like the following:
</P>

<blockquote><pre>machine ftp.server.sch.uk   login   usernametom  password xxxxxxx
</pre></blockquote>
<P>
The reason why your users can log in via telnet, is that telnet uses
different protocols. I would also suggest using a program such as "ssh",
which is more secure than telnet, but I digress.
</P>
<P>
Regards,
</P>
<P>
Thomas Adam
</P>

<!-- end 9 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/10"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Self extracting shell script</FONT></H3>
Sat, 7 Jul 2001 22:26:22 -0400
<BR>Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)
<P>
Question From: Albert J. Evans (evans.albert from mayo.edu)
</P>
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
I'm looking through some older Linux Gazzette articles and noticed
"fuzzybear" had put out a location to download his "self extracting w/make"
shell script. He was responding to your inquiry about this script. The URL
he listed is now defunct. Did you by chance get a copy of it, or know his
current URL?
</STRONG></P>
<P>
You know, I searched the past issues of LG... and I must admit that I
couldn't find my own article mentioning that. I'm pretty sure that the
URL I gave is the same as it is now - I don't rememberr changing it at
all - and I've just tested it (with Lynx.) It's still good. Anyway,
here it is -
</P>
<P>
<A HREF="http://www.geocities.com/ben-fuzzybear/sfx-0.9.4.tgz"
	>http://www.geocities.com/ben-fuzzybear/sfx-0.9.4.tgz</A>
</P>
<P>
The reason I haven't been particularly hyped about this thing is that,
the more time passes, the less I think of it as a good idea. Given that
one of the classes I teach for a living is Unix (Solaris) security, it's
actually my job to believe that it's a bad idea. 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> Just like many other
things, it's perfectly fine as long as you trust the source of the data
- but things rapidly skid downhill as soon as that comes into question.
Sure, in the Wind*ws world, people blithely exchange "Setup.exe" files;
they also suffer from innumerable viruses, etc.
</P>
<P>
Think well before you use this tool. Obviously - and if it isn't
obvious, even downloading it might be a bad idea - never-ever-*ever* run
a self-extracting archive, or any executable that is not 100%
trustworthy, as root.
</P>
<blockquote><em>...at this point Ben drew a huge ASCII-art skull and crossbones...</em></blockquote>
<P>
You have been warned. 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</P>
<P>
Ben Okopnik
</P>

<!-- end 10 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/11"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Cannot Format Network Drive</FONT></H3>
Sat, 14 Jul 2001 12:49:30 -0400
<BR>Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P><STRONG>
I'm not quite sure if you can help me out with this situation.
Okay here's the lay down
I have 1 IDE Hardrive 35 gigs
About a month ago I added the program System Comander so I could put Windows
98, Windows 2000, and Linux on my system.
I did it successfully!
So now about a week ago I wanted everything off, cause I bought a serperate
PC for Linux.
This is how I wipe everything off of my drive.
I used a Debug to wipe everything off and used fdisk to try to get rid off
all of the partititions... but it still didn't get all of the partitions off
(looking in fdisk). How I got rid of all of them was doing the commands
</STRONG></P>

<pre><strong>lock c:
fdisk /mbr
</strong></pre>
<P><STRONG>
Than going back to fdisk and deleted the remaining partitions.
This did work... no longer is there any drives stated in fdisk.
So than I created 2 drive c: and d: both about 15 gigs or more
But now this is were I run into my problem....
After rebooting I tried to format those drives a it's giving the error
message CANNOT FORMAT A NETWORK DRIVE????
I know this is a lot more information than you prbably needed, but I thought
I'd better say everything so that you know the whole story...
Can you help me?
Do you know of anything I could try?
</STRONG></P>
<P>
Well, since you've removed Linux, your options are pretty thin.
It sounds like your 'fdisk' screwed up somewhere, or you have a
virus (I remember, a looong time ago, of some that did that.) One of
the easiest ways to handle it would be to download <A HREF="http://www.toms.net/rb/">Tom's rootboot</A>
&lt;<A HREF="http://www.toms.net/rb/&gt"
	>http://www.toms.net/rb/&gt</A>;, run it, and use the Linux fdisk that comes
with it (you should read the 'fdisk' man page unless you're very
familiar with it.) It can rewrite your partitions and assign the correct
types to them; after that, you should be able to boot to DOS and do
whatever you need.
</P>
<P>
Ben Okopnik
</P>

<!-- end 11 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/13"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Wu-FTP and Linux Newbie</FONT></H3>
Wed, 11 Jul 2001 18:40:57 +0200 (MET DST)
<BR>Karl-Heinz Herrmann (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Question From: seboulva (seboulva from gmx.de)
</P>
<P><strong>
Sorry about this Simple Question, but I am a Linux Newbie and I want, no  I
must Update our Wu- FTP Server.It Comes with <A HREF="http://www.redhat.com/">Red Hat</A> 6.3
</strong></P>
<P><STRONG>
I Downloaded the 3 *.patch Files . And want to Apply it with the Patch
Command.
</STRONG></P>
<P>
Do you have the source code for wu-ftp and did you compile it yourself last
time? patch files are usually for source code, and they will change a
specific version to a specific other version. Are you sure that the patch
files math your source code version?
If it's RedHats patch files for their 6.3 distribution that should match.
But most probably it matches only the source code from their 6.3 CD's.
</P>
<P>
If all this matches, you should be able to compile the basic wu-tfp as it
comes with 6.3. Then you can try to patch the source and recompile.
</P>
<P>
Depending on the patch files (especially with which path they are generated)
you would do something like:
</P>

<blockquote><pre>cd wu-ftp-source
patch -p 1 &lt; ./path/to/patchfile
</pre></blockquote>
<P>
the -p x optioon strips off x directory levels from the path in the patch
file. If you look in the  ascii patch-files you will see file names with
path -- they have to match where your source is.
</P>
<P>
'patch --help' says among other very usful thing:
</P>

<blockquote><pre>  --dry-run  Do not actually change any files; just print what would happen.
</pre></blockquote>
<P>
so this is the option for testing until it looks as if it will apply
cleanly. Then remove the dry-run and do it for real.
</P>
<P>
recompile wu-ftp and then install it in the system. You will have to restart
it of course.
</P>
<P>
K.-H.
</P>

<!-- end 13 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/14"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Root Password</FONT></H3>
Mon, 02 Jul 2001 14:02:18 -0400
<BR>Thomas Adam &lt;<A HREF="mailto:n6tadam@users.purbeck.dorset.sch.uk">The Weekend Mechanic</A>&gt; 

<P>
Question From: Adam Wilhite (a.m.wilhite from larc.nasa.gov)
</P>
<P><STRONG>
Somehow the root password was lost or doesn't work anymore for one of
the computers I administer.  I went through your steps to reboot with
init=/bin/sh...  My problem is when I try to mount <TT>/usr</TT>. It says it
can't find <TT>/usr.</TT>  I would really appreciate your help.
</STRONG></P>
<P><STRONG>
thanks,
<br>adam wilhite
</STRONG></P>
<P>
Hi,
</P>
<P>
Your error message about not being able to find <TT>/usr</TT>, suggests to me that
"<TT>/usr</TT>" is not your mount point. Take a look in the file "<TT>/etc/fstab</TT>", which
is the filesystem table.
</P>
<P>
Locate the entry which points to "<TT>/usr</TT>". Your mount points are usually in
the second field, i.e. after all the "<TT>/dev/hda1</TT>" entries.
</P>
<P>
When you have found it, type in the correct value, using:
</P>
<P><CODE>
mount /path/to/mountpoint
</CODE></P>
<P>
Failing that, try issuing the command:
</P>
<P><CODE>
mount -a
</CODE></P>
<P>
that will tell your computer, to (try and) mount all the entries within the
file "<TT>/etc/fstab</TT>". You can then check what has been mounted, by typing in
the following:
</P>
<P><CODE>
mount
</CODE></P>
<P>
HTH,
</P>
<P>
Thomas Adam
</P>

<!-- end 14 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">RH7.1 switch to KDE login as default</FONT></H3>
Fri, 6 Jul 2001 11:09:13 -0400
<BR>Faber Fedor (<a href="mailto:linux-questions-only@ssc.com">The Answer Gang</a>)

<P>
Questions From: Larry Sanders (lsanders from hsa-env.com) and Jim (<em>anonymous</em>)
</P>
<P><STRONG>
Having completed the installation of <A HREF="http://www.redhat.com/">Red Hat</A> 7.1 with both
<A HREF="http://www.gnome.org/">GNOME</A> and <A HREF="http://www.kde.org/">KDE</A>, the default graphical login is GNOME.
How is this changed to the KDE default login for the system?
-- Larry
</STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
I love and use both the KDE and Gnome desktops. I have a strong
aesthetic preference, though, for the KDE login manager.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
My RedHat 7.1 install has resisted all efforts to switch it from its
default Gnome login manager to the KDE one. This isn't a big deal but
where is this managed and how do I make the change?
-- Best Regards, Jim
</EM></FONT></STRONG></P>
<P>
Try running the program "switchdesk".  It might be on the GNOME menu,
but you can run it from a command-line quicker.  It will let you switch
default desktops and even different desktops for different displays
(although that tends to be a bit problematic).
</P>
<P>--
Regards,
<br>
Faber Fedor
</P>

<!-- end 15 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips/16"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">3d linux</FONT></H3>
Mon, 16 Jul 2001 22:04:19 +0200
<BR>Zdenko Podobny (<a href="mailto:linux-questions-only@ssc.com">zdpo from mailbox.sk</a>)


<!-- sig -->

<P>
Hello!
</P>
<P>
This week I found some interesting programs that can help (a little bit) to
Philippe CABAL.
</P>
<dl>
<dt>K-3D
<dd><A HREF="http://freshmeat.net/redir/k-3d/4976/url_tgz/k3d-0.1.29.0-src.tar.gz"
	>http://freshmeat.net/redir/k-3d/4976/url_tgz/k3d-0.1.29.0-src.tar.gz</A>
</dl>
<p>It is frontend(Opensource, GPL) to render engines that are available to
linux and win:</p>
<dl>
<dt>BMRT, 
<dt>RDC 
<dd>(<A HREF="ftp://ftp.dotcsw.com/rdc32lnx.tar.gz"
	>ftp://ftp.dotcsw.com/rdc32lnx.tar.gz</A> -&gt;demo)
<dt>and 3Delight 
<dd>(<A HREF="http://www.3delight.com"
	>http://www.3delight.com</A> - I didn't try it)
</dl>
<P>
BTW: K-3D is one of the best applications I have seen on linux. Also no
other application need so much time and memory resources for
compiling like K-3D
</P>
<P>
<A HREF="http://www.dotcsw.com"
	>http://www.dotcsw.com</A> have perfect page with links. There is lof of
rendering staff (also many that are just expected)
</P>
<P>
I hope this help.
</P>
<P>
Zdeno
</P>

<!-- end 16 -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<H5 align="center">This page edited and maintained by the Editors
	of <I>Linux Gazette</I> 
<a href="http://www.linuxgazette.com/copying.html"
	>Copyright &copy;</a> 2001
<BR>Published in issue 69 of <I>Linux Gazette</I> August 2001</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>
<!-- *** END copyright *** -->

<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">HelpDex</font></H1>
<H4>By <a href="mailto:shane_collinge@yahoo.com">Shane Collinge</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<IMG ALT="bb.jpg" SRC="misc/collinge/bb.jpg" 
	WIDTH="750" HEIGHT="303">
<BR CLEAR="all">

<IMG ALT="cleaners.jpg" SRC="misc/collinge/cleaners.jpg" 
	WIDTH="750" HEIGHT="303">
<BR CLEAR="all">

<IMG ALT="degaussed.jpg" SRC="misc/collinge/degaussed.jpg" 
	WIDTH="750" HEIGHT="303">
<BR CLEAR="all">

<IMG ALT="escape.jpg" SRC="misc/collinge/escape.jpg" 
	WIDTH="750" HEIGHT="303">
<BR CLEAR="all">

<IMG ALT="gameboy.jpg" SRC="misc/collinge/gameboy.jpg" 
	WIDTH="750" HEIGHT="303">
<BR CLEAR="all">

<P> Here's a peek at Shane's sketchbook:

<BR>
<IMG ALT="Batman.jpg" SRC="misc/collinge/Batman.jpg" 
	WIDTH="750" HEIGHT="332">
<BR CLEAR="all">


<P> More HelpDex cartoons are at
<A HREF="http://www.shanecollinge.com/Linux/">http://www.shanecollinge.com/Linux</A>.  This month, Shane has also been busy doing some
<A HREF="http://www.shanecollinge.com/Illustrations/">illustrations</A> 
(non-Linux).


<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Shane Collinge</H4>
<EM>Part computer programmer, part cartoonist, part Mars Bar. At night, he runs
around in a pair of colorful tights fighting criminals. During the day... well,
he just runs around.  He eats when he's hungry and sleeps when he's sleepy.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Shane Collinge.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Make Your Virtual Console Log In Automatically</font></H1>
<H4>By <a href="mailto:bryanh@giraffe-data.com">Bryan Henderson</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<p>When you boot Linux, do you get a "login:" prompt on a bunch of
virtual consoles and have to type in your username and password on
each of them?  Even though you're the only one who uses the system?
Well, stop it.  You can make these consoles come up all logged on and
at a command prompt at every boot.

<p>In case you're thinking that password prompt is necessary for
security, think again.  Chances are that if someone has access to your
console keyboard, he also has access to your floppy disk drive and
could easily insert his own system disk in there and be logged in as
you in three minutes anyway.  That password prompt is about as useful
as an umbrella for fish.

<h2>Introduction</h2>

<p>The method I'm going to describe for getting your virtual consoles
logged in automatically consists of installing some software and
changing a few lines in <strong>/etc/inittab</strong>.  Before I do
that, I'll take you on a mind-expanding journey through the land of
getties and logins to see just how a Unix user gets logged in.

<p>First, I must clarify that I'm talking about virtual consoles --
those are text consoles that you ordinarily switch between by pressing
ALT-F2 or CTL-ALT-F2 and such.  Shells that you see in windows on a
graphical desktop are something else entirely.  You can make those
windows come up automatically at boot time too, but the process is
quite a bit different and not covered by this article.

<p>Also, consider serial terminals:  The same technique discussed in
this article for virtual consoles works for serial terminals, but may
need some tweaking because the terminal may need some things such as
baud rate and parity set.

<h2>How Logging In Works</h2>

<h3>Historical Background</h3>

<p>In the traditional Unix system of old, the computer was in a
locked room and users accessed the system via terminals in another
room.  The terminals were connected to serial ports.  When the system
first came up, it printed (we're back before CRT terminals -- they
really did print) some identification information and then a "login:"
prompt.  Whoever wanted to use the computer would walk up to one of
these terminals and type in his username, then his password, and then
he would get a shell prompt and be "logged in."

<p>Today, you see the same thing on Linux virtual consoles, though it
doesn't make as much sense if you don't think about the history.

<h3>Getty</h3>

<p>Let's go through the Linux boot process now and see how that login
prompt gets up there.

<p>When you first boot Linux, the kernel creates the
<strong>init</strong> process.  It is the first and last process to
exist in any Linux system.  All other processes in a Linux system are
created either by <strong>init</strong> or by a descendant of
<strong>init</strong>.

<p>The <strong>init</strong> process normally runs a program called
Sysvinit or something like it.  It's worth pointing out that you can
really run any program you like as <strong>init</strong>, naming the
executable in Linux boot parameters.  But the default is the
executable <strong>/sbin/init</strong>, which is usually Sysvinit.
Sysvinit takes its instructions from the file
</strong>/etc/inittab</strong>.

<p> To see how <strong>init</strong> works, do a <kbd>man init</kbd> and
<kbd>man inittab</kbd>.

<p>If you look in <strong>/etc/inittab</strong>, you will see the
instructions that tell it to start a bunch of processes running a
getty program, one process for each virtual console.  Here is an
example of a line from <strong>/etc/inittab</strong> that tells
<strong>init</strong> to start a process running a getty on the
virtual console <strong>/dev/tty5</strong>:

<xmp>
   c5:235:respawn:/sbin/agetty 38400 tty5 
</xmp>

<p> In this case, the particular getty program is
<strong>/sbin/agetty</strong>.  On your system, you may be using
<strong>/sbin/mingetty</strong> or any of a bunch of other programs.
(Whatever the program, it's a good bet it has "getty" in its name.  We
call these getties because the very first one was simply called
"getty," derived from "get teletype".)

<p>Getty opens the specified terminal as the standard input, standard
output, and standard error files for its process.  It also assigns
that terminal as the process' "controlling terminal" and sets the
ownership and permissions on the terminal device to something safe
(resetting whatever may have been set by the user of a previous login
session).

<p>So now you can see how the login prompt gets up on virtual console
<strong>/dev/tty5</strong>.  The kernel creates the
<strong>init</strong> process, running Sysvinit.  Sysvinit, as
instructed by its <strong>/etc/inittab</strong> file, starts another
process running a getty program, with parameters identifying
<strong>/dev/tty5</strong>.  The getty program prints "login:" on
<strong>/dev/tty5</strong> and waits for someone to type something.

<h3>Login</h3>

<p> After you respond to getty's login prompt, getty execs the program
<strong>login</strong>.  (Actually, you can usually tell getty to execute
any program of your choice, but <strong>/bin/login</strong> is normal);
i.e. <strong>getty</strong> replaces itself with <strong>login</strong>.  It's
still the same process, though.

<p> Bear in mind that this process was created by <strong>init</strong>,
which is owned by the superuser.  So this process, which is now
running login, is also owned by the superuser.

<p> The first thing <strong>login</strong> does is ask for your password.
When you type it in, <strong>login</strong> determines if it's right or
not.  Assuming it is, login then proceeds to do the following things:

<ul>
<li>
Set the owning user id of the process to you.
<li>
Set the owning group id of the process to your group.
<li>
Put a record in the user accounting database (the "utmp" file)
showing that you are logged in.  This database is technically
unnecessary today, but it is still used by old programs such as
<strong>who</strong> to tell who is logged on and at what terminal.
<li>
Set the process' supplemental groups to all the groups to which
you belong.
<li>
Set the process' current working directory to your home directory.
<li>
Make you the owner of the terminal device and set its permissions
appropriately.
</ul>

<p> The next thing <strong>login</strong> does is exec your shell program
(which can really be any program, but is normally a command shell,
e.g. <strong>/bin/bash</strong>).  I.e.  it replaces itself with the shell
program.

<p> Login looks up your username in the file <strong>/etc/passwd</strong>
to find all the information it needs, such as your password, uid, and
shell program.

<h3>The Shell</h3>

<p> The shell proceeds to run the system shell profile
(<strong>/etc/profile</strong>) and your personal profile (typically the
file <strong>.profile</strong> in your home directory), and ultimately
display a command prompt (<code>$</code> or <code>%</code>) on the terminal.  
This is the point at which
you consider yourself logged in, and our journey is complete.

<h2>Automating Login</h2>

<p>Ok, that was fun, but our purpose in this article is to explore a
new kind of login -- an automated one.

<p>Our goal is to do all those things that <strong>init</strong>,
<strong>getty</strong>, <strong>login</strong>, and the shell do except
<em>without the username and password prompt</em>.

<p> There are a bunch of ways to do that, but I wrote the program
<strong>qlogin</strong> to do it all very simply.
<strong>qlogin</strong> performs the functions of
<strong>getty</strong> and <strong>login</strong>.  It gets called by
<strong>init</strong>, like getty, and its last act is to call the
shell program, like <strong>login</strong>.

<p> So to set this up, all you have to do is replace the
<strong>/etc/inittab</strong> line shown above with one something like
this:

<xmp>
   c4:235:respawn:/sbin/qlogin /dev/tty5 bryanh 
</xmp>

This logs in username <strong>bryanh</strong> to virtual console
<strong>/dev/tty5</strong> at boot time instead of going through the
username and password prompt business.

<p>Note that the "respawn" in the line above means that when the
process ends, <strong>init</strong> will create a new one to take its
place.  In the traditional Unix system, that means when you log out of
your shell, which causes the process to end, a new getty runs and the
terminal gets a login prompt for the next user.  In the
<strong>qlogin</strong> case, it means when you log out of your shell,
a new one comes up immediately to take its place.  So if you want to
reset a bunch of stuff in your login session, typing <kbd>logout</kbd>
is a good way to do it.

<h2>Starting Slowly</h2>

<p>You probably shouldn't install <strong>qlogin</strong> and then
just dive right into changing all your getty's to qlogin's in
<strong>/etc/inittab</strong> and reboot and see if it works.  That
would be pretty optimistic.

<h3>Diversity Is Good</h3>

<p>First of all, I recommend that you not convert <em>all</em> your
virtual consoles to <strong>qlogin</strong> ever.  Use the tried and
true getty/login system on at least one virtual console so that if you
mess up something with <strong>qlogin</strong>, you can get into
another virtual console and fix it.  And if you mess up something with
<strong>getty</strong> or <strong>login</strong>, you can get into
another virtual console via <strong>qlogin</strong> and fix that!

<h3>Run It From A Shell</h3>

<p>Before you go editing <strong>/etc/inittab</strong> and messing
around with the <strong>init</strong> task, you should convince
yourself you know what you're doing by running <strong>qlogin</strong>
from a shell.  Watch <strong>qlogin</strong> work with your own eyes.
The problem with <strong>init</strong>, besides the fact that it's a
very important process you don't want to break, is that it doesn't
have a standard error file -- no way to give you error messages to
tell you why it can't do what you thought you told it to do.

<p>Usually, the indication from <strong>init</strong> that something is
wrong is "id X spawning too fast.  Disabled for 5 minutes."  What that
means is that the program (e.g. <strong>qlogin</strong>) that you told
<strong>init</strong> to run runs into trouble and terminates immediately.
Because it's a "respawn" entry, <strong>init</strong> simply generates a
new process running the same program.  And these processes start and
crash repeatedly.  <strong>init</strong> notices this and suspends the
"respawn" procedure for 5 minutes in hopes that someone fixes the
problem.  But why is the program immediately crashing?  Nobody knows
except that program, and it's not telling.

<p>So just invoke <strong>qlogin</strong> from a shell prompt, with
the same arguments with which you would have <strong>init</strong>
invoke it.  Now <strong>qlogin</strong> will issue error messages if
it crashes.

<p>Of course, the shell from which you invoke <strong>qlogin</strong>
had better be a superuser shell.  Otherwise, I can tell you right now
what your error message will be.

<h4>One Difference - Controlling Terminal</h4>

<p>One tricky aspect of running <strong>qlogin</strong> from a shell is
the matter of the controlling terminal.  The login process you
generate with <strong>qlogin</strong> will use the terminal you specify as
its input and output terminal, but its controlling terminal will be
the terminal where you typed "<strong>qlogin</strong>."

<p>The reason for the difference is this: If you're a Linux process,
when you open a terminal for input and you don't already have a
controlling terminal, that terminal becomes your controlling terminal.
But if you already have a controlling terminal, you just keep it.
<strong>init</strong> does not have a controlling terminal, so neither
does the <strong>qlogin</strong> child process it creates.  But login
shells have controlling terminals, and therefore the child processes
you create by typing commands (such as <strong>qlogin</strong>) at
shell prompts do too.

<p>Where you will see the difference is when you type Control-C:  It
won't do anything.  Control-C typed on a standard input device has no
effect other than to include a Control-C character in the input
stream.  But Control-C on a controlling terminal causes the foreground
processes associated with that terminal to get a SIGINT signal, which
has the familiar effect of terminating the program.

<p>All I'm saying is that if you log yourself on to
<strong>/dev/tty5</strong> by typing <kbd>qlogin /dev/tty5 ...</kbd> on
<strong>/dev/tty1</strong>, then Control-C on <strong>/dev/tty5</strong> will
have no effect.  Put the same <kbd>qlogin /dev/tty5 ... </kbd> command
in <strong>/etc/inittab</strong>, and Control-C on <strong>/dev/tty5</strong>
will work fine.

<p> Note: to be pedantic, I must admit that in saying Control-C, I am
assuming that the terminal's TTY properties are set such that
Control-C is the "interrupt character."  You could use
<strong>stty</strong> to make the interrupt character something else or
not have one at all.

<h2>About Qlogin</h2>

<p> <Strong>qlogin</Strong> isn't on your system, so you'll have to
install it.  Get it from <a
href=ftp://ibiblio.org/pub/Linux/system/misc>ibiblio.org</a> and
follow the simple installation instructions.  As you will find, a
prerequisite is the Perl extension called <strong>User::Utmp</strong>,
which probably also is not on your system, so you'll have to follow
the instructions to get and install that too.

<p><Strong>qlogin</Strong> is written in Perl and is quite simple.  So
you can see for yourself the steps involved in logging in a user.  And
you can modify it to suit your particular needs.

<p>One of the nice things about <Strong>qlogin</Strong> is that it's so
basic that it doesn't even rely on configuration files.  You can tell
it everything it needs to know to log you in just with command line
parameters.  You can override your <strong>/etc/passwd</strong> file or
log in a user that isn't even in <strong>/etc/passwd</strong>.  You're in
control.

<p>
Let's look at <strong>qlogin</strong>'s options:
<dl>
<dt>--command
<dd>the "command" (a kind of sloppy way to say a program plus
its arguments) to run after <strong>qlogin</strong> exits.  <strong>/bin/bash</strong>
is typical.
<dt>--arg0
<dd>the Argument Zero value for the program that runs after
<strong>qlogin</strong> exits, which is what shows up in a <strong>ps</strong> display.
<dt>--uid
<dd>the numeric user id for the process.
<dt>--gid
<dd>the numeric group id for the process.
<dt>--homedir
<dd>the home directory and initial current working directory
for the process.
<dt>--utmp/--noutmp
<dd>determines whether <strong>qlogin</strong> logs the session in the user
accounting database (utmp file).
</dl>

<p> And <strong>qlogin</strong> arguments specify the terminal device to
use for the process.

<p> All the details of using <strong>qlogin</strong> are in the
documentation that comes with it.

<h2>Other Things You Can Do With Qlogin</h2>

<p> So now you know how to make logged in shells come up automatically
on the various virtual consoles.  But with a simple change to the
procedure, you can make other programs run automatically on certain
virtual consoles or on serial terminals.  Imagine a virtual console
that runs the <strong>top</strong> system monitor program all the time.
Just say

<xmp>
  qlogin /dev/tty5 root --command=/bin/top --noutmp
</xmp>

<p> Maybe your system is a point of sale system for a store.  The
terminals are serial terminals at the cashier stations.  Cashiers
don't want to log in to Linux and don't want to see a shell.  If the
POS program is <strong>/usr/local/bin/pos</strong>, you could do this:

<xmp>
  qlogin /dev/ttyS1 cashier --uid=500 --gid=500 --command=/usr/local/bin/pos
      --arg0=POS --homedir=/
</xmp>

In this case, the <strong>pos</strong> program probably needs to do some
initialization of the serial port, such as setting its baud rate.  In
the traditional Unix login model, <strong>getty</strong> does that before
it puts up the login prompt.

<h1>Foreground Processes</H1>

<blockquote><em>[Your Editor asked Bryan, "I thought the system didn't have a
concept of a foreground process; that's a fiction of the shell."  Here's his
response.  --Iron]</em></blockquote>

<P>  I used to think that too; probably because of something I read in Bash
documentation.  However, the Linux kernel defines a "foreground
process group."  Every controlling terminal has a foreground process
group.  By default, it is the process group of the process that
originally opened the terminal.  But a process can set the foreground
process group to any process group in its session with an ioctl.

<P> I took a slight liberty in the article in referring to "foreground
processes," which I think can easily be interpreted as "processes in
the foreground process group."

<P> I believe the only significance of the foreground process group (the
kernel entity) is that the processes in that process group get the
control-C and hangup signals.

<P> Bash's job control uses that ioctl to make whatever your "foreground
job" is the foreground process group for your terminal.  That's why
when you put something in the background, like "grep abc * &",
control-C does not kill it.  If you want to kill it, you have to "fg",
causing Bash to ioctl it to the foreground, then Control-C.

<P> Many years ago, before the Web when terminals mattered a lot more, I
spent many hours combing through kernel code and experimenting to
figure out process groups, sessions, controlling terminals, job
control, SIGINT, SIGHUP, and the like.  I could write a long article
on it, but I think it's really arcane information.

<blockquote><em>[Readers: if you want to take him up on his offer for
such "arcane information", ask in the Mailbag.  Also remember that the
Mailbag is where you can ask for articles on any other topic. --Iron]
</em></blockquote>


<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Bryan Henderson</H4>
<EM>Bryan Henderson is an operating systems programmer from way back,
working mostly on large scale computing systems.  Bryan's love of
computers began with a 110 baud connection to a local college for a
high school class, but Bryan had little interest in home computers
until Linux came out.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Bryan Henderson.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Creating a Kernel Driver for the PC Speaker</font></H1>
<H4>By <a href="mailto:berryplumis@yahoo.com">Cherry George Mathew</a></H4>
<H5>Originally published at 
<A HREF="http://linux.com/">Linux.com</A>  
(<A HREF="http://Linux.com/newsitem.phtml?aid=12197&sid=93&page=1">article URL</A>)<BR>
Reprinted with permission from Linux.com and with revisions by the author</H5>
</center>
<P> <HR> <P>  

<!-- END header -->






<p>Sometimes I wonder how easy it is to re-invent the wheel, and then to
prattle about how hard it was to get the thing moving. But then again this
article is for those die-hards that sympathise with me, for those folk that
reckon that the joy of doing something by oneself is more important than being
the pioneer, the first soul on earth to step on the moon......</p>

 

<p><strong>I decided to make the PC speaker spew rock music.</strong> 
(The speaker is that invisible little thing under the PC
hood that beeps under your skin when you get naughty.)  I
wanted it to play real music. I couldn't bother to write all the code from
scratch, to decode mp3, etc etc. So I got a little lazy and decided to play
games with the most documented, most sophisticated Operating System Kernel,
ever - Linux. ;)  </p>

<p>How do you go about it, when you are new to a city and want to get from
point 'a' to 'b' with confidence? I'd take a deep breath and start walking
downtown. I'd start gleaning information and discovering places. Foolhardy?
Just try it in the city of the Linux kernel. It's a maze of code, a dizzy
labyrinth of cross-linked directories and makefiles. When I started off, I knew
that this was going to be a long project. But I had the 'staff' of DOS and the
'rod' of <i>Peter Norton's guide to the IBM PC and Compatibles</i> with me to
lend me courage. So off I strode with my chin in the air, and ready to take on
the worst d(a)emons.</p>

<p>The PC-speaker driver patches that are available for download from, 
<a href="ftp://ftp.uk.linux.org/pub/people/dwmw2/pcsp/">ftp://ftp.uk.linux.org/pub/people/dwmw2/pcsp/ </a>   (Authored by Michael Beck, maintained by David Woodhouse see 
<a href="http://linux-patches.rock-projects.com/v2.2-d/pcsp.html">http://linux-patches.rock-projects.com/v2.2-d/pcsp.html</a> )  I understand, require to have the kernel recompiled if they are to work. When I started off, I was ready to play foul, and get quick results. Besides it's all a game, is it not ? ;-) That's why you'll find inline assembly in the code.Anyways, here is how it works..........</p>

<h2>The PC speaker: background</h2>

<p>The internal speaker is tied to the buffered output of the 8254 timer chip
on all PCs. The output of the 8254 timer is further latched through the
integrated system peripheral chip, through port 61h. A little chart should
help, I think. Here goes:</p>

<p>
<img src="misc/mathew/speaker_illustration1.png" WIDTH="396" HEIGHT="82" 
BORDER="3">
</p>

<h2>PIC stands for programmable interrupt controller</h2>

<p>The base clock frequency of the 8254 is 1193180Hz which is 1/4 the standard
NTSC frequency, incidentally. The counters have the values of the divisors,
which, roughly speaking, are used to divide the base frequency. Thus the
output of channel 0 will be at a frequency of 1193180Hz if counter0=1,
596590Hz if counter0=2 and so on. Therefore counter0=0 =&gt; a frequency of
approximately 18.2 Hz, which is precisely the frequency at which the PIC is
made to interrupt the processor. In DOS, the PIC is programmed to call the
Interrupt Service Routine (ISR), at vector 8.</p>

<p>Effectively this means that the value of counter0 will determine the
frequency of the timer ISR (Vector 8 in DOS) is called. Changing counter 0
changes the rate at which the timer ISR is called. Therefore if the same
person wrote both the code for the ISR, and that for programming counter 0 of
the 8254 timer chip, then he could get his ISR called at a predetermined rate
as required.</p>

<p>All this is leading to another aside.</p>

<p></p>

<h2>Aside: digital audio</h2>

<p>When you hear sound, you know something near you is vibrating. If that
something is a speaker cone, you know immediately that there is an electrical
signal driving it. So we could always grab the signal generator by the scruff,
if we want to snuff out the noise. If we want audio, we need a vibrating, or
alternating, voltage. And we know that digital implies numbers, 1s and 0s. How
do we put all of this stuff together and create digital audio?</p>

<p>Lets imagine that we want a continuous hum to wake us out of slumber in the
morning. Bless the man who tries to sell this gadget to me! We need a
continuous sine wave. Something like:</p>

<p>
<img src="misc/mathew/speaker_illustration2.png" 
WIDTH="313" HEIGHT="118">
</p>

<p>The numbers represent how loud the noise gets at every instant. You're
involuntarily doing DSP here. DSP is a year two pain-in-the-neck paper for
most Electrical Engineering undergraduates. (I'm one of them. Accept my hearty
condolences.) So I'd better mention that you're actually looking at samples.
These values are all you need to recreate the wave we need. Do that
continuously, and you have a continuous wave. So if we ran through the numbers
starting at 1 through 7 through 0 through -1 through -7 through -1 to 0, all
in a second, we'd get a very approximate sine wave at 1Hz. (Remember, Hertz is
cycles per second.) Got the mechanics of the thing? Want a sine wave with a
smoother curve? Just increase the number of samples you take per second. Here
we've done 14. How about if it were 44000? That's the rate a CD player spews
the numbers out to its DAC. DAC stands for Digital to Analog Converter, it's
the little gadget that converts the 1s and 0s that make up the binary numbers
that we are talking about into real analog time-varying voltage. Our little
coding technique is called pulse code modulation. There are different ways to
code the pulses, so we have PCM, ADPCM etc. The waveform above could be termed
"4bit, signed mono PCM at 14Hz" sampling rate.</p>

<h2>1 Bit DAC</h2>

<p>So you ask me, where does all this come in when we're talking about the PC
speaker? How about a custom timer ISR to vibrate the speaker cone at a
pre-requisite frequency, so that all the ISR programmer has to do is to make
the PC speaker cone move to the required amplitude (distance from the zero
line) according to the sample value he gets from digital data, from a CDROM,
for example. This means that we can set up a timer ISR for 44000Hz, and that
is CD quality music staring at us! Perfect logic if you have a DAC to convert
every sample into the corresponding analog voltage. In fact, the parallel port
DAC driver does just that. Just rig a R - 2R ladder network of resistors and
tie a capacitor across the output, feed it to any amplifier, even a microphone
input will do, and voila, you have digital music!</p>

<p>Alas, things are not all that simple with the PC speaker. All because the
PC speaker is not at all tied to a DAC, but of all things, to a timer chip.
Take look at the waveform output of a timer chip for, say, a sine wave:</p>

<p>
<img src="misc/mathew/speaker_illustration3.jpg" WIDTH="370" HEIGHT="56">
</p>

<p>We have two discrete values to play around with: One +5V, the other 0V and
nothing in between. How do we get the Analog waveform? Oh man, why hast thou
asked the impossible? Ask the designers at IBM who designed the first XT
motherboards!</p>

<p>But we do have a very fragile, subtle solution. The techie terms are 1bit
DAC, Chopping, and so on and so forth.</p>

<p>It's rather simple and easy to implement, and somewhere down the line, it
was bound to happen. I doubt that the old XT bugger at IBM ever dreamt of 1.5
GHz Pentiums when he fixed his 8086 on the motherboard for the first time.</p>

<p>The idea is to drive the PC speaker cone in bursts, when we can't quite
push it up to the mark smoothly. Mind you, at 22Khz the cone is a mighty lazy
bloke, it reluctantly moves up to the mark. Halfway through, take a rest so
that if it's overdone and the cone has overshot, it gets time to come back
down. Something like anti-lock brakes in automobiles. When you press the brake
pedal half way down, the mechanism starts alternately pushing the brakes on
and off. When you're standing on the pedal, the brake shoes are not quite
stuck to the wheel drum, they're hammering at a furious pace. So you don't get
a locked wheel. Similarly the more frequently you hammer the speaker cone with
a +5V pulse, the farther it moves from the centerline. Bingo! Vary the
frequency of pulsing according to the required amplitude. I named the DOS
version fm.com just to remind myself that the idea was indeed ingenuous.</p>

<p>Now go back to the first figure and look at counter 2 of the 8254. Where does it lead to ? To the PC speaker, of course. Now all we have to do to get REAL sound, is to dump a scaled (remember 1 < countervalue < 65535) that is proportional to sample value (value => amplitude in PCM). We do this from within our hack timer ISR. Go on and take a look at the myhandler() function in myaudio.h</p>

<FONT COLOR="purple">
<h2> Quiz Time!!!!!</h2>

<DIV><b><i>&nbsp;&nbsp;smpl1&nbsp;&nbsp;&nbsp;&nbsp;smpl2&nbsp;&nbsp;&nbsp;&nbsp;smpl3</i></b></DIV>
<DIV>_______&nbsp;&nbsp;&nbsp;___&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_</DIV>

<DIV>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;|</DIV>

<DIV>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;|</DIV>






<DIV>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|_|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|___|&nbsp;&nbsp;&nbsp;|_____</DIV>






</p>

<h3><i>Can you guess the values of smpl1, smpl2 and smpl3 ? </i> </h3> 
</FONT>


<h2>Linux, here we come!</h2>

<p>The Linux kernel is an amazing piece of programming in that it has been
organized so well that a person with little or no knowledge of assembly language
can write a lot of kernel code (in fact 99% [wanna bet ? ;)] of the kernel is written in "c"). It is also designed in such a way that device driver writers are given a preset environment and an elegantly exhaustive programming interface to write code.</p>

<p>The kernel code is very portable, i.e., it can be compiled on a variety of
machines (processors like the i86, alpha, sparc). I think it makes good logic to
write code templates, which can be elaborated and tailor made for individual
hardware. In English, I can best illustrate this principle with an example. Suppose that you want to publish a PhD thesis on how to wash clothes using your brand of washing machine. You'd write a sequence of steps starting from:</p>

<p>1) Insert the power cord into the wall socket and switch on the power</p>

<p>...</p>

<p>n) Finally, retrieve your garments from the soaking mess and dump them on
the clothesline.</p>

<p>The sequence from 1 to n would take minor variations depending on whether
your washing machine was semi or fully automatic, whether it was top or side
loading (try step 'n' from the side loading washing machine, and send me an
e-mail about it) and other variables. The instructions in your thesis would be
fine for one washing machine, but how about if you were a freelance user
manual writer, and needed to write manuals for a thousand brands?</p>

<p>Take the case of the /dev/dsp device interface, the default interface for PCM
(pulse code modulated) and coded PCM sound. Hannu Savolainen designed much of
the interface, with Alan Cox making significant contributions. But these
designers--quite rightly--didn't make room for one teeny-weeny little device
called the PC-speaker, in favor of the AWE 64 and cards of the kind. They
assumed that all DSP devices would at least have DMA (Direct Memory Access is a
technique by which "intelligent" peripheral chips take care of moving data
to/from RAM, without involving the processor) support, or on board buffers, if
not coprocessors (i.e., on-board processors). So they put the DMA registration
code as a mandatory part of the OSS API. The OSS API has two levels of exported
functions: those exported by soundcore.o and another set exported by sound.o </p>

<p>sound.o is stacked on top of soundcore.o and uses its exported functions much the same as any other device driver. It provides an easy interface to portable device drivers and supports advanced functions like DMA access. (Modern sound cards support at least DMA ) </p>
<p>That's where we begin hacking. We have to avoid the standard OSS interface, and use the soundcore interface directly. Which means it's time for another technical discussion - character devices in Linux.</p>

<h2>Character Devices in Linux</h2>

<p>In Linux, there are mainly two kinds of devices: block and character.
(We're ignoring network devices since they aren't really "devices", more like
interfaces.)</p>

<p>Block devices are assumed to have certain characteristics like reading and
writing in blocks, buffering, partitioning etc. The hard disk drive is the
perfect example of a block device. An application normally accesses a hard
drive through a file system driver. That's why in Unix you mount disk drives
and do not access them sector-by-sector.</p>

<p>Character devices are meant to be read and written one byte at a time (e.g.:
the serial port), but are transparently buffered to improve system throughput. An
application accesses them by doing ordinary file operations on the
corresponding device nodes. Device nodes are special "files" which can be
accessed through the ordinary path tree. So if you want to write to the sound
device, by convention, /dev/dsp is the published device node to use for that.
Note that any device node that points to the corresponding device number
registered by the driver can be used to access that driver. For example, the
/dev/dsp node is attached to device number 14/3. (try: file /dev/dsp; on your
system). You could equally well access it via /dev/mynode if /dev/mynode points
to 14/3. Check the mknod man pages for exact semantics.</p>

<p>Now if you have a .wav file which is of a specific format, say 16-bit, stereo, raw pcm, to make it play on the system sound device, you might open the /dev/dsp node using the open system call, and open your .wav file, read a block of data from the .wav file, and write it to the /dev/dsp node using read and write system calls respectively. AHA! And guess what client is readily available for this? Our very own cp. So next time, try cp -f fart.wav /dev/dsp. And tell me how it sounded. I'll bet that unless you're very lucky, you wouldn't get the right sound even if you play Celine Dione. That's because the sound driver needs to be told what format the raw data it gets is in. More often than not, you'd be trying to play a 16-bit stereo file at 44khz on a 8-bit mono 8khz driver. That's like trying to play an LP disc at the wrong turntable speed.</p>

<p>The ioctl (short for input/output control) system call is used on /dev/dsp,
to talk to the device driver. Unfortunately, the exact semantics of the ioctl
call is left to the device driver writer's discretion. That's sort of like the
chaos one gets in the DOS software market. Thankfully, we have a few recognized
conventions in Linux, the most popular of which is the OSS or Open Sound System.
This is the interface implemented in Linux by Savolainen &amp; Co. So we have XMMS plug-ins for OSS on the application side, and scores of device drivers on the kernel side.</p>

<h2>The Kernel</h2>

<p>When an application makes the open "call" it's obviously calling something.
That something is a kernel routine (remember, <code>open</code> is a system call). The kernel
is designed to pass the call on to the corresponding device driver. The
amazingly nice thing about the Linux kernel is that you can tell the kernel to
call your routine for a particular device number. This is called device callback
registration, and is a kernel mode call, i.e., you cannot write applications
that do these calls and can be run from the terminal. Similarly you can play
kernel, and pass on user calls to further routines, if you design and export
your own custom registration functions. That's exactly what soundcore.o does via
register_sound_dsp().(Alright, alright, hold it, you ask me.  We'll dive into
the OSS sound modules soon. Just making sure that there's water in the pool!)
You use insmod for that, and write a special program called a kernel module,
which insmod can load into kernel space and link with the kernel system calls.
The main difference between system calls and kernel mode calls is that system
calls have to conform to general conventions if they are ever to be recognized
as a part of Unix.(Remember the "what is Linux" FAQ? ) The kernel, on the other
hand, is Linux. So it's just Linux conventions one has to follow in kernel
programming, and mind you, Linux kernel conventions change nine to the dozen per
kernel release. That's why you have a "pre-x.xx.xx version compile only "
warning with many releases of module binaries. At a minimum, we need to have a
read and write callback routine each, besides open and close. The Linux kernel
specifies a routine called init_module, and another called cleanup_module, which
are called by the kernel at the insertion and removal of our module. (Somewhat
like main() in user space.) In other words, when we write a init_module routine,
we assume that we have full control over the system ports, memory, etc. and that
we can call all available kernel functions. Another thing that's interesting is
that any kernel or module function can be exported to the kernel symbol table
(Check /proc/ksyms for a list) , so that it can get called by any other kernel
function or module. In other words, the kernel program file, /boot/vmlinuz,
originally was a C program starting with main() just like you or I would write
any other program in C. Only that the lines after the parenthesis were filled in by a very talented systems programmer called Linus Torvalds.</p>

<h2>Registering our driver</h2> <p>The most crucial part of the whole
discussion is of course the code itself. Registering the driver is done by
means of the register_sound_dsp function exported by the soundcore.o module,
which as I explained earlier, is part of the standard OSS distribution. What it
does is to pass through the <code>open</code> call from the user-space
application. Much of the code is self-explanatory. The GNU assembler
(originally AT&T assembler format) has to do with hooking the timer interrupt.
The setvect and getvect functions work much the same as they do in DOS. (OK go
ahead and say YUCK - I know you're lying. I wasn't born in Bell labs, you know
:) </p>


<h2>Towards A Working Device Driver</h2>

<p>For us, the main job is to get a working device driver that can access the
PC speaker through the 8254 timer ports, and do the tricks that'll copy the
application's sound data to the PC speaker, byte-by-byte.</p>

<p>OSS creates a device node called /dev/dsp for us. Our driver called
myaudio.o can be loaded into the running kernel using insmod myaudio.o,
and removed using rmmod myaudio. /dev/dsp points to our driver after the insmod.</p>

<p>Let's take a look at the program structure. We have the following tasks to
do:</p>

<p>1) Register our fake dsp device. 2) Hook the timer interrupt vector and set
the interrupt at the correct sampling rate. 3) Print a message that says Phew!
The kernel will tell you if anything went wrong. In many cases, it'll reboot
the system for you.</p>

<p>When the device is unloaded, we need to restore the system to its previous
state by the following steps:</p>

<p>4) Unhook the timer interrupt vector and reset the interrupt to the old
rate. 5) Unregister the dsp device. 6) Print a success message.</p>

<h2>A Look at myhandler()</h2>

<p>The sample code is in two files called myaudio.c and myaudio.h. myaudio.c
contains the device registration routines that do all the above tasks.
myaudio.h contains a very important routine called the ISR (Interrupt Service
Routine). It's named myhandler(). I think that the steps given above are
best explained by reading the code in myaudio.c. Let me turn your attention to
myaudio.h, to myhandler() in particular.</p>

<p>Step number 2 above says: "hook the timer interrupt vector". This means
that the ISR is to be setup in such a way as to get executed at exactly the
sampling rate we intend. This means that when I write the code in the ISR, I
can be reasonably sure of the following: a) The next datum from the user
application, if available, is to be fetched, b) It needs to be processed into
an 8254 counter 2 value (discussed in detail above), c) This counter value is
to be dumped into the 8254 counter 2 register: i.e. delay for the PC-speaker
is set according to the value of the fetched datum and d) The system scheduler
has not yet been called! Decide whether to call it.</p>

<p>Step d) needs an aside:</p>

<p>If you've read through setvect() in myaudio.c, you'll find that setvect
uses a few gimmicks to put myhandler into the system vector table. This is
Intel 386+ specific. In the real mode of 8086 operation, all one needs to do
to revector an ISR is to save the corresponding entry in the interrupt vector
table (IVT) that starts at memory address 0000:0000 in increments of 4 bytes.
(Because a fully qualified long pointer in the 8086 is 32bits long cs:ip.) In
other words, for interrupt 8, which is the default BIOS setting for IRQ 7, of
the PIC, just change the pointer value at 0000:0020 to the full address of
myhandler().Things are a little more complicated here. In 386+ protected mode,
in which the Linux kernel runs, the processor, the IVT is called the IDT, or
the Interrupt Descriptor Table. A meaningful description of the IDT would take
a whole HOWTO, but I'll assume that you know about 386+ protected mode if you
want to and save all the gory details for your PhD thesis. What we really need
to know is that the pointer to myhandler is scattered over an 8-byte area.
That information is put together using some cute GNU assembler statements to
make the original ISR memory pointer that actually points to the system
SCHEDULER (which is a special program routine in every multitasking operating
system) now point to myhandler(). The responsibility of the SCHEDULER is to pluck control from one
program when its time slice is over, and give control to the next. This is
called pre-emptive multitasking. In Linux, the time slice given to a process
is 10 milliseconds. Can you guess the rate at which the default timer ISR is
called? It's a value called HZ, in the Linux kernel.</p>

<p>The catch here is that while the original ISR (the scheduler) needs to be
called at 100Hz, our ISR requires calling at the sampling rate, usually
22Khz. And if we neglect to call the original ISR, all hell's going to break
loose. There's a simple solution waiting. If you know the rate at which you're
called, and the rate at which to call the original ISR, just call it once
every so many times. In other words: At 22Khz, increment a counter at
every tick and when the counter reaches 220, call the old ISR, otherwise, send
an EOI (End Of Interrupt) to the PIC. Thus the old ISR gets called at exactly
100Hz! Black Magic!! If you forget to compensate for the rates, it's very
interesting to observe what happens. Just try it. On my system, the minute
needle of xclock was spinning like a roulette wheel!</p>

<p>If you take a look at the figure above, the one which shows how the 8254
timer interrupt is hooked to the PIC, you'll notice that when the 8254 wants
to interrupt, it tells the PIC, via the IRQ 7 line, (which incidentally is
just a piece of copper wire embedded on the motherboard). Nowadays of course,
a number of the older chips are merged into one package so don't go around
snooping for a PCB trace labeled IRQ 7 on your motherboard! The PIC decides
whether, and when to interrupt the processor. This is a standard method to
share interrupts, and is called interrupt priority resolution (or
prioritization), which is the sole purpose of the PIC. In Linux, the PIC is
reprogrammed to call vector 20 for the timer ISR (IRQ 7) as against the vector
8 setting of the BIOS in DOS. After every interrupt, the corresponding ISR is
expected to do an EOI, which is essentially an outportb(0x20,0x20). So a
little care is needed to make sure you don't send a double EOI, one from you,
and one from the original ISR which doesn't know about you.</p>


<h2>One Last Point</h2>

<p>I guess, that's it, but before I run away satisfied that I've shoved Latin
up a thousand throats, I want to clear up a few things about the sample that I did
in myaudio.x . Linux has a formal method to claim interrupts for device
drivers. The trouble is, by the time a module is loaded, the scheduler has already
claimed the timer interrupt. So we have to hack a bit and steal it from the
scheduler. That's why we had to discuss IDTs and stuff. The OSS interface that
I've written in the code is pre-alpha. Actually, you can run applications like
mpg123, play and even xmms and you'll get insight into event synchronisation in
Multi-Multi Operation Systems if you add a -D SPKDBG to the compiler options
variable in myaudio.mak. The "-D SPKDBG" turns on debug messages. Be warned however,
that your machine may not be able to handle the overhead of recording the logs.
So do it only if you know what you are doing. I've elaborated OSS on a TODO
list earlier. You're welcome to complete it.</p>

<p>Do the following to use our driver:As root user, chdir to the directory where you've copied the source files
myaudio.c, myaudio.h, and myaudio.mak. Run:

<PRE>
make -f myaudio.mak
</PRE>

assuming that you have a standard OSS distribution on your machine. (The path
is /usr/src/linux/drivers/sound. Check it out.)

<PRE>
modprobe sound
insmod myaudio.o
</PRE>

<p>Now the driver is active. Check it with:

<PRE>lsmod
</PRE>

<p>Look for myaudio at the top of the list. mpg123, play and xmms should work like usual now.</p>

<p>If none of the above applications work, it's possible to listen to MP3 music with the following:

<PRE>
mpg123 -m -r 22000 --8bit -w /dev/dsp x.mp3 #this should playx.mp3
</PRE>

<p>ENJOY!!!!

<HR WIDTH="70%">

<b>Note: All these operations need to be done as user root. So I'm assuming
that you're using your own machine, and are ready to trash any part of it,
maybe permanently. I cannot take any responsibility for what happened to your
system because of my code, so I'll insist that you try it only at your own
risk. I tried my own sample on a Redhat 7.1 system running on a Celeron
366/64MB RAM. For a really, seriously, interested person who's bent on not
messing up his/her machine, kindly use the patches provided by Michael Beck,
but then you wouldn't be reading this, would you?

</b>

<HR WIDTH="70%">

<p><FONT COLOR="brown"> If your answer was in the order 
<PRE>
smpl1&gt;smpl2&gt;smpl3, and smpl2=127 
</PRE> then you've passed the test. You may now apply to Creative labs ;)
</FONT>

<HR WIDTH="70%">

Program listing:
<ul>
<li> <A HREF="misc/mathew/myaudio.h.txt">myaudio.h</A>
<li> <A HREF="misc/mathew/myaudio.c.txt">myaudio.c</A>
<li> <A HREF="misc/mathew/Makefile.txt">Makefile</A>
</ul>




<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Cherry George Mathew</H4>
<EM>I'm a third year Electronics Engineering undergraduate student at College of
Engineering, Adoor, Kerala, India.   You may contact me at at <a
href="http://berryplum.homestead.com/">http://berryplum.homestead.com/</a> or
<a href="mailto:berryplumis@yahoo.com">berryplumis@yahoo.com</a>, and time
permitting I will try to answer.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Cherry George Mathew and Linux.com.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Combining Perl and PostgreSQL, Part 2: Procedures with PL/pgSQL</font></H1>
<H4>By <a href="mailto:articles@gnujobs.com">Mark Nielsen</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<p>
<ol>
<li>
<a href="#Introduction">Introduction</a></li>
<li><a href="#perl">Perl script to create tables, procedures, 
backup tables, and sequences. 
</a></li>
<li><a href="#execute">Executing the Perl script</a></li>
<li><a href="#consider">Considerations to explore.</a></li>
<li><a href="#Conclusion">Conclusion</a></li>
<li><a href="#REF">References</a></li>
</ol>

<h3><a NAME="Introduction"></a>Introduction</h3>
After dealing with installing PostgreSQL, Perl, and embedding Perl in
PostgreSQL, I wanted a standard way to create tables, sequences, 
stored procedures, and backup tables. Perhaps other people have nice GUI
solutions to do this, but I haven't seen any. I would like it if someone
would work with me to create a GUI interface to achieve what I am doing here. 
My goals are:
<ol>
<li> Always backup data no matter what happens. </li>
<li> Always use stored procedures to insert, update, delete, copy, or
  to do anything that changes data on the tables. One should even create
  stored procedures to select data. </li>
<li> Have a Perl script create tables, sequences, backups tables, and the
  stored procedures to manipulate the data. </li>
<li>Have the stored procedures clean data using Perl. </li> 
<li>Backup data if someone runs the Perl script on a live system.</li>
<li> There should be an active column in the table so that you can specify
active or inactive rows in the table. We create a view which views 
active rows of a table. </li>
<li> Stored procedures should record date created and date last updated. 
</li>
<li>All rows have a unique id. Even if we choose not to use them, 
they will still have them. It is not always good to use oid to get
unique rows. </li>
<li> Be able to delete inactive rows 
with a purge procedure. The delete procedure
just makes it inactive. Also, unpurge data with the latest purged
data for a unique id. This
is cool.</li> 
<li> All negative numbers returned from pl/sql procedures are considered
failures. All positive numbers (including 0) are considered to be
successes in the fact nothing errored out. They are either 0, in which
nothing happened, or something greater than 0 which indicates the
number of items affected or a id number. </li>
</ol>
My future goals include:
<ol>
<li> Creating a GUI interface. Preferrably one that is not dependent on GNOME
or KDE libraries but Python. You can create Python binaries easily, so I 
would prefer Python/TK.</li>
<li>Allow the GUI design to make changes to live tables by either:
  <ul>
  <li>Making updates that really happen with full effects. Some changes
   con't allow all options (at least in the past). </li>
  <li>Creating a new table, and dumping all the data from the old table
  into the new one while locking the old table.  </li>
  </ul>
</li>
<li>Record all database changes to review history.</li>
</ol>

<h3><a NAME="perl"></a>Perl script to create tables, procedures,
backup tables, and sequences.</h3>
Here is the Perl script I use. You can also get a copy here
<a href="misc/nielsen/Create_Functions.pl.txt">Create_Functions.pl.txt</a>.
<pre>
#!/usr/bin/perl

#              Create Functions for Perl/PostgreSQL version 0.1

#                       Copyright 2001, Mark Nielsen
#                            All rights reserved.
#    This Copyright notice was copied and modified from the Perl 
#    Copyright notice. 
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of either:

#        a) the GNU General Public License as published by the Free
#        Software Foundation; either version 1, or (at your option) any
#        later version, or

#        b) the "Artistic License" which comes with this Kit.

#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
#    the GNU General Public License or the Artistic License for more details.

#    You should have received a copy of the Artistic License with this
#    Kit, in the file named "Artistic".  If not, I'll be glad to provide one.

#    You should also have received a copy of the GNU General Public License
#   along with this program in the file named "Copying". If not, write to the 
#   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
#    02111-1307, USA or visit their web page on the internet at
#    http://www.gnu.org/copyleft/gpl.html.

use strict;

  ### We want to define some variables WHICH YOU SHOULD CHANGE FOR YOUR
  ### OWN COMPUTER. 
my $Home = "/tmp/testdir";
my $File = "$Home/Tables.txt";
my $Template = "$Home/Generic.fun";
my $Custom = "$Home/Custom.sql";
my $Database = "testdatabase";
 
#------------------------------------------------------------------------

my @List = @ARGV;

  ## Let us create the two directories we need if they are not there. 
if (!(-e "$Home/Tables")) {system "mkdir -p $Home/Tables"}
if (!(-e "$Home/Backups")) {system "mkdir -p $Home/Backups"}

  ### Open up the template for the functions and the file that contains
  ### the info to create the tables. 
open(FILE,$Template); my @Template = &lt;FILE&gt;; close FILE;
open(FILE,$File); my @File = &lt;FILE&gt;; close FILE;
open(FILE,$Custom); my @Custom = &lt;FILE&gt;; close FILE;

  ### Filter out lines that have no numbers or letters. 
@File = grep($_ =~ /[a-z0-9]/i, @File);
  ### Get rid of any line which contains a #
@File = grep(!($_ =~ /\#/), @File);
  ### Get rid of the newline. 
grep(chomp $_, @File);
  ### Get rid of tabs and replace with spaces. . 
grep($_ =~ s/\t/ /g, @File);
  ### Convert all multiple spaces to one.  
grep($_ =~ s/  +/ /g, @File);
  ### Next two lines get rid of spaces and front and end.  
grep($_ =~ s/^ //g, @File);
grep($_ =~ s/ $//g, @File);
  ### Delete any commas at the end, we will put them back on later. 
grep($_ =~ s/\,$//g, @File);

my $Tables = {};
my $TableName = "";
  ### For each line in the file, either make a new array for the table, 
  ### or store the lines in the array for a table.  
foreach my $Line (@File)  
  {
  my $Junk = "";
    ### If the line starts with "TABLENAME" then create a new array. 
  if ($Line =~ /^TABLENAME/) 
    {
    ($Junk,$TableName, $Junk) = split(/ /,$Line);
       ### This creates the aray for the table. 
    $Tables-&gt;{$TableName} = [];
    }
  else 
    {
       ### Storing lines for the table. 
    push (@{$Tables-&gt;{$TableName}}, $Line) ;
    }
  }

    ### If we listed specific tables, then only do those. 
  if (@List) 
    {
    foreach my $TableName (sort keys %$Tables)
      { if (!(grep($_ eq $TableName, @List))) {delete $Tables-&gt;{$TableName};} }
    }

  ### Get the keys of the reference to an array $Tables
  ### and get the data for that array, create our file, and then use the file. 
foreach my $TableName (sort keys %$Tables) 
  {
  my @Temp = @{$Tables-&gt;{$TableName}};

  my $Backup_Columns = "";  my $Backup_Values = ""; my $Update_Fields = "";
  my $Field_Copy_Values = "";  my $FieldTypes = "";
  my $CleanVariables = ""; my $RemakeVariables = ""; 
    ### The two tables are different in one respect, the backup table 
    ### does not require uniqueness and it doesn't use a sequence.  
  my $Table = qq($TableName\_id int4 NOT NULL UNIQUE DEFAULT nextval('$TableName\_sequence'),
    date_updated  timestamp NOT NULL default CURRENT_TIMESTAMP,
    date_created  timestamp NOT NULL default CURRENT_TIMESTAMP,
    active int2 CHECK (active in (0,1)) DEFAULT 0,
);
    ## I should allow null for the id instead of 0, but since the sequence
    ### starts at 1, I use 0 as null. I hate nulls.  
  my $Table_Backup = qq(backup_id int4 NOT NULL UNIQUE DEFAULT nextval('$TableName\_sequence_backup'), 
    $TableName\_id int4 NOT NULL DEFAULT 0,
    date_updated  timestamp NOT NULL default CURRENT_TIMESTAMP,
    date_created  timestamp NOT NULL default CURRENT_TIMESTAMP,
    active int2 CHECK (active in (0,1)) DEFAULT 0,
    );

  print "Creating functions for table '$TableName'\n";
  my $No = 1;
    ### For each line for this table do this. 
    ### We want to create a few variables that are going to be placed into
    ### the template.  
  foreach my $Line (@Temp) 
    {
    $Table .= "$Line,\n";
    $Table_Backup .= "$Line,\n";
    my ($Name,$Type,$Ext) = split(/ /,$Line,3);
      ### The backup columns
    $Backup_Columns .= ", $Name"; 
      ### The update fields
    $No++; $Update_Fields .= ", $Name = var_$No"; 
      ### Backup values
    $Backup_Values .= ", record_backup.$Name";
      ### Now the fields when we copy stuff in the cyop function. 
    $Field_Copy_Values .= ", clean_text(record2.$Name)";
      ### Now the field types for the update function. 
    $FieldTypes .= ", $Type";
      ### We need to define the variables for the updating function.
    $CleanVariables .= "          var_$No $Type;\n";
      ### We need to define the type, I only check for text and int4 for now. 
    my $Temp = "\$$No";  
    if ($Type eq "int4") {$Temp = "clean_numeric($Temp)";}
    elsif  ($Type eq "text") {$Temp = "clean_text($Temp)";}
      ### Now we need to set the variables. 
    $RemakeVariables .= "         var_$No := $Temp;\n";

     ### We also need to add the function to clean out he variables before
     ### they are submitted. 
    }
   ### Record how many rows we had. Make a line for the update command for
   ### testing. 
  my $Number_Of_Rows = $No;
  my $Update_Test = "1";
  for (my $i = 1; $i &lt; $Number_Of_Rows - 1; $i++) {$Update_Test .= ",$i";}

    ### We need to chop off the last comma. 
  chomp $Table; chop $Table; chomp $Table_Backup; chop $Table_Backup;
    ### Now let us setup dropping and creating of the table and backup table. 
  my $Tables = qq(drop table $TableName;\ncreate table $TableName (\n$Table\n);); 
  $Tables .= "drop table $TableName\_backup;\n";
  $Tables .= "create table $TableName\_backup (\n$Table_Backup, error_code text NOT NULL DEFAULT ''\n);\n";
    ### Let us create a view for active stuff in our table. 
  $Tables .= "drop view $TableName\_active;\n";
  $Tables .= "create view $TableName\_active as select * from $TableName
        where active = 1;\n";
    ### Create a view for inactive or deleted items. 
  $Tables .= "drop view $TableName\_deleted;\n";
  $Tables .= "create view $TableName\_deleted as select * from $TableName
        where active = 0;\n";
    ### Create a view for a list of unique backup ids. 
  $Tables .= "drop view $TableName\_backup_ids;\n";
  $Tables .= "create view $TableName\_backup_ids as 
           select distinct $TableName\_id from $TableName\_backup;\n";
    ### Create a list of purged data (lastest data per id).  
  $Tables .= "drop view $TableName\_purged;\n";
  $Tables .= "create view $TableName\_purged as
   select * from $TableName\_backup where oid = ANY (
     select max(oid) from $TableName\_backup where $TableName\_id = ANY
        (
        select distinct $TableName\_id from $TableName\_backup
          where $TableName\_backup.error_code = 'purge'
           and NOT $TableName\_id = ANY (select $TableName\_id from $TableName)
        )
        group by $TableName\_id
     )
    ;\n";

     ### I use grep commands to search and replace stuff for arrays.
     ### I could use map, but I like greps.  
  my @Temp = @Template;
     ### now add the custom sql commands. 
  push (@Temp,@Custom);

  grep($_ =~ s/TABLENAME/$TableName/g, @Temp);
  grep($_ =~ s/BACKUPCOLUMNS/$Backup_Columns/g, @Temp);
  grep($_ =~ s/BACKUPVALUES/$Backup_Values/g, @Temp);
  grep($_ =~ s/UPDATEFIELDS/$Update_Fields/g, @Temp);
  grep($_ =~ s/COPYFIELDS/$Field_Copy_Values/g, @Temp);
  grep($_ =~ s/FIELDS/$FieldTypes/g, @Temp);
  grep($_ =~ s/HOME/$Home/g, @Temp);
  grep($_ =~ s/CLEANVARIABLES/$CleanVariables/g, @Temp);
  grep($_ =~ s/REMAKEVARIABLES/$RemakeVariables/g, @Temp);

    ### Now move the stuff from the array @Temp to @Template_Copy.
  my @Template_Copy = @Temp;

    ### Now we save the file. We won't delete it (unless you run this script
    ### again) so that we can figure out what was done.  
  open(FILE,"&gt;$Home/Tables/$TableName\.table_functions");
    ### Create the sequence for the table . 
  print FILE "drop sequence $TableName\_sequence;\n";
  print FILE "create sequence $TableName\_sequence;\n";
  print FILE "drop sequence $TableName\_sequence_backup;\n";
  print FILE "create sequence $TableName\_sequence_backup;\n";
    ### Print out the table and backup table.   
  print FILE $Tables;
    ### Print out the 4 functions, insert, delete, update, and copy. 
  foreach my $Temp (@Template_Copy) {print FILE "$Temp";} 

  close FILE;

    ### Before we execute, let us backup the table in case some novice 
    ### executes this on a live server. 
  my $Backup_File = "$Home/Backups/$TableName\_0.backup";
  my $No = 0;
  while (-e $Backup_File)
    {$No++; $Backup_File = "$Home/Backups/$TableName\_$No\.backup";} 
    ### Now we have the filename to store the backup, execute it. 
  system ("pg_dump -t $TableName -f $Backup_File $Database");
  
  ### Uncomment this option if you want to see what is in the file. 
##  system ("cat $Home/Tables/$TableName\.table_functions");

    ### Drop table and functions, create table and functions and backup table. 
  system ("psql -d $Database -c '\\i $Home/Tables/$TableName\.table_functions'");
  print "Check the file\n $Home/Tables/$TableName\.table_functions.\n";

  } 



</pre>
Rename the perl script "Create_Functions.pl.txt". Here are the things
needed to get it to work:
<ul>
<li>You must change the options above the dotted line. </li>
<li> You must have PostgreSQL installed with Perl embedded in it. 
<li>Enter the command "psql template1". Then type "create database
testdatabase;" or whatever you named your database. Press enter. If you have
errors along the way, you haven't set up the permissions yet. Login in as
root, then execute "su -l postgres". Then type "createuser" and press
enter. This will create a user in your postgresql database. Enter in the
username and give the username full privledges. Then try again 
with your normal account. </li> 
</ul>

<h3><a NAME="execute"></a>Executing the Perl script </h3>
You will need some more files. The <a href="misc/nielsen/Tables.txt">Tables.txt</a> file.  
<pre>

TABLENAME contact
question_id int4 NOT NULL DEFAULT 0
company_name text NOT NULL default ''
first  text NOT NULL default ''
middle text NOT NULL default ''
last text NOT NULL default ''
email  text NOT NULL default ''
work_phone text NOT NULL default ''
home_phone text NOT NULL default ''
address_1 text NOT NULL default '',
address_2 text NOT NULL default ''
city text NOT NULL default ''
state text NOT NULL default ''
zip text NOT NULL default ''

TABLENAME account
username text NOT NULL DEFAULT '',
password text not NULL DEFAULT '',

TABLENAME contact_lists
account_id int4 not null default 0,
contact_id int4 not null default 0,
</pre>
You can use my file as an example, but I suggest to modify it for your
own needs. It is simulated to make three tables. One containing userame
and passwords, and the other associating a username to a list of
contacts.  Another file you will need is <a href="misc/nielsen/Generic.fun">Generic.fun</a>
<pre>
---              Generic Functions for Perl/Postgresql version 0.1

---                       Copyright 2001, Mark Nielsen
---                            All rights reserved.
---    This Copyright notice was copied and modified from the Perl 
---    Copyright notice. 
---    This program is free software; you can redistribute it and/or modify
---    it under the terms of either:

---        a) the GNU General Public License as published by the Free
---        Software Foundation; either version 1, or (at your option) any
---        later version, or

---        b) the "Artistic License" which comes with this Kit.

---    This program is distributed in the hope that it will be useful,
---    but WITHOUT ANY WARRANTY; without even the implied warranty of
---    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
---    the GNU General Public License or the Artistic License for more details.

---    You should have received a copy of the Artistic License with this
---    Kit, in the file named "Artistic".  If not, I'll be glad to provide one.

---    You should also have received a copy of the GNU General Public License
---   along with this program in the file named "Copying". If not, write to the 
---   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
---    02111-1307, USA or visit their web page on the internet at
---    http://www.gnu.org/copyleft/gpl.html.

-- create a method to unpurge just one item.  
-- create a method to purge one item. 
--  \i HOME/TABLENAME.table
---------------------------------------------------------------------

drop function sql_TABLENAME_insert ();
CREATE FUNCTION sql_TABLENAME_insert () RETURNS int4 AS '
DECLARE
    record1 record;  oid1 int4; id int4 :=0; record_backup RECORD;
BEGIN
   insert into TABLENAME (date_updated, date_created, active)
        values (CURRENT_TIMESTAMP,CURRENT_TIMESTAMP, 1);
     -- Get the unique oid of the row just inserted. 
   GET DIAGNOSTICS oid1 = RESULT_OID;
     -- Get the TABLENAME id. 
   FOR record1 IN SELECT TABLENAME_id FROM TABLENAME where oid = oid1
      LOOP
      id := record1.TABLENAME_id;
   END LOOP;
   
     -- If id is NULL, insert failed or something is wrong.
   IF id is NULL THEN return (-1); END IF;
     -- It should also be greater than 0, otherwise something is wrong.
   IF id &lt; 1 THEN return (-2); END IF;

      -- Now backup the data. 
    FOR record_backup IN SELECT * FROM TABLENAME where TABLENAME_id = id
       LOOP
       insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created, 
           active, error_code) 
         values (id, record_backup.date_updated, record_backup.date_created,
            record_backup.active, ''insert'');
    END LOOP;

     -- Everything has passed, return id as TABLENAME_id.
   return (id);
END;
' LANGUAGE 'plpgsql';
---------------------------------------------------------------------

drop function sql_TABLENAME_delete (int4);
CREATE FUNCTION sql_TABLENAME_delete (int4) RETURNS int2 AS '
DECLARE
    id int4 := 0;
    id_exists int4 := 0;
    record1 RECORD; 
    record_backup RECORD;
    return_int4 int4 :=0;

BEGIN
     -- If the id is not greater than 0, return error.
   id := clean_numeric($1);
   IF id &lt; 1 THEN return -1; END IF;

     -- If we find the id, set active = 0. 
   FOR record1 IN SELECT TABLENAME_id FROM TABLENAME 
          where TABLENAME_id = id
      LOOP
      update TABLENAME set active=0, date_updated = CURRENT_TIMESTAMP
           where TABLENAME_id = id;  
      GET DIAGNOSTICS return_int4 = ROW_COUNT;       
      id_exists := 1;
   END LOOP;
      
     -- If we did not find the id, abort and return -2.  
   IF id_exists = 0 THEN return (-2); END IF;

   FOR record_backup IN SELECT * FROM TABLENAME where TABLENAME_id = id
      LOOP
      insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS ,error_code)
           values (record_backup.TABLENAME_id, record_backup.date_updated, 
             record_backup.date_updated, record_backup.active
             BACKUPVALUES , ''delete''
      );
   END LOOP;

     -- If id_exists == 0, Return error.
     -- It means it never existed. 
   IF id_exists = 0 THEN return (-1); END IF;

     -- We got this far, it must be true, return ROW_COUNT.   
   return (return_int4);
END;
' LANGUAGE 'plpgsql';

---------------------------------------------------------------------
drop function sql_TABLENAME_update (int4 FIELDS);
CREATE FUNCTION sql_TABLENAME_update  (int4 FIELDS) 
  RETURNS int2 AS '
DECLARE
    id int4 := 0;
    id_exists int4 := 0;
    record_update RECORD; record_backup RECORD;
    return_int4 int4 :=0;
    CLEANVARIABLES
BEGIN
    REMAKEVARIABLES
     -- If the id is not greater than 0, return error.
   id := clean_numeric($1);
   IF id &lt; 1 THEN return -1; END IF;

   FOR record_update IN SELECT TABLENAME_id FROM TABLENAME
         where TABLENAME_id = id
      LOOP
      id_exists := 1;
   END LOOP;

   IF id_exists = 0 THEN return (-2); END IF;

   update TABLENAME set date_updated = CURRENT_TIMESTAMP
      UPDATEFIELDS 
        where TABLENAME_id = id;
   GET DIAGNOSTICS return_int4 = ROW_COUNT;

   FOR record_backup IN SELECT * FROM TABLENAME where TABLENAME_id = id
      LOOP
     insert into TABLENAME_backup (TABLENAME_id,
         date_updated, date_created, active
         BACKUPCOLUMNS, error_code)
       values (record_update.TABLENAME_id, record_backup.date_updated,
         record_backup.date_updated, record_backup.active
         BACKUPVALUES, ''update''
      );
   END LOOP;

     -- We got this far, it must be true, return ROW_COUNT.   
   return (return_int4);
END;
' LANGUAGE 'plpgsql';
---------------------------------------------------------------------

drop function sql_TABLENAME_copy (int4);
CREATE FUNCTION sql_TABLENAME_copy (int4) 
  RETURNS int2 AS '
DECLARE
    id int4 := 0;
    id_exists int4 := 0;
    record1 RECORD; record2 RECORD; record3 RECORD;    
    return_int4 int4 := 0;
    id_new int4 := 0;
    TABLENAME_new int4 :=0;
BEGIN
     -- If the id is not greater than 0, return error.
   id := clean_numeric($1);
   IF id &lt; 1 THEN return -1; END IF;

   FOR record1 IN SELECT TABLENAME_id FROM TABLENAME where TABLENAME_id = id
      LOOP
      id_exists := 1;
   END LOOP;
   IF id_exists = 0 THEN return (-2); END IF;

     --- Get the new id
   FOR record1 IN SELECT sql_TABLENAME_insert() as TABLENAME_insert
      LOOP
      TABLENAME_new := record1.TABLENAME_insert;
   END LOOP;
     -- If the TABLENAME_new is not greater than 0, return error.
   IF TABLENAME_new &lt; 1 THEN return -3; END IF;

   FOR record2 IN SELECT * FROM TABLENAME where TABLENAME_id = id
      LOOP

     FOR record1 IN SELECT sql_TABLENAME_update(TABLENAME_new COPYFIELDS)
        as TABLENAME_insert
      LOOP
        -- execute some arbitrary command just to get it to pass. 
      id_exists := 1;
     END LOOP;
   END LOOP;

     -- We got this far, it must be true, return new id.   
   return (TABLENAME_new);
END;
' LANGUAGE 'plpgsql';

------------------------------------------------------------------
drop function sql_TABLENAME_purge ();
CREATE FUNCTION sql_TABLENAME_purge () RETURNS int4 AS '
DECLARE
    record_backup RECORD; oid1 int4 := 0;
    return_int4 int4 :=0;
    deleted int4 := 0;
    delete_count int4 :=0;
    delete_id int4;

BEGIN 

     -- Now delete one by one. 
   FOR record_backup IN SELECT * FROM TABLENAME where active = 0
      LOOP
         -- Record the id we want to delete. 
      delete_id = record_backup.TABLENAME_id;

      insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS ,error_code)
           values (record_backup.TABLENAME_id, record_backup.date_updated, 
             record_backup.date_updated, record_backup.active
             BACKUPVALUES , ''purge''
          );

        -- Get the unique oid of the row just inserted. 
      GET DIAGNOSTICS oid1 = RESULT_OID;

        -- If oid1 less than 1, return -1
      IF oid1 &lt; 1 THEN return (-2); END IF;
        -- Now delete this from the main table.   
      delete from TABLENAME where TABLENAME_id = delete_id;

        -- Get row count of row just deleted, should be 1. 
      GET DIAGNOSTICS deleted = ROW_COUNT;
        -- If deleted less than 1, return -3
      IF deleted &lt; 1 THEN return (-3); END IF;
      delete_count := delete_count + 1;

    END LOOP;

     -- We got this far, it must be true, return the number of ones we had.  
   return (delete_count);
END;
' LANGUAGE 'plpgsql';

------------------------------------------------------------------
drop function sql_TABLENAME_purgeone (int4);
CREATE FUNCTION sql_TABLENAME_purgeone (int4) RETURNS int4 AS '
DECLARE
    record_backup RECORD; oid1 int4 := 0;
    record1 RECORD;
    return_int4 int4 :=0;
    deleted int4 := 0;
    delete_count int4 :=0;
    delete_id int4;
    purged_no int4 := 0;

BEGIN

    delete_id := $1;
        -- If purged_id less than 1, return -4
    IF delete_id &lt; 1 THEN return (-4); END IF;

   FOR record1 IN SELECT * FROM TABLENAME 
      where active = 0 and TABLENAME_id = delete_id 
      LOOP
      purged_no := purged_no + 1;
   END LOOP;

        -- If purged_no less than 1, return -1
   IF purged_no &lt; 1 THEN return (-1); END IF;

     -- Now delete one by one.
   FOR record_backup IN SELECT * FROM TABLENAME where TABLENAME_id = delete_id
      LOOP

      insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS ,error_code)
           values (record_backup.TABLENAME_id, record_backup.date_updated,
             record_backup.date_updated, record_backup.active
             BACKUPVALUES , ''purgeone''
          );

        -- Get the unique oid of the row just inserted.
      GET DIAGNOSTICS oid1 = RESULT_OID;

        -- If oid1 less than 1, return -2
      IF oid1 &lt; 1 THEN return (-2); END IF;
        -- Now delete this from the main table.
      delete from TABLENAME where TABLENAME_id = delete_id;

        -- Get row count of row just deleted, should be 1.
      GET DIAGNOSTICS deleted = ROW_COUNT;
        -- If deleted less than 1, return -3
      IF deleted &lt; 1 THEN return (-3); END IF;
      delete_count := delete_count + 1;

    END LOOP;

     -- We got this far, it must be true, return the number of ones we had.
   return (delete_count);
END;
' LANGUAGE 'plpgsql';

------------------------------------------------------------------------
drop function sql_TABLENAME_unpurge ();
CREATE FUNCTION sql_TABLENAME_unpurge () RETURNS int2 AS '
DECLARE
    record1 RECORD;
    record2 RECORD; 
    record_backup RECORD;
    purged_id int4 := 0;
    purge_count int4 :=0;
    timestamp1 timestamp;
    purged_no int4 := 0;
    oid1 int4 := 0;
    oid_found int4 := 0;
    highest_oid int4 := 0;

BEGIN

     -- Now get the unique ids that were purged. 
   FOR record1 IN select distinct TABLENAME_id from TABLENAME_backup 
       where TABLENAME_backup.error_code = ''purge''
          and NOT TABLENAME_id = ANY (select TABLENAME_id from TABLENAME)
      LOOP

      purged_id := record1.TABLENAME_id;
      timestamp1 := CURRENT_TIMESTAMP;
      purged_no := purged_no + 1;
      oid_found := 0;
      highest_oid := 0;

        -- Now we have the unique id, find its latest date. 

      FOR record2 IN select max(oid) from TABLENAME_backup 
          where TABLENAME_id = purged_id and error_code = ''purge''
        LOOP 
          -- record we got the date and also record the highest date.
        oid_found := 1; 
        highest_oid := record2.max;
      END LOOP;
 
         -- If the oid_found is 0, return error. 
      IF oid_found = 0 THEN return (-3); END IF;

        -- Now we have the latest date, get the values and insert them. 
      FOR record_backup IN select * from TABLENAME_backup 
          where oid = highest_oid
        LOOP 

      insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS ,error_code)
           values (purged_id, record_backup.date_updated, 
             timestamp1, record_backup.active
             BACKUPVALUES , ''unpurge''
          );

        -- Get the unique oid of the row just inserted. 
      GET DIAGNOSTICS oid1 = RESULT_OID;
        -- If oid1 less than 1, return -1
      IF oid1 &lt; 1 THEN return (-1); END IF;

      insert into TABLENAME (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS)
           values (purged_id, timestamp1,
             timestamp1, record_backup.active
             BACKUPVALUES );
        -- Get the unique oid of the row just inserted.
      GET DIAGNOSTICS oid1 = RESULT_OID;
        -- If oid1 less than 1, return -2
      IF oid1 &lt; 1 THEN return (-2); END IF;

      END LOOP;

   END LOOP;

     -- We got this far, it must be true, return how many were affected.  
   return (purged_no);
END;
' LANGUAGE 'plpgsql';

---------------------------------------------------------------------
drop function sql_TABLENAME_unpurgeone (int4);
CREATE FUNCTION sql_TABLENAME_unpurgeone (int4) RETURNS int2 AS '
DECLARE
    record_id int4;
    record1 RECORD;
    record2 RECORD;
    record_backup RECORD;
    return_int4 int4 :=0;
    purged_id int4 := 0;
    purge_count int4 :=0;
    timestamp1 timestamp;
    purged_no int4 := 0;
    oid1 int4 := 0;
    oid_found int4 := 0;
    highest_oid int4 := 0;

BEGIN

      purged_id := $1;
        -- If purged_id less than 1, return -1
      IF purged_id &lt; 1 THEN return (-1); END IF;
        --- Get the current timestamp.
      timestamp1 := CURRENT_TIMESTAMP;

   FOR record1 IN select distinct TABLENAME_id from TABLENAME_backup
       where TABLENAME_backup.error_code = ''purge''
          and NOT TABLENAME_id = ANY (select TABLENAME_id from TABLENAME)
          and TABLENAME_id = purged_id
      LOOP
      purged_no := purged_no + 1;

   END LOOP;

        -- If purged_no less than 1, return -1
   IF purged_no &lt; 1 THEN return (-3); END IF;

        -- Now find the highest oid.  
   FOR record2 IN select max(oid) from TABLENAME_backup
          where TABLENAME_id = purged_id and error_code = ''purge''
        LOOP
          -- record we got the date and also record the highest date.
        oid_found := 1;
        highest_oid := record2.max;
    END LOOP;

         -- If the oid_found is 0, return error.
    IF oid_found = 0 THEN return (-4); END IF;

        -- Now get the data and restore it. 
    FOR record_backup IN select * from TABLENAME_backup 
          where oid  = highest_oid
        LOOP 
        -- Insert into backup that it was unpurged. 
      insert into TABLENAME_backup (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS ,error_code)
           values (purged_id, timestamp1, 
             record_backup.date_created, record_backup.active
             BACKUPVALUES , ''unpurgeone''
          );

        -- Get the unique oid of the row just inserted. 
      GET DIAGNOSTICS oid1 = RESULT_OID;
        -- If oid1 less than 1, return -1
      IF oid1 &lt; 1 THEN return (-1); END IF;
        -- Insert into live table. 
      insert into TABLENAME (TABLENAME_id, date_updated, date_created,
          active BACKUPCOLUMNS)
           values (record_backup.TABLENAME_id, timestamp1,
             record_backup.date_updated, record_backup.active
             BACKUPVALUES );
        -- Get the unique oid of the row just inserted.
      GET DIAGNOSTICS oid1 = RESULT_OID;
        -- If oid1 less than 1, return -2
      IF oid1 &lt; 1 THEN return (-2); END IF;

      END LOOP;

     -- We got this far, it must be true, return how many were affected (1).  
   return (purged_no);
END;
' LANGUAGE 'plpgsql';





</pre>

and lastly <a href="misc/nielsen/Custom.sql">Custom.sql</a>. 
<pre>
---          Custom Sample SQL for Perl/PostgreSQL version 0.1

---                       Copyright 2001, Mark Nielsen
---                            All rights reserved.
---    This Copyright notice was copied and modified from the Perl 
---    Copyright notice. 
---    This program is free software; you can redistribute it and/or modify
---    it under the terms of either:

---        a) the GNU General Public License as published by the Free
---        Software Foundation; either version 1, or (at your option) any
---        later version, or

---        b) the "Artistic License" which comes with this Kit.

---    This program is distributed in the hope that it will be useful,
---    but WITHOUT ANY WARRANTY; without even the implied warranty of
---    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
---    the GNU General Public License or the Artistic License for more details.

---    You should have received a copy of the Artistic License with this
---    Kit, in the file named "Artistic".  If not, I'll be glad to provide one.

---    You should also have received a copy of the GNU General Public License
---   along with this program in the file named "Copying". If not, write to the 
---   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
---    02111-1307, USA or visit their web page on the internet at
---    http://www.gnu.org/copyleft/gpl.html.

drop function clean_text (text);
CREATE FUNCTION  clean_text (text) RETURNS text AS '
  my $Text = shift;
    # Get rid of whitespace in front. 
  $Text =~ s/^\\s+//;
    # Get rid of whitespace at end. 
  $Text =~ s/\\s+$//;
    # Get rid of anything not text.
  $Text =~ s/[^ a-z0-9\\/\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\-\\_\\=\\+\\\\\\|\[\\{\\]\\}\\;\\:\\''\\"\\,\\&lt;\\.\\&gt;\\?\\t\\n]//gi;
    # Replace all multiple whitespace with one space. 
  $Text =~ s/\\s+/ /g;
  return $Text;
' LANGUAGE 'plperl';
 -- Just to show you what this function cleans up. 
select clean_text ('       ,./&lt;&gt;?aaa aa      !@#$%^&*()_+| ');

drop function clean_alpha (text);
CREATE FUNCTION  clean_alpha (text) RETURNS text AS '
  my $Text = shift;
  $Text =~ s/[^a-z0-9_]//gi;
  return $Text;
' LANGUAGE 'plperl';
 -- Just to show you what this function cleans up. 
select clean_alpha ('       ,./&lt;&gt;?aaa aa      !@#$%^&*()_+| ');

drop function clean_numeric (text);
CREATE FUNCTION  clean_numeric (text) RETURNS int4 AS '
  my $Text = shift;
  $Text =~ s/[^0-9]//gi;
  return $Text;
' LANGUAGE 'plperl';
 -- Just to show you what this function cleans up.
select clean_numeric ('       ,./&lt;&gt;?aaa aa      !@#$%^&*()_+| ');

drop function clean_numeric (int4);
CREATE FUNCTION  clean_numeric (int4) RETURNS int4 AS '
  my $Text = shift;
  $Text =~ s/[^0-9]//gi;
  return $Text;
' LANGUAGE 'plperl';
 -- Just do show you what this function cleans up.
select clean_numeric (1111);



</pre>

<p>
After you save the perl script, execute "chmod 755 Create_Functions.pl"
and then "./Create_Functions.pl". That should do it. 
<p>
If you have installed PostgreSQL and Perl correctly, and you have setup
the database and your account has permissions to that database, then everything
should have worked fine.  

<h3><a NAME="consider"></a>Considerations to explore.</h3>
I would like to test TCL, Python, and other languages as well for
stored procedures. If you are using MySQL, and I don't believe it has
stored procedures, you may want to consider PostgreSQL if you like the
style I mentioned. A nice GUI application to create tables and 
make changes to tables would be nice. Lastly, examples of how to
connect to the database server to use these stored procedures (using Perl, 
Python, PHP, TCL, C, etc) would be nice.  

<h3><a NAME="Conclusion"></a>Conclusion</h3>
The combination of PostgreSQL and Perl rocks. I can use Perl for three things, 
stored procedures, to setup my database, and to make Perl modules for
Apache that connect to the PostgreSQL database. Similar stuff can be
accomplished with other programming languages like Python, TCL, and others.
I want to try Python at some point when it gets out of beta
for PostgreSQL.
<p>
All database servers should use procedures exclusively for changing data. 
You could even argue that you should make custom stored procedures
for selecting data as well. The reason why this is so important is because
the web programmer (or other type of programmer) doesn't have to know 
anything about how to manipulate the data. They just submit variables
to procedures. This lets the web programmer use any programming language
he/she wants to without changing the behaviour of the database. The database
and how you use it becomes abstract. 
<p>
One stupid thing my perl script does is execute the custom sql code
for each table. This s very bad. I will have to go back and fix it later. 
You may want to test my stuff out with these commands:
<pre>
select sql_account_insert();
select sql_account_delete(1);
select sql_account_insert();
select sql_account_update(2,'mark','nielsen');
select sql_account_purge();
select sql_account_unpurge();
select * from account_backup;
select sql_account_delete(2);
select sql_account_insert();
select sql_account_update(1,'john','nielsen');
select sql_account_purge();
select * from account_backup;
</pre> 

<h3>
<a NAME="REF"></a>References</h3>

<ol>
<li><a href="../issue67/nielsen.html">
My Previous PostgreSQL article</a>.
<li>
If this article
changes, it will be available at
<a href="http://www.gnujobs.com/Articles/22/Perl_PostgreSQL2.html">
http://www.gnujobs.com/Articles/22/Perl_PostgreSQL2.html</a></li>
</ol>







<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<p> 
<h4><img align=bottom alt="" src="../gx/note.gif">Mark Nielsen</h4>
<EM>Mark works as an independent consultant donating time to causes like
GNUJobs.com, writing articles, writing free software, and working
as a volunteer at <a href="http://www.eastmont.net">eastmont.net</a>.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Mark Nielsen.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Learning Perl, part 5</font></H1>
<H4>By <a href="mailto:ben-fuzzybear@yahoo.com">Ben Okopnik</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<br><tt>What is the sound of Perl? Is it not the sound of a wall that people
have stopped banging their heads against?</tt>
<br><tt>&nbsp;-- Larry Wall</tt>

<p><b>Overview</b>
<p>This month, we're going to cover some general Perl issues, look at a
way to use it in Real Life(tm), and take a quick look at a mechanism that
lets you leverage the power of O.P.C. - Other People's Code :). <i>Modules</i>
let you plug chunks of pre-written code into your own scripts, saving you
hours - or even days - of programming. That will wrap up this introductory
series, hopefully leaving you with enough of an idea of what Perl is to
write some basic scripts, and perhaps a desire to explore further.
<br>&nbsp;
<p><b>A Quick Correction</b>
<p>One of our readers, A. N. Onymous (he didn't want to give me his name;
I guess he decided that fame wasn't for him...), wrote in regarding a statement
that I made in last month's article - that "close" without any parameters
closes <i>all</i> filehandles. After cranking out a bit of sample code
and reading the docs a bit more closely, I found that he was right: it
only closes the currently selected filehandle (<tt>STDOUT</tt> by default).
Thanks very much - well spotted!
<br>&nbsp;
<p><b>Excercises</b>
<p>In the last article, I suggested a couple of script ideas that would
give you some practice in using what you'd learned previously. One of the
people who sent in a script was Tjabo Kloppenburg; a brave man. :) No worries,
Tjabo; either you did a good job, or you get to learn a few things... it's
a win-win situation.
<p>The idea was to write a script that read "/etc/services", counted UDP
and TCP ports, and wrote them out to separate files. Here was Tjabo's solution
(my comments are preceded with a '###'):
<br>
<hr WIDTH="100%"><tt>#!/usr/bin/perl -w</tt>
<br><tt>### Well done; let the computer debug your script!</tt>
<p><tt>$udp = $tcp = 0;</tt>
<br><tt>### Unnecessary: Perl does not require variable declaration.</tt>
<p><tt># open target files:</tt>
<br><tt>open (TCP, ">>tcp.txt") or die "Arghh #1 !";</tt>
<br><tt>open (UDP, ">>udp.txt") or die "Arghh #2 !";</tt>
<p><tt>### My fault here: in a previous article, I showed a quick hack
in which</tt>
<br><tt>### I used similar wording for the "die" string. Here is the proper
way</tt>
<br><tt>### to use it:</tt>
<br><tt>###</tt>
<br><tt>### open TCP, ">tcp.txt" or die "Can't open tcp.txt: $!\n";</tt>
<br><tt>###</tt>
<br><tt>### The '$!' variable gives the error returned by the system, and
should</tt>
<br><tt>### definitely be used; the "\n" at the end of the "die" string
prevents</tt>
<br><tt>### the error line number from being printed. Also, the ">>" (append)</tt>
<br><tt>### modifier is inappropriate: this will cause anything more than
one</tt>
<br><tt>### execution of the script to append (rather than overwrite) the</tt>
<br><tt>### contents of those files.</tt>
<p><tt># open data source:</tt>
<br><tt>open (SERV, "&lt;/etc/services") or die "Arghh #3 !";</tt>
<p><tt>while( &lt;SERV> ) {</tt>
<br><tt>&nbsp; if (/^ *([^# ]+) +(\d+)\/([tcpud]+)/) {</tt>
<p><tt>### The above regex has several problems, some of them minor</tt>
<br><tt>### (unnecessary elements) and one of them critical: it actually
misses</tt>
<br><tt>### out on most of the lines in "/etc/services". The killer is
the ' +'</tt>
<br><tt>### that follows the first capture: "/etc/services" uses a mix
of spaces</tt>
<br><tt>### and *tabs* to separate its elements.</tt>
<p><tt>&nbsp;&nbsp;&nbsp; $name&nbsp;&nbsp; = $1;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; $port&nbsp;&nbsp; = $2;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; $tcpudp = $3;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; $tmp = "$name ($port)\n";</tt>
<p><tt>### The above assignments are unnecessary; $1, $2, etc. will keep
their</tt>
<br><tt>### values until the next succesful match. Removing all of the
above</tt>
<br><tt>### and rewriting the "if" statement below as</tt>
<br><tt>###</tt>
<br><tt>### if ( $3 eq "udp" ) { print UDP "$1 ($2)\n"; $udp++; }</tt>
<br><tt>###</tt>
<br><tt>### would work just fine.</tt>
<p><tt>&nbsp;&nbsp;&nbsp; if ($tcpudp eq "udp") {</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print UDP $tmp;</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $udp++;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; }</tt>
<p><tt>&nbsp;&nbsp;&nbsp; if ($tcpudp eq "tcp") {</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print TCP $tmp;</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $tcp++;</tt>
<br><tt>&nbsp;&nbsp;&nbsp; }</tt>
<br><tt>&nbsp; }</tt>
<br><tt>}</tt>
<p><tt># just learned :-) :</tt>
<br><tt>for ( qw/SERV TCP UDP/ ) { close $_ or die "can't close $_: $!\n";
}</tt>
<p><tt>print "TCP: $tcp, UDP: $udp\n";</tt>
<br>
<hr WIDTH="100%">
<p>The above script counted 14 TCPs and 11 UDPs in my "/etc/services" (which
actually contains 185 of one and 134 of the other). Let's see if we can
improve it a bit:
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -w</tt>
<p><tt>open SRV, "&lt;/etc/services" or die "Can't read /etc/services:
$!\n";</tt>
<br><tt>open TCP, ">tcp.txt"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or die
"Can't write tcp.txt: $!\n";</tt>
<br><tt>open UDP, ">udp.txt"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or die
"Can't write udp.txt: $!\n";</tt>
<p><tt>for ( &lt;SRV> ) {</tt>
<br><tt>&nbsp;&nbsp;&nbsp; if ( s=^([^# ]+)(\s+\d+)/tcp.*$=$1$2= ) { print
TCP; $tcp++; }</tt>
<br><tt>&nbsp;&nbsp;&nbsp; if ( s=^([^# ]+)(\s+\d+)/udp.*$=$1$2= ) { print
UDP; $udp++; }</tt>
<br><tt>}</tt>
<p><tt>close $_ or die "Failed to close $_: $!\n" for qw/SRV TCP UDP/;</tt>
<p><tt>print "TCP: $tcp\t\tUDP: $udp\n";</tt>
<br>
<hr WIDTH="100%">
<br>In the "for" loop, where all the 'real' work is done, I perform the
following matches/substitutions:
<p><i>Starting at the beginning of the line, (begin capture into $1) match
any character that is not a '#' or a space and occurs one or more times
(end capture). (Begin capture into $2) Match any whitespace character that
occurs one or more times that is followed by one or more digits (end capture),
a forward slash, and the string 'tcp' followed by any</i>
<br><i>number of any character to the end of the line. Replace the matched
string (i.e., the entire line) with $1$2 (which contain the name of the
service, whitespace, and the port number.) Write the result to the TCP
filehandle, and increment the "$tcp" variable.</i>
<p><i>Repeat for 'udp'.</i>
<p>Note that I used the '=' symbol for the delimiter in the 's///' function.
'=' has no particular magic about it; it's just that I was trying to avoid
conflict with the '/' and the '#' characters which appear as part of the
regex (those being two commonly used delimiters), and there was a sale
on '=' at the neighborhood market. :) Any other character or symbol would
have done as well.
<br>&nbsp;
<p>Here are a couple of simple solutions for the other two problems:
<p>1. Open two files and exchange their contents.
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -w</tt>
<br><tt># The files whose contents are to be exchanged are named "a" and
"b".</tt>
<p><tt>for ( A, B ) { open $_, "&lt;\l$_" or die "Can't open \l$_: $!\n";
}</tt>
<br><tt>@a = &lt;A>; @b = &lt;B>;</tt>
<p><tt>for ( A, B ) { open $_, ">\l$_" or die "Can't open \l$_: $!\n";
}</tt>
<br><tt>print A @b; print B @a;</tt>
<br>
<hr WIDTH="100%">
<br>Pretty conservative, basic stuff. A minor hack: I used the '\l' modifier
to set the filename to lowercase. Note that re-opening a filehandle closes
it automatically - you don't have to close a handle between different "open"s.
Also, explicitly closing a file isn't always necessary: Perl will close
the handles for you on script exit (but be aware that some OSs have been
reported as leaving them open.) By the way, the current version of Perl
(5.6.1) has a neat mechanism that helps you do what I did above, but far
more gracefully:
<br>
<hr WIDTH="100%">
<br><tt>...</tt>
<br><tt>$FN = "/usr/X11R6/include/X11/Composite.h";</tt>
<br><tt>open FN or die "I choked on $FN: $!\n";</tt>
<br><tt># "FN" is now open as a filehandle to "Composite.h".</tt>
<br><tt>...</tt>
<br>
<hr WIDTH="100%">
<br>All the distros with which I'm familiar currently come with Perl version
5.005.003 installed. I suggest getting 5.6.1 from CPAN (see below) and
installing it; different versions of Perl coexist quite happily on the
same machine. (Note that <b>replacing</b> an installed version by anything
other than a distro package can be rather tricky, given how much system
stuff depends on
<br>Perl.)
<p>I'm sure that a number of folks figured out that renaming the files
would produce the same result. That wasn't the point of the excercise...
but here's a fun way to do that:
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -w</tt>
<br><tt>%h = qw/a $$.$$ b a $$.$$ b/;</tt>
<br><tt>rename $x, $y while ($x, $y) = each %h</tt>
<br>
<hr WIDTH="100%">
<br>Here, I created a hash using a list of the filenames and a temporary
variable - "$$" in Perl, just as in the shell, is the current process ID,
and "$$.$$" is almost certainly a unique filename - and cycled through
it with the "each" command, which retrieves key/value pairs from hashes.
I suppose you could call it "round-robin renaming"...
<br>&nbsp;
<p>2. Read "/var/log/messages" and print out any line that contains the
words "fail", "terminated/terminating", or " no " in it. Make it case-insensitive.
<p>This one is an easy one-liner:
<br>
<hr WIDTH="100%">
<br><tt>perl -wne 'print if /(fail|terminat(ed|ing)| no )/i' /var/log/messages</tt>
<br>
<hr WIDTH="100%">
<br>The interesting part there is the "alternation" mechanism in the match:
it allows strings like "<tt>(abc|def|ghi)</tt>" for lines matching any
of the above.
<br>&nbsp;
<p><b>Building Quick Tools</b>
<p>A few days ago, I needed to convert a text file into its equivalent
in phonetic alphabet - a somewhat odd requirement. There may or may not
have been a program to do this, but I figured I could write my own in
<br>less time that it would take me to find one:
<p>1) I grabbed a copy of the phonetic alphabet from the Web and saved
it to a file. I called the file "phon", and it loked like this:
<p><tt>Alpha</tt>
<br><tt>Bravo</tt>
<br><tt>Charlie</tt>
<br><tt>Delta</tt>
<br><tt>Echo</tt>
<br><tt>Foxtrot</tt>
<br><tt>Golf</tt>
<br><tt>...</tt>
<p>2) Then, I issued the following command:
<br>
<hr WIDTH="100%">
<br><tt>perl -i -wple's/^(.)(.*)$/\t"\l$1" => "$1$2",/' phon</tt>
<br>
<hr WIDTH="100%">
<br>Ta-daa! Magic. (See below for a breakdown of the substitute operation.)
The file now looked like this:
<p><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "a" => "Alpha",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "b" => "Bravo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "c" => "Charlie",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "d" => "Delta",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "e" => "Echo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "f" => "Foxtrot",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "g" => "Golf",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...</tt>
<p>3) A few seconds later, I had the tool that I needed - a script with
exactly one function and one data structure in it:
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -wlp</tt>
<br><tt># Created by Benjamin Okopnik on Sun May 27</tt>
<br><tt>13:07:49 2001</tt>
<p><tt>s/([a-zA-Z])/$ph{"\l$1"} /g;</tt>
<p><tt>BEGIN {</tt>
<br><tt>&nbsp;&nbsp;&nbsp; %ph = (</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "a" => "Alpha",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "b" => "Bravo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "c" => "Charlie",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "d" => "Delta",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "e" => "Echo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "f" => "Foxtrot",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "g" => "Golf",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "h" => "Hotel",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "i" => "India",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "j" => "Juliet",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "k" => "Kilo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "l" => "Lima",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "m" => "Mike",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "n" => "November",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "o" => "Oscar",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "p" => "Papa",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "q" => "Quebec",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "r" => "Romeo",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "s" => "Sierra",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "t" => "Tango",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "u" => "Uniform",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "v" => "Victor",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "w" => "Whisky",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "x" => "X-ray",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "y" => "Yankee",</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "z" => "Zulu",</tt>
<br><tt>&nbsp;&nbsp;&nbsp; );</tt>
<br><tt>}</tt>
<br>
<hr WIDTH="100%">
<br>The above script will accept either keyboard input or a file as a command-line
argument, and return the phonetic alphabet equivalent of the text.
<p>This is one of the most common ways I use Perl - building quick tools
that I need to do a specific job. Other people may have other uses for
it - after all, <a href="#1">TMTOWTDI [1]</a> - but for me, a computer
without Perl is only half-useable. To drive the point even further home,
a group of Perl Wizards have rewritten most of the system utilities in
Perl - take a look at &lt;http://language.perl.com/ppt/> - and have fixed
a number of annoying quirks in the process. As I understand it, they were
motivated by the three chief virtues of the programmer: Laziness, Impatience,
and
<br>Hubris (if that confuses you, see the Camel Book ["Programming Perl,
Third Edition"] for the explanation). If you want to see <b>well</b>-written
Perl code, there are very few better places. Do note that the project is
not yet complete, but a number of Unices are already catching on: Solaris
8 has a large number of Perl scripts as part of the system
<br>executables, and doing a
<p><tt>file /sbin/* /usr/bin/* /usr/sbin/*|grep -c perl</tt>
<p>shows at least the Debian "potato" distro as having 82 Perl scripts
in the above directories.
<br>&nbsp;
<p>OK, now for the explanation of the two s///'s above. First, the "magic"
converter:
<p><tt>perl -i -wple's/^(.)(.*)$/\t"\l$1" => "$1$2",/' phon</tt>
<p>The "-i", "-w", "-p", and "-e" switches were described in the second
part of this series; as a quick overview, this will edit the contents of
the file by looping through it and acting on each line. The Perl "warn"
mechanism is enabled, and the script to be executed runs from the command
line. The "-l" enables end-of-line processing, in effect adding a carriage
return to the lines that don't have it. The substitution regex goes like
this:
<p><i>Starting at the beginning of the line, (begin capture into $1) match
one character (end capture, begin capture into $2). Capture any number
of any character (end capture) to the end of the line.</i>
<p>The replacement string goes like this:
<p><i>Print a tab, followed by the contents of $1 in lowercase* and surrounded
by double quotes. Print a space, the '=>' digraph, another space, $1$2
surrounded by double quotes and followed by a comma.</i>
<p>* This is done by the "\l" 'lowercase next character' operator (see
'Quote and Quote-like Operators' in the "perlop" page.)
<br>&nbsp;
<p>The second one is also worth studying, since it points up an interesting
feature - that of using a hash value (including modifying the key "on the
fly") in a substitution, a very useful method:
<p><tt>s/([a-zA-Z])/$ph{"\l$1"} /g;</tt>
<p>First, the regex:
<p><i>(Begin capture into $1) Match any character in the 'a-zA-Z' range
(end capture).</i>
<p>Second, the replacement string:
<p><i>Return a value from the "%ph" hash by using the lowercase version
of the contents of $1 as the key, followed by a space.</i>
<br>&nbsp;
<p>The BEGIN { ... } block makes populating the hash a one-time event,
despite the fact that the script may loop thousands of times. The mechanism
here is the same as in Awk, and was mentioned in the previous article.
So, all we do is use every character as a key in the "%ph" hash, and print
out the value associated with that key.
<p>Hashes are very useful structures in Perl, and are well worth studying
and understanding.
<br>&nbsp;
<p><b>Modular Construction</b>
<p>One of the wonderful things about Perl - really, the thing that makes
it a living, growing language - is the community that has grown up around
it. A number of these folks have contributed useful chunks of code that
are made to be re-used; that, in fact, make Perl one of the most powerful
languages on the planet.
<p>Imagine a program that goes out on the Web, connects to a server, retrieves
the weather data - either the current or the forecast - for your city,
and prints the result to your screen. Now, imagine this entire Perl script
taking just <b>one</b> line.
<p><tt>perl -MGeo::WeatherNOAA -we 'print print_forecast( "Denver", "CO"
)'</tt>
<p>That's it. The whole thing. How is it possible?
<p>(Note that this will not work unless you have the 'Geo::WeatherNOAA'
module installed on your system.)
<p>The CPAN (Comprehensive Perl Archive Network) is your friend. :) If
you go to &lt;http://cpan.org/> and explore, you'll find lots and lots
(and LOTS) of modules designed to do almost every programming task you
could imagine. Do you want your Perl script converted to Klingon (or Morse
code)? Sure. Would you like to pull up your stock's performance from Deutsche
Bank Gruppe funds? Easy as pie. Care to send some SMS text messages? No
problem! With modules, these are short, easy tasks that can be coded in
literally seconds.
<p>The standard Perl distribution comes with a number of useful modules
(for short descriptions of what they do, see "Standard Modules" in 'perldoc
perlmodlib'); one of them is the CPAN module, which automates the module
downloading, unpacking, building, and installation process. To use it,
simply type
<p><tt>perl -MCPAN -eshell</tt>
<p>and follow the prompts. The manual process, which you should know about
just in case there's some complication, is described on the "How to install"
page at CPAN, &lt;http://http://cpan.org/modules/INSTALL.html>. I highly
recommend reading it. The difference between the two processes, by the
way, is exactly like that of using "apt" (Debian) or "rpm" (RedHat) and
trying to install a tarball by hand: 'CPAN' will get all the prerequisite
modules to support the one you've requested, and do all the tests and the
installation, while doing it manually can be rather painful. For specifics
of using the CPAN module - although the above syntax is the way you'll
use it 99.9% of the time - just type
<p><tt>perldoc CPAN</tt>
<p>The complete information for any module installed on your system can
be accessed the same way.
<p>As you've probably guessed by now, the "-M" command line switch tells
Perl to use the specified module. If we want to have that module in a script,
here's the syntax:
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -w</tt>
<p><tt>use Finance::Quote;</tt>
<p><tt>$q = Finance::Quote->new;</tt>
<br><tt>my %stocks = $q->fetch("nyse","LNUX");</tt>
<br><tt>print "$k: $v\n" while ($k, $v) = each %stocks;</tt>
<br>
<hr WIDTH="100%">
<br>The above program (you'll need to install the "Finance::Quote" module
for it to work) tells me all about VA Linux on the New York Stock Exchange.
Not bad for five lines of code.
<p>The above is an example of the <i>object-oriented</i> style of module,
the type that's becoming very common. After telling Perl to use the module,
we create a new instance of an object from the "Finance::Quote" class and
assign it to <tt>$q</tt>. We then call the "fetch" method (the methods
are listed in the module's documentation) with the "nyse" and "LNUX" variables,
and print the results stored in the returned hash.
<p>A lot of modules are of the so-called <i>exporting</i> style; these
simply provide additional functions when "plugged in" to your program.
<br>
<hr WIDTH="100%">
<br><tt>#!/usr/bin/perl -w</tt>
<br><tt>use LWP::Simple;</tt>
<p><tt>$code = mirror( "http://slashdot.org", "slashdot.html" );</tt>
<br><tt>print "Slashdot returned a code of $code.\n";</tt>
<br>
<hr WIDTH="100%">
<br>In this case, "mirror" is a new function that came from the LWP::Simple
module. Somewhat obviously, it will copy ("mirror") a given web page to
a specified file, and return the code (e.g., '404' for 'RC_NOT_FOUND).
<br>&nbsp;
<p><b>Wrapping It Up</b>
<p>Well, that was a quick tour through a few interesting parts of Perl.
Hopefully, this has whetted a few folks' tastebuds for more, and has shown
some of its capabilities. If you're interested in extending your Perl knowledge,
here are some recommendations for reading material:
<p><b><font size=-1>Learning Perl, 3rd Edition (coming out in July)</font></b>
<br><font size=-1>Randal Schwartz and Tom Phoenix</font>
<p><b><font size=-1>Programming Perl, 3rd Edition</font></b>
<br><font size=-1>Larry Wall, Tom Christiansen &amp; Jon Orwant</font>
<p><b><font size=-1>Perl Coookbook</font></b>
<br><font size=-1>By Tom Christiansen &amp; Nathan Torkington</font>
<p><b><font size=-1>Data Munging with Perl</font></b>
<br><font size=-1>By David Cross</font>
<p><b><font size=-1>Mastering Algorithms with Perl</font></b>
<br><font size=-1>By Jon Orwant, Jarkko Hietaniemi &amp; John Macdonald</font>
<p><b><font size=-1>Mastering Regular Expressions</font></b>
<br><font size=-1>By Jeffrey E. F. Friedl</font>
<p><b><font size=-1>Elements of Programming with Perl</font></b>
<br><font size=-1>by Andrew Johnson</font>
<br>&nbsp;
<p>Good luck with your Perl programming - and happy Linuxing!
<br>&nbsp;
<p><b>Ben Okopnik</b>
<br><tt>perl -we'print reverse split//,"rekcah lreP rehtona tsuJ"'</tt>
<br>
<hr WIDTH="100%">
<br><a NAME="1"></a>1. "There's More Than One Way To Do It" - the motto
of Perl. I find it applicable to all of Unix, as well.
<p><tt>References:</tt>
<p><tt>Relevant Perl man pages (available on any pro-Perl-y configured</tt>
<br><tt>system):</tt>
<p><tt>perl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - overview&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
perlfaq&nbsp;&nbsp; - Perl FAQ</tt>
<br><tt>perltoc&nbsp;&nbsp; - doc TOC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
perldata&nbsp; - data structures</tt>
<br><tt>perlsyn&nbsp;&nbsp; - syntax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
perlop&nbsp;&nbsp;&nbsp; - operators/precedence</tt>
<br><tt>perlrun&nbsp;&nbsp; - execution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
perlfunc&nbsp; - builtin functions</tt>
<br><tt>perltrap&nbsp; - traps for the unwary&nbsp; perlstyle - style guide</tt>
<p><tt>"perldoc", "perldoc -q" and "perldoc -f"</tt>




<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Ben Okopnik</H4>
<EM>A cyberjack-of-all-trades, Ben wanders the world in his 38' sailboat, building
networks and hacking on hardware and software whenever he runs out of cruising
money. He's been playing and working with computers since the Elder Days
(anybody remember the Elf II?), and isn't about to stop any time soon.</EM>


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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Ben Okopnik.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">DMCA in the news: Russian programmer arrested, nerds protest for his release</font></H1>
<H4>By <a href="mailto:gazette@ssc.com">Mike Orr</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<P> The Digital Millennium Copyright Act (DMCA) has claimed its 
first  prisoner.  Russian programmer Dmitry Sklyarov was arrested by the FBI
July 16 after giving a talk at DEF CON in Las Vegas, Nevada, on the inadequate
security of Adobe's eBook format.  But he was arrested not because of the
talk, but because his company
ElcomSoft sold (and he worked on) a product that converted said eBook
format to ordinary PDF.  This violates the DMCA's circumvention
provision, which  prohibits circumventing any encryption that serves as a form
of copy protection. Never mind that the program was built and sold in  Russia,
which has no such law.  (Neither do Canada or Europe, at least not yet.) Never
mind that there are legitimate uses for ElcomSoft's product, such as exercising
your Fair Use rights or having a speech synthesizer read you the book if you
are blind.  

<P> Protests erupted a week later in several US cities, asking for
the release of Dmitry, boycotting Adobe, and/or arguing for the repeal of the
DMCA.  The Electronic Frontier Foundation (EFF) talked with Adobe and
got them to withdraw their complaint against Dmitry and ask for his 
release.  However, Dmitry is still in an Oklahoma jail without bail, and
his fate rests with the US justice department and a court trial.
A second route of protests took place a week later (July 30) to convince
the Justice Department to release Dmitry and to convince Congress to repeal
the DMCA.  There are other problems with the DMCA too. (Remember DeCSS?
What about your previous right to reverse engineer?)  

<P> The DMCA is an important issue for all Americans, even those who aren't
engineers or are computer novices, because the laws are changing much
faster than people realize, and you may find that rights you've always had
no longer exist, and that your right to read what you want when you want
(without some company keeping track of you)--and to criticize what you
read--may be gone.

<P> It's also an important issue to those outside the US.  Canada is 
already debating a similar law.  And Europeans must also be wary, lest
corporate lobbyists sneak it past your parliaments when you're not watching.
Already, American engineers have started sending their resumes to Canada
and Europe, in case their jobs get declared illegal over here.

<P> So much has been written about Sklyarov and the DMCA that I won't
retell it all but just point to some existing links.

<UL>
<LI> <A HREF="http://www.nytimes.com/2001/07/30/opinion/30LESS.html">Jail Time in the Digital Age</A> (Excellent New York Times article that articulates
many of the issues.  Free for one week, then purchase online or go to the
library and choose the July 30, 2001 edition.)
<LI> <A HREF="http://search.nytimes.com:80/plweb-cgi/fastweb?state_id=996644093&view=site&docrank=2&numhitsfound=5&query=%28sklyarov%29%20AND%20%2820010703%3C%3Dpdate%29&query_rule=%28$query%29&query1=thedbs%3Dpast30days%26section%3DALL%26fields%3DALL%26thequery%3Dsklyarov&query2=sorting%3DBYFIELD%3A-skey_pdate&query7=sklyarov&query8=from%20the%20past%2030%20days&docid=58838&docdb=2001arc&dbname=unify&numresults=10&sorting=BYFIELD%3A-skey_pdate&operator=AND&TemplateName=abs_MPoff.tmpl&setCookie=1">Arrest Raises Stakes in Battle Over Copyright</A>
(Another excellent NY Times article that also explains some of the issues.
Purchase online or go to the library and look at the July 23, 2001 edition.)
<LI> <A HREF="http://www.wired.com/">Wired</A> and
<A HREF="http://www.theregister.co.uk">The Register</A> (UK) have had several
articles.
<LI> <A HREF="http://noframes.linuxjournal.com/articles/misc/0048.html">We're Not Your Enemies; We're Your Customers</A> (Yours Truly wrote a 
<I>Linux Journal</I> web article on the Seattle protest July 24, on the 
effect of the DMCA on programmers, and some ideas for what to do now)

<LI> <A HREF="http://nodmca.org">nodmca.org</A> 
<LI> <A HREF="http://www.freesklyarov.org">www.freesklyarov.org</A>
<LI> <A HREF="http://www.anti-dmca.org/">http://www.anti-dmca.org/</A>
<LI> <A HREF="http://www.eff.org/">Electronic Frontier Foundation (EFF)</A>
<LI> <A HREF="http://www.eff.org/Legal/Cases/Felten_v_RIAA/20010606_eff_felten_pr.html">Felten vs RIAA</A>
<LI> <A HREF="http://www.gnu.org/philosophy/right-to-read.html">The Right to Read</A>
(a dysotopian short story by Richard Stallman, 1997)
<LI> <a href="http://lwn.net/2001/0719/">Linux Weekly News editorial</a> (scroll
down to "DMCA")
<LI> <A HREF="http://www.freedmitry.org">www.freedmitry.org</A>
<LI> <A HREF="http://www.boycottadobe.org">www.boycottadobe.org</A> (has some
technical references about the eBook case)
</UL>





<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P>
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Mike Orr</H4>
<EM>Mike ("Iron") is the Editor of <I>Linux Gazette</I>.  You can read what he
has to say in the Back Page column in this issue.  He has been a Linux
enthusiast since 1991 and a Debian user since 1995.  He is SSC's web technical
coordinator, which means he gets to write a lot of Python scripts.
Non-computer interests include Ska/Oi! music and the international language
Esperanto.  The nickname Iron was given to him in college--short for Iron Orr,
hahaha.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Mike Orr.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Installing Tomcat on Linux</font></H1>
<H4>By <a href="mailto:tl082@yahoo.com">Allan Peda</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<img src="misc/peda/tomcat.png" 
  alt="Screencap of the Tomcat Demo Webserver Running" 
  WIDTH="130" HEIGHT="92" ALIGN="left">

By now I'm sure many of you my have the impression that unless you know
Java, your r&eacute;sum&eacute; is severely handicapped, and even if
you are fluent in Java, increasingly employers will ask if you know Java
Server Pages (JSPs), and/or servlets.  Fortunately, there is a free
application server for Java Server Pages, and the related Java
Servlets, it is called called Jakarta-Tomcat (hereafter referred to
simply as Tomcat). I decided to download and install it, documenting
my experiences for reference.  I set up  Tomcat on a vintage Pentium
2/200 running SuSE 7.2, however it appears that the steps described
here should work with any recent distribution, as long as Java can
compile the source.  
<p>

Installation of the applet server involves the downloading and
compilation of several packages in addition to the obvious need for
Java and Tomcat.  The following packages are necessary:
<p>
<table CLASS="listing">
<caption>Required Packages to Set Up Jakarta-Tomcat</caption>
<tr><th>Package</th><th>Source  &nbsp;</th></tr>
<tr><td>Java SDK 1.3.1          &nbsp;</td>
         <td><a href="#java_download">Sun</a> &nbsp;</td></tr>
<tr><td>XML Parser Library 1.1  &nbsp;</td>
         <td><a href="#java_xml">Sun</a> &nbsp;</td></tr>
<tr><td>Secure Sockets for Java 1.0.2 &nbsp;</td>
         <td><a href="#java_sse">Sun</a> &nbsp;</td></tr>
<tr><td>Java Servlet API 3.2.3  &nbsp;</td>
         <td><a href="#jakarta_download">Apache Foundation</a> &nbsp;</td> </tr>
<tr><td>Jakarta Ant 1.3         &nbsp;</td>
         <td><a href="#jakarta_download">Apache Foundation</a> &nbsp;</td> </tr>
<tr><td>Jakarta Tomcat 3.2.3    &nbsp;</td>
         <td><a href="#jakarta_download">Apache Foundation</a> &nbsp;</td> </tr>
</table><p>

<p>
<h2>Getting Java Installed</h2><p>
Installation of Java has been written up so frequently it's almost
not worth repeating here, however for completeness I'll quickly run through the
steps using RPM.  I downloaded version 1.3 of the SDK (also known as
the JDK) from the <a href="#java_download">Java web site</a>, 
but 1.4 is in Beta, and may be out by the time you read this. The
notes for the Secure Sockets library indicate that 1.4 will include
them, so the installation will be simplified somewhat.
<p>

For Linux, Sun's Java comes as a script wrapped around an RPM package,
so that you must execute it and agree to the licensing before you get
to actually install the RPM.&nbsp; After unpacking the shell script to
yield an RPM, follow the standard installation as root.

<p>
<table CLASS="sourcecode">
<caption>RPM install for Java (after unpacking)</caption>
<tr><td>
    <pre>

    moby:~ &gt; sudo rpm -Uv jdk-1.3.1.i386.rpm
    </pre>
</td></tr>
</table>
<p>

I modified my path to include the location of the JDK, on SuSE you are
advised to edit /etc/profile.local to accomplish this, although on
other distributions one might edit /etc/profile directly. Note also the
environmental variable for $JAKARTA_HOME, and $TOMCAT_HOME, we can
ignore them for now, but you will need them soon enough as part of the
installation procedure, so it's easier to set them now. Note that I
did not initially set CLASSPATH, although you may want or need to.
You'll see below the steps I took to make sure that Java could find
the libraries. 

<p>
<table CLASS="sourcecode"  WIDTH="100%">
<caption>Environmental Variables Needed</caption>
<tr><td>
    <pre>

    #!/bin/bash
    JAVA_HOME=/usr/java/jdk1.3.1
    JAKARTA_HOME=/opt/jakarta
    ANT_HOME=$JAKARTA_HOME/jakarta-ant
    TOMCAT_HOME=$JAKARTA_HOME/build/tomcat
    PATH=$JAVA_HOME/bin:$PATH

    export JAVA_HOME JAKARTA_HOME ANT_HOME PATH TOMCAT_HOME
    </pre>
</td></tr>
</table>
<p>
<h2>Installing the Java XML Parser Library</h2>
I installed the libraries for XML parsing by unzipping and copying the
required libs to the library extensions directory (as root).  I
originally unzipped this file into my home directory.  Where the files
are initially unzipped doesn't matter, as long as java can find the
installed libraries.<p> 

<table CLASS="sourcecode"  WIDTH="100%">
<caption>Copying the XML Parser Library jar files</caption>
<tr><td>
    <pre>

    unzip jaxp-1_1.zip; cd jaxp-1.1
    moby:~/jaxp-1.1 > sudo cp *.jar $JAVA_HOME/jre/lib/ext
    </pre>
</td></tr>
</table>

<p>
Now, I like to do things step by step, so to check that your setup is 
able to find these new libraries, I suggest running an example
program, which is included in the XML parser library.
<br>
If your Java Virtual Machine (JVM) cannot find the libraries, you will
get an error like this:
<p>
<table CLASS="errormsg">
<caption>Error Message</caption>
<tr><td>
    <pre>

    moby:~/jaxp-1.1/examples/trax &gt; java Examples
    Exception in thread "main" java.lang.NoClassDefFoundError: 
    javax/xml/transform/TransformerException
    </pre>
</td></tr>
</table>
<p>

If you see something like this, check the library locations (.jar
files).  I constantly ran into this problem, and I solved it by
copying symlinking them to the correct location, or modifying
$CLASSPATH. 

<h2>Installing the Secure Sockets Library</h2>
<p>You follow a similar procedure to install the Secure
Sockets library copying the .jar libraries into the extensions directory.
<p>

<table CLASS="sourcecode">
<caption>Secure Sockets Library</caption>
<tr><td>
    <pre>

    moby:~/jsse1.0.2/lib &gt; sudo cp *.jar $JAVA_HOME/jre/lib/ext
    </pre>
</td></tr>
</table>
<p>
I then edited the file
/usr/java/jdk1.3.1/jre/lib/security/java.security to contain an entry
for "com.sun.net.ssl.internal.www.protocol" which was not in the
default file.
<p>
<table CLASS="sourcecode">
<caption>Java Security Entry for SSL</caption>
<tr><td>
    <pre>

    security.provider.1=sun.security.provider.Sun
    security.provider.2=com.sun.net.ssl.internal.ssl.Provider
    security.provider.3=com.sun.rsajca.Provider
    </pre>
</td></tr>
</table>
<p>

Now, to test that javac could find these libs, I quickly typed up
compiled the following piece of code, saved it as TestSSL.java and
compiled it:
<p>
<table CLASS="sourcecode">
<caption>Testing Secure Sockets</caption>
<tr><td>
    <pre>

    import javax.net.ssl.*;
    
    public class TestSSL {
	public static
	    void main(String [] arstring) {
	    try  {
		new java.net.URL("https://" + arstring[0] + "/").getContent();
	    } catch (Exception exception) {
		exception.printStackTrace();
	    }
	}
    }
    </pre>
</td></tr>
</table>
<p>
We compile to bytecode Using the standard javac invocation:
<pre>
      moby:~/jsse1.0.2 &gt; javac TestSSL.java
</pre>
Once again, if java could not find the libray, then I would get a
java.lang.NoClassDefFoundError error, and the code would not compile
to yield the TestSSL.class bytecode file.<p>

After compiling with javac to bytecode, I wanted to test the ssl library by
connecting to an SSL site (sourceforge).  Here it is necessary to 
specify the use of SSL on the command line, or as Sun's install docs say,
"add the handler's implementation package name to the list of packages
which are searched by the Java URL class".  I think of this as
analogous to linking the math library  using -lm as a linker option
to gcc, except it's done at runtime.

<table CLASS="sourcecode">
<caption>Explicitly Specifying the Handler</caption>
<tr><td>
    <pre>
    
    moby:~/jsse1.0.2 &gt; java \
    -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol \
    TestSSL sourceforge.net
    moby:~/jsse1.0.2 &gt; echo $?
    moby:~/jsse1.0.2 &gt; 0
    </pre>
</td></tr>
</table>
<p>
<br>	
As an aside, if I did not include this argument to the JVM, I would
get the following error:<p>

<table CLASS="errormsg">
<caption>Unknown Protocol Error Message</caption>
<tr><td>
    <pre>

    moby:~/jsse1.0.2 &gt; java TestSSL sourceforge.net
    java.net.MalformedURLException: unknown protocol: https
	    at java.net.URL.&lt;init&gt;(URL.java:480)
	    at java.net.URL.&lt;init&gt;(URL.java:376)
	    at java.net.URL.&lt;init&gt;(URL.java:330)
	    at TestSSL.main(TestSSL.java:8)
    </pre>
</td></tr>
</table>
<p>

So now we have Apache, Java, Java libraries for XML and Secure
Sockets, and we can install Jakarta-Tomcat.  Not quite yet, we
still need Ant, a Java "make" replacement, and the Servlet API.

<h2>Installing Ant</h2>

Despite the fact that we not quite ready to install the Jakarta-Tomcat
distribution, the next step does involve installing some essential
components of Jakarta, so we need to modify our environment to
accommodate the package. We do this by creating the environmental variable 
$JAKARTA_HOME which was briefly introduced with the $JAVA_HOME
variable.  I decided to put Jakarta under /opt, simply because
there was space there, and also I try to put anything I build under
/opt, leaving /usr and /usr/local for the distribution RPM to
decide. Now we are getting to First, think of a place where you want
to install Ant.<p>

First download and unpack it.  In my example I downloaded the
compressed source into my home directory, then changed to the 
$JAKARTA_HOME directory.  I then unpacked it into the $JAKARTA_HOME
directory, letting tar choose the directory name.<p>

In order to comply with the requirement that jakarta-ant be in a
directory called $JAKARTA_HOME/jakarta-ant I symlinked the build
directory to the correct directory name. Then I cd'd into the
jakarta-ant/ directory and ran the bootstrap.sh script as root. 
After you run this script, there should be a new build/lib/
subdirectory containing the libraries just built:

<p>
<table CLASS="sourcecode">
<caption>Building Jakarta - Ant</caption>
<tr><td>
    <pre>

    moby:~ &gt; cd $JAKARTA_HOME
    moby:~/opt/jakarta&gt; tar xzf ~/jakarta-ant-1.3-src.tar.gz
    moby:/opt/jakarta &gt; sudo ln -s jakarta-ant-1.3/ jakarta-ant
    moby:~/opt/jakarta &gt; cd jakarta-ant
    moby:/opt/jakarta/jakarta-ant &gt; sudo sh bootstrap.sh    
    moby:/opt/jakarta/jakarta-ant > ls -1 build/lib/
    ant.jar
    optional.jar
    </pre>
</td></tr>
</table>
<p>

<a href="misc/peda/bootstrap_ant.txt">Output of the Ant bootstrap
script</a><p>

<h2>Installing the Servlet API</h2>
Next we install the servlet API, once again symlinking the real
extract directory to the required directory name:

<p>
<table CLASS="sourcecode">
<caption>Building the Servlet API</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta &gt; sudo tar xvzf \
    &gt; ~/jakarta-servletapi-3.2.3-src.tar.gz 
    moby:/opt/jakarta &gt; sudo ln -s jakarta-servletapi \
    &gt; jakarta-servletapi-3.2.3-src
    moby:/opt/jakarta &gt; cd jakarta-servletapi
    moby:/opt/jakarta/jakarta-servletapi &gt;
    </pre>
</td></tr>
</table>
<p>
I was ready to build the jakarta servlet libraries, using the
build.sh script supplied.  But it was at this point I had to "cheat"
in order to resolve two library related errors: 

<p>
<table CLASS="errormsg">
<caption>Error messages due to libraries not being found</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta/jakarta-servletapi &gt; sudo sh build.sh dist
    Exception in thread "main" java.lang.NoClassDefFoundError:
    org/apache/tools/ant/Main

    /opt/jakarta/jakarta-servletapi-3.2.3-src/build.xml:31: Cannot use
    classic compiler, as it is not available A common solution is to set
    the environment variable JAVA_HOME to your jdk directory.
    </pre>
</td></tr>
</table>
<p>

The error messages <i>look</i> different, but are really both related
to libraries not being found.  The first is related to ant.jar, the
second is due to a "lost" tools.jar library. To solve these problems I
created two symlinks under $JAVA_HOME/jre/lib/ext to allow Java to 
find the newly created ant.jar and tools.jar libraries.<br> 

<p>
<table CLASS="sourcecode">
<caption>Symlinks set to allow Java to find "lost" Libraries</caption>
<tr><td>
    <pre>

    $JAVA_HOME/jre/lib/ext/ant.jar -&gt; /opt/jakarta/jakarta-ant/build/lib/ant.jar
    $JAVA_HOME/jre/lib/ext/tools.jar -> /usr/java/jdk1.3.1/lib/tools.jar
    </pre>
</td></tr>
</table>
<p>

Alternately I know of two other options that <i>should</i> work (but
did not for me):<p> 
<ol>
    <li>modify the $CLASSPATH environmental variable to include tools.jar
    and ant.jar explicitly.<br>
    <TT>export
    CLASSPATH=$JAVA_HOME/lib/tools.jar:$ANT_HOME/lib/ant.jar</TT>
    <br><em>or</em>
    <li>
    Explicitly specify the "-classpath" option when calling
    java. This is probably impractical for any large run script.
</ol>
<br>

After creating these symlinks, the following command ran perfectly:
<p>
<table CLASS="sourcecode">
<caption>Building Tomcat</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta/jakarta-servletapi > sudo sh build.sh dist
    </pre>
</td></tr>
</table>
<p>
<a href="misc/peda/build_servlet_api.txt">Here is the output of servlet build
script</a><p>

<h2>Building Tomcat</h2>
Finally, the moment of truth, building the Jakarta-Tomcat package.  I
still had one error, 
<p>
<table CLASS="errormsg">
<caption>Error messages due to bin directory not being found</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta/jakarta-tomcat > sudo sh ./build.sh dist
    Buildfile: build.xml
    prepare:
    BUILD FAILED
    /opt/jakarta/jakarta-tomcat-3.2.3-src/build.xml:32: /opt/jakarta/jakarta-ant-1.3/bin not found.
    
    Total time: 2 seconds
    </pre>
</td></tr>
</table>
<p>
The error message, unlike most, is obvious. After symlinking the bin
directory in jakarta-ant, it ran perfectly. 
<p>
<table CLASS="sourcecode">
<caption>Symlink so the binaries could be found</caption>
<tr><td>
    <pre>

    moby:~ > cd /opt/jakarta/jakarta-ant
    moby:/opt/jakarta/jakarta-ant &gt; sudo ln -s bootstrap/bin .
    </pre>
</td></tr>
</table>
<p>

Here is the <a href="misc/peda/build_tomcat.txt">output of the
Tomcat build script</a><p>
At this point you can cd to $JAKARTA_HOME/dist/tomcat/bin and run
startup.sh .
<p>
<table CLASS="sourcecode">
<caption>Starting Jakarta-Tomcat</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta/dist/tomcat/bin &gt; sudo ./startup.sh
    Using classpath: /opt/jakarta/build/tomcat/classes:/opt/jakarta/build/tomcat/lib
    /servlet.jar:/opt/jakarta/build/tomcat/lib/test:/usr/java/jdk1.3.1/lib/tools.jar
    allan@moby:/opt/jakarta/build/tomcat/bin &gt; 2001-07-20 03:13:50 - ContextManager:
     Adding context Ctx( /examples )
    2001-07-20 03:13:50 - ContextManager: Adding context Ctx( /admin )
    Starting tomcat. Check logs/tomcat.log for error messages 
    2001-07-20 03:13:50 - ContextManager: Adding context Ctx(  )
    2001-07-20 03:13:50 - ContextManager: Adding context Ctx( /test )
    allan@moby:/opt/jakarta/build/tomcat/bin &gt; 2001-07-20 03:13:53 - \
    PoolTcpConnector: Starting HttpConnectionHandler on 8080
    2001-07-20 03:13:53 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007
    </pre>
</td></tr>
</table>
<p>
Similarly with shutdown:
<p>
<table CLASS="sourcecode">
<caption>Stopping Jakarta-Tomcat</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta/dist/tomcat/bin > sudo ./shutdown.sh 
    Using classpath:
    /opt/jakarta/build/tomcat/classes:/opt/jakarta/build \
    /tomcat/lib/servlet.jar:/opt/jakarta/build/tomcat/lib/test:/usr/java \
    /jdk1.3.1/lib/tools.jar
    Stop tomcat
    2001-07-20 03:15:47 - ContextManager: Removing context Ctx( /examples )
    2001-07-20 03:15:47 - ContextManager: Removing context Ctx( /admin )
    2001-07-20 03:15:47 - ContextManager: Removing context Ctx(  )
    2001-07-20 03:15:47 - ContextManager: Removing context Ctx( /test )
    </pre>
</td></tr>
</table>
<p>

Congratulations!  After running the startup script, you can view the
greeting screen by pointing your browser at the web server's machine,
port 8080, unless modified.<p>
<img src="misc/peda/tomcat_works.png" 
alt="Screencap of the Tomcat Demo Webserver Running" WIDTH="600" HEIGHT="587">
<p>
Jumping to the various pages supplied you can then check out the
screen shots of the example <a href="misc/peda/servlet_examples.html">Servlets</a> 
and <a href="misc/peda/jsp_samples.html">Java Server Pages</a>. This
is a bit of a tease, because you are tempted to try to run the demos
from the screencaps, but still it's nice to see what you can expect
when you actually get Jakarta Tomcat Running. 
<p>

<h2>It works!</h2>
At this point you have two servers running: a simple web server
listening on port 8080, and a servlet container application server
listening on port 8007. The first thing I am concerned with is the
fact that everything was set up as root.  Supporting documentation
suggests running the server as "nobody", but I felt that a special
jakarta user analogous to a database user would be a good idea because of
the special environmental variables that are set.  Having a dedicated
jakarta user just for servlets would then allow configuration to be kept in
the ~jakarta home directory.  This would be even more useful if there
were other versions of java installed on the system.
<p>

Anyhow this is all fairly simple.  After the jakarta user is set up as
shown, you can run jakarta as that user, and since it runs from a
nonpriviliged port there should be no problem there.  Still I thought
that the permissions could be tightened up more so that only the jakarta
user can run the servlet container, so I shutdown the server, and
changed the permissions as follows:<p> 

<p>
<table CLASS="sourcecode" >
<caption>Tightening Up Permissions</caption>
<tr><td>
    <pre>

    moby:/opt/jakarta &gt; sudo $TOMCAT_HOME/bin/shutdown.sh 
    moby:/opt/jakarta &gt; sudo /usr/sbin/groupadd jakarta
    moby:/opt/jakarta &gt; sudo /usr/sbin/useradd -g jakarta -c \
    &gt; "Java Server Pages" jakarta
    moby:/opt/jakarta &gt; sudo mkdir /home/jakarta
    moby:/opt/jakarta &gt; sudo chown jakarta.jakarta /home/jakarta
    moby:/opt/jakarta &gt; sudo chown -R jakarta.jakarta $JAKARTA_HOME
    moby:/opt/jakarta &gt; sudo su - jakarta
    moby:~ &gt; cd $JAKARTA_HOME
    </pre>
</td></tr>
</table>
<p>

Naturally you could set the password too, but since root can get in
anyhow, I didn't bother.  I decided to tighten some permissions by using 
 <a href="misc/peda/tighten_perms.sh.txt">this</a> script.
Now only user jakarta can start and stop the servlets, and Java server
pages. The environmental variables set in /etc/profile or
 /etc/profile.local can now be set instead in ~jakarta/.profile or
 ~jakarta/.bash_profile leaving other users free to choose other java
 versions and reducing the count of environmental variables.
<p>
Now that Tomcat is running, you can experiment with altering the stock
configuration.  There are many options here, and of course since
Jakarta is a project by the Apache foundation, it is designed to
integrate easily with Apache. Take a look at the users guide
included with the source, it provides some good examples, and
you can also consult the project <a href="#tomcat_ug">web site</a>.  
XML is the native format of it's configuration file, and you'll be
getting a crash course in XML, it you haven't learned about it yet.
To get you started, see the main configuration files, "server.xml" and
"web.xml". 
<p>
So welcome to the wild world of Java Server Pages and Servlets.
You'll find that it's a very mature in interesting technology.  Good
luck.
<p>
<hr>
References:
<ol>
<li>Linux as an Application Server -- The Tomcat Way<br>
    by Chris Bush
    <a href="http://www.sysadminmag.com/linux/articles/v10/i01/a4.htm">http://www.sysadminmag.com/linux/articles/v10/i01/a4.htm</a>

<li><a name="java_download">Sun's Java Software Development Kit 1.3.1</a><br>
    <a href="http://java.sun.com/products/">http://java.sun.com/products/</a>

<li><a name="java_sse">Java Secure Sockets Extension (JSSE) version 1.0.2 or later</a><br>
    <a href="http://java.sun.com/products/jsse/">http://java.sun.com/products/jsse/</a>

<li><a name = "java_xml">Java API for XML Parsing implementation 1.1</a><br>
    <a href="http://java.sun.com/xml">http://java.sun.com/xml</a>

<li><a name="jakarta_download">Jakarta Tomcat download (includes
Jakarta Tomcat, ANT, Servlet API)</a><br>
    <a href="http://jakarta.apache.org/site/sourceindex.html">http://jakarta.apache.org/site/sourceindex.html</a><br>
    Note that Ant is a separate project, but the servlet API source is in the
    same download directory as the Jakarta-Tomcat source.

<li>Build secure network applications with SSL and the JSSE API<br>
    by Todd Sundsted
    <a href="http://www.javaworld.com/javaworld/jw-05-2001/jw-0511-howto.html">http://www.javaworld.com/javaworld/jw-05-2001/jw-0511-howto.html</a>

<li>The Ant FAQ:
    <a href="http://jakarta.apache.org/ant/faq.html">http://jakarta.apache.org/ant/faq.html</a>
<li><a name="tomcat_ug">The Tomcat Users Guide</a><br>
    <a href="http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html">http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html</a>

</ol>






<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Allan Peda</H4>
<EM>Allan has been enjoying Linux since about 1995, discovering Perl shortly
thereafter. Currently he is doing Linux consulting work in the NYC area.
He enjoys surfing, sailing, and dreams of owning a charter boat in
</EM>tranquilo<EM> Costa Rica.</EM>


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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Allan Peda.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Qubism</font></H1>
<H4>By <a href="mailto:sirflakey@core.org.au">Jon "Sir Flakey" Harsem</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->


Vi-Agra (of HelpDex fame) makes a cameo appearance in two Qubism cartoons.

<P>

<IMG ALT="qb-hug.jpg" SRC="misc/qubism/qb-hug.jpg" 
	WIDTH="683" HEIGHT="306">
<BR CLEAR="all">

<IMG ALT="qb-joyride.jpg" SRC="misc/qubism/qb-joyride.jpg" 
	WIDTH="750" HEIGHT="308">
<BR CLEAR="all">

<IMG ALT="qb-magnify.jpg" SRC="misc/qubism/qb-magnify.jpg" 
	WIDTH="800" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-vi-agra.jpg" SRC="misc/qubism/qb-vi-agra.jpg" 
	WIDTH="682" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-ota.jpg" SRC="misc/qubism/qb-ota.jpg" 
	WIDTH="767" HEIGHT="306">
<BR CLEAR="all">

<IMG ALT="qb-pt.jpg" SRC="misc/qubism/qb-pt.jpg" 
	WIDTH="604" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-pt2.jpg" SRC="misc/qubism/qb-pt2.jpg" 
	WIDTH="465" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-pt3.jpg" SRC="misc/qubism/qb-pt3.jpg" 
	WIDTH="605" HEIGHT="305">
<BR CLEAR="all">

<IMG ALT="qb-skywritten.jpg" SRC="misc/qubism/qb-skywritten.jpg" 
	WIDTH="777" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-xpbeta.jpg" SRC="misc/qubism/qb-xpbeta.jpg" 
	WIDTH="800" HEIGHT="310">
<BR CLEAR="all">

<IMG ALT="qb-revert.jpg" SRC="misc/qubism/qb-revert.jpg" 
	WIDTH="800" HEIGHT="310">
<BR CLEAR="all">




<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Jon "SirFlakey" Harsem</H4>
Jon is the creator of the Qubism cartoon strip and current
Editor-in-Chief of the 
<A HREF="http://www.core.org.au/">CORE</A> News Site.  
Somewhere along the early stages of
his life he picked up a pencil and started drawing on the wallpaper.  Now
his cartoons appear 5 days a week on-line, go figure. He confesses to
owning a Mac but swears it is for "personal use".

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Jon "Sir Flakey" Harsem.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Numerical Workbenches</font></H1>
<H4>By <a href="mailto:cspiel@hammersmith-consulting.com">Christoph Spiel</a></H4>
</center>
<P> <HR> <P>  

<!-- END header -->




<p>Some people think GNU/Linux is a good operating system, but has not enough
applications to make it succeed in the market. Although this might be true for
the desktop area, it is certainly wrong for numerical workbenches. In this
field GNU/Linux users have many different (and excellent) choices -- in
fact too many to introduce them all. Therefore, this series of articles
introduces three outstanding applications:</p>

<dl>
<dt><strong><a name="item_GNU%2FOctave_2%2E1%2E34">GNU/Octave
2.1.34</a></strong><br>
</dt>

<dd><a href="http://www.che.wisc.edu/octave/">
http://www.che.wisc.edu/octave/</a></dd>

<dt><strong><a name="item_Scilab_2%2E6">Scilab 2.6</a></strong><br>
</dt>

<dd><a href="http://www-rocq.inria.fr/scilab/">
http://www-rocq.inria.fr/scilab/</a></dd>

<dt><strong><a name="item_Tela_1%2E32">Tela 1.32</a></strong><br>
</dt>

<dd><a href="http://www.geo.fmi.fi/prog/tela.html">
http://www.geo.fmi.fi/prog/tela.html</a></dd>
</dl>

<p>To find out about more numerical workbenches, check out <a href=
"http://sal.kachinatech.com/A/2/">http://sal.kachinatech.com/A/2/</a></p>

<h2><a name="introduction">Introduction</a></h2>

<p>What can these programs do? Isn't paper and pencil -- er -- a
spreadsheet program enough?</p>

<p>The main application areas of numerical workbenches are:</p>

<ul>
<li>Preprocessing (yes -- meanwhile we need computers to talk to
computers) and postprocessing data with the special case of ``gluing'' two
numerical applications together.</li>

<li>Numerical optimizations (both, linear and non-linear),</li>

<li>Standalone simulations,</li>

<li>Data visualization,</li>

<li>Sophisticated ``pocket'' calculators,</li>

<li>Rapid prototyping of specialized numerical applications, which finally
will be implemented in, say, C++ or Fortran-90.</li>
</ul>

<p>However, because all of them provide complete programming languages to the
user and, moreover, are designed to be extended, the number of numerical
problems they can solve is almost limitless.</p>

<h3><a name="numerical mathematics">Numerical Mathematics</a></h3>

<p>Now, what the heck is numerical math anyhow? Numerical Mathematics is the
branch of math that develops, analyzes, and applies methods to compute with
finite precision numbers. Computer hardware, for example, uses numerical math.
</p>

<p>Why do computers work with finite precision numbers?  Why has nobody
developed a scheme that allows for the storage of exact numbers?</p>

<ol>
<li>Solving problems with finite precision numbers is faster -- much, much
faster. Take for example the sum of all square roots from one to one million.
On my computer, doing the exact computation with MuPAD-1.4.2 available at <a
href="http://math-www.uni-paderborn.de/MuPAD/index.html">
http://math-www.uni-paderborn.de/MuPAD/index.html</a> 

<pre>
    time(sum(sqrt(i), i = 1..10^6));
</pre>

<p>takes about 40&nbsp;seconds, whereas getting the approximate result with
Tela-1.32</p>

<pre>
    tic(); sum(sqrt(1:10^6)); toc();
</pre>

<p>takes 0.31&nbsp;seconds, that is, the answer in finite precision is
returned over 100&nbsp;times faster! Put another way, we can crunch hundred
times more data with finite precision numbers in the same time slice.</p>
</li>

<li>When using good algorithms -- the ones suggested by numerical
mathematicians -- and being careful one can get surprisingly precise
answers even with finite precision numbers.<p></p></li>

<li>Admit it, most of the time users do not need exact results! A good
approximation -- with ``sufficiently many correct digits'' -- will
do.<p></p></li>
</ol>

<h3><a name="article organization">Article Organization</a></h3>

<p>In this article series, we point out the similarities among the three
applications that we are going to discuss. We will use GNU/Octave in most of
the examples. Where there are important differences you should be aware of, we
have put a <strong>Differences</strong> paragraph at the end of the section.</p>

<p>Technical details for the terminally curious have been put in <strong>
Details</strong> sections.</p>

<h2><a name="getting in and out">Getting In and Out</a></h2>

<p>To give you a hands-on experience, let us start each of the applications,
request help on a function, and then quit.</p>

<dl>
<dt><strong><a name="item_GNU%2FOctave">GNU/Octave</a></strong><br>
</dt>

<dd>
<pre>
    cspiel@hydra:~/articles/numerical-workbenches $ octave
    GNU Octave, version 2.1.34 (i686-pc-linux-gnu).
    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 John W. Eaton.
    This is free software with ABSOLUTELY NO WARRANTY.
    For details, type `warranty'.
</pre>

<pre>
    *** This is a development version of Octave.  Development releases
    *** are provided for people who want to help test, debug, and improve
    *** Octave.
    ***
    *** If you want a stable, well-tested version of Octave, you should be
    *** using one of the stable releases (when this development release
    *** was made, the latest stable version was 2.0.16).
</pre>

<pre>
    octave:1&gt; help diag
    diag is a built-in function
</pre>

<pre>
     - Built-in Function:  diag (V, K)
         Return a diagonal matrix with vector V on diagonal K.  The second
         argument is optional.  If it is positive, the vector is placed on
         the K-th super-diagonal.  If it is negative, it is placed on the
         -K-th sub-diagonal.  The default value of K is 0, and the vector
         is placed on the main diagonal.  For example,
</pre>

<pre>
              diag ([1, 2, 3], 1)
              =&gt;  0  1  0  0
                       0  0  2  0
                       0  0  0  3
                       0  0  0  0
</pre>

<pre>
    octave:2&gt; quit
    cspiel@hydra:~/articles/numerical-workbenches $
</pre>

<p>Alternatively use <code>exit</code> or press <strong>C-d</strong> to quit
GNU/Octave.</p>

<p>GNU/Octave offers the user function-name completion, this is, when only
part of a function's name is entered and the user hits <strong>Tab</strong>,
the partial name is completed as much as possible. A second <strong>
Tab</strong> displays the list of remaining choices.</p>
</dd>

<dt><strong><a name="item_Scilab">Scilab</a></strong><br>
</dt>

<dd>After starting Scilab thus:

<pre>
    cspiel@hydra:~/articles/numerical-workbenches $ scilab
</pre>

<p>we get a new <a href="misc/spiel/scilab-main.png">X-window</a> in which the
Scilab interpreter runs.  Asking for help opens an 
<a href="misc/spiel/scilab-xless-help.png">xless(1x) window</a>.
(Both these links are screenshots, so click on them.)</p>

<p>To exit Scilab, enter <code>quit</code> or <code>exit</code>.</p>

<p>Scilab can also be launched in non-window mode by passing the <code>
-nw</code> option to it:</p>

<pre>
    cspiel@hydra:~/articles/numerical-workbenches $ scilab -nw
                               ===========
                               S c i l a b
                               ===========
</pre>

<pre>
                              scilab-2.6
                      Copyright (C) 1989-2001 INRIA
</pre>

<pre>
    Startup execution:
      loading initial environment
</pre>

<pre>
    --&gt;help diag
</pre>

<p>The help system then uses the text output, too.</p>
</dd>

<dt><strong><a name="item_Tela">Tela</a></strong><br>
</dt>

<dd>Tela's banner is quite terse, nonetheless, the help system is as
comprehensive as necessary. Note that Tela offers function name completion as
GNU/Octave does. 

<pre>
    cspiel@hydra:~/articles/numerical-workbenches $ tela
    This tela is a tensor language, Version 1.32.
    Type  ?help  for help.
    -&gt;TAB completion works; try docview() and source("demo")
    &gt;help diag
    diag(V, K) (V is a vector) returns a square diagonal matrix, with
       vector V on the main diagonal (K == 0, default), the K-th super
       diagonal (K &gt; 0) or the K-th sub-diagonal (K &lt; 0).
</pre>

<pre>
       diag(M, K) (M is a matrix) returns the main diagonal (K == 0,
       default), the K-th super diagonal (K &gt; 0), or the K-th sub-diagonal
       (K &lt; 0) of M as a vector.  M need not necessarily be square.
</pre>

<pre>
    &gt;quit()
    63 instructions, 0 arithmetic ops.
    0.0063 MIPS, 0 MFLOPS.
    cspiel@hydra:~/articles/numerical-workbenches $
</pre>

<p>Tela can also be exited by pressing <strong>C-d</strong>.</p>
</dd>
</dl>

<h2><a name="better than a pocketcalculator!">Better Than a
Pocket Calculator!</a></h2>

<p>Now that we know how to start and exit the programs, let us look at them in
action.</p>

<h3><a name="simple expressions">Simple Expressions</a></h3>

<p>We want to see:</p>

<ol>
<li>Whether we can write mathematical expressions the way we are used to from
school. Ugh! 
<BR><code>1&nbsp;+&nbsp;2&nbsp;*&nbsp;3&nbsp;^&nbsp;4</code> should be treated 
as <code>1&nbsp;+&nbsp;(2 *&nbsp;(3&nbsp;^&nbsp;4))</code>, yielding 
<code>163</code>.  It should not be treated as
<code>((1&nbsp;+&nbsp;2)&nbsp;*&nbsp;3)&nbsp;^&nbsp;4</code>, which equals 
<code>6561</code>,</li>

<li>How many bits are necessary to store <code>10^6</code>, and</li>

<li>How steep is our driveway? (measured in degrees) 
Our garage is 7&nbsp;meters away from the street and half a meter above
it.</p>
</li>
</ol>

<p>Here we go.</p>

<pre>
    cspiel@orion:~/articles/numerics $ octave
</pre>

<p>All three programs are console-based.  That is, the user gets a prompt
whenever the application is ready to accept input. We enter our first question
as we write it on paper. Hitting return terminates the line, the program
evaluates it, and returns the result in variable&nbsp;<code>ans</code> (more on
variables later).</p>

<pre>
    octave:1&gt; 1 + 2 * 3 ^ 4
    ans = 163
</pre>

<p>Aha, obviously GNU/Octave knows elementary-school math!</p>

<p>Our second question requires the logarithm function&nbsp;<code>log</code>,
which returns the natural logarithm of its argument; this is, the logarithm to
base&nbsp;<em>e</em>.</p>

<pre>
    octave:2&gt; log(10^6) / log(2)
    ans = 19.932
</pre>

<p>We conclude that 1,000,000 needs 20&nbsp;bits to be stored.</p>

<p>Finally, how steep is our driveway? What we need here is an angular
function, namely the arctangent, written as <code>atan(argument)</code>.</p>

<pre>
    octave:3&gt; atan(0.50 / 7.0)
    ans = 0.071307
</pre>

<p>Hmm, ain't that a bit too flat? Digging out the wisdom of long forgotten
math classes, we remember that the arctangent of 1 is 45 degrees. Let us check
this!</p>

<pre>
    octave:4&gt; atan(1)
    ans = 0.78540
</pre>

<p>Ouch, off by a factor of 57! Do we have to throw the program away? Wait
-- 57 equals almost 180&nbsp;over&nbsp;<em>pi</em>. This means GNU/Octave
has returned the result in radians, not in degrees. All angular functions work
in units of radians, this is, an angle of 360 degrees is equivalent
2&nbsp;<em>pi</em>&nbsp;radians.</p>

<p>We try again, supplying the correct conversion factor:</p>

<pre>
    octave:5&gt; atan(0.50 / 7.0) * 360/(2 * 3.14)
    ans = 4.0856
</pre>

<p>Approximately 4&nbsp;degrees, that looks good.  Our garage certainly won't
get flooded in the next deluge.</p>

<p><strong>Details</strong></p>

<ul>
<li>Numbers are either real-valued or complex-valued. Elementary operations
``+'', ``-'', ``*'', and ``/'', as well as exponentiation&nbsp;``^'' work as
expected on reals and complex numbers.</li>

<li>The commonly used basic functions are the absolute value <code>
abs(arg)</code>, the sign-function <code>sign(arg)</code>, and the square root
<code>sqrt(arg)</code>.</li>

<li>Two logarithm functions are supplied, one to the base of <em>e</em>:
<code>log(arg)</code>, and to the base of 10: <code>log10(arg)</code>. The
exponential <code>exp(arg)</code> is the inverse of <code>
log(arg)</code>.</li>

<li>All workbenches offer a wealth of angular and hyperbolic functions: <code>
sin(arg)</code>, <code>cos(arg)</code>, <code>tan(arg)</code>, <code>
sec(arg)</code>, <code>csc(arg)</code>; <code>asin(arg)</code>, <code>
acos(arg)</code>, <code>atan(arg)</code>, <code>acsc(arg)</code>; <code>
sinh(arg)</code>, <code>cosh(arg)</code>, <code>tanh(arg)</code>, <code>
sech(arg)</code>, <code>csch(arg)</code> <code>asinh(arg)</code>, <code>
acosh(arg)</code>, <code>atanh(arg)</code>, <code>acsch(arg)</code>.</li>
</ul>

<p><strong>Differences</strong></p>

<ul>
<li>Tela does not know the convenience variable <code>ans</code>.</li>

<li>In GNU/Octave and Tela imaginary literal numbers are written by appending
``i'', ``j'', ``I'', or ``J'' to a number. For example <code>1i</code>, <code>
-8.99I</code>, <code>324J</code>. Scilab defines a special constant for the
imaginary unit <code>sqrt(-1)</code>, which is written &lt;%i&gt;. Therefore,
Scilab's imaginary literals look like products: <code>-8.99*%i</code>, <code>
%i*324</code>.</li>
</ul>

<h3><a name="variables">Variables</a></h3>

<p>In the last section we have not gained much in comparison with a pocket
calculator, have we? The first feature where our programs beat pocket
calculators and spread-sheets are names that we can give parameters or
results; these are called variables.</p>

<p>Assume our better half wants us to build a garden in the yard, but we want
to watch basketball. Therefore we quickly need a hard figure that proves we
don't have enough compost for the desired size. Ha -- brilliant
idea!</p>

<img height="281" alt="[image: plan for a flower bed]" src=
"misc/spiel/patch.png" width="551">
<BR CLEAR="all">

<p>From our little plan we take the following lengths in feet:</p>

<pre>
    houseside_length = 10
    creekside_length = 6
    width = 2
</pre>

<p>Our better half also said the layer of new soil ought to be at least 
five inches, so</p>

<pre>
    height = 5 / 12
</pre>

<p>GNU/Octave to the rescue!</p>

<pre>
    octave:1&gt; houseside_length = 10
    houseside_length = 10
    octave:2&gt; creekside_length = 6
    creekside_length = 6
    octave:3&gt; width = 2
    width = 2
    octave:4&gt; height = 5 / 12
    height = 0.41667
    octave:5&gt; volume = (houseside_length + creekside_length) * width * height
    volume = 13.333
</pre>

<p>The compost box is 6' x 4' and currently holds eight inches of usable
compost.</p>

<pre>
    octave:6&gt; box_width = 6
    box_wight = 6
    octave:7&gt; box_depth = 4
    box_depth = 4
    octave:8&gt; compost_height = 8/12
    compost_height = 0.66667
    octave:9&gt; compost_volume = box_width * box_depth * compost_height
    compost_volume = 16
</pre>

<p>Oh no, we have just dug our own grave. We have got <em>enough</em> compost!
What about taping the match on the VCR?</p>

<p><strong>Details</strong></p>

<ul>
<li>Variables spring into existence when they are first assigned to.</li>

<li>It is not an error to assign a value of different type to an existing
variable. (Currently, we only know of one type, but more types are waiting for
us)</li>

<li>Using a undefined variable on the right-hand side of an assignment causes
an error.</li>
</ul>

<h2><a name="structured data">Structured Data</a></h2>

<p>Until now we have not exploited where computers are really good at:
repetitive work.</p>

<h3><a name="vectors">Vectors</a></h3>

<p>Say we got a long receipt from the grocery store. [Your ad here!]  How can
we get the VAT in Dollars on each item given the gross amount and the VAT rate
in percent? The formula</p>

<pre>
            vat_percent / 100
    vat = --------------------- * gross_amount
          1 + vat_percent / 100
</pre>

<p>is trivial, but we want to save us repeated typing.</p>

<p>The list of all gross amounts in the receipt forms what numerical programs
call a <em>vector</em>. Vectors are built from values by enclosing these
values in square brackets and separating them with commas like this:</p>

<pre>
    octave:1&gt; gross = [1.49, 4.98, 0.79, 5.49, 0.96, 0.96, 0.96, 0.96]
    gross =
</pre>

<pre>
      1.49000  4.98000  0.79000  5.49000  0.96000  0.96000  0.96000  0.96000
</pre>

<p>The vector is built from left to right using our supplied numbers in the
same order that we enter them.</p>

<p>Wouldn't it be wonderful if we simply wrote: <code>gross *
(vat_percent/100) / (1 + vat_percent/100)</code> and get the VAT of each item?
It really is that simple.</p>

<pre>
    octave:2&gt; vat_percent = 7
    vat_percent = 7
    octave:3&gt; a = (vat_percent/100) / (1 + vat_percent/100)
    a = 0.065421
    octave:4&gt; vat = a * gross
    vat =
</pre>

<pre>
      0.097477  0.325794  0.051682  0.359159  0.062804  0.062804  0.062804  0.062804
</pre>

<p>Wow -- it works! For the first time we have really gained convenience
and expressiveness: a single multiplication sign performs eight
multiplications in a row.</p>

<p>What has happened? <code>vat_percent</code> is a single value, which is
called <em>scalar</em> in numerics to distinguish it from vectors. Well, if
<code>vat_percent</code> is a scalar, then <code>vat_percent/100</code>,
<code>1 + vat_percent/100</code>, and <code>a</code> are scalars, too.
Finally, scalar&nbsp;<code>a</code> must be multiplied with vector&nbsp;<code>
gross</code>. What we wanted and what happened was that <code>a</code> was
multiplied in turn with every element of <code>gross</code>. This holds for
every operator, not only multiplication! In general</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>vector</em>&nbsp;<em>
op</em>&nbsp;&nbsp;<em>scalar</em></p>

<p>and</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<em>scalar</em>&nbsp;<em>
op</em>&nbsp;&nbsp;<em>vector</em></p>

<p>apply <em>scalar</em> to every element in <em>vector</em> according to
operation <em>op</em>. In our example, this is as if we had written the
following</p>

<pre>
    vat(1) = a * gross(1)
    vat(2) = a * gross(2)
    ...
    vat(8) = a * gross(8)
</pre>

<p>where we have introduced a new piece of syntax: vector indexing. Each
element (a scalar) of a vector can be accessed by its <em>index</em>, which is
the number of it's place in the vector. The index is written in parenthesis
after the vector. For example, to get the second element in <code>
gross</code>, we write</p>

<pre>
    octave:5&gt; gross(2)
    ans = 4.9800
</pre>

<p>Elements in vectors can be assigned to with the same syntax. Just place the
indexed vector to the left of the assignment sign, for example, <code>gross(2)
= 5.12</code>.</p>

<p>What else can be thought of as a vector of numbers besides our receipt? Any
series of values! Most of the time the values will be related, like the
temperature measured each day at 8am, the diameters of a batch of metal rods,
the velocities of all westbound traffic across Buffalo Street at the corner of
West Clinton Street on Wednesday April&nbsp;18, 2001. As we are living in the
Digital Age, many more series of data fit the notion of a vector: every piece
of music on a CD is a vector of sound amplitudes and the indices mark discrete
moments in time.</p>

<p><strong>Details</strong></p>

<ul>
<li>Mathematically speaking what we call vectors here are tuples.</li>

<li>Most built-in functions, for example <code>sin</code>, can be used on
vectors. 

<pre>
    v = [0.12, 0.89, 0.78, 0.10]
    sin(v)
</pre>

<p>or</p>

<pre>
    sin([0.12, 0.89, 0.78, 0.10])
</pre>
</li>

<li>Vectors do not have to be built from scalars; more than one vector can be
catenated with the same syntax. Furthermore, the elements used in the
definition of the vector do not have to be literal numbers, but can be
arbitrary expressions, which again yield scalars or vectors.</li>
</ul>

<p><strong>Differences</strong></p>

<ul>
<li>Tela uses a different syntax for vector construction, which resembles
Scheme or Smalltalk: The vector is surrounded by parentheses which are
preceded by a sharp sign; for example: <code>gross = #(1.49, 4.98, ...,
0.96)</code>.</li>

<li>Tela uses a different syntax for vector indexing, which resembles Pascal.
The index is enclosed in square brackets; for example: <code>gross[2]</code>.
Warning for C programmers: Though the square brackets look like C, the lowest
index always is 1.</li>
</ul>


<h2>Next Month</h2>

<ul>
<li>Matrices</li>

<li>User defined functions</li>

<li>Flow control statements</li>

<li>Input and output</li>
</ul>





<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Christoph Spiel</H4>
<EM>Chris runs an Open Source Software consulting company in Upper Bavaria/Germany.
Despite being trained as a physicist -- he holds a PhD in physics from Munich
University of Technology -- his main interests revolve around numerics,
heterogenous programming environments, and software engineering.  He can be
reached at 
<A
HREF="mailto:cspiel@hammersmith-consulting.com">cspiel@hammersmith-consulting.com</A>.</EM>

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

<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P --> 
<H5 ALIGN=center>

Copyright &copy; 2001, Christoph Spiel.<BR>
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 69 of <i>Linux Gazette</i>, August 2001</H5>
<!-- *** END copyright *** -->


<H4 ALIGN="center">
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <hr> <P> 

<H1><font color="maroon">The Back Page</font></H1>

<ul>
<li><a HREF="#wacko">Wacko Topic of the Month</a>
<li><a HREF="#nottag">Not The Answer Gang</a>
<li><a HREF="#spam">World of Spam</a>
</ul>

<a name="wacko"></a>
<P> <hr> <P> 
<!--====================================================================-->

<center><H3><font color="maroon">Wacko Topic of the Month</font></H3></center>

<P> <hr> <P> 
<!--====================================================================-->

<FONT COLOR="purple">
[Ben] O'course, "linux" _could_ just be another type of rhubard... &lt;sic&lt;
*that* would explain some things. :)
</FONT>




<a name="nottag"></a>
<P> <hr> <P> 
<!--====================================================================-->

<center><H3><font color="maroon">Not The Answer Gang</font></H3></center>

<P> <HR> <P> 
<!--======================================================================-->
<P>
<H3 ALIGN="center">Homework assignment: reading directions</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Iron
</strong></FONT></p>

<STRONG>
question 1. using the man page on a linux work station identify four flags that 
can be supplied to the shutdown command . giving the description of each flag.

<P> question 2. using the man page on linux work station find out what three 
options can be used with the Is command .include a brief descrption of how the 
output will be formatted.
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron]

It says right in the question what to do.  Which part of "using the man page" do
you not understand?

<P> But here's a hint: there is no 'Is' command.  Do you mean 'ls'?  But it has a lot more than
three options.

<HR NOSHADE WIDTH="40%" ALIGN="center"> <!-- ************************************** -->

<H3 ALIGN="center">Homework assignment: American colonists</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Frank Rodolf, Heather
Stern, Iron and Huibert Alblas
</strong></FONT></p>

<STRONG>
1 question

<P> what methods did colonists use to protest actions by parliament between 1765 
and 1775
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Frank]

Hmm... Lets see if a European can answer that...

<P> My first guess was they dropped penguins in the parliamentary buildings. I
don't think that is correct though.

<P> I guess you did not realize you were sending this question to a list that is
about helping people with problems with Linux, a computer operating system,
not a homework help line. :)

<P> You might go to a search engine - www.google.com might be a good choice, and
search for (for instance):

               rebellion 1765-1775


<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather]

We (The Answer Gang) 
are not a study group. Most especially not a USA 
History 101 study group.

<P> The only way you could have found us is because we: 
<OL>
<LI> regularly advise people asking us questions that are
   poorly phrased to "do their homework first".
<LI> advise people who send us pieces of their computing
   exams in college that they can ask us these things,
   but it's no substitute for doing their homework. We
   then welcome them to read the rest of the Gazette.
</OL>

<P> Ask instead:

<H4>Q.</H4>
What methods did high school and college students use 
to study the late 1700s before the internet promised
them a fast answer to everything?

<H4>A.</H4> 
Books.  There is probably a library near you.  Failing 
that the textbook that was suggested by your professor
may have the answer in it, or a bibliography leading 
to more useful books.  Reading such books and thereby
gaining an understanding of the question and its 
answers... there may be many... is called "research"
and you can probably do an internet search on any 
buzzwords you find that way.

<P> Good luck in your quest.  And your quizzes.


<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron]

The Boston tea party.

<P> That inspired the Silicon Valley tea party some 200 years later.
<A HREF="http://www.svlug.org/events/tea-party-199811.shtml">
http://www.svlug.org/events/tea-party-199811.shtml</A>


<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Halb]

Nope, actualy the colonist were sick and tired from the English trying
to impose somekind off copyrightlisencefees and taxes on
software,mp3,linux,_stamps_,and everything but the kitchensink.

<P> The colonist reacted in not using M$-windows anymore and burning some
MP3 cd's.

<P> Get the real story on:
<A HREF="http://www.britannica.com/eb/article?euq187&tocid=0">
http://www.britannica.com/eb/article?euq187&tocid=0</A>

<P> This Brittanica thing is quite good, I wish it had been there back then
when I was supposed to do my history homework.....


<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron]
Never mind the irony of looking up the American Revolution in a British
encyclopedia!





<HR NOSHADE WIDTH="40%" ALIGN="center"> <!-- ************************************** -->

<H3 ALIGN="center">Homework assignment: modernizing an office</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Heather Stern
</strong></FONT></p>

<STRONG>
respected sir;(to whom it may concern)
i have visited ur webpage
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather]
You may have visited them, but you haven't read them... or you'd know we
don't answer for the operating systems you have asked about.  Or else you
don't mind taking a few flames, because you hope there will be a useful
tidbit anyway.  If that's so, please read onward.

<P>
<STRONG>
ir i am student of IT and want ur help in solving my college assignment, as 
it is tecnically advanced ur i think u can give me help.
points of the asssignments are;
</STRONG>

<P>
With a certain amount of rolling our eyes towards the heavens... who told
you to mail us?

If you just found us in some search engine, that would be because the 
buzzword "homework" is part of the commonly used phrases here:

<UL>
<LI> SO you have some homework to do.
<LI> Trying to get us to do your homework, eh?
</UL>

When we answer these sorts of questions it is nearly always with some 
better places to look.  The 
<A HREF="http://www.linuxdoc.org/">Linux Documentation Project</A>, for
instance. 

<P> Shall we send a carbon copy of this message to your professor, too?

<P> I think you can stand to read the back issues of the Linux Gazette in some
detail.  This is a very old practice in schools called "research".  I've
heard that some people get better answers from technical forums when they
try to do some of it before just dumping their take-home exam in someone
else's lap.

<P>
<STRONG>
The company is tradionalist in information privacy, security, and the 
applications of new technologies: so

<P> 1)if i am doing job in World computer inc.and i have to upgrade the system 
into modern arena
</STRONG>

<P> Can't "up" grade until you know what you want it to do.  If it is already
doing its job well, "up" grading it is a waste of your time, and annoys 
the users.

<P>
<STRONG>
Q1)from security point of view ...
</STRONG>

<P> To quote another member of The Answer Gang:
<blockquote>
	"Security is the enforcement of policy.  First you must set 
	 policy, then you can try to enforce it."
</blockquote>

<P> Not all security policies are about computers - for those, there is only
a slight amount software can do. 

<P>
<STRONG>
... which software is better Sun solaris or Windows NT.and which of them
can better ...
</STRONG>

<P> can [verb] better?
We don't care which of those two is better - FOR WHAT? - this is the 
<EM>LINUX</EM> Gazette.

<P>
<STRONG>
...in the environment of data processsing deapartmant.
</STRONG>

<P> I hope you would better know the context of a data processing department
than I would, because those aren't the kind of sites I work with most.  I
have no idea if COBOL exists for either one.

<P> But you might try Celeste Stokely's home page, it has much more general
UNIX related information.  And some humor.

<P>
<STRONG>
so plz give me strengths and of the software u recommend----?
</STRONG>

<P> Yes, if you're used to Sun versions of UNIX, try Slackware as your Linux
distribution.  It's very "BSDish" which means some of its commands may be
more comfortable to use.  KDE or Openlook window managers might resemble
the default X interfaces found on Suns.  And you'll need Samba to talk to 
those NT domains... 

<P> Oh what the heck, here's a bonus tip: Samba works on Solaris too, so you
can have that Solaris box talk to NT boxen.  You could use *both*...

<P>
<STRONG>
sir i would be very gr8ful to u if u give me some suggestions as soon 
possible because i have to submit this assignment after 2 days.
</STRONG>

<P> The Answer Gang does not promise anybody any answer at all, timely or
otherwise.  If we do, we can publish them on the Linux Gazette website.  
THE ANSWERS WILL BE ABOUT LINUX.  Tell your friends we are not a college 
study group.



<HR NOSHADE WIDTH="40%" ALIGN="center"> <!-- ************************************** -->

<H3 ALIGN="center">Loans</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Ben Okopnik
</strong></FONT></p>

<STRONG>
Dear Sir:
Please send infor on how to apply for a student loan.
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben]

<OL>
<LI> Get the paperwork.
<LI> Using a #2 pencil, fill it out.
<LI> Submit it to the proper agency.
</OL>

<P> Hint: If you don't learn to spell the word "information" properly, you  
won't be able to apply for a number of the available courses, 
especially in the field of computing. <EM>Verbum sapienti</EM>, eh?




<HR NOSHADE WIDTH="40%" ALIGN="center"> <!-- ************************************** -->

<H3 ALIGN="center">Pagers</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Heather Stern
</strong></FONT></p>

<STRONG>
I need some basic information on how pagers work. I would appreciate it if you 
could help me out by showing me some links on the related subject, or by mailing 
me any diagram or .pdf file containig any information about it. Thanks a lot.
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather]

They work just like cellphones, except that they don't eat as much, so 
when they are on their lunch break, they get to hang out by the coffee
for a bit longer.  They like that because they can catch the local buzz.

<P> Honestly, the reason they don't eat as much is usually because the cell
phones regularly "ping" their cell site to make sure they don't have
to negotiate a handoff in order to keep listening, while pagers are
usally passive and they get whatever signal they get.  So they only 
use a tiny amount of juice to remember messages they already recieved,
and to ding or buzz or whatever it is they do.  

<P> Two way pagers may act more like cellphones, and some cellphones are
definitely pagers too, so beyond this, you need to hit the web searching
on the model number.  Some even let you web browse but even there, you 
are still not close to Linux.  See the search engines, using the keyword
"WAP" for more about that stuff.

<P> Try "how pagers work" in google?



<HR NOSHADE WIDTH="40%" ALIGN="center"> <!-- ************************************** -->

<H3 ALIGN="center">The TAG skirmish</H3>

<p align="right"><FONT COLOR="#000000"><strong>Answered By Ben Okopnik, Heather
Stern, Jim Dennis and Iron
</strong></FONT></p>

Sudhakar An asked:
<STRONG>
Gazette's July issue was pretty interesting. Jim I
assume you literally had a quarrel with Ben heh?
</STRONG></P>

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben]
Yeah... he got in a fairly good lick with that bullwhip, but I'm pretty
fast with the nunchucks. We'll both be out of the hospital in no time at
all; the No-Holds Barred Smackdown rematch is already sold out, we're
both making a fortune on the t-shirts and the pre-printed mousepads, and
the crowds are screaming for blood.

<P> I've *heard* that there are people that can disagree and remain 
friends... but I'm sure that it's a myth; "Death before Dishonor", I 
always say.

<P> &lt;laugh&gt; I'm _very_ interested in how you see The Answer Gang, 
Sudhakar. You must have quite a colorful imagination.

<P>
<STRONG>
ps: Cool it Jim
</STRONG>

<P> Hey, Jim *is* cool. Just because we try to kill each other in the ring 
doesn't mean we can't be the best of friends at other times, right?

<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather] 
Hey, I thought we agreed, no mousepads unless you send a few to his Mom...

<P>
<STRONG>
But my problem started when I enabled services like
ftp,telnet, ssh , .... under xinetd.
</STRONG>

<P>
<IMG SRC="../gx/denni