File: issue18.html

package info (click to toggle)
lg-issue18 4-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,928 kB
  • ctags: 148
  • sloc: makefile: 36; sh: 4
file content (13440 lines) | stat: -rw-r--r-- 531,762 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <HTML>
<HEAD>
<TITLE> Linux Gazette Front Page </TITLE>
</HEAD>

<BODY BGCOLOR="#EEE1CC" TEXT="#000000" LINK="#0000FF" VLINK="#0020F0"
ALINK="#FF0000" >
<center><H2>
<IMG SRC="../gx/banner.gif" 
ALT="Linux Gazette... making Linux just a little more fun!">
</H2>

<H5>Copyright &copy; 1996-97 Specialized Systems Consultants, Inc.
<A HREF="mailto:linux@ssc.com"><I>linux@ssc.com</I></A></H5>
</center>

<P> <HR> <P> 
<!--==================================================================-->
<center>
<H1>Welcome to Linux Gazette!<img src="../gx/tm.gif" alt="(tm)"></H1>
</center>
<P> 
Sponsored by:
<center>
<H1><A HREF="http://www.infomagic.com/"><img src=../gx/infologo.gif alt="InfoMagic"></A></H1>
</center> 
<P> 
Our sponsors make financial contributions toward the costs of
publishing <I>Linux Gazette</I>. If you would like to become a sponsor
of <I>LG</I>, e-mail us at <A
HREF="mailto:sponsor@ssc.com">sponsor@ssc.com</A>.


<P> <HR> <P> 

<P> <HR> <P>
<!--=================================================================-->
<center><H1>Table of Contents <BR> June 1997 Issue #18</H1></center>

<P> <HR> <P>
<table><tr>
<td rowspan=4>
<UL>
<LI><A HREF="../lg_frontpage.html">The Front Page</A> 
<LI><A HREF="./lg_mail18.html">The MailBag</A> 
<ul>
<li><a HREF="./lg_mail18.html#help">Help Wanted -- Article Ideas</a>
<li><a HREF="./lg_mail18.html#gen">General Mail</a>
</ul>
<LI><A HREF="./lg_tips18.html">More 2 Cent Tips</A>
<ul>
<li><a HREF="./lg_tips18.html#print">A Fast and Simple Printing Tip</a>
<li><a HREF="./lg_tips18.html#grep">Grepping Files ina Directory Tree</a>
<li><a HREF="./lg_tips18.html#virge">ViRGE Chipset</a>
<li><a HREF="./lg_tips18.html#multip">Maintaining Multiple X Sessions</a>
<li><a HREF="./lg_tips18.html#auto">Automatic File Transfers</a>
<li><a HREF="./lg_tips18.html#news">Setting Up Newsgroups</a>
<li><a HREF="./lg_tips18.html#color">Color Application in X</a>
<li><a HREF="./lg_tips18.html#xcolor">X With 256 Colors</a>
<li><a HREF="./lg_tips18.html#video">Video Cards on the S3/ViRGE</a>
<li><a HREF="./lg_tips18.html#line">C Source With Line Numbers</a>
<li><a HREF="./lg_tips18.html#ncftp">ncftp Vs. ftplib</a>
<li><a HREF="./lg_tips18.html#names">Domain & Dynamic IP Names</a>
<li><a HREF="./lg_tips18.html#netcfg">netcfg Tool</a>
<li><a HREF="./lg_tips18.html#links">Putting Links to Your Dynamic IP</a>
<li><a HREF="./lg_tips18.html#disk">Hard Disk Duplication</a>
<li><a HREF="./lg_tips18.html#untar">Untar and Unzip</a>
</ul>
<LI><A HREF="./lg_bytes18.html">News Bytes</A>  
<ul>
<li><a HREF="./lg_bytes18.html#general">News in General</a>
<li><a HREF="./lg_bytes18.html#software">Software Announcements</a>
</ul>
<LI><A HREF="./lg_answer18.html">The Answer Guy</A>, by James T. Dennis
<ul>
<li><a HREF="./lg_answer18.html#network">Networking Problems</a>
<li><a HREF="./lg_answer18.html#fetch">Fetchmail</a>
<li><a HREF="./lg_answer18.html#procmail">Procmail</a>
<li><a HREF="./lg_answer18.html#tcl">Tcl/tlk Dependencies</a>
<li><a HREF="./lg_answer18.html#var">/var/log/messages</a>
<li><a HREF="./lg_answer18.html#show">OS Showdown</a>
<li><a HREF="./lg_answer18.html#adding">Adding Linux to a DEC XLT-366</a>
<li><a HREF="./lg_answer18.html#config">Configuration Problems of a Soundcard</a>
<li><a HREF="./lg_answer18.html#proc">Procmail Idea and Question</a>
<li><a HREF="./lg_answer18.html#uucp">UUCP/Linux on Caldera</a>
<li><a HREF="./lg_answer18.html#active">ActiveX For Linux</a>
<li><a HREF="./lg_answer18.html#pack">What Packages Do I Need?</a>
<li><a HREF="./lg_answer18.html#users">Users And Mounted Disks</a>
<li><a HREF="./lg_answer18.html#map">[q] Map Left Arrow to Backspace</a>
<li><a HREF="./lg_answer18.html#pull">Adding Programs to Pull Down Menus</a>
<li><a HREF="./lg_answer18.html#nt">Linux and NT</a>
<li><a HREF="./lg_answer18.html#serv">pcmcia 28.8 Modems and Linux 1.2.13
Internet Servers</a>
</ul>
<LI><A HREF="./bash.html">bash Strng Manipulations</a>, by Jim Dennis
<LI><A HREF="./gnu.html">Brave GNU World</A>, by Michael Stutz
<LI><A HREF="./building.html">Building Your Linux Computer Yourself</A>, by
Josh Turial
<LI><A HREF="./tmp.html">Cleaning Up Your /tmp, The Safe Way</A>, by Guy
Geens
<LI><A HREF="./clueless.html">Clueless at the Prompt: A Column for
New Users</A>, by Mike List
<LI><A HREF="./disk_hog.html">DiskHog: Using Perl and the WWW to Track
System Disk Usage</a>, by Ivan Griffin
<LI><A HREF="./dosemu.html">dosemu & MIDI: A User's Report</A>, by Dave Phillips
<LI><A HREF="./gm.html">Graphics Muse</A>, by Michael J. Hammel
<LI><A HREF="./bomb.html">New Release Reviews</A>, by Larry Ayers
<UL>
<LI><A HREF="./bomb.html">Bomb: An Interactive Image Generator</A>   
<LI><A HREF="./e2compr.html">On-The_Fly Disk Compression</A>
<LI><A HREF="./xlock.html">Xlock and Xlockmore</A>
</UL>
<LI><A HREF="./redhat.html">Red Hat Linux: Linux Installation and Getting
Started</A>, by Henry Pierce
<LI><A HREF="./sybase.html">SQL Server and Linux: No Ancient Heavenly
Connections, But...</A>, by Brian Jepson
<LI><A HREF="./wkndmech.html">The Weekend Mechanic</A>, by John M. Fisk
<LI><A HREF="./lg_backpage18.html">The Back Page</A> 
<ul>
<li><a HREF="./lg_backpage18.html#authors">About This Month's Authors</a>
<li><a HREF="./lg_backpage18.html#notlinux">Not Linux</a>
</UL>
</UL>
</td>
<td align=center>
<A HREF="lg_bytes18.html">
<IMG SRC="../gx/alepeng.gif" border=0 alt="">
<i>A.L.S.</i>
</a>
</td>
</tr><tr>
<td align=center>
<A HREF="lg_answer18.html"> 
<img src="../gx/wizard2.gif" border=0 alt="">
</a>
<A HREF="lg_answer18.html"><i>The Answer Guy</i></a>  
</td>
</tr><tr>
<td align=center>
<A HREF="gm.html">
<IMG SRC="../gx/hammel/banner-3.gif" border=0 alt="">
</a>
</td>
</tr><tr>
<td align=center>
<!--<A HREF="wkndmech.html"> -->
<img src="../gx/fisk/mechanic.gif" border=0 alt="">
<A HREF="wkndmech.html"><I>The Weekend Mechanic</I></a>
</td>
</tr><tr>
</table> 

<P> <HR><P> 
<!--=============================================================-->
<A HREF="./issue18.txt">TWDT 1 (text)</A><BR>
<A HREF="./issue18.html">TWDT 2 (HTML)</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.
 
<!--=============================================================-->
<P> <HR><P> 
Got any <I>great</I> ideas for improvements!  Send your
<A HREF="mailto:gazette@ssc.com">comments, criticisms, suggestions
and ideas.</A>

<P><hr><p>
This page written and maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>

<H4>&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;</H4>  
<HR> 
<center>
<table width="100%" cellpadding=7><tr><td>
<H2><a NAME="mail"><IMG SRC="../gx/mailbox.gif" ALIGN=MIDDLE ALT=" ">
The Mailbag!</a> </H2>
Write the Gazette at <A HREF="mailto:gazette@ssc.com"> gazette@ssc.com</A>
</td><td>
<H3>Contents:</H3>
<ul>
<li><a HREF="./lg_mail18.html#help">Help Wanted -- Article Ideas</a>
<li><a HREF="./lg_mail18.html#gen">General Mail</a>
</ul>
</td></tr></table>
</center>

<a name="help"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3> Help Wanted -- Article Ideas </H3></center>

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Wed May 28 11:16:14 1997<br>
Subject: Help wanted: 2.1.40 will not boot<br>
From: Duncan Simpson, <a href="mailto:D.P.Simpson@ecs.soton.ac.uk">D.P.Simpson@ecs.soton.ac.uk</a><br>

<p>2.1.40 dies after displaying the message
Checking whether the WP bit is honored even in supervisor mode...

<p>A few prints hacked in later reveals that in enters the page
fault handler, detects the bootup test and gets to the end of the
C (do_fault in traps.c). However it never gets back to continue
booting---exactly where it gets lost is obscure.

<p>Anyone have any ideas/fixes?

<p>Duncan


<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Fri, 16 May 1997 16:17:47 -0400<br>
Subject: CD-ROMs<br>
From: James S Humphrye, <a href="mailto:humpjs@aur.alcatel.com">humpjs@aur.alcatel.com</a>

<p>I just found the LG today, and I have read most of the back issues...
Great job so far! Lots of really useful info in here!

<p>Now to my "problem". I installed Slackware 3.0, which went just fine.
I had XFree86 and all the goodies working perfectly (no, really, it all
worked just great!) Then I upgraded my machine to a P150, and installed
a Trident 9660) PCI video card. Then the X server wasn't happy any more.
So...I upgraded the kernel sources to 2.0.29, got all the required
upgrades for GCC, etc. I built a new kernel, and it was up and
running...sort of.

<p>Despite having compiled in support for both IDE and SCSI CDROMs, I can
only get the IDE one to work. I have edited the rc.* scripts, launched
kerneld, run depmod -s, and all the other things the docs recommend.

<p>I have rebuilt the kernel to zdisk about 25 times, trying different
combinations of built-in and module support, all to no avail. When the 
system boots, the scsi host adapter is not detected (it is an AHA1521,
located on a SB16/SCSI-2 sound card, and it worked fine under 1.2.13 &
1.3.18 kernels)  When the aha152x module tries to load, it says it does
not recognize scd0 as a block device. If I try to mount the SCSI unit,
it says "init_module: device or resource busy". Any advice would be
welcome. What I want is to at least be able to use the SCSI CDROM under
Linux, or better yet, both it and the IDE CDROM...

<p>There are also a bunch of messages generated by depmod about unresolved
symbols that I don't understand, as well as a bunch of lines generated
by modprobe that say "cannot locate block-major-XX" (XX is a major
number, and the ones I see are for devices not installed or supported by
the kernel) The second group of messages may be unimportant, but I don't
know..

<p>Thanks in advance,
Steve

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Mon, 26 May 1997 12:18:40 -0700<br>
Subject: Need Help From Linux Gazette<br>
From: Scott L. Colantonio, <a href="mailto:scott@burbank.k12.ca.us">scott@burbank.k12.ca.us</a>

<p>Hi...

We have Linux boxes located at the remote schools and the district
office.  All remote school clients (Mac, WinNT, Linux) attempting to
access the district office Linux boxes experience a 75 second delay on
each transaction.  On the other hand, we do not experience any delay
when district office clients (Mac, WinNT, Linux) attempt to access the
remote school Linux boxes.  The delay began when we moved all the remote
school clients to a separate network (and different ISP) than the
district office servers.

<p>To provide a map, consider this:

<p>remote school &lt;-&gt; city hall
city hall &lt;-&gt; Internet
Internet &lt;-&gt; district office

<p>We experience a 75 second delay:  
remote school client -&gt; city hall -&gt; Internet -&gt; District office Linux
box

<p>We do not experience any delay:
remote school client -&gt; city hall -&gt; Internet

<p>We do not experience any delay:
city hall -&gt; Internet -&gt; District office Linux box

<p>We do not experience any delay:
District office client -&gt; Internet -&gt; city hall -&gt; remote school Linux
box

...

<p>The remote schools use a Linux box at City Hall for the DNS.

<p>In effect, the problem is isolated to the remote school clients
connecting to the district office Linux boxes, just one hop away from
city hall.

<p>As a result, the mail server is now a 75 second delay away from all
educators in our district.  Our Cisco reps do not think, after extensive
tests, that this is a router configuration problem.

<p>I setup a Microsoft Personal web server at the district office to test
if the delay was universal to our route.  Unfortunately, there was no
delay when remote school clients attempted to access the MS web server.

<p>Is this a known Linux network problem? Why is this a one-way problem?

<p>Any help would be greatly appreciated.

<p>Scott L. Colantonio
<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Thu, 1 May 1997 16:16:58 -0700<br>
Subject: inetd<br> 
From: Toby Reed, <a href="mailto:toby@eskimo.com">toby@eskimo.com</a> 

<p>I have a question for the inetd buffs out there...perhaps something like
xinetd or a newer version has the capability to do the job, but what I
want is this:

<pre>normal behavior:
connect to inetd
look in /etc/inetd.conf
run program

enhanced behavior:
connect to inetd
find out what hostname used to connect to inetd
look in /etc/inetd.conf.hostname if it exists, if not, use /etc/inetd.conf
run program listed in /etc/inetd.conf
</pre>
<p>So if dork1.bob.com has the same IP address as dork2.bob.com, inetd would
still be able to distinguish between them. In other words, similar to the
VirtualHost directive in Apache that allows you to make virtual hosts that
have the same IP address, except that with inetd.

<p>Or, depending on the hostname used to access inetd, inetd could forward
the request to another address.

<p>This would be extremely useful in many limited-budget cases where a
multitude of IPs are not available. For example, in combination with IP
masquerading, would allow a lan host to be accessed transparently both
ways on all ports, so long as it was accessed by a hostname, not an IP
address. No port masquerading or proxies would be required unless the
service needed was very very special. Even non-inetd httpd servers would
work with this kind of redirection because the forwarded connection would
still be handled by httpd on the machine with the masqueraded machine.

<p>Anyone know if this already exists or want to add to it so I can suggest
it to the inetd group?

<p>-Toby

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">
Date: Thu, 8 May 1997 08:05:03 -0700 (PDT)<br>
Subject: S3 Virge Video Board<br>
From: Tim Gray & Family, <a href="mailto:timgray@lambdanet.com">timgray@lambdanet.com</a>

<p>I have a Linux box using a S3 Virge video board with 4 meg Ram.  The
problem is that X refuses to start with no other color depth than 8bpp.  As
X is annoying at 8bpp (Color flashing on every window and several programs
complain about no free colors) Is there a way to FORCE X to start in 16
bpp?   using the command ....   startx -bpp 16 does not work and erasing
the 8bpp entry in the XF86Config file causes X to self destruct. Even
changing the Depth from 8 to 16 causes errors..  Anyone have experience
with this X server?



<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">
Date: Fri, 9 May 1997 09:20:05<br>
Subject: Linux and NT<br>
From: Greg McNichol, <a href="mailto:mcnichol@mcs.net">mcnichol@mcs.net</a>

<p>I am new to LINUX (and NT 4.0 for that matter) and would like any and all 
information I can get my hands on regarding the dual-boot issue. Any help 
is appreciated.

<p>--Greg

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">
Date: Wed, 14 May 1997 00:02:04<br>
Subject: Help with CD-ROM <br>
From: Ralph, <a href="mailto:ralphs@kyrandia.com">ralphs@kyrandia.com</a><br>

<p>I'm relatively new to Linux...not a coder or anything like that...just
like messing with new things....anyways I have been running Linux for
about a year now and love the H*** out of it. About two weeks ago I was
testing some HD's I picked up used with this nifty plug and play bios I
got and when I went to restore the system back to normal and now my
CD-Rom does not work in Linux...I booted back into 95 and it still
worked so I tried forcing the darn thing nothing, nada , zero. I booted
with the install disks and still no CD-Rom...its on the 2nd eide set for
cable select I tried removing the 2nd hard drive and moving it there
still nothing....can anyone give me some more suggestions to try?

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Thu, 15 May 1997 12:40:27 -0700<br>
Subject: Programming in C++<br>
From: Chris Walker, <a href="mailto:crwalker@cc.weber.edu">crwalker@cc.weber.edu</a><br>

<p>Hi, I'm Chris Walker.  I'm an undergrad computer science major at Weber
State University. During my object oriented programming class Linux was
brought up. The question was asked "if c++ is so good for programs that
are spread over different files or machines, why are Linux and Unix
programmed in c not c++?"
I was hoping that you may have an answer.  Has anyone converted Linux
source to c++, would there be any advantages/disadvantages?

<p>Thanks,

Chris Walker

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Thu, 15 May 1997 11:27:17 -0700 (PDT)<br>
Subject: Programming Serial Ports<br>
From: Celestino Rey Lopez, <a href="mailto:claude@idecnet.com">claude@idecnet.com</a><br>

<p>First of all congratulations for your good job in the Linux Gazette.
I'm interested in programming the serial ports in order to get data from other computers or devices. In other
Unixes it is possible, via ioctl, to ask the driver to inform a process with a signal every time a character is
ready in the port. For example, in HP-UX, the process receive a SIGIO signal.
In Linux SIGIO means input/output error. Do you know where can I get information about this matter? Is there
any books talking about that?

<p>Thanks in advance and thanks for providing the Linux community with lot of tricks, ideas and information about
this amazing operating system.

<p>Yours,

Celestino Rey Lopez.



<a name="gen"></a>
<P> <hr> <P> 
<!-- =================================================================== -->
<center><H3> General Mail </H3></center>

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date:Fri, 16 May 1997 10:53:18<br> 
Subject: Response to VGA-16 Server in LG Issue 17<br>
From: Andrew Vanderstock, <a href="mailto:Andrew.van.der.Stock@member.sage-au.org.au">Andrew.van.der.Stock@member.sage-au.org.au</a><br>

<p>I'll look into it, even though VGA_16 has a very short life. Yes, he is
correct, there isn't much in the way of testing dual headedness with a herc
card and VGA16, as both are getting quite long in the tooth. VGA_16
disappears in a few months to reappear as the argument -bpp 4 on most
display adapters. One bug fixer managed to re-enable Herc support in the
new source tree a while back, so there may be life there yet. 

<p>Also, there was one 2c issue that was a little out of whack in regards to
linear addressing. The Cirrus chipsets are not fabulous, but many people
have them built into their computers (laptops, HP PC's etc). 

<p>All I can suggest is that he try startx -- -bpp 16 and see if that works.
If it doesn't have a look at the release notes for his chipset. If all else
fails, report any XFree bugs to the bug report cgi on www.xfree86.org

<p>I'll ask the powers that be if I can write an article for you on XFree86
3.3, the next version of the current source tree, as it is due soon. How
many words are your articles generally?

<p>Andrew Vanderstock


<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Sat, 24 May 1997 01:32:29 -0700<br>
Subject: Secure Anonymous FTP setup mini-howto spotted, then lost<br>
From: Alan Bailward, <a href="mailto:ajb@direct.ca">ajb@direct.ca</a>

<p>I saw once on a friend of mines linux box, running Slackware 3.1, in
/usr/docs/faq/HOWTO/mini, a mini-howto on how to setup a secure anonymous
FTP server.  It detailed how to setup all the directories, permissions, and
so on, so you could upload, have permissions to write but not delete on
your /incoming, etc etc etc.  It looked like a great doc, but for the life
of me I can't find it!  I've looked on the slackware 3.2 cdrom, the 3.1
cdrom, searched all through the net, but to no avail.  As I am trying to
setup an anonymous ftp site now, this would be invaluable... I'd feel much
better reading it than 'chmod 777'ing all over the place :)

<p>If anyone has seen this document, or knows where it is, please let me know.
 Or even if there is another source of this type of information, I would
sure appreciate it sent to me at <a href="mailto:ajb@direct.ca">ajb@direct.ca</a>

<p>Thanks a lot, and keep on Linuxing!
<p>
alan

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Mon, 26 May 1997 13:21:20 +0800<br>
Subject: Tuning XFree86<br>
From: Soh Kam Yung, <a href="mailto:kysoh@ctlsg.creaf.com">kysoh@ctlsg.creaf.com</a>

<p>I've been reading Linux Gazette since day one and it has been great.
Keep up the good work.

<p>I've been seeing comments and letters in the Gazette from people who are
having trouble with their XFree86.  Well, here's a tip for those not satisfied
with the way their screen looks (offset to one side, too high/wide, etc.).

<p>While looking through the XFree86 web site for tips on how to tweak my
XF86 configuration, I noticed a reference to a program called xvidtune.
Not many people may have heard about it, but it is a program used to
tune your video modes.  Among its features include:
<ol>
<li>the ability to modify your graphics screen 'on-the-fly'.  You can
move the screen, strech/compress it vertically or horizontally and see
the results.

<li>it can generate a modeline of the current screen setting.  Just copy
it into the correct area of your XF86Config file and the next time you
start up the XFree86 server, the screen will come up the way you like it.
</ol>
<p>Just run xvidtune and have fun with it!  But be careful: as with XFree86
in general, it does not guarantee that the program will not burn your
monitor by generating invalid settings.  Fortunately, it has a quick
escape (press 'r' to restore your previous screen settings).
<p>
Regards,
--
Soh Kam Yung

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Fri, May 30 1997 12:34:23<br>
Subject: Certification and training courses for Linux<br> 
From: Harry Silver, <a href="mailto:hsilver@pyx.net">hsilver@pyx.net</a>

<p>I am currently on a mailing list for consultants for
Red Hat Linux. One of my suggestions to that list is
contained below. I truly hope as part of a broader
international initiative, Linux International will
pick up the ball on this one so as to ensure that
Linux generically will survive. I truly hope that
someone from your organization will follow up both
with myself and with the Red Hat consulting mailing
list as to a more generic Linux support effort in this 
area. All that would be required is gathering up the 
manuals from the older Unixware CNE course and 'porting'
them to Linux and creating an HTMLized version. This 
along with online testing could easily generate a reasonable 
revenue stream for the generic Linux  group involved.

<p>Respectfully,

<p>MY SUGGESTION:
About two years ago, Novell still had Unixware before
sending it over to the care of SCO. At the time Unix 
was under the stewardship of Novell, a Unixware CNE course
was developed. Since, Ray Noorda of Caldera and former CEO 
of Novell is also an avid supporter of Linux as well as the 
good folks at Red Hat and other distributions, rather than 
RE-INVENT the wheel so to speak, wouldn't it make more sense 
to pattern certification AFTER the Unixware CNE courses by 
'porting' the course to Linux GENERICALLY ? 

<p>Harley Silver

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Fri, 24 May 1996 11:39:25 +0200<br>
Subject: Duplicating a Linux Installed HD<br>
From: Dietmar Kling, <a href="mailto:kling@tao.de">kling@tao.de</a>

<p>Hello.

I did duplicate my Hard disk before you release this articles for it. A
friend of mine new to linux tried to do it, too using your instructions.
But we discovered, when he copied my root partition, that he couldn't
compile anything on his computer afterwards. A bug in libc.so.5.2.18
prevented his old 8 MB Machine from runnig make or gcc. it always
aborted with an error. After updating libc.so5.2.18 and running ldconfig
the problem was solved.

<p>We had a SuSe 4.0 installation.

<p>Dietmar


<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">


Date: Sat, 10 May 1997 16:09:29 +0200 (MET DST)<br>
Subject: Re: X Color Depth<br>
From: Roland Smith, <a href="mailto:rsmit06@ibm.net">rsmit06@ibm.net</a><br>

<p>In response to Michael J. Hammel's 2cent tip in issue #17: 
I disagree that a 16bit display displays less colors than a 8 bit display.
 
<p>Both kinds of displays use a colormap. A color value is nothing more than
an index into a color map, which is an array of red,green,blue triplets,
each 8 bits.
The amount of colors that can be shown simultaneously depends on the
graphics hardware.

<p>An 8bit display has an eight bit color value, so it can maximally have 256
different color values. The color map links these to 256 different
colors which can be displayed simultaneously. Each of these 256 colors can
be one of the 2^24 different colors possible with the 3*8 bits in each
colormap entry (or color cell, as it is called).

<p>A 16bit display has a sixteen bit color value, which can have 2^16=65536
different values. The colormap links these to 65535 different,
simultaneously visible, colors (out of 2^24 possible colors).
(actually it's a bit more difficult than this, but thats beyond the
 point).
 
<p>So both a 8 and 16 bit display can show 2^24=16.7*10^6 colors. The
difference lies in the number of colors they can show *at once*.

<p>Regards, Roland


<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">
Date: Fri, May 30 1997 13:24:35<br>
Subject: Using FTP as a shell-command with ftplib<br>
<p>From: Walter Harms, <a href="mailto:Walter.Harms@Informatik.Uni-Oldenburg.DE">Walter.Harms@Informatik.Uni-Oldenburg.DE</a>
...

<p>Any drawbacks?
Of course, for any ftp session you need a user/paswdr. I copy into public
area using anonymous/email@ others >will need to surly a password at login,
what is not
very useful for regular jobs or you have to use some kind of public login
but still I think it's easier and >better to use than the r-cmds. 

<p>-- walter 


<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

<p>Date: Mon, 12 May 1997 17:05:09 -0700<br>
Subject: RE: Using ftp Commands in Shellscript<br>
From: James Boorn, <a href="mailto:jboorn@optum.com">jboorn@optum.com</a><br>

<p>I recommend you depend on .netrc for ftp usernames and passwords for
automated ftp.

<p>James Boorn



<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Thu, 29 May 1997 09:09:35 -0500<br>
Subject: X limitation to 8 Bit Color (Response to Gary Masters)<br>
From: Omegaman, <a href="mailto:omegam@COMMUNIQUE.NET">omegam@COMMUNIQUE.NET</a><br>

<p><I>I read your question in Linux Gazette regarding an X limitation to 8 bit 
color when the system has more that 14 megs of RAM. Where did you find that
information? I ask because my system has 24 megs of RAM, and I run 16 bit
color all the time. One difference between our 
systems is that I am using a Diamond Stealth 64 video card.</I>

<p>Gary,
<p>Just caught this letter in Linux Gazette.  This limitation is
specific to Cirrus Logic cards, particularly those on the ISA bus and
some on VLB (ie. old systems -- like mine. Since you're using a
Diamond Stealth 64, you don't have this limitation.

<p>Full details are in the readme.cirrus file contained in the XFree86
Documentation.  Some cirrus owners may be able to overcome this
limitation.  See <a href="http://www.xfree86.org">http://xfree86.org</a>

<P> <HR> <P> 
<!--====================================================================-->
<IMG ALT=" " SRC="../gx/envelope.gif">

Date: Fri, May 30 1997 8:31:25<br>
Subject: Response to Gary Masters<br>
From: Ivan Griffin, <a href="mailto:Ivan.Griffin@ul.ie">Ivan
Griffin@ul.ie</a><br>

<I><p>From: Gary Masters <a href="mailto:gmasters@devcg.denver.co.us">gmasters@devcg.denver.co.us</a> 
<p>I read your question in Linux Gazette regarding an X limitation to 8 bit
color when the system has more than 14 megs of RAM. Where did you find
that information? I ask because my system has 24 megs of RAM, and I run
16 bit color all the time. One difference between our systems is that I
am using a Diamond Stealth 64 video card.</I> 

<p>XFree86 needs to be able to map video memory in at the end of physical
memory linearly. However, ISA machines cannot support greater than 16MB in
this fashion - so if you have 16 or greater MB or RAM, you cannot run
XFree86 in higher than 8 bit color.
<p>
Ivan




<P> <hr> <P> 
<!--================================================================-->
<center>Published in Linux Gazette Issue 18, June 1997</center>
<!--====================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A>
<A HREF="../index.html"><IMG SRC="../gx/homenew.gif" ALT="[ FRONT 
PAGE ]"></A> 
<A HREF="./lg_tips18.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P>
<h5>This page written and maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com">gazette@ssc.com</A><BR> 
Copyright &copy; 1997 Specialized Systems Consultants, Inc. </H5> 
<P> 
<!-- QUICK TIPS SECTION ==================================================  -->
<center>
<H1><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.gif">
More 2&#162; Tips!</A></H1> <BR>
Send Linux Tips and Tricks to <A HREF="mailto:gazette@ssc.com">
gazette@ssc.com
</A></center>

<p><hr><p>
<H3>Contents:</H3>
<ul>
<li><a HREF="./lg_tips18.html#print">A Fast and Simple Printing Tip</a>
<li><a HREF="./lg_tips18.html#grep">Grepping Files in a Directory Tree</a>
<li><a HREF="./lg_tips18.html#virge">ViRGE Chipset</a>
<li><a HREF="./lg_tips18.html#multip">Maintaining Multiple X Sessions</a>
<li><a HREF="./lg_tips18.html#auto">Automatic File Transfers</a>
<li><a HREF="./lg_tips18.html#news">Setting Up Newsgroups</a>
<li><a HREF="./lg_tips18.html#color">Color Application in X</a>
<li><a HREF="./lg_tips18.html#xcolor">X With 256 Colors</a>
<li><a HREF="./lg_tips18.html#video">Video Cards on the S3/ViRGE</a>
<li><a HREF="./lg_tips18.html#line">C Source With Line Numbers</a>
<li><a HREF="./lg_tips18.html#ncftp">ncftp Vs. ftplib</a>
<li><a HREF="./lg_tips18.html#names">Domain & Dynamic IP Names</a>
<li><a HREF="./lg_tips18.html#netcfg">netcfg Tool</a>
<li><a HREF="./lg_tips18.html#links">Putting Links to Your Dynamic IP</a>
<li><a HREF="./lg_tips18.html#disk">Hard Disk Duplication</a>
<li><a HREF="./lg_tips18.html#untar">Untar and Unzip</a>
</ul>

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

<a name="ftp"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Monitoring a ftp Download.
</H3>
<P> 

Date: Tue, 27 May 1997 09:57:20 -0400<br>
From: Bob Grabau <a href="mailto:bob_grabau@fmso.navy.mil">bob_grabau@fmso.navy.
mil</a>

<p>Here is a tip for monitoring a ftp download. in another virtual console
enter the following script:
<pre>
while :
do
clear
ls -l &lt;filename that you are downloading&gt;
sleep 1
done
</pre>
<p>This virtual console can be behind (if you are using X) any other window
and just showing a line of text. This will let you
know if your download is done or stalled. This will let you do other
things, like reading the Linux Gazette.
<p>When you type this in, you wll get a &gt; prompt after the first line and
continue until you enter the last line.
<p>
-- 
Bob Grabau

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

<a name="logging"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Logging In To X Tip
</H3>
<P> 

Date: Mon, 26 May 1997 10:17:12 -0500 (CDT)<br>
From: Tom Barron <a href="mailto:barron@usit.net">barron@usit.net</a><br>

<B>Xlogin.mini-howto</B>

<p>Several people regularly use my Linux system at home (an
assembled-from- components box containing a 133 Mhz Pentium, 2Gb of
disk, 32Mb of memory, running the Slackware distribution) -- my
step-son Stephen, who's learning to program and likes using X, my
younger step-son Michael, who likes the X screen-savers and games like
Doom, my wife Karen, who prefers the generic terminalness of the
un-X'd console, and myself -- I like to use X for doing software
development work since it lets me see several processes on the screen
at once.  I also like to keep an X screen saver running when no-one is
using the machine.  

<p>I didn't want to run
<a href="http://squirl.nightmare.com:5150/xdm(1)">xdm</a>
(an X-based login manager), since Karen
doesn't want to have to deal with X.  She wants to be at the console
when she logins in and not have to worry about where to click the mouse and
such.  But I wanted to have a simple way of getting into X when I
login without having to start it up manually.
<p>

Here's what I came up with:
<p>

<ul>
<li>In my .profile (my shell is bash), I put:
<pre>
if [ "$DISPLAY" = "" ]; then

   cal > ~/.month
   xinit .Xsession > /dev/null 2>&1
   clear
   if [ ! -f .noexit ]; then
      exit
   fi

else

   export TTY=`tty`
   export TTY=`expr "$TTY" : "/dev/tty\(.*\)"`
   export PS1="<$LOGNAME @ \h[$TTY]:\w> \n$ "
   export PATH=${PATH}:~/bin:.
   export EDITOR=emacs
   export WWW_HOME=file://localhost/home/tb/Lynx/lynx_bookmarks.html
   export DISPLAY

   alias cls="clear"
   alias dodo="$EDITOR ~/prj/dodo"
   alias e="$EDITOR"
   alias exit=". ~/bin/off"
   alias l="ls -l"
   alias lx="ls -x"
   alias minicom="minicom -m"
   alias pg=less
   alias pine="export DISPLAY=;'pine'"
   alias prj=". ~/bin/prj"
   alias profile="$EDITOR ~/.profile; . ~/.profile"

fi
</pre>
   When I first login, on the console, $DISPLAY is not yet set, so the
   first branch of the if statement takes effect and we start up X.
   When X terminates, we'll clear the screen and, unless the file
   .noexit exists, logout.  Running cal and storing the output in
   .month is in preparation for displaying a calender in a window
   under X.
<p>
<li>Once X comes up, $DISPLAY <strong>is</strong> set.  
My .Xsession file contains:
<pre>
:
xsetroot -solid black
fvwm &
oclock -geometry 75x75-0+0 &
xload -geometry 100x75+580+0 &
emacs -geometry -0-0 &
xterm -geometry 22x8+790+0 -e less ~/.month &
color_xterm -font 7x14 -ls -geometry +5-0 &
exec color_xterm -font 7x14 -ls -geometry +5+30 \
   -T "Type 'exit' in this window to leave X"
</pre>

   So when my color_xterms run, with -ls as an argument (which says to
   run a login shell), they run .profile again.  Only this time
   $DISPLAY is set, so they process the else half of the if, getting
   the environment variables and aliases I normally expect.

</ul>
 
<P> <hr> <P> 
<!--================================================================-->

<a name="xlock"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
xlock Tip
</H3>
<P> 

Date: Mon, 26 May 1997 10:14:12 -0500 (CDT)<br>
From: Tom Barron <a href="mailto:barron@usit.net">barron@usit.net</a>

<B>Xscreensaver.mini-howto</B>

<p>Several people regularly use my Linux system at home (an
assembled-from- components box containing a 133 Mhz Pentium, 2Gb of
disk, 32Mb of memory, running the Slackware distribution) -- my
step-son Stephen, who's learning to program and likes using X, my
younger step-son Michael, who likes the X screen-savers and games like
Doom, my wife Karen, who prefers the generic terminalness of the
un-X'd console, and myself -- I like to use X for doing software
development work since it lets me see several processes on the screen
at once.  I also like to keep an X screen saver running when no-one is
using the machine.  
<p> 

I didn't want to run
<a href="http://squirl.nightmare.com:5150/xdm(1)">xdm</a>
(an X-based login manager), since Karen
doesn't want to have to deal with X.  She wants to be at the console
when she logins in and not have to worry about where to click the mouse and
such.  But I wanted to have a simple way of starting up the X-based
screensaver xlock when I (or anyone) logged out to the console login.
<p>

Here's what I did (as root):
<p>

<ul>
<li>I created a user called xlock.  It has no password and its home
   directory is /usr/local/xlock.  Its shell is bash.
<p>

<li>In xlock's .profile, I put

<pre>
if [ "$DISPLAY" = "" ]; then

   xinit .Xsession > /dev/null 2>&1
   clear
   exit

fi
</pre>

<li>In xlock's .Xsession, I put
<pre>
:
exec xlock -nolock -mode random
</pre>
</ul>
Now, anybody can login xlock and instantly bring up the X
screen-saver.  The "random" keyword tells it to select a pattern to
display at random, changing it every so often.  When a key is pressed
or a mouse button clicked, the screensaver process exits, the X
session is ended, and control returns to the console login prompt.
<p>

In my next article, I show how I arranged to jump into X from the
console login prompt just by logging in (i.e., without having to start
X manually).

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

<a name="hex"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Hex Dump
</H3>
<P> 

Date: Sat, 24 May 1997 00:29:20 -0400<br>
From: Joseph Hartmann <a href="mailto:joeh@arakis.sugar-river.net">joeh@arakis.sugar-river.net</a>
             
<p>Hex Dump
by Joseph L. Hartmann, Jr.

<p>This code is copyright under the GNU GPL by Joseph L. Hartmann, Jr.

<p>I have not been happy with Hex Dump.  I am an old ex-DOS user,
and am familiar with the HEX  ... ASCII  side-by-side
presentation.

<p>Since I am studying awk and sed, I thought it would be an
interesting excercise to write this type of dump.  

<p>Here is a sample of what you may expect when you type the
(script) command "jhex <YOUR-FILENAME>" to the shell:
<pre>
0000000  46 69 6c 65 6e 61 6d 65  0000000 F i l e n a m e
0000008  3a 20 2f 6a 6f 65 2f 62  0000008 :   / j o e / b
0000010  6f 6f 6b 73 2f 52 45 41  0000010 o o k s / R E A
0000018  44 4d 45 0a 0a 62 6f 6f  0000018 D M E . . b o o
0000020  6b 2e 74 6f 2e 62 69 62  0000020 k . t o . b i b
0000028  6c 69 6f 66 69 6e 64 2e  0000028 l i o f i n d .
0000030  70 65 72 6c 20 69 73 20  0000030 p e r l   i s
</pre>
<p>If you like it, read on....
<pre>
The 0000000 is the hexadecimal address of the dump
46 is the hexadecimal value at 0000000
69 is the hexadecimal value at 0000001
6c is the hexadecimal value at 0000002
...and so on.
</pre>
<p>To the right of the repeated address,  "F i l e n a m e"
is the 8 ascii equivalents to the hex codes you see
on the left.  

<p>I elected to dump 8 bytes in one row of screen output.
The following software is required: hexdump, bash, less and gawk.

<p>gawk is the GNU/Linux version of awk.

<p>There are four files that I have installed in my /joe/scripts
directory, a directory that is in my PATH environment.  

<p>The four files are:
combine  -- an executable script: you must "chmod +x combine"
jhex     -- an executable script: you must "chmod +x jhex"
hexdump.dashx.format   -- a data file holding the formatting
  information for the hex bytes.
hexdump.perusal.format -- a data file holding the formatting
  information for the ascii bytes.

<p>Here is the file jhex:
<pre>
hexdump -f /joe/scripts/hexdump.dashx.format $1 > /tmp1.tmp
hexdump -f /joe/scripts/hexdump.perusal.format $1 > /tmp2.tmp
gawk -f /joe/scripts/combine /tmp1.tmp > /tmp3.tmp
less /tmp3.tmp
rm /tmp1.tmp
rm /tmp2.tmp
rm /tmp3.tmp
</pre>

Here is the file combine:
<pre>
# this is /joe/scripts/combine -- it is invoked by /joe/scripts/jhex
{  getline < "/tmp1.tmp"
   printf("%s  ",$0)
   getline < "/tmp2.tmp"
   print 
}
</pre>
Here is the file hexdump.dashx.format:
<pre>
           "%07.7_ax  " 8/1 "%02x "  "\n"
</pre>

Here is the file hexdump.perusal.format:
<pre>
           "%07.7_ax "  8/1  "%_p " "\n"
</pre>


<p>I found the "sed & awk" book by Dale Dougherty helpful.

<p>I hope you find jhex useful. To make it useful for yourself, you
will have to replace the "/joe/scripts" with the path of your
choice.  It must be a path that is in your PATH, so that the 
scripts can be executed from anyplace in the directory tree. 

<p>A trivial note: do not remove the blank line from the 
                hexdump.dasx.format and hexdump.perusal.format
                files: it will not work if you do!

<p>A second trivial note: when a file contains many characters all of
                       same kind, the line-by-line display will
                       be aborted and the display will look similar
                       to the example below:
<pre>
0000820  75 65 6e 63 65 20 61 66  0000820 u e n c e   a f
0000828  74 65 72 20 74 68 65 20  0000828 t e r   t h e
0000830  0a 20 20 20 20 20 20 20  0000830 .
0000838  20 20 20 20 20 20 20 20  0000838
*  *
0000868  20 20 20 20 20 6c 61 73  0000868           l a s
0000870  74 20 72 65 63 6f 72 64  0000870 t   r e c o r d
</pre>
<p>Instead of displaying *all* the 20's, you just get the

<pre>*  *  .</pre>

<p>I don't like this myself, but I have reached the end of my
competence (and/or patience), and therefore, that's the way it
is!


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

<a name="print"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
A Fast and Simple Printing Tip
</H3>
<P> 
Date: Fri, 23 May 1997 07:30:38 -0400<BR>
From: Tim Bessell <a href="mailto:tbessell@buffnet.net">tbessell@buffnet.net</a>

<P>I have been using Linux for about a year, as each day passes and my
knowledge increases, my Win95 patitions decrease.  This prompted me to
by a notebook, which of course is loaded with Windows.  Currently these
two machines are NOT networked :-(  But that doesn't mean I can't print
a document created in Word for Windows, Internet Explorer, etc., without
plugging my printer cable into the other machine.

<P>My solution is rather simple.  If you haven't already, add a new
printer in the Windows control panel, using the driver for the printer
that is connected to your Linux box.  Select "FILE" as the port you wish
to print to and give it a name, eg: Print File (HP Destjet 540).  Now
print your document to a floppy disk file, take it to the Linux machine,
and issue a command simular to:  cat filename > /dev/lp1.  Your document
will be printed with all the formatting that was done in Windows.

<P>Enjoy,<BR>
  Tim Bessell                                 
                                            



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

<a name="grep"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Grepping Files in a Directory Tree
</H3>
<P> 
Date: Wed, 21 May 1997 21:42:34<br> 
From: Earl Mitchell <a href="mailto:earlm@Terayon.COM">earlm@Terayon.COM</a>

<p>Ever wonder how you can grep certain files in a directory
tree for a particular string. Here's example how

<pre>grep foo `find . -name \*.c -print`</pre>

<p>This command will generate a list of all the .c files in
the current working directory or any of its subdirectories
then use this list of files for the grep command. The
grep will then search those files for the string "foo" and
output the filename and the line containing "foo". 

<p>The only caveat here is that UNIX is configured to limit
max chars in a command line and the "find" command may
generate a list of files to huge for shell to digest when
it tries to run the grep portion as a command line. Typically
this limit is 1024 chars per command line.

<p>-earl


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

<a name="virge"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ViRGE Chipset
</H3>
<P> 
Date: Wed, 30 Apr 1997 22:41:28<br> 
From: Peter Amstutz <a href="mailto:amstpi@freenet.tlh.fl.us">amstpi@freenet.tlh.fl.us</a>
<P>

<p>A couple suggestions to people with video cards based on the ViRGE Chipset...

<ol>
<li>XFree 3.2 has a ViRGE server!  I have heard a number of people complain
about XFree's lack of ViRGE support.  Yo GUYZ!  That's because your
wonderful Linux CD has XFree86 3.1.2 WHICH IS NOT THE MOST RECENT VERSION!

<li>There is a minor hack you can make to svgalib 1.12.10 to get it to
reconignize your nice S3 based card as actually being such.  The s3/ViRGE
chip is, in the words of some guy at C|Net, "basically a S3 Trio 64 with a
3d engine bolted on top."  Unfortunately, it returns a card code totally
different to the Trio64.  With just a minor little bit of hacking, you too
can do 1024x768x16bpp through svgalib.  Get the source, untar it &
everything.  Go into the main source directory, and with your favorite
editor, open up s3.c (or it maybe vga.c it has been sometime since I did
this and I do not have the source now in front of me)  Now, search for the
nice little error message it gives you when it says something like "S3 chip
0x(some hex number) not reconignized."  Above it there should be a
switch()/case statement that figures out which card it is.  Find the case
statement that matches a Trio64.  Insert a fall-through case statement that
matches the code your card returns, so svgalib treats it as a Trio64!
You're home free!  Recompile, re-install libraries, and now, what we've all
been waiting for, test 640x480x256!  640x480x16bpp!  800x600x24bpp!  YES!!!
</ol>

<p>Note: this trick has not been authorized, reconignized, or in any way
endorsed, recommended, or even considered by the guy(s) who wrote svgalib in
the first place.  (that last version of svgalib is over a year old, so I
don't expect there to be any new versions real soon) It works for me, so I
just wanted to share it with the Linux community that just might find it useful.

Peter Amstutz 

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

<a name="multip"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Maintaining Multiple X Sessions  
</H3>
Date: Sun, 04 May 1997 21:02:10 +0200<br>
From: David Kastrup <a href="mailto:dak@neuroinformatik.ruhr-uni-bochum.de">dak@neuroinformatik.ruhr-uni-bochum.de</a>
<P>

<p>Suppose you have an X running, and want to start another one (perhaps
for a different user).

<p>startx alone will complain.

<p>Writing
<pre>startx -- :1</pre><br>
will work, however (if screen 0 is already taken).  Start another one
with
<pre>startx -- :2</pre><br>
if you want.  You want that to have hicolor, and your Xserver would
support it?

<p>Then start it rather with
<pre>startx -- -bpp 16 :2</pre>

<p>Of course, if no Xserver is running yet, you can get a non-default depth
by just starting with
<pre>startx -- -bpp 16</pre>
or
<pre>startx -- -bpp 8</pre><br>

or whatever happens to be non-standard with you.


-- 
David Kastrup

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

<a name="auto"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Automatic File Transfer
</H3>
<P> 
Date: Sat, 3 May 1997 12:58:11 +0200 (MDT)<br>
From: Gregor Gerstmann <a href="mailto:gerstman@tfh-berlin.de">gerstman@tfh-berlin.de</a><br>
<P>

<p>Hi there,
Here is a small tip concerning the 'automatic' file transfer;
Linux Gazette Issue 17, May 1997. Everything is known stuff in Unix
and Linux. To 'automate' file transfer for me means to minimize the
load on the remote server as well as my own telephone costs - you
have to pay for the time you think if or not to get a special file,
for changing the directories and for the time to put the names into
the PC. The procedure is called with the address as parameter and
generates a protocol.
<pre>
#!/bin/bash
#
date &gt; prot
#
ftp -v $1 &gt;&gt; prot
#
#
date &gt;&gt; prot
#
</pre>
<p>Ftp now looks if a .netrc file exists; in this file I use macros
written in advance and numbered consecutively:
<pre>
...
machine ftp.ssc.com login anonymous password -gerstman@tfh-berlin.de
macdef T131
binary
prompt
cd ./pub/lg
pwd
dir . C131.2
get lg_issue17.tar.gz SSC17

macdef init
$T131
bye
...
</pre>
<p>Now I first get the contents of several directories via dir . C131...
and, to have some book-keeping, logically use the same numbers for the
macros and the directories. The protocol shows, if I am really in the
directory I wished to. Until the next session begins, the file C131...
is used to edit the last .netrc file, therefore the names will always
be typed correctly. If you are downloading under DOS from your account
the shorter names are defined in the .netrc file. Everything is done
beforehand with vi under Linux.

<p>Dr.Werner Gerstmann

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

<a name="news"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Setting Up Newsgroups
</H3>
<P> 
Date: Mon, 05 May 1997 16:19:05 -0600<br>
From: "Michael J. Hammel" <a href="mailto:mjhammel@emass.com">mjhammel@emass.com</a><br>
<P>

<p><I>But I just can't seem to find any documentation explaining 
how to set up local newsgroups. smtpd and nntpd are running,
but the manpages won't tell anything about how to set up ng's</I>

<p>smtpd and nntpd are just transport agents.  They could just as easily
transport any sort of message files as they do mail or NetNews files. 
What you're looking for is the software which manages these files on
your local system (if you want newsgroups available only locally then
you need to have this software on your system).  I used to use CNEWS for
this.  I believe there are some other packages, much newer than CNEWS,
that might make it easier.  Since I haven't used CNEWS in awhile I'm
afraid I can't offer any more info than this.
 
<p>Michael J. Hammel           

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

<a name="color"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Color Applications in X
</H3>
<P> 
Date: Tue, 06 May 1997 09:25:01 -0400 (EDT)<br>
From: Oliver Oberdorf <a href="mailto:oly@borg.harvard.edu">oly@borg.harvard.edu</a><br>
<P>

<p>Saw some X Window tips, so I thought I'd send this one along..

<p>I tend to use lots of color rich applications in X.  After
cranking up XEmacs, Gimp, etc., I find that I quickly run
out of palette on my 8-bit display.  Most programs don't behave
sensibly when I run out of colors - for example, CGoban comes up 
black and white and realaudio refuses to run at all (not enough 
colors to play sound, I suppose. 

<p>I've found I can solve these problems by passing a "-cc 4" option
to the X server.  This tells it to pretend I have a bigger
pallete and to pass back closest matches to colors when necessary.
I've never run out of colors since then.

<p>There are caveats: programs that check for a full colormap
and install their own (color flashing) will automatically do so.
This includes netscape and XForms programs (which I was running
with private color maps anyway).  My copy of LyriX
makes the background black.  Also, I tried Mosaic on a Sun and
had some odd color effects.

<p>oly

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

<a name="xcolor"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
X With 256 Colors        
</H3>
<P> 
Date: Tue, 06 May 1997 09:40:10 -0400 (EDT)<br>
From: Oliver Oberdorf <a href="mailto:oly@borg.harvard.edu">oly@borg.harvard.edu</a><br>
<P>

<p>I forgot to add that the -cc 4 can be used like this:
<pre>
startx -- -cc 4
</pre><br>
(I use xdm, so I don't have to do it this way)

<p>sorry about that

<p>oly

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

<a name="video"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Video Cards on the S3/ViRGE
</H3>
<P> 
Date: Mon, 05 May 1997 20:44:13 -0400<br>
From: Peter Amstutz <a href="mailto:amstpi@freenet.tlh.fl.us">amstpi@freenet.tlh.fl.us</a><br>
<P>
<p>A couple suggestions to people with video cards based on the S3/ViRGE
Chipset... (which is many video cards that ship with new computers that
claim to have 3D accelerated graphics.  Don't believe it.  The 3D graphics
capability of all ViRGE-based chips sucks.  They make better cheap 2D
accelerators)

<ol>
<li>XFree 3.2 has a ViRGE server!  I have heard a number of people complain
about XFree's lack of ViRGE support.  Yo GUYZ!  That's because your
wonderful Linux CD has XFree86 3.1.2 WHICH IS NOT THE MOST RECENT VERSION!

<li>There is a minor hack you can make to svgalib 1.12.10 to get it to
reconignize your nice S3 based card as actually being such.  The s3/ViRGE
chip is, in the words of some guy at C|Net, "basically a S3 Trio 64 with a
3d engine bolted on top." (as noted, the 3D engine is really slow)
Unfortunately, it returns a card ID code totally different to the Trio64.
But, drum roll please, with just a little bit of hacking, you too can do
1024x768x16bpp through svgalib!  Just follow these E-Z steps:
</ul>
I)Get the source, untar it & everything.  
II) Go into the main source directory, and with your favorite editor (vim
forever!), open up s3.c 
III) Now, search for the nice little error message  "S3: Unknown chip id
%02x\n"  around line 1552.  Above it there should be a switch()/case
statement that figures out which card it you have based on an ID code.  Find
the case statement that matches a Trio64.  Insert a fall-through case
statement that matches the code your card returns, so svgalib treats it as a
Trio64!  Like this: (starts at line 1537 of s3.c)
<pre>	    case 0x11E0:
		s3_chiptype = S3_TRIO64;
		break;
becomes
	    case 0x11E0:
	    case 0x31E1:
		s3_chiptype = S3_TRIO64;
		break;</pre><br>
Replace 0x31E1 with the appropriate ID if your card returns a different code.

<p>Save it!  You're home free!  Recompile, re-install libraries, and now, what
we've all been waiting for, test some svga modes!  640x480x256!
640x480x16bpp! 800x600x24bpp!  YES!!!

<p>But wait!  One thing to watch out for.  First, make sure you reinstall it in
the right place!  Slackware puts libvga.a in /usr/lib/, so make sure that is
that file that you replace.  Another thing: programs compiled with svgalib
statically linked in will have to be rebuilt with the new library, otherwise
they will just go along in their brain dead fashion blithely unaware that your
card is not being used to nearly it's full potential.

<p>Note: this hack has not been authorized, reconignized, or in any way
endorsed, recommended, or even considered by the guy(s) who wrote svgalib.
The last version of svgalib is over a year old, so I don't expect there to
be any new versions real soon.  It works for me, so I just wanted to share
it with the Linux community that just might find it useful.  This has only
been tested on my machine, using a Diamond Stealth 3D 2000, so if you have a
different ViRGE-based card and you have problems you're on your own.

<p>No, there are no Linux drivers that use ViRGE "accelerated 3D"
features.  It sucks, I know (then again, the 3D performance of ViRGE chips
is so bad you're probably not missing much)

<p>Peter Amstutz 


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

<a name="line"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
C Source with Line Numbers
</H3>
<P> 
Date: 5 May 1997<br>
From: <a href="mailto:joeh@sugar-river.net">joeh@sugar-river.net</a><br>
<P>

<p>I wanted to print out a c source with line numbers.  Here is one
way to do it:

<p>Assuming you are using bash, install the following function in
your .bashrc file.  

<pre>jnl () {
           for args
         do
           nl -ba $args &gt; /tmp.tmp
         done
         lpr /tmp.tmp
       }
</pre>
<p>"nl" is a textutils utility that numbers the lines of a file.

<p>"-ba" makes sure *all* the lines (even the empty lines) get numbered.

<p>/tmp.tmp is my true "garbage" temporary file, hence I write over it,
and send it to the line printer.

<p>For example to print out a file "kbd.c", with line numbers:
<pre>jnl kdb.c <ENTER></pre>

<p>There are probably 20 different methods of accomplishing the same
thing, but when you don't even have *one* of them in your bag of
tricks, it can be a time-consuming detour.

<p>Note: I initially tried to name the function "nl", but this led to
      an infinite loop.  Hence I named it jnl (for Joe's number lines).

<p>Best Regards,<br>
Joe Harmann


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

<a name="ncftp"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
ncftp Vs. ftplib
</H3>
<P> 
Date: Thu, 08 May 1997 13:30:04 -0700<br>
From: Igor Markov <a href="mailto:imarkov@math.ucla.edu">imarkov@math.ucla.edu</a><br>
<P>

<p>Hi, I read your 2c tip in Linux gazette regarding ftplib.

<p>I am not sure why you recommend downloading ftpget, while
another package, actually, a single program, which is available
on many systems does various ftp services pretty well.

<p>I mean ncftp ("nikFTP"). It can do command line, it can work
in the mode of usual ftp (with the "old" or "smarter" interface")
and it also does full-screen mode showing ETA during the transfer.
It has filename and hostname completion and a bunch of other niceties,
like remembering passwords if you ask it to.

<p>Try man ncftp on your system (be in Linux or Solaris) ...
also, ncftp is available from every major Linux archive
(including ftp.redhat.com where you can find latest RPMs)


<p>Hope this helps, Igor


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

<a name="names"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Domain and Dynamic IP Names
</H3>
<P> 
Date: Thu, 08 May 1997 13:52:02 -0700<br>
From: Igor Markov <a href="mailto:imarkov@math.ucla.edu">imarkov@math.ucla.edu</a>
<P>

<p>I have a dial-up with dynamic IP and it has always been an
incontinence for me and my friends to learn my current IP address
(I had an ftp script which put the address every 10 minutes into
~/.plan file on my acct at UCLA, then one could get the address
by fingering the account).

<p>However, recently I discovered a really cool project
<a href="http://www.ml.org">http://www.ml.org</a> which

<ul>
<li>can give you a dynamic IP name, i.e. when your 
computer gets a new IP address, it needs to 
contact www.ml.org and update its record. 

<p>Once their nameserver reloads its tables (once every 5-10mins!)
your computer can be accessed by the name you selected
when registered.

<p>For example, my Linux box has  IP name math4.dyn.ml.org
      
<p>Caveat: if you are not online, the name can point to 
a random computer. In my case, those boxes are
most often wooden (i.e. running Windoze ;-) so
you would get "connection refused".

<p>In general, you need some kind of authentication
scheme (e.g. if you telnet to my computer, it would
say "Office on Rodeo Drive")

<li>allows you to register domain name for free
(e.g. you can register an alternative name for
your computer at work which has a constant IP) 

<li>offer nameserver support for free (if you need it)
</ul>     

<p>Isn't that cool ?

<p>Cheers,
								Igor
<P> <hr> <P> 
<!--================================================================-->

<a name="netcfg"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
netcfg Tool
</H3>
<P> 
Date: Sat, 10 May 1997 11:55:28 -0400<br>
From: Joseph Turian <a href="mailto:turian@idt.net">turian@idt.net</a>
<P>

<p>I used Redhat 4.0's netcfg tool to install my PPP connection, but found
that I could only use the
Internet as root. I set the proper permissions on my scripts and the
pppd (as stated in the
PPP Howto and the Redhat PPP Tips documents), but I still could not use
any Internet app from
a user's account. I then noticed that a user account _could_ access an
IP number, but could not
do a DNS lookup. It turns out that I merely had to chmod ugo+r
/etc/resolv.conf


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

<a name="links"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Putting Links to Your Dynamic IP
</H3>
<P> 
Date: Wed, 28 May 1997 13:24:45<br>
From: Nelson Tibbitt <a href="mailto:nelson@interpath.com">nelson@interpath.com</a>
<P>

<p>Sometimes it might be useful to allow trusted friends to connect to your
personal Linux box over the Internet.
An easy way to do this is to put links to your IP address on a full-time
web server, then give the URL to whomever.
Why would you want to do that?  Well, I do it so my sister can telnet to
Magnon, my laptop, for a chat whenever I'm connected.

<p>However it might prove difficult if, like me, your ISP assigns your
IP address dynamically.  So I wrote a short script to take care
of this...  The script generates an html file containing my local
IP address then uploads the file via ftp to a dedicated web server
on which I have rented some web space.  It runs every time a ppp
connection is established, so the web page always contains my current
IP, as well as the date/time I last connected.

<p>This is pretty easy to set up, and the result is way cool.  Just give my
sis (or anyone else I trust) the URL... then she can check
to see if I'm online whenever she wants, using Netscape from her vax
account at RIT.   If I am connected, she can click to telnet
in for a chat.

<p>Here's how it works....
<ul>
<li>determine local IP address
<li>write an html file containing date/time and links to the IP address
that has been assigned
<li>upload the html file to a dedicated web server using ftp (and a .netrc
file)
</ul>
<p>To get ftp to work, I had to create a file named .netrc in my home
directory with a line that
contains the ftp login information for the remote server.  My .netrc has
one line that looks like this:

<pre>machine ftp.server.com login ftpusername password ftppassword
</pre>
<p>For more information on the .netrc file and its format, try "man ftp".
Chmod it 700 (chmod 700 .netrc) to prevent other users from reading the
file.
This isn't a big deal on my laptop, which is used primarily by yours
truly.  But it's a good idea anyway.

<p>Here's my script.  There might be a better way to do all of this,
however my script works pretty well.
Still, I'm always interested in ways to improve  my work, so if you have
any suggestions or comments,
feel free to send me an email.


<pre>

#!/bin/sh
# *** This script relies on the user having a valid local .netrc ***
# *** file permitting automated ftp logins to the web server!!   ***
#
# Slightly modified version of:
# Nelson Tibbitt's insignificant bash script, 5-6-97
# nelson@interpath.com
#
# Here are variables for the customizing...
# Physical destination directory on the remote server
# (/usr/apache/htdocs/nelson/ is the httpd root directory at my virtual
domain)
REMOTE_PLANDIR="/usr/apache/htdocs/nelson/LinuX/Magnon"
# Desired destination filename
REMOTE_PLANNAME="sonny.htm"
# Destination ftp server
# Given this and the above 2 variables, a user would find my IP address
at
# http://dedicated.web.server/LinuX/Magnon/sonny.htm
REMOTE_SERVER="dedicated.web.server"
# Local (writable) temporary directory
TMPDIR="/usr/tmp"
# Title (and header) of the html file to be generated
HTMLHEAD="MAGNON"
# Existing image on remote server to place in html file..
# Of course, this variable isn't necessary, and may be commented out.
If commented out,
# you'll want to edit the html file generation below to prevent an empty
image from appearing
# in your web page.
HTMLIMAGE="/LinuX/Magnon/images/mobile_web.gif"
# Device used for ppp connection
PPP_DEV="ppp0"
# Local temporary files for the html file/ftp script generation
TFILE="myip.htm"
TSCPT="ftp.script"
# Used to determine local IP address on PPP_DEV
#  There are several ways to get your IP, this was the first
command-line method I came
# up with.   It works fine here.  Another method, posted in May 1997
LJ  (and which looks
# much cleaner) is this:
#  `/sbin/ifconfig | awk 'BEGIN { pppok = 0} \
#   /ppp.*/ { pppok = 1; next } \
#  {if (pppok == 1 ) {pppok = 0; print} }'\
#  | awk -F: '{print $2 }'| awk  '{print $1 }'`
GETMYIP=$(/sbin/ifconfig | grep -A 4 $PPP_DEV \
  | awk '/inet/ { print $2 } ' | sed -e s/addr://)
# Used to place date/time of last connection in the page
FORMATTED_DATE=$(date '+%B %-d, %I:%M %p')
#
#
# Now, do it!  First give PPP_DEV time to settle down...
sleep 5
echo "Current IP: $GETMYIP"

# Generate the html file...
# Edit this part to change the appearance of the web page.
rm -f $TMPDIR/$TFILE
echo "Writing $REMOTE_PLANNAME"
echo &gt;$TMPDIR/$TFILE
echo "&lt;html&gt;&lt;head&gt;&lt;title&gt;$HTMLHEAD&lt;/title&gt;&lt;/head&gt;&lt;center&gt;"   &gt;&gt; 
$TMPDIR/$TFILE
echo "&lt;body bgcolor=#ffffff&gt;&lt;font size=+3&gt;$HTMLHEAD&lt;/font&gt;"  &gt;&gt; 
$TMPDIR/$TFILE
# Remove the &lt;imgtag in the line below if you don't want an image
echo "&lt;p&gt;&lt;img src='$HTMLIMAGE' alt='image'&lt;p&gt;The last "     &gt;&gt; 
$TMPDIR/$TFILE
echo "time I connected was &lt;b&gt;$FORMATTED_DATE&lt;/b&gt;, when the " &gt;&gt;
$TMPDIR/$TFILE
echo "Net Gods dealt &lt;b&gt;$GETMYIP&lt;/bto Magnon. &lt;p&gt;&lt;a href="  &gt;&gt;
$TMPDIR/$TFILE
echo "http://$GETMYIP target=_top&gt;http://$GETMYIP&lt;/a&gt;&lt;p&gt;"     &gt;&gt;
$TMPDIR/$TFILE
echo "&lt;a href=ftp://$GETMYIP target=_top&gt;ftp://$GETMYIP</a>"  &gt;&gt;
$TMPDIR/$TFILE
echo "&lt;p&gt;&lt;a href=telnet://$GETMYIP&gt;telnet://$GETMYIP&lt;/a&gt;&lt;br&gt;" &gt;&gt;
$TMPDIR/$TFILE
echo "(Telnet must be properly configured in your browser.)"  &gt;&gt;
$TMPDIR/$TFILE
# Append a notice about the links..
echo "&lt;p&gt;The above links will only work while I'm connected." &gt;&gt;
$TMPDIR/$TFILE

# Create an ftp script to upload the html file
 echo "put $TMPDIR/$TFILE" $REMOTE_PLANDIR/$REMOTE_PLANNAME &gt;
$TMPDIR/$TSCPT
 echo "quit" &gt;$TMPDIR/$TSCPT

# Run ftp using the above-generated ftp script (requires valid .netrc
file for ftp login to work)
 echo "Uploading $REMOTE_PLANNAME to $REMOTE_SERVER..."
 ftp $REMOTE_SERVER &gt; $TMPDIR/$TSCPT &/dev/null

# The unset statements are probably unnecessary, but make for a clean
'look and feel'  
echo -n "Cleaning up... "
rm -f $TMPDIR/$TFILE ; rm -f $TMPDIR/$TSCPT
unset HTMLHEAD HTMLIMAGE REMOTE_SERVER REMOTE_PLANDIR REMOTE_PLANNAME
unset GETMYIP FORMATTED_DATE PPP_DEV TMPDIR TFILE TSCPT
echo "Done."

exit


</pre>


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

<a name="disk"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Hard Disk Duplication
</H3>
<P> 
Date: Tue, 27 May 1997 11:16:32<br> 
From: Michael Jablecki <a href="mailto:mcjablec@ucsd.edu">mcablec@ucsd.edu</a><br>
<P>
<p>Shockingly enough, there seems to be a DOS product out there that will
happily make "image files" of entire hard disks and copy these image files
onto blank hard disks in a sector-by-sector fashion.  Boot sectors and
partition tables should be transferred exactly.  See:
<a href="http://www.ingot.com">http://www.ingot.com</a>
for more details.  Seagate (I think...) has also made a program that does
the duplication in one step - transfers all of one hard disk to another
identical disk.  I'm not sure which of these products works with
non-identical disks.

<p>Hope this helps.

<p>Michael Jablecki

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

<a name="untar"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Untar and Unzip
</H3>
<P> 
From: Paul

<p>Oh, here's a little tidbit of info to pass on, this has been bugging me
for a while.  Often times when people send in tips 'n' tricks, it requires
one to untar and unzip an archive.  It usually suggested that this be done
in one of several cumbersome ways:

	gzcat foo.tar.gz | tar zxvf -

or	1. gunzip foo.tar.gz
	2. tar xvf foo.tar

or some other multi-step method.  There is a much easier, time-saving,
space saving method.  The version of tar shipped with most distributions
of Linux is from the FSF GNU project.  These people recognized that most
tar archives are usually gzipped and provided a 'decompress' flag to tar.
This is equivalent to the above methods:

	tar zxvf foo.tar.gz

This decompress the tar.gz file on the fly and then untars it into the
current directory, but it also leaves the original .tar.gz alone.

However, one step I consider essential that is usually never mentioned, is
to look at what's in the tar archive prior to extracting it.  You have no
idea whether the archiver was kind enough to tar up the parent directory
of the files, or it they just tarred up a few files.  The netscape tar.gz
is a classic example.  When that's untarred, it dumps the contents into
your current directory.  Using:

	gtar ztvf foo.tar.gz

allows you to look at the contents of the archive prior to opening it up
and potetially writing over files with the same name.  At the very least,
you will know what's going on and be able to make provisions for it before
you mess something up.

For those who are adventurous, (X)Emacs is capable of not only opening up
and reading a tar.gz file, but actually editing and re-saving the contents
of these as well.  Think of the time/space savings in that!

Seeya,
Paul

<P> <hr> <P> 
<!--================================================================-->
<center>Published in Linux Gazette Issue 18, June 1997</center>
<P> <hr> <P> 
<!--================================================================-->
<A HREF="./lg_toc18.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif" 
ALT="[ FRONT PAGE ]"></A> <A HREF="./lg_mail18.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./lg_bytes18.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>

<P> <hr> <P>
<h5>This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com">gazette@ssc.com</A><BR> 
Copyright &copy; 1997 Specialized Systems Consultants, Inc. </H5> 
<P> 
<H4>&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;</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="./lg_bytes18.html#general">News in General</a>
<li><a HREF="./lg_bytes18.html#software">Software Announcements</a>
</ul>
</td></tr></table>
</center>

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

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Atlanta Linux Showcase
</H3>

<p>Linus Torvalds, the "Kernel-Kid" and creator of Linux, Jon
"Maddog" Hall, Linux/Alpha team leader and inspiring Linux
advocate, David Miller, the mind behind Linux/SPARC, and Phil
Hughes, publisher of Linux Journal, and many more will speak
at the upcoming Atlanta Linux Showcase.

<p>For more information on the Atlanta Linux Showcase and to
reserve your seat today, please visit our web site at
<a href="http://www.ale.org/showcase/">http://www.ale.org.showcase</a>

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Linux Speakers Bureau
</H3>

<p>SSC is currently putting together a Linux Speaker's Bureau.

<a href="http://www.ssc.com/linux/lsb.html">http://www.ssc.com/linux/lsb.html</a> 

<p>The LSB is designed to become a collage of speakers specializing in Linux.
Speakers who specialize in talks ranging from novice to advanced - technical 
or business are all welcome.  The LSB will become an important tool for  
organizers of trade show talks, computer fairs and general meetings, so if 
you are interested in speaking at industry events, make sure to visit the 
LSB WWW page and register yourself as a speaker.

<p>We welcome your comments and suggestions.  




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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
The Linux System Administrator's Guide (SAG)
</H3>

<p>The Linux System Administrator's Guide (SAG) is a book on system
administration targeted at novices. Lars Wiraenius has been writing it for
some years, and it shows. He has made an official
HTML version, available at the SAG home page at:<br>

<a href="http://www.iki.fi/liw/linux/sag/">http://www.iki.fi/liw/linux/sag</a>

<p>Take a Look!

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Free CORBA 2 ORB For C++ Available
</H3>

<p>The Olivetti and Oracle Research Laboratory has made available the first
public release of omniORB (version 2.2.0). We also refer to this version
as omniORB2.

<p>omniORB2 is copyright Olivetti & Oracle Research Laboratory. It is free
software. The programs in omniORB2 are distributed under the GNU General
Public Licence as published by the Free Software Foundation. The libraries
in omniORB2 are distributed under the GNU Library General Public
Licence.

<p>For more information take a look at <a
href="http://www.orl.co.il/omniORB">http://www.orl.co.il/omniORB</a>.

<p>Source code and binary distributions are available from 
<a href="http://www.orl.co.uk/omniORB/omniORB.html">http://www.orl.co.uk/omniORB/omniORB.html</a>



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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
The Wurd Project
</H3>

<p>The Wurd Project, a SGML Word Processor for the UNIX environment (and
hopefully afterwards, Win32 and Mac) is currently looking for developers
that are willing to participate in the project.

Check out the site at:
<a href="http://sunsite.unc.edu/paulc/wp">http://sunsite.unc.edu/paulc/wp</a><br>

<p>Mailing list archives are available, as well as the current source,
documentation, programming tools and various other items can also be found
at the above address.


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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Linus in Wonderland
</H3>

<p>Check it out...

<p>Here's the online copy of Metro's article on Linus...<br>

<a href="http://www.metroactive.com/metro/cover/linus-9719.html">http://www.metroactive.com/metro/cover/linux-9719.html</a><br>

<p>Enjoy!

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

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
BlackMail 0.24
</H3>

<p>Announcing BlackMail 0.24.  This is a bug-fix release over the previous
release, which was made public on April 29th.  

<p>BlackMail is a mailer proxy that wraps around your existing mailer
(preferrably smail) and provides protection against spammers, mail
forwarding, and the like.

<p>For those of you looking for a proxy, you may want to
look into this.  This is a tested product, and works very well.  I am
interested in getting this code incorporated into SMAIL, so if you are
interested in doing this task, please feel free.

<p>You can download blackmail from <a href="ftp://ftp.bitgate.com:/pub/blackmail">ftp://ftp.bitgate.com</a>.  
You can also view the web page at
<a href="http://www.bitgate.com/spam">http://www.bitgate.com</a>.

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
CDE--Common Desktop Environment for Linux
</H3>

<P>Red Hat Software is proud to announce the arrival of Red Hat's TriTeal CDE
for Linux.  Red Hat Software, makers of the award-winning, technologically
advanced Red Hat Linux operating system, and TriTeal Corporation, the industry
leader in CDE technology, teamed up to bring you this robust, easy to use CDE
for your Linux PC.

<P>CDE includes 
Red Hat's TriTeal CDE for Linux provides users with a graphical
environment to access both local and remote systems.  
It gives you icons, pull-down menus, and folders. 

<P>Red Hat's TriTeal CDE for Linux is available in two versions.  The Client
Edition gives you everything you need to operate a complete licensed copy
of the CDE desktop, incluidng the Motif 1.2.5 shared libraries.  The
Developer's Edition allows you to perform all functions of the Client
Edition, and also includes a  complete integrated copy of OSF Motif version
1.2.5, providing a complete development environment with static and
dynamically linked libraries, Motif Window Manager, and sample Motif
Sources.  

<P>CDE is an RPM-based product, and will install easily on Red Hat and other
RPM-based Linux systems.  We recommend using Red Hat Linux 4.2 to take full
advantage of CDE features.  For those who do not have Red Hat 4.2, CDE
includes several Linux packages that can be automatically installed to
improve its stability. 

<P>Order online at: <a href="http://www.redhat.com">http://www.redhat.com</a>
Or call 1-888-REDHAT1 or (919) 572-6500.

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
TCFS 2.0.1
</H3>

<P>Announcing the release 2.0.1 of TCFS
(Transparent Cryptographic File System) for Linux.
TCFS is a cryptographic filesystem developed here at Universita' di
Salerno (Italy). It operates like NFS but allow users to use a new
flag X to make the files secure (encrypted). Security engine is based on
DES, RC5 and IDEA.

<P>The new release works in Linux kernel space, and may be linked as 
kernel module. It is developed to work on Linux 2.0.x kernels.

<P>A mailing-list is available at <a href="mailto:tcfs-list@mikonos.dia.unisa.it">tcfs-list@mikonos.dia.unisa.it</a>. 
Documentation is available at <a href="http://mikonos.dia.unisa.it/tcfs">http://mikonos.dia.unisa.it/tcfs</a>.
Here you can find instructions for installing TCFS and docs on
how it works.
Mirror site is available at <a href="http://www.globenet.it/~ermmau/tcfs">http://www.globenet.it</a>
and
<a href="http://www.inopera.it/~ermmau/tcfs">http://www.inopera.it/~ermmau.tcfs</a>



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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Qddb 1.43p1
</H3>

<p>Qddb 1.43p1 (patch 1) is now available
<p>Qddb is fast, powerful and flexible database software that runs
on UNIX platforms, including Linux.  Some of its features include:

<ul>
<li>Tcl/Tk programming interface
<li>Easy to use, you can have a DB application completely up and
<li>running in about 5 minutes, using nxqddb.
<li>CGI interface for quick and easy online databases/guestbooks/etc...
<li>Fast, and powerful searching capability
<li>Report generator
<li>Barcharts and graphs
<li>Mass mailings with Email, letters and postcards
</ul>
<p>Qddb-1.43p1 is the first patch release to 1.43.  This patch
fixes a few minor problems and a searching bug when
using cached secondary searching.

<p>To download the patch file:
<a href="ftp://ftp.hsdi.com/pub/qddb/sources/qddb-1.43p1.patch">ftp://ftp.hsdi.com/pub/qddb/sources/qddb-1.43p1.patch</a><br>

<p>For more information on Qddb, visit the official Qddb home page:
<a href="http://www.hsdi.com/qddb">http://www.hsdi.com/qddb</a>


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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Golgotha
</H3>

<P>AUSTIN, TX- Crack dot Com, developers of the cult-hit Abuse and the
anticipated 3D action/strategy title Golgotha, recently learned
that Kevin Bowen, aka Fragmaster on irc and Planet Quake, has put up
the first unofficial Golgotha web site.

<P>The new web site can be found at <a href="http://www.planetquake.com/frags/golgotha">http://www.planetquake.com/grags/golgotha</a>,
and there is a link to the new site at <a href="http://crack.com/games/golgotha">http://crack.com/games/golgotha</a>.
Mr. Bowen's web site features new screenshots and music previously available
only on irc.

<P>Golgotha is Crack dot Com's first $1M game and features a careful
marriage of 3D and 2D gameplay in an action/strategy format featuring
new rendering technology, frantic gameplay, and a strong storyline.
For more information on Golgotha, visit Crack dot Com's web site at
<a href="http://crack.com/games/golgotha">http://crack.com/games/golgotha</a>.

<P>Crack dot Com is a small game development company located in Austin,
Texas.  The corporation was founded in 1996 by Dave Taylor, co-author
of Doom and Quake, and Jonathan Clark, author of Abuse.


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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
ImageMagick-3.8.5-elf.tgz
</H3>

<p>ImageMagick-3.8.5-elf.tgz is now out.

<p>This version brings together a number of minor changes made to
accomodate PerlMagick and lots of minor bugs fixes including
multi-page TIFF decoding and writing PNG.

<p>ImageMagick (TM), version 3.8.5, is a package for display and
interactive manipulation of images for the X Window System.
ImageMagick performs, also as command line programs, among others
these functions:
<ul>
<li>Describe the format and characteristics of an image 
<li>Convert an image from one format to another 
<li>Transform an image or sequence of images 
<li>Read an image from an X server and output it as an image file 
<li>Animate a sequence of images 
<li>Combine one or more images to create new images 
<li>Create a composite image by combining several separate images 
<li>Segment an image based on the color histogram 
<li>Retrieve, list, or print files from a remote network site 
</ul>
<p>ImageMagick supports also the Drag-and-Drop protocol form the OffiX
package and many of the more popular image formats including JPEG,
MPEG, PNG, TIFF, Photo CD, etc.

Check out:
<a href="ftp://ftp.wizards.dupont.com/pub/ImageMagick/linux">ftp://ftp.wizards.dupont.com/pub/ImageMagick/linux</a>


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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Slackware 3.2 on CD-ROM
</H3>
 
<p>Linux Systems Labs, The Linux Publishing Company is pleased to announce 
Slackware 3.2 on CD-ROM 
This CD contains Slackware 3.2 with 39 security fixes and patches since 
the Official Slackware 3.2 release.  The CD mirrors the slackware ftp site
as of April 26, 1997.  Its a great way to get started with Linux or update
the most popular Linux distribution.  

<p>This version contains the 2.0.29 Linux kernel, plus recent versions of
these (and other) software packages:
<ul>
<li>Kernel modules 2.0.29
<li>PPP daemon 2.2.0f
<li>Dynamic linker (ld.so) 1.8.10
<li>GNU CC 2.7.2.1
<li>Binutils 2.7.0.9
<li>Linux C Library 5.4.23
<li>Linux C++ Library 2.7.2.1
<li>Termcap 2.0.8
<li>Procps 1.01
<li>Gpm 1.10
<li>SysVinit 2.69
<li>Shadow Password Suite 3.3.2 (with Linux patches)
Util-linux 2.6
</ul>
 
<p>LSL price:     $1.95    
<p>Ordering Info: <a href="http://www.lsl.com">http://www.lsl.com</a>

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
mtools
</H3>

<p>A new release of mtools, a collection of
utilities to access MS-DOS disks from Unix without mounting them.

<p>Mtools can currently be found at the following places:

<a href="http://linux.wauug.org/pub/knaff/mtools">http://linux.wauug.org/pub/knaff/mtools</a><br>
<a href="http://www.club.innet.lu/~year3160/mtools">http://www.club.innet.lu/~year3160/mtools</a><br>
<a href="ftp://prep.ai.mit.edu/pub/gnu">ftp://prep.ai.mit.edu/pub/gnu</a><br>

<p>Mtools-3.6 includes the features such as Msip -e which now only ejects Zip
disks when they are not mounted, Mzip manpage, detection of bad passwords
and more.

Most GNU software is packed using the GNU `gzip' compression program.
Source code is available on most sites distributing GNU software.

For more information write to <a href="mailto:gnu@prep.ai.mit.edu">gnu@prep.ai.mit.edu</a><br>

or look at:
<a href="mailto:http://www.gnu.ai.mit.edu/order/ftp.html">http://www.gnu.ai.mit.edu/order/ftp.html</a>

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
CM3
</H3>

<p>CM3 version 4.1.1 is now available for Unix and Windows platforms:
SunOS, Solaris, Windows NT/Intel, Windows 95, HP/UX, SGI IRIX,
Linux/ELF on Intel, and Digital Unix on Alpha/AXP. For additional
information, or to download an evaluation copy, contact Critical Mass,
Inc. via the Internet at info@cmass.com or on the World Wide Web at<br>
<a href="http://www.cmass.com">http://www.cmass.com</a>

<p><b>newsBot:</b><br>
Extracts exactly what you want from your news feed.  Cuts down 
on "noise". Sophisticated search algorithms paired with 
numerous filters cut out messages with ALL CAPS, too many $ signs, 
threads which won't die, wild cross posts and endless discussions 
why a Mac is superior to a Chicken, and why it isn't.
newsBot is at:<br>
<a href="http://www.dsb.com/mkt/newsbot.html">http://www.dsb.com/mkt/newsbot.html</a><br>

<p><b>mailBot:</b><br>
Provides itendical functionality but reads mailing lists and e-zines
instead of news groups. Both are aimed at responsible Marketers
and Information managers. The *do not* extract email addresses and
cannot be mis-used for bulk mailings.
mailBot is at:
<a href="http://www.dsb.com/mkt/mailbot.html">http://www.dsb.com/mkt/mail.bot.html</a><br>
 
<p><b>siteSee:</b><br>
A search engine running on your web server and using the very same 
search technology: a very fast implementation of Boyer Moore.
siteSee differs from other search engines in that it does not require
creation and maintenance of large index files. It also becomes
an integrated part of your site design. You have full control over
page layout.
siteSee is located at: 
<a href="http://www.dsb.com/publish/sitesee.html">http://www.dsb.com/publish/seitesee.html</a><br>

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
linkCheck
</H3>

<p><b>linkCheck:</b><br>
A hypertext link checker, used to keep your site up to date. Its 
client-server implementation allows you to virtually saturate
your comms link without overloading your server. LinkCheck is fast
at reading and parsing HTML files and builds even large deduplicated
lists of 10,000 or more cross links faster than interpreted languages
take to load.
linkCheck is at: 
<a href="http://www.dsb.com/maintain/linkcheck.html">http://www.dsb.com/maintain/linkckeck.html</a><br>
 
<p>All products require Linux, SunOS or Solaris. And all are sold as
"age ware": a free trial license allows full testing. When the
license expires, the products "age", forget some of their skills,
but they still retain about 80% of their functionality. 
<p>A GUI text editor named "Red" is available for Linux.
The editor has a full graphical interface, supports mouse and key
commands, and is easy to use.

<p>These are some of Red's features that might be interesting: 
<ul>
<li>Graphical interface 
<li>Full mouse and key support 
<li>40 step undo (and redo) 
<li>User-definable key bindings 
<li>Automatic backup creation 
<li>Cut/paste exchange with other X Windows applications 
<li>On-line function list, help and manual 
</ul>
<p>It can be downloaded free in binary form or with full source code.<br>

<a href="ftp://ftp.cs.su.oz.au/mik/red/">ftp://ftp.cs.su.oz.au/mik/red</a><br>

Also, take a look at the web site at:<br>

<a href="http://www.cs.su.oz.au/~mik/red-manual/red-main-page.html">http://www.cs.su.oz.au/~mik/red-manual/red-main-page.html</a><br>

<p>The web site also includes a full Manual - have a look if you are
interested.

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

<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
Emacspeak-97++
</H3>

<p>Announcing Emacspeak-97++ (The Internet PlusPack). Based
on InterActive Accessibility technology, Emacspeak-97++
provides a powerful Internet ready audio desktop that 
integrates Internet technologies including Web surfing and
messaging into all aspects of the electronic desktop.

<p>Major Enhancements in this release include:
<ul>
<li>Support for WWW ACSS (Aural Cascading Style Sheets)
<li>Audio formatted output for rich text
<li>Enhanced support for browsing tables
<li>Support for speaking commonly used ISO Latin characters
<li>Speech support for the  Emacs widget libraries
<li>Support for SGML mode
<li>Emacspeak now has an automatically generated users manual
thanks to Jim Van Zandt.
</ul>
<p>Emacspeak-97++ can be downloaded from:<br>
<a href="http://cs.cornell.edu/home/raman/emacspeak">http://cs.cornell.edu/home/raman/emacspeak</a><br>
<a href="ftp://ftp.cs.cornell.edu/pub/raman/emacspeak">ftp://ftp.cs.cornell.edu/pub/raman/emacspeak</a><br>



<P> <hr> <P> 
<!--================================================================-->
<center>Published in Linux Gazette Issue 18, May 1997</center>
<P> <HR> <P>
<!-- =================================================================== -->
<A HREF="./lg_toc18.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A>
<A HREF="../index.html"><IMG SRC="../gx/homenew.gif" ALT="[ FRONT 
PAGE ]"></A> 
<A HREF="./lg_tips18.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./lg_answer18.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>

<P><HR><P>
<h5>This page written and maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com">gazette@ssc.com</A><BR> 
Copyright &copy; 1997 Specialized Systems Consultants, Inc. </H5> 
<P> 
<H4>&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>
<P> <hr> <P> 

<!-- ===============================================================  -->
<center>
<H1><A NAME="answer">
<img src="../gx/ans.gif" alt="" border=0 align=middle>
The Answer Guy
<img src="../gx/ans.gif" alt="" border=0 align=middle>
</A></H1> <BR>
<H4>By James T. Dennis,
<a href="mailto:jimd@starshine.org">jimd@starshine.org</a><BR> 
Starshine Technical Services, <A HREF="http://www.starshine.org/">
http://www.starshine.org/</A> </H4> 
</center>

<p><hr><p>
<H3>Contents:</H3>
<ul>
<li><a HREF="./lg_answer18.html#network">Networking Problems</a>
<li><a HREF="./lg_answer18.html#fetch">Fetchmail</a>
<li><a HREF="./lg_answer18.html#procmail">Procmail</a>
<li><a HREF="./lg_answer18.html#tcl">Tcl/tlk Dependencies</a>
<li><a HREF="./lg_answer18.html#var">/var/log/messages</a>
<li><a HREF="./lg_answer18.html#show">OS Showdown</a>
<li><a HREF="./lg_answer18.html#adding">Adding Linux to a DEC XLT-366</a>
<li><a HREF="./lg_answer18.html#config">Configuration Problems of a Soundcard</a>
<li><a HREF="./lg_answer18.html#proc">Procmail Idea and Question</a>
<li><a HREF="./lg_answer18.html#uucp">UUCP/Linux on Caldera</a>
<li><a HREF="./lg_answer18.html#active">ActiveX For Linux</a>
<li><a HREF="./lg_answer18.html#pack">What Packages Do I Need?</a>
<li><a HREF="./lg_answer18.html#users">Users And Mounted Disks</a>
<li><a HREF="./lg_answer18.html#map">[q] Map Left Arrow to Backspace</a>
<li><a HREF="./lg_answer18.html#pull">Adding Programs to Pull Down Menus</a>
<li><a HREF="./lg_answer18.html#nt">Linux and NT</a>
<li><a HREF="./lg_answer18.html#serv">pcmcia 28.8 Modems and Linux 1.2.13
Internet Servers</a>
</ul>

<p><hr><p> 
<!--================================================================-->

<a name="tcl"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Tcl/tlk Dependencies
</h3>
<P><B>

From: David E. Stern, <a href="mailto:kotsya@u.washington.edu">lptsua@i/wasjomgtpm/edu</a>
 
<p>The end goal: to install FileRunner, I simply MUST have it! :-)

<p>My intermediate goal is to install Tcl/Tk 7.6/4.2, because FileRunner
needs these to install, and I only have 7.5/4.1 . However, when I try to
upgrade tcl/tlk, other apps rely on older tcl/tk libraries, atleast that's
what the messages allude to:

<pre>  libtcl7.5.so is needed by some-app
       libtk4.1.so is needed by some-app</pre>

(where some-app is python, expect, blt, ical, tclx, tix, tk, tkstep,...)

<p>I have enough experience to know that apps may break if I upgrade the
libraries they depend on. I've tried updating some of those other apps,
but I run into further and circular dependencies--like a cat chasing it's
tail. 

<p>In your opinion, what is the preferred method of handling this scenario?
I must have FileRunner, but not at the expense of other apps.
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	It sounds like you're relying too heavily on RPM's.
	If you can't afford to risk breaking your current stuff,
	and you "must" have the upgrade you'll have to do some
	stuff beyond what the RPM system seems to do.

<p>	One method would be to grab the sources (SRPM or tarball)
	and manually compile the new TCL and tk into /usr/local
	(possibly with some changes to their library default 
	paths, etc).  Now you'll probably need to grab the 
	FileRunner sources and compile that to force it to use the
	/usr/local/wish or /usr/local/tclsh (which, in turn, will
	use the /usr/local/lib/tk if you've compiled it all right).

<p>	Another approach is to set up a separate environment 
	(separate disk, a large subtree of an existing disk
	-- into which you chroot, or a separate system entirely)
	and test the upgrade path where it won't inconvenience you
	by failing.  A similar approach is to do a backup, test your
	upgrade plan -- (if the upgrade fails, restore the backup).

<p>	This is a big problem in all computing environments (and
	far worse in DOS, Windows, and NT systems than in most 
	multi-user operating systems.  At least with Unix you have
	the option of installing a "playpen" (accessing it with the
	chroot call -- or by completely rebooting on another partition
	if you like).  

<p>	Complex interdepencies are unavoidable unless you require that
	every application be statically linked and completely self-sufficient
	(without even allowing their configuration files to be separate.
	So this will remain an aspect of system administration where
	experience and creativity are called for (and a good backup
	may be the only thing between you and major inconvenience).

--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="network"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Networking Problems
</h3>
<P><B>

From: Bill Johnson, <a href="mailto:b_johnson@cel.co.chatham.ga.us">b_johnson@cel.co.chatham.ga.us</a>
 
<p>I have two networking problems which may be related.  I'm using a 
dial-up (by chat) ppp connection.

<p>1) pppd will not execute for anyone without root privilege, even 
though it's permissions are set rw for group and other.
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I presume you mean that it's *x* (execute) bit is set.
	It's *rw* bits should be disabled -- the *w* bit ESPECIALLY.

<p>	If you really want pppd to be started by users (non-root)
	you should write a small C "wrapper" program that executes
	pppd after doing a proper set of suid (seteuid) calls and 
	sanity checks.  You might be O.K. with the latest suidperl
	(though there have been buffer overflows with some versions
	of that.

<p>	Note that the file must be marked SUID with the chmod command
	in order for it to be permitted to use the seteuid call
	(unless ROOT is running it, of course).

<p>	Regardless of the method you use to accomplish your SUID of 
	pppd (even if you just set the pppd binary itself to SUID):

<p>	I suggest you pick or make a group (in /etc/group) and make
	the pppd wrapper group executable, SUID (root owned), and 
	completely NON-ACCESSIBLE to "other"  (and make sure to just
	as the "trusted" users to the group.

<p>	'sudo' (University of Colorado, home of Evi Nemeth) is a 
	generalized package for provided access to privileged programs.
	You might consider grabbing it and installing it.

<p>	I'd really suggest diald -- which will dynamically bring the 
	link up and down as needed.  Thus your users will just try to
	access their target -- wait a long time for dialing, negotiation,
	etc (just like pppd only a little faster) and away you go
	(until your connection is idle long enough to count as a 
	"timeout" for diald.
<P><B><img align=bottom alt=" " src="../gx/ques.gif">
<p>2) http works, and mail works, and telnet works, but ftp does not 
work.  I can connect, login, poke around, and all that.  But when I 
try to get a file, it opens the file for writing on my machine and 
then just sits there.  No data received, ever.  Happens with 
Netscape, ftp, ncftp, consistently, at all sites. Even if user is 
root.  Nothing is recorded in messages or in ppp-log.  
/etc/protocols, /etc/services and all that seems to be set up 
correctly.  Any suggestions?
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Can you dial into a shell account and do a kermit 
	or zmodem transfer?  What does 'stty -a < /dev/modem' 
	say?  Make sure you have an eight-bit clean session.
	Do you have 16550 (high speed) UARTS.

<p>	Do you see any graphics when you're using HTTP?
	(that would suggest that binary vs. text is not the 
	problem).

<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="fetch"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Fetchmail
</h3>
<P><B>

From: Zia Khan, <a href="mailto:khanz@foxvalley.net">khanz@foxvalley.net</a>


<p>I have a question regarding fetchmail. i've been successful at using it
to send and recieve mail from my ISP via a connection to their POP3
server. there is a slight problem though. the mail that i send out has
in its from: field my local login and local hostname e.g.
ruine@clocktower.net. when it should be my real email address
khanz@foxvalley.net those who recieve my message recieve an non existant
email address to reply to. is there any way in modifying this behavior?
i've been investigating sendmail with hopes it may have have a means of
making this change,to little success.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Technically this has nothing to do with fetchmail or POP.
	'fetchmail' just *RECIEVES* your mail -- POP is just the 
	protocol for storing and picking up your mail.  All of your
	outgoing mail is handles by a different process.

<p>	Sendmail has a "masquerade" feature and an "all_masquerade"
	feature which will tell it to override the host/domain portions
	of the headers addresses when it sends your mail.  That's
	why my mail shows up as "jimd@starshine.org" rather than 
	"jimd@antares.starshine.org." 

<p>	The easy way to configure modern copies of sendmail is to use
	the M4 macro package that comes with it.  You should be able to 
	find a file in /usr/lib/sendmail-cf/cf/ 

<p>	Mine looks something like:
<pre>
divert(-1)
include(`../m4/cf.m4')
VERSIONID(`@(#)antares.uucp.mc  .9 (JTD) 8/11/95')
OSTYPE(`linux')

FEATURE(nodns)
FEATURE(nocanonify)
FEATURE(local_procmail)
FEATURE(allmasquerade)
FEATURE(always_add_domain)
FEATURE(masquerade_envelope)

MAILER(local)
MAILER(smtp)

MASQUERADE_AS(starshine.org)
define(`RELAY_HOST', a2i)
define(`SMART_HOST', a2i)
define(`PSEUDONYMS', starshine|antares|antares.starshine.org|starshine.org)
</pre>
<p>	(I've removed all the UUCP stuff that doesn't apply to you
	at all). 

<p>	Note:  This will NOT help with the user name -- just the host and 
	domain name.  You should probably just send all of your outgoing 
	mail from an account name that matches your account name at your
	provider.  There are other ways to do it  -- but this is the 
	easiest.

<p>	Another approach would require that your sendmail "trust"
	your account (with a define line to add your login ID as one
	which is "trusted" to "forge" their own "From" lines in 
	sendmail headers.  Then you'd adjust your mail-reader to 
	reflect your provider's hostname and ID rather than your local
	one.  The details of this vary from one mailer to another --
	and I won't give the gory details here).

<p>	Although I said that this is not a fetchmail problem -- I'd
	look in th fetchmail docs for suggestions.  I'd also read
	(or re-read) the latest version of the E-Mail HOW-TO.

<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="procmail"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Procmail
</h3>
<P><B>

Justin Mark Tweedie, <a href="mailto:linda@zanet.co.za">linda@zanet.co.za</a> 

 
<p>Our users no not have valid command shells in the /etc/passwd file (they
have /etc/ppp/ppp.sh). I would like the users to use procmail to process
each users mail but .forward returns an error saying user does not have a
vaild shell.

<p>The .forward file has the following entry
<pre>|IFS=' '&&exec /usr/local/bin/procmail -f-||exit 75 #justin</pre>

<p>How can I make this work ???
<p>Cheers Justin

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I suspect that its actually 'sendmail' that issuing the
	complaint.

<p>	Add the ppp.sh to your /etc/shells file.
	procmail will still use /bin/sh for processing the 
	recipes in the .procmailrc file.

<p>	Another method would be to use procmail as your local
	delivery agent.  In your sendmail "mc" (m4 configuration 
	file) you'd use the following:

<pre>FEATURE(local_procmail)</pre>

<p>	(and make sure that your copy of procmail is in a place
	where sendmail can find it -- either using symlinks or
	by adding:

<pre>define(`PROCMAIL_PATH', /usr/local/your/path/to/procmail);</pre>

<p>	Then you don't have to muss with .forward files at all.
	'sendmail' will hand all local mail to procmail which will
	look for a .procmailrc file.

<p>	Another question to as is whether you want to use your 
	ppp.sh has a login shell at all.  If you want people to 
	login in and be given an automatic PPP connection I'd look
	at some of the cool features of mgetty (which I haven't 
	used yet -- but seen in the docs).

<p>	These allow you to define certain patterns that will be 
	caught by 'mgetty' when it prompts for a login name -- 
	so that something like Pusername will call .../ppplogin
	while Uusername will login with with 'uucico' etc.

<p>	If you want to limit your customers solely to ppp services
	and POP (with procmail) then you've probably can't do it in
	any truly secure or reasonably way.  Since the .procmailrc
	can call on arbitrary external programs -- the user with a 
	valid password and account can access other services on the 
	system.  Also the ftp protocol can be subverted to provide
	arbitrary interactive access -- unless it is run in a 
	'chroot' environment -- one which would make the processing
	of updating the user's .procmailrc and any other .forward or
	configuration files a hassle.

<p>	It can be done -- but it ultimately is more of a hassle than 
	it's worth.  So if you want to securely limit your customers'
	from access to interactive services and arbitrary commands
	you'll want to look at a more detailed plan than I could 
	write up here.
<p>
--
Jim 



<p><hr><p> 
<!--================================================================-->

<a name="var"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
/var/log/messages
</h3>
<P><B>
From: Mike West, <a href="mailto:mwest@netpath.net">mwest@netpath.net</a><br>

<P>Hi Jim,

This may seem like a silly question, but I've been unable to find any 
HOW-TOs or suggestions on how to do it right.  My question is, how should 
I purge my /var/log/messages file?  I know this file continues to grow.  
What would be the recommended way to purge it each month?  Also, are 
there any other log files that are growing that I might need to know 
about?  Thanks in advance Jim.


</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I'm sorry to have dropped the ball on your message.
	Usually when I don't answer a LG question right away
	it's because I have to go do some research.  In this case
	it was that I knew exactly what I wanted to say -- which would be
	"read my 'Log Management' article in the next issue of LG"
	
<p>	However haven't finished the article yet.  I have finished 
	the code.

<p>	Basically the quick answer is:  

<pre>		rm /var/log/messages
		kill -HUP $(cat /var/run/syslog.pid)
</pre>
	(on systems that are configured to conform to the FSSTND 
	and putting a syslog.pid file in /var/run).

<p>	The HUP signal being send to the syslogd process is to 
	tell it to close and re-open its files.  This is necessary 
	because of the way that Unix handles open files.
	"unlinking" a file (removing the directory entry for it)
	is only a small part of actually removing it.  Remember that
	real information about a file (size, location on the device,
	ownership, permissions, and all three date/time stamps for 
	access, creation, and modification) is stored in the 
	"inode."  This is a unique, system maintained data structure.
	One of the fields in the inode is a "reference" or "link" 
	count.  If the name that you supplied to 'rm' was the only
	"hard link" to the file than the reference count reaches
	zero.  So the filesystem driver will clear the inode and
	return all the blocks that were assigned to that file to the
	"free list" -- IF THE FILE WASN'T OPEN BY ANY PROCESS!

<p>	If there is any open file descriptor for the file -- then
	the file is maintained -- with no links (no name).  This 
	is because it could be critically bad to remove a file out
	from under a process with no warning.

<p>	So, many daemons interrupt a "Hang-up" signal (sent via
	the command 'kill -HUP') as a hint that they should
	"reinitialize in some way.  That usually means that they 
	close all files, re-read any configuration or options files
	and re-open any files that they need for their work.

<p>	You can also do a 
<pre>		
		cp /dev/null /var/log/messages
</pre>
	.. and you get away without doing the 'kill -HUP'.

<p>	I don't really know why this doesn't get the syslog 
	confused -- since it's offset into the file is all 
	wrong.  Probably this generates a "holey" file -- which
	is a topic for some other day.

<p>	Another quick answer is:

		Use the 'logrotate' program from Red Hat.

		(That comes with their 4.1 distribution -- and
		is probably freely usable if you just want to 
		fetch the RPM from their web site.  If you don't
		use a distribution that support RPM's you can 
		get converters that translate .rpm files into
		tar or cpio files.  You can also just use
		Midnight Commander to navigate through an RPM 
		file just like it was a tar file or a directory).

<p>	The long answer looks a little more like:

<pre>
#! /bin/bash
## jtd: Rotate logs

## This is intended to run as a cron job, once per day
## it renames a variety of log files and then prunes the
## oldest.

cd /var/log
TODAY=$(date +%Y%m%d)	# YYYYMMDD convenient for sorting

function rotate {
	cp $1 OLD/${1}.$TODAY
	cp /dev/null $1
	}

rotate maillog
rotate messages
rotate secure
rotate spooler
rotate cron

( echo -n "Subject: Filtered Logs for:  " ; date "+%a %m/%d/%Y"
echo; echo; echo;
echo "Messages:"
/root/bin/filter.log /root/lib/messages.filter  OLD/messages.$TODAY

echo; echo; echo "Cron:"
/root/bin/filter.log /root/lib/cron.filter OLD/cron.$TODAY

echo; echo; echo "--"; echo "Your Log Messaging System"
echo; echo; echo ) | /usr/lib/sendmail -oi -oe  root
## End of rotate.logs
</pre>

<p>	That should be fairly self explanatory except for the 
	part at the end with the (....) | sendmail ....
	stuff.  The parenthese here group the output from all
	of those commands into the pipe for sendmail -- so the
	provide a whole message for sendmail.  (Otherwise
	only the last echo would go to sendmail and the
	rest would try to go to the tty of the process that ran
	this -- which (when cron runs the job) will generate a
	different -- much uglier -- piece of mail.

<p>	Now there is one line in the sendmail group that bears
	further explanation:

/root/bin/filter.log /root/lib/messages.filter  OLD/messages.$TODAY

<p>	This is a script (filter.log) that I wrote -- it 
	takes a data file (messages.filter) that I have created
	in little parts over several weeks and still have to 
	update occasionally.

<p>	Here's the filter.log script:

<pre>
#!  /usr/bin/gawk -f
	# filter.log
	# by James T. Dennis

	# syntax filter.log patternfile  datafile [datafile2 .....]

	# purpose -- trim patterns, listed in the first filename
	# from a series of data files (such as /var/adm/messages)
	# the patterns in the patternfile should take the form
	# of undelimited (no '/foo/' slashes and no "foo" quotes)

        # Note:  you must use a '-' as the data file parameter if 
        # if you to process stdin (use this as a filter in a pipe
        # otherwise this script will not see any input from it!

ARGIND == 1  { 
		# ugly hack. 
	# allows first parameter to be specially used as the 
	# pattern file and all others to be used as data to 
	# be filtered; avoids need to use 
	# gawk -v patterns=$filename ....  syntax.
	if ( $0 ~/^[ \t]*$/ ) { next }  # skip blank lines
		# also skip lines that start with hash
		# to allow comments in the patterns file.
	if ( $0 !~ /^\#/ ) { killpat[++i]=$0 }}

ARGIND > 1 { 
	for( i in killpat ) { 
	 	if($0 ~ killpat[i]) { next }}}
 
 ARGIND > 1 { 
	 print FNR ": " $0 }
</pre>
<p>	That's about eight lines of gawk code.  
	I hope the comments are clear enough.  All this
	does is reads one file full of pattern, and then
	use that set of patterns as a filter for all of the
	rest of the files that are fed through it.

<p>	Here's an excerpt from my ~root/lib/messages.filter
	file:
<pre>
... ..? ..:..:.. antares ftpd\[[0-9]+\]: FTP session closed
... ..? ..:..:.. antares getty\[[0-9]+\]: exiting on TERM signal
... ..? ..:..:.. antares innd: .*
... ..? ..:..:.. antares kernel:[ \t]*
... ..? ..:..:.. antares kernel:   Type: .*
</pre>

<p>	Basically those first seventeen characters on each 
	line match any date/time stamp -- the antares 
	obviously matches my host name and the rest of each
	line matches items that might appear in my messages 
	file that I don't care about.

<p>	I use alot of services on this machine.  My filter
	file is only about 100 lines long.  This scheme trims
	my messages file (several thousand lines per day)
	down to about 20 or 30 lines of "different" stuff
	per day.

<p>	Everyone once in awhile I see a new pattern that 
	I add to the patterns list.

<p>	This isn't an ideal solution.  It is unreasonable to 
	expect of most new Linux users (who shouldn't "have to"
	learn this much about regular expressions to winnow 
	the chaff from their messages file.  However it is
	elegant (very few lines of code -- easy to understand
	exactly what's happening).

<p>	I thought about using something like swatch or some other
	log management package -- but my concern was that these are
	looking for "interesting things" and throwing the rest 
	away.  Mine looks for "boring things" and whatever is 
	left is what I see.  To me anything that is "unexpected"
	is interesting (in my messages file) -- so I have to use a 
	fundamentally different approach.

	I look at these messages files as a professional sysadmin.
	They may warn me about problems before my users notice them.

	(incidentally you can create a larger messages file that
	handles messages for many hosts -- if you are using 
	remote syslogging for example).

<p>	Most home users can just delete these files with abandon. 
	They are handy diagnostics -- so I'd keep at least a few
	days worth of them around.  
<p>
--
Jim 


<p><hr><p> 
<!--================================================================-->

<a name="show"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
OS Showdown
</h3>
<P><B>

From: William Macdonald <a href="mailto:will@merchant.clara.net">will@merchant.clara.net</a><br>
Subject: OS showdown 
 
<p>Hi,
I was reading one of the British weekly computing papers this week and
there was an article about a shoot out between Intranetware and NT. 
This was to take place on 20th May in the Guggenhiem museum in NYC.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Intranetware sounds interesting.  Sadly I think it may be
	too little, too late in the corporate world.  However, if 
	Novell picks the right pricing strategy and niche they may be 
	able to come back in from the bottom.

<p>	I won't talk about NT -- except when someone is paying me 
	for the discomfort.

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
 
<p>The task was to have a system offering an SQL server that could process
1 billion transasctions in a day.  This was supposed to be 10 time what
Visa requires and 4 time what a corporation like American Airlines.  It
was all about proving that these OSs could work reliably in a mission
critical environment. 

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	If I wanted to do a billion SQL transactions a day I'd probably 
	look at a Sun Starfire running Solaris.  The Sun Starfire
	has 64 SPARC (UltraSPARC's??) running in parallel.

<p>	Having a face off between NT and Netware (or "Intra" Netware 
	as they've labelled their new release) in this category is 
	really ignoring the "real" contenders in the field of SQL.

<p>	Last I heard the world record for the largest database system
	was owned by Walmart and ran on Tandem mini-computers.  However
	that was several years ago.  

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>I haven't seen the follow up article yet so I can't say what the result
was.  The paper was saying it was going to be a massive comp with both
the boss' there etc.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Sounds like typical hype to me.  Pick one or two companies
	that you think are close to you and pretend that your small
	group comprises the whole market.

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>How would linux fair in a comp like this ??  The hardware resources were
virtually unlimited.  I think the NT box was a compaq 5000 (proliant
??).  Quad processors, 2 GB RAM, etc.
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	The OS really doesn't have to much to do with the SQL 
	performance.  The main job of the OS in running an SQL 
	engine is to provide system and file services as fast as
	possible and stay the heck out of the way the real work.

<p>	The other issue is that the hardware makes a big difference.
	So a clever engineer could make a DOG of a OS still look 
	like a charging stallion -- by stacking the hardware in
	his favor.

<p>	If it was me -- I'd think about putting in a few 
	large (9 Gig) "silicon disks."  A silicon disk is really
	a bunch of RAM that's plugged into a special controller
	that makes it emulate a conventional IDE or SCSI hard 
	drive.  If you're Microsoft or Novell and you're serious 
	about winning this (and other similar) face offs -- the
	half a million bucks you spend on the "silicon disks" 
	may pay for itself in one showing.

<p>	In answer to your question -- Linux, by itself, can't 
	compete in this show -- it needs an SQL server.  Postgres
	'95 is, from what I've seen and heard, much too lightweight
	to go up against MS SQL Server -- and probably no match for
	whatever Novell is using.  mSQL is also pretty lightweight.
	Mind you P'gres '95 and mSQL are more than adequate for 
	most businesses -- and have to offer a price performance
	ratio that's unbeatable (even after figuring in "hidden"
	and "cost of ownership" factors).  I'm not sure if Beagle
	is stable enough to even run.

<p>	So we have to ask:<br>

		What other SQL packages are available for Linux?<br>

	Pulling out my trusty _Linux_Journal_1997_Buyers's_Guide_
	(and doing a Yahoo! search) I see:

<ul>
<li><a href="http://www.solidtech.com">Solid</a>

<li><a href="http://www.justlogic.com">Just Logic Technologies</a> 

<li><a href="http://www.yard.de">YARD Software GmbH</a> 
</ul>
<p>	That's all that are listed in the Commercial-HOWTO
	However -- here's a few more:

<ul>
<li><a href="http://www.infoflex.com">Infoflex</a>--
		(which goes into my Lynx hall of shame list --
		it was quite a challenge reading that without
		resorting to a GUI).

<li><a href="http://www.vbix.com/dbix.html">DBIX Information</a> -- (SQL Server???)
			
<li><a href="http://www.inter-soft.com/html/products/sqlserver.html">InterSoft</a>(Essential -- SQL Engine)

<li><a href="http://www.bytedesigns.com">Byte Designs Home on the Internet</a> 
(ISAM with ODBC/SQL gateways)

<li><a href="http://tiny.iapnet.com/rob/beagle.html</a>Beagle SQL</a>--Free client server SQL database engine.
</ul>
<p>	And here's a couple of articles (not about SQL servers --
	just making references to SQL and Linux or Unix):

<ul>
<li><a href="http://think.ucdavis.edu/~cgi/SQLGate/SQLGateUserGuide.html">SQLGate User's Guide</a> -- (Embedding SQL in HTML)

<li><a href="http://ww.datamation.com/PlugIn/issues/april15/04bint10.html">April-15-1995 DATAMATION: International</a> -- Article on Linux
</ul>
<p>	Sadly the "big three" (Informix, Oracle, and Sybase) 
	list nothing about Linux on their sites.  I suspect they 
	still consider themselves to be "too good" for us -- and 
	they are undoubtedly tangled in deep licensing aggreements
	with SCO, Sun, HP, and other big money institutions.  So
	they probably view us as a "lesser threat" -- (compared
	to the 800 lb gorilla in Redmond).  Nonetheless -- it doesn't
	look like they are willing to talk about Linux on their 
	web pages.

<p>	I'd also like to take this opportunity to lament the 
	poor organization and layout of these three sites.  These
	are the large database software companies in the world --
	and they can create a simple, INFORMATIVE web site.  Too 
	much "hype" and not enough "text."

<p>	(My father joked:  "Oh! you meant 'hypertext' -- I thought
	it was 'hype or text'"  -- Obviously too many companies
	hear it the same way and choose the first option of a 
	mutually exclusive pair).
 

<p>--
Jim 




<p><hr><p> 
<!--================================================================-->

<a name="adding"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Adding Linux to a DEC XLT-366
</h3>
<P><B>

From: Alex Pikus of WEBeXpress <a href="mailto:alex@webexpress.net">alex@webexpress.net</a>

<p>I have a DEC XLT-366 with NTS4.0 and I would like to add Linux to it.  I
have been running Linux on an i386 for a while.

I have created 3 floppies:
<ol>
<li>Linload.exe and MILO (from DEC site)
<li>Linux kernel 2.0.25
<li>RAM disk
</ol>
<p>I have upgrade AlphaBIOS to v5.24 (latest from DEC) and added a Linux
boot option that points to a:\

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	You have me at a severe disadvantage.  I'll be running
	Linux on an Alpha based system for the first time next
	week.

	So I'll have to try answering this blind.

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>When I load MILO I get the "MILO&gt;" prompt without any problem.  When I
do "show" or "boot ..." at the MILO&gt;" I get the following result ...
SCSI controller gets identified as NCR810 on IRQ 28 ... test1 runs and
gets stuck "due to a lost interrupt" and the system hangs ...
In WinNTS4.0 the NCR810 appears on IRQ 29.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>     My first instinct is the ask if the autoprobe code in
	Linux (Alpha) is broken.  Can you use a set of command-line
	(MILO) parameters to tell pass information about your 
	SCSI controller to your kernel?  You could also see about
	getting someone else with an Alpha based system to compile
	a kernel for you -- and make sure that it has values in 
	it's scsi.h file that are appropriate to your system -- as
	well as insuring that the corrective drivers are built in.

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>How can make further progress here?

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	It's a tough question.  Another thing I'd look at 
	is to see if the Alpha system allows booting from a
	CD-ROM.  Then I'd check out Red Hat's (or Craftworks')
	Linux for Alpha CD's -- asking each of them if they 
	support this sort of boot.

<p>	(I happened to discover that the Red Hat Linux 4.1 (Intel)
	CD-ROM was bootable when I was working with one system that 
	had an Adaptec 2940 controller where that was set as an 
	option.  This feature is also quite common on other Unix
	platforms such as SPARC and PA-RISC systems -- so it is 
	a rather late addition to the PC world).
 
<p>
--
Jim 






<p><hr><p> 
<!--================================================================-->

<a name="config"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Configuration Problems of a Soundcard
</h3>
<P> <B> 

From: Stuby Bernd, <a href="mailto:eacj1049@inuers17.inue.uni-stuttgart.de">eacj1049@inuers17.inue.uni-stuttgart.de</a>

<P>Hello there,

First I have to metion that my Soundcard (MAD16 Pro from Shuttle
Sound System with an OPTi 82C929 chipset) works right under Windows.
I tried to get my Soundcard configured under Linux 2.0.25.with the same 
Parameters as under Windows but as I was booting the new compiled Kernel
the Soundcard whistled and caused terrible noise. The same happened
as I compiled the driver as a module and installed it in the kernel.
In the 'README.cards' file the problem coming up just with this
Soundcard is mentioned (something like line 3 mixer channel).
I don't know what to do with this information and how to change the
sounddriver to getting it working right.
May be there's somebody who knows how to solve this problem or where
I can find more information.

<P>With best regards
Bernd

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Sigh.  I've never used a sound card in my machine.
	I have a couple of them floating around -- and will
	eventually do that -- but for now I'll just have to 
	depend on "the basics"

<p>	Did you check the 
	<a href="http://sunsite.unc.edu/LDP/HOWTO/Hardware-HOWTO-11.html#ss11.1">Hardware-HOWTO</a>?
I see the MAD16 and this chipset listed there.  That's
encouraging.
How about the 
	<a href="http://sunsite.unc.edu/LDP/HOWTO/Sound-HOWTO-6.html">Soundcard-HOWTO</a>?

	Unfortunately this has no obvious reference to your 
	problem.  I'd suggest browsing through it in detail.
	Is your card a PnP (plug and "pray")?  I see notes
	about that being a potential source of problems.
	I also noticed a question about "noise" being "picked
	up" by the sound card<br>
	<a href="http://sunsite.unc.edu/LDP/HOWTO/Sound-HOWTO-6.html#ss6.23">http://sunsite.unc.edu/LDP/HOWTO/Sound-HOWTO-6.html#ss6.23</a>

That might not match your probelm but it's worth looking at.

<p>	Did you double check for IRQ and DMA conflicts?

	The thing I hate about PC sound cards is that most of them
	use IRQ's and DMA channels.  Under DOS/Windows you used to be
	able to be fairly sloppy about IRQ's.  When your IRQ conflicts
	caused conflicts the symptoms (like system lockups) tend to 
	get lost in the noise of other problems (like system lockups
	and mysterious intermittent failures).  Under Linux these 
	problems usually rear their ugly heads and have nowhere to 
	hide.
	
<p>	Have you contacted the 
	<a href="http://www.shuttlegroup.com/products/support/sound.html">manufacturer</a>
of the card?

	I see a Windows '95 driver.  No technical notes on 
	their sound cards -- and no mention of anything other 
	than Windows on their web site (that I could find).
	That would appear to typify the "we only do Windows"
	attitude of so many PC peripherals manufacturers.

	I've blind copied their support staff on this -- so
	they have the option to respond.

<p>	If this is a new purchase -- and you can't resolve the 
	issue any other way -- I'd work with your retailer or
	the manufacturer to get a refund or exchange this with
	hardware that meets your needs.

	An interesting side note.  While searching through 
<a href="http://av.yahoo.com/bin/query?p=%2blinux+%2bsound+%2bnoise&b=21&d=a&hc=0&hs=0">Alta
Vista</a> on 
<a href="http://www.yahoo.com">Yahoo!</a>
I found a page that described itself as 
<a href="http://romeo.pf.jcu.cz/~perex/ultra/">The Linux Ultra Sound
Project</a>.

	Perhaps that will help you choose your next PC sound system
	(if it comes to that).
<p>
--
Jim 



<p><hr><p> 
<!--================================================================-->

<a name="proc"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Procmail Idea and Question
</h3>
<P> <B> 

From: Larry Snyder, <a href="mailto:larrys@lexis-nexis.com">larrys@lexis-nexis.com</a> 

<p>Just re-read your excellent article on procmail in the May LJ.  
(And yes, I've read both man pages :-).  What I want to try is: 
<ol>
<li>Ignore the header completely
<li>Scan the body for <pre>[*emov* *nstruction*]</pre> or <pre>remove@*</pre>
<li>/dev/null anything that passes that test
</ol>
<p>This should be a MUCH cheaper (in cpu cycles) way of implementing a spam
filter than reading the header then going through all the possible domains
that might be applicable.  Most of the headers are forged in your 
average spam anyway....

<p>Not my idea, but it sounds good to me.  What do you think, and how would 
I code a body scan in the rc?


</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I think it's a terrible idea.

<p>	The code would be simple -- but the patterns you suggest
	are not very specific.

<p>	Here's the syntax (tested):

<pre>		:0 B
		* (\[.*remove.*instruction.*\]|\[.*remove@.*\])
		/dev/null
</pre>
<p>	... note the capital "B" specifies that the recipe 
	applies to the "Body" of the message --  the line 
	that starts with an asterisk is the only conditional
	(pattern) the parentheses enclose/group the regular
	expression (regex) around the "pipe" character.  The
	pipe character means "or" in egrep regex syntax. Thus
	(foo|bar) means "'foo' or 'bar'"

<p>	The square brackets are a special character in regexes
	(where they enclose "classes" of characters).  Since 
	you appeared to want to match the literal characters
	-- i.e. you wanted your phrases to be enclosed in
	square brackets -- I've had to "escape" them in my
	pattern -- so they are treated literally and not taken
	as delimiters.  

<p>	The * (asterisk) character in the regex means
	"zero or more of the preceding element" and the . (dot or 
	period) means "any single character" --  so the 
	pair of them taken together means "any optional characters"
	If you use a pattern line like:

<pre>		* foo*l</pre>

<p>	... it can match fool fooool and fooooolk and even fol but 
	not forl or foorl.  The egrep man page is a pre-requisite to
	any meaningful procmail work.  Also O'Reilly has an entire
	book (albeit a small one) on regular expressions.

<p>	The gist of what I'm trying to convey is that .* is needed
	in regex'es -- even though you might use just * in shell
	or DOS "globbing"  (the way that a shell matches filenames
	to "wildcards" is called "globbing" -- and generally does
	NOT use regular expressions -- despite some similarities 
	in the meta characters used by each).

<p>	Not also that the * token at the beginning of this line
	is a procmail thing.  It just identifies this as being
	a "condition" line.  Lines in procmail recipes usually start
	with a token like a : (colon), a * (asterisk), a | (pipe) or
	a ! (bang or exclammation point) -- any that don't 
	may consist of a folder name (either a file or a directory)
	or a shell variable assignment (which are the lines with
	= (equal signs) somewhere on them.

<p>	In other words the * (star) at the begining of that line
	is NOT part of the expression -- it's a token that tells
	the procmail processor that the rest of the line is a regex.


<p>	Personally I found that confusing when I first started with
	procmail.

<p>	Back to your original question:

<p>	I'm very hesitant to blindly throw mail away. 
	I'd consider filing spam in a special folder which is 
	only review in a cursory fashion.  That would go something
	like this:

<pre>		:0 B:
		* (\[.*remove.*instruction.*\]|\[.*remove@.*\])
		prob.spam
</pre>
<p>	Note that I've added a trailing : (colon) to the start
	of the recipe.  This whole :x FLAGS business is a throwback
	to an early procmail which required each recipe to specify
	the number of patterns that followed the start of a recipe.
	Later :0 came to mean "I didn't count them -- look at the
	first character of each line for a token."  This means that
	procmail will can forward through the patterns and -- when
	one matches -- it will execute ONE command line at the end
	of the recipe (variable assignments don't count).  

<p>	I'm sure none of that made any sense.  So :0 starts a 
	recipe, the subsequent * ... lines provide a list of patterns,
	and each recipe ends with a folder name, a pipe, or a 
	forward (a ! -- bang thingee).  The : at the *END* of the :0 B
	line is a signal that this recipe should use locking -- so that
	to pieces of spam don't end up interlaced (smashed together)
	in your "prob.spam" mail folder.  I usually use MH folders
	(which are directories in which each message takes up a single
	file -- with a number for a filename).  That doesn't require
	locking -- you'd specify it with a folder like:

<pre>		:0 
		* ^TO.*tag
		linux.gazette/.
</pre>
<p>	... (notice the "/." (slash, dot) characters at the end of this).

<p>	Also note that folder names don't use a path.  procmail
	defaults to using Mail (like elm and pine).  You can set
	the MAILDIR variable to over-ride that -- mine is set to
	$HOME/mh.  To write to /dev/null (where you should NOT
	attempt to lock the file!) you must use a full path
	(I suppose you could make a symlink named "null" in your
	MAILDIR or even do a mknod but....).  When writing procmail
	scripts just think of $MAILDIR as your "current" directory
	(not really but...) and either use names directly under it
	(no leading slashes or dot/slash pairs) or use a full path.

<p>	The better answer (if you really want to filter
	mail that looks like spam) is to write an auto-responder.
	This should say something like:

<p>	<I>The mail you've sent to foo has been trapped
	by a filtering system.  To get past the filter
	you must add the following line as the first
	line in the body of your message:

				......

		... Your original message follows:

				......</I>

<p>	... using this should minimize your risks.  Spammers
	rely on volume -- no spammer will look through thousands
	of replies like this and manually send messages with the
	requisite "pass-through" or "bypass" directive to all of 
	them.  It's just not worth it.  At the same time your
	friends and business associates probably won't mind pasting
	and resending (be sure to use a response format that 
	"keeps" the body -- since your correspondents may get
	irritated if they have to dig up their original message for
	you.

<p>	Here's where we can work the averages against the spammer.
	He uses mass mailings to shove their message into our view
	-- we can each configure our systems to require unique 
	(relatively insecure -- but unique) "pass codes" to reject
	"suspicious" mail.  Getting the "pass codes" on thousands
	of accounts -- and using them before they are changed -- is
	not a task that can be automated easily (so long as we each
	use different explanations and formatting in our "bypass"
	instructions.

<p>	More drastic approaches are:
<ul>
<li>		Require that all incoming mail be PGP, PEM or 
		S/MIME signed -- and that the signatories 
		signature be on your mail keyring.  (Enhancements 
		would allow anyone to add themselves to your 
		mail keyring if they got thier signature "counter 
		signed" by anyone on one of your other keyrings).

<li>		(Return any unsigned mail with a message of
		explanation).

<li>		Test all incoming mail against a list of 
		associates and friends -- accept anything from
		them.  Test all remaining mail against a list of 
		know spammers -- reject those with an error
		message.  Respond to all remaining mail to 
		explain your anti-spam policy -- and provide
		"bypass" instuctions (so they can add themselves
		to your accept list).

<li>		Compare the "mail" and "envelope" addresses
		(the From: and From_ (space) header lines).
		Reject any that are inconsistent.

<li>		Upgrade to a recent sendmail and configure the
		"reverse lookup" and the "rejection mailer table"
		features (which I haven't done yet -- so I 
		know NOTHING about).
</ul>
<p>	I hope some of these ideas help.

<p>	Here is a copy of one of my autoresponders for your 
	convenience:
<pre>
:0
* < 1000
* !^FROM_DAEMON
* !^X-Loop:[    ]*info@starshine.org
* ^Subject:[    ]*(procmail|mailbot)
| ((formail -rk -A "Precedence: junk" \
-A "X-Loop: info@starshine.org" ; \
echo "Mail received on:" `date`)  \
| $HOME/insert.doc -v file=$DOC/procmail.tutorial ) | $SENDMAIL -t -oi -oe
</pre>

<p>	I realize this looks ugly.  The first condition is to
	respond only to requests that are under 1K in size.
	(An earlier recipe directs larger messages to me).
	The next two try to prevent reponses to mail lists and
	things like "Postmaster@..." (to prevent some forms of
	"ringing") and check against the "eXtended" (custom) 
	header that most procmail scripts use to identify 
	mail loops.  The next one matches subjects of "procmail"
	or "mailbot."

<p>	If all of those conditions are met than the message is 
	piped to a complex command (spread over four lines -- it
	has the trailing "backslash" at the end of each of those --
	to force procmail to treat it all as a single logical line:

<p>		This command basically breaks down like so:

<pre>			(( formail -rk ...
</pre>
<p>		... the two parenthese have to do with how the
		data passes through the shell's pipes.  Each set
		allows me to group the output from a series of
		commands into each of my pipes.

<p>		.... the formail command creates a mail header
		the -r means to make this a "reply" and the -k
		means to "keep" the body.  The two -A parameters are
		"adding" a couple of header lines.  Those are enclosed
		in quotes because they contain spaces.

<p>		... the echo command adds a "timestamp" to when
		I received the mail.  The `date` (backtick "date")
		is a common shell "macro expansion" construct --
		Korn shell and others allow one to use the $(command)
		syntax to accomplish the same thing.

<p>		Now we close the inner group -- so formail's output --
		and the echo's output are fed into my little awk
		script:  insert.doc.  This just takes a parameter
		(the -v file=) and scans its input for a blank line.
		After the first blank line insert.doc prints the 
		contents of "file."  Finally it then just prints
		all of the rest of it's input.

<p>		Here's a copy of insert.doc:

<pre>#! /usr/bin/gawk -f
/^[ \t]*$/ && !INSERTED { print; system("cat " file ); INSERTED=1}
1
</pre>
<p>	... that's just three lines:  the pattern matches any line
	with nothing or just whitespace on it.  INSERTED is a variable
	that I'm using as a flag.  When those to conditions are met
	(a blank line is found *and* the variable INSERTED has not
	yet been set to anything) -- we print a blank line, call
	the system() function to cat the contents of a file -- whose
	name is stored in the 'file' variable, and we set the 
	INSERTED flag.  The '1' line is just an "unconditional true"
	(to awk).  It is thus a pattern that matches any input -- 
	since no action is specified (there's nothing in braces on 
	that line) awk takes the default action -- it prints the 
	input.

<p>		In awk the two lines:

		<pre>	1</pre>
	<p>	... and
	<pre>		{print}</pre>

<p>		... are basically the same.  They both match 
		every line of input that  reaches them and they
		both just print that and continue.

<p>	... Back to our ugly procmail recipe.  'insert.doc'
	has now "inserted" the contents of a doc file between
	formail's header and the body of the message that was
	"kept."  So we combine all of that and pipe it into 
	the local copy of sendmail.  procmail thoughtfully presets
	the variable $SENDMAIL -- so we can use it to make our 
	scripts (recipes) more portable (otherwise they would 
	break when written on a system with /usr/lib/sendmail and
	moved to a system that uses /opt/local/new/allman/sendmail
	(or some silly thing like that)).

<p>	The switches on this sendmail command are:

<ul>
<li>-t (take the header from STDIN)
<li>-oi (option: ignore lines that contain just a dot)
<li>-oe (option: errors generate mail)
</ul>
<p>	... I'll leave it as an exercise to the reader to look
	those up in the O'Reilly "bat" book (the "official" Sendmail 
	reference).

<p>	There are probably more elegant ways to do the 
	insertion.  However it is a little messy that 
	our header and our "kept" body are combined in 
	formail's output.  If we had a simple shell syntax
	for handling multiple file streams (bash has this 
	feature -- but I said *simple*) then it would be 
	nice to change formail to write the header to one
	stream and the body to another.  However we also want
	to avoid creating temp files (and all the hassles 
	associated with cleaning up after them).  So -- this is
	the shortest and least resource intensive that I've
	come up with.


<p>	So that's my extended tutorial on procmail.

<p>	I'd like to thank Stephen R. van den Berg (SRvdB)
	(creator of procmail), Eric Allman (creator of sendmail),
	and Alan Stebbens (an active contributor to the procmail
	mailing list -- and someone who's written some nice
	extensions to SmartList).

<p>	Alan Stebbens' web pages on mail handling can be found
	at:
<a href="http://reality.sgi.com/aks/mail/">http://reality.sgi.com/aks/mail</a>

<p>		
--
Jim 


<p><hr><p> 
<!--================================================================-->

<a name="uucp"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
UUCP/Linux on Caldera
</h3>
<P> <B> 
From: David Cook, <a href="mailto:david_cook@VNET.IBM.COM">david_cook@VNET.IBM.COM</a><br>

<p>We have spoken before on this issue over the caldera-users list (which I
dropped because of too much crap).

I recently gave up on Caldera's ability to support/move forward and acquired
redhat 4.1.

<p>All works well, except I cannot get uucico & cu to share properly the modem
under control of uugetty. Other comm programs like minicom and seyon have no
problem with it.

<p>Both uucico and cu connect to the port and tell me that they cannot change
the flow control !? and exit.
 
<p>If I kill uugetty, both uucico and cu work perfectly.

<p>In your discussion on the caldera newsgroup of Nov 2/96 you don't go into the
details of your inbound connection, but you mention "mgetty" as opposed to
uugetty.

<p>What works/why doesn't mine?<br>
What are pros/cons of mgetty?

<p>By the way, I agree wholeheartedly with your rational for UUCP. Nobody else seems to
apreciate the need for multiple peer connections and the inherit security
concerns with bringing up an unattended TCP connection with an ISP.

<p>Dave Cook, IBM Global Solutions.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	
<p>The two most likely problems are:

		lock files
	or
		permissions

<p>	There are three factors that may cause problems with 
	lock files:  location, name, and format.

<p>	For lock files to work you must use the same device 
	names for all access to a particular device -- i.e. if 
	you use a symlink named 'modem' to access your modem
	with *getty -- then you must use the same symlink for 
	your cu, uucico, pppd, minicom, kermit, seyon, etc.  
	(or you must find some way to force them to map the
	device name to a properly named LCK..* file). 

<p>	You must also configure each of these utilities to look
	for their lock files in the same location -- /var/lock/
	under Red Hat.  This configuration option may need to be
	done at compile time for some packages (mgetty) or it 
	might be possible to over-ride it with configuration 
	directives (Taylor UUCP) or even command line options.

<p>	The other things that all modem using packages have to 
	agree on is the format of the lock file.  This is normally
	a PID number of the process that creates the lock.   It can
	be in "text" (human readable) or "binary" form.  

<p>	Some packages never use the contents of the lock file -- 
	its mere existence is sufficient.  However most Linux/Unix 
	packages that use device lock files will verify the validity 
	of the lock file by reading the contents and checking the process
	status of whatever PID they read therefrom.  If there is 
	"no such process" -- they assume that it is a "stale" lock
	file and remove it.  

<p>	I currently have all of my packages use text format and 
	the /dev/modem symlink to /dev/ttyS1 (thus if I move my
	modem to /dev/ttyS2 or whatever -- say while migrating
	everything to a new machine -- all I have to change is 
	the one symlink).  My lock files are stored in /var/lock/

<p>	Permissions are another issue that have to be co-ordinated
	among all of the packages that must share a modem.  One 
	approach is to allow everyone write access to the modem.
	This, naturally, is a security whole large enough to steer
	an aircraft carrier through.

<p>	The most common approach is to make the /dev/ node owned
	by uucp.uucp or by root.uucp and group writable.  Then we 
	make all of the programs that access it SGID or SUID (uucp).

<p>	Here are the permissions I currently have set:
<pre>
$ ls -ald `which uucico` `which cu`  /dev/modem /dev/ttyS* /var/lock
-r-sr-s---   1 uucp     uucp       /usr/bin/cu
-r-sr-s---   1 uucp     uucp       /usr/sbin/uucico
lrwxrwxrwx   1 uucp     uucp       /dev/modem -> /dev/ttyS1
crw-rw----   1 root     uucp       /dev/ttyS0
crw-rw-r--   1 root     uucp       /dev/ttyS1
crw-------   1 root     tty        /dev/ttyS2
crw-rw----   1 root     uucp       /dev/ttyS3
drwxrwxr-x   6 root     uucp       /var/lock
</pre>
<p>	On the next installation I do I'll probably experiment
	with tightening these up a little more.  For example I
	might try setting the sticky bit on the /var/lock directory
	(forcing all file removals to be by the owner or root).
	That might prevent some programs from removing stale 
	lock files (they would have to be SUID uucp rather than 
	merely SGID uucp).

<p>	'cu' and 'uucico' are both SUID and SGID because they 
	need access to configuration files in which passwords
	are stored.  Those are mode 400 -- so a bug in minicom
	or kermit won't be enough to read the /etc/uucp/call 
	file (for example).  uucico is started by root run 
	cron jobs and sometimes from a root owned shell at 
	the console.  cu is called via wrapper script by members
	of a modem group.

<p>	Things like pppd, diald, and mgetty are always exec'd by
	root (or SUID 'root' wrappers).  mgetty is started by 
	init and diald and pppd need to be able to set routing
	table entries (which requires root).  So they don't need
	to be SUID anything.  (If you want some users to be able to 
	execute pppd you can make it SUID or you can write a simple
	SUID wrapper or SUID perl script.  I favor perl on my home 
	system and I make the resulting script inaccessible (unexecutable)
	by "other".  At customer sites with multi-user systems I 
	recommend C programs as wrappers -- a conservative approach
	that's been re-justified by recent announcements of new 
	buffer overflows in sperl 5.003).

<p>	Oddly enough ttyS2 is the null modem that runs into the 
	living room.  I do a substantial portion of my writing
	while sitting in my easy chair watching CNN and SF 
	(Babylon 5, Deep Space 9, Voyager that stuff).  

<p>	Permissions are a particularly ugly portion of Unix
	since we rightly don't trust SUID things (with all of the
	buffer overflows, race conditions between stat() and open()
	calls and complex parsing trickery (ways to trick embedded
	system(), popen() and other calls that open a shell behind
	the programmer's back -- and are vulnerable to the full range
	of IFS, SHELL, alias, and LD_* attacks).

<p>	However I'm not sure that the upcoming Linux implementation
	of ACL's will help with this.  I really need to read more
	about the planned approach.  If it follows the MLS (multi-
	layer security) model of DEC and other commercial Unix 
	implementations -- then using them make the system largely
	unusable for general-purpose computing (i.e. -- cast them
	solely as file servers).

<p>	From what I've read some of the problem is inherent in basing 
	access primarily on ID and "group member ship" (really an 
	extension of "identity").  For a long time I racked my brains
	to try to dream up alternative access control models -- and 
	the only other one I've heard of is the "capabilities" of
	KeyKOS, Multics, and the newer Eros project.

<p>	Oh well -- we'll see.  One nice thing about having the
	Linux and GNU project consolidating some much source code
	in such a small number of places is that it may just be 
	possible to make fundamental changes to the OS design and
	"fix" enough different package to allow some those changes
	to "take" (attain a critical mass).
<p>
--
Jim                                 

<p><hr><p> 
<!--================================================================-->

<a name="active"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
ActiveX for Linux
</h3>
<P> <B> 

To: John D. Messina, <a href="mailto:messina@bellatlantic.net">messina@bellatlantic.net</a><br>

<p>I was recently at the AIIM trade show in New York.  There was nothing
for Linux there, but I happened to wander over to the cyber cafe that
was set up.  I happened to be reading last month's Linux Gazette when a
Microsoft employee walked up behind me.  He was excited to find someone
who was knowledgeable about Linux - he wanted to get a copy for himself.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

	I presume that you're directing this to the "Linux Gazette
	Answer Guy."  
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
Anyway, we got to talking and he told me that Linux was getting so
popular that Microsoft had decided to port ActiveX to Linux.  Do you
know if, in fact, this is true?  If so, when might we see this port
completed?

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	I have heard the same story from other Microsoft 
	representatives (once at a Java SIG meeting where
	the MS group was showing off their J++ package).

<p>	This doesn't tell me whether or not the rumor is 
	"true" -- but it does suggest that it is an 
	"officially condoned leak."  Even if I'd heard an
	estimated ship date (I heard this back in Nov. or
	Dec.) I wouldn't give it much credence.

<p>		(That is not MS bashing by the way --
		I consider ship dates from all software
		companies and groups -- even our own 
		Linus and company -- to be fantasies).

<p>	To be honest I didn't pursue the rumor.  I asked
	the gentlemem I spoke to what ActiveX provides that
	CGI, SSI (server side includes), XSSI (extended 
	server side includes), FastCGI, SafeTCL, Java and 
	JavaScript don't.  About the only feature they could 
	think of is that it's from Microsoft.  To be honest 
	they tried valiantly to describe something -- but I 
	just didn't get it.  

<p>	So, your message as prompted me to ask this question
	again.  Switching to another VC and firing up Lynx and
	my PPP line (really must get that ISDN configured one 
	of these dasy) I surf on over to MS' web site.  

<p>	After a mildly amusing series of redirects (their sites 
	seems to be *all* .ASP (active server procedures?) files)
	I find my self at a reasonably readable index page.  That's
	hopeful -- they don't qualify for my "Lynx Hall of Shame"
	nomination.  I find the "Search" option and search on the
	single keyword "Linux."

<p>	"No Documents Match Query"

<p>	... hmm.  That would be *too* easy wouldn't it.  So I search
	on ActiveX:

<p>	"No Documents Match Query"

<p>	... uh-oh!  I thought this "Search" Feature would search 
	massive lists of press releases and "KnowlegeBase" articles
	and return thousands of hits.  Obviously MS and I are 
	speaking radically different languages.

<p>	Let's try Yahoo!

<p>	So I try "+ActiveX +Linux."  


<p>	Even more startling was the related rumor -- that 
	I heard at the same Java SIG meeting.  The Microsoft
	reps there announced Microsoft's intention to port
	IE (Internet Explorer) to Unix.  They didn't say which
	implementations of Unix would be the recipients of this
	dubious honor -- but suggested that Linux was under
	serious consideration.

<p>	(We can guess that the others would include SCO, Solaris,
	Digital, and HP-UX.  Some of MS' former bed partners
	(IBM's AIX) would likely be snubbed -- and more "obscure"
	OS' (like FreeBSD???), and "outmoded" OS' like SunOS
	are almost certainly to be ignored).

<p>	It appears that the plan is to port ActiveX to a few
	X86 Unix platforms -- and use that to support an IE
	port (I bet IE is in serious trouble without ActiveX))

<p>	They'll run the hype about this for about a year before
	shipping anything -- trying to convince people to wait a 
	little longer before adopting any other technologies.

<p>	"No! Joe!  Don't start that project in Java -- wait a 
	couple of months and those "Sun" and "Linux" users will
	be able to use the ActiveX version."

<p>	Some Links on this:

<ul>
<li><a href="http://www8.zdnet.com/pcweek/news/0303/03actx.html">PC
WEEK</a>: ActiveX moving to Unix; Netscape support lags

<li><a href="http://www.zendatta.com/workshop/techbriefs/activex.html">ActiveX--Zendetta</a>
	
<li><a href="http://antenna.infocity.co.jp/activex-howto.html">ANTENNA
ActiveX Mini-HOWTO</a>
<li>	This last one is amusing since it displays a footer at the
	end of every page:<br>

	"This server is: Digital Multia VX40 - Running RedHat Linux"


Here's one that meets my criteria for "Hall of Shame",

<li><a href="http://connected-place.co.uk">Connected Place Ltd</a>. Now
here's one that meets my criteria for "Hall of Shame".

	It contained no text on the main index page -- all icons.  
	The only reference to Linux on the site seemed to be in 
	the Keywords tag:<br>

		  &lt;META Name="KEYWORDS" Content="....&gt;<br>

	(Which repeated every term about four times -- this tag was 
	a half a screenful long).  Unfortunately it showed up 
	first in the hits list (first page in English that is --
	the one French page that preceded just had an "I've moved
	notice" -- or maybe it was a "You're a silly goat" message
	-- my French never was that good).

<li><a href="http://syrinx.res.cmu.edu/programmers.html">Jason't
Programmer Corner</a>
	... which started with the words,<br>
"ActiveX Sucks!"<br>

	... and said nothing else on the matter.  However,
	it doesn't make it into the Hall of Shame -- because
	the page is well organized, easily read -- only two
	"un-ALT'd" icons on several pages of information -- and
	has many good Linux and other links.  Even the "hit counter"
	works in Lynx saying, <br>

"You are visitor number 253 since 8.4.97"<br>
</ul>
<p>	Everybody who uses NetNews or E-Mail should read the little
	essay on "Good Subject Lines."

	A promising page which I didn't have time to properly
	peruse is
<ul>
<li><a href="http://www.blueriver.net/~wyrm/program.html">Sean Michael Mead's
Computer Programming Links</a>

	 which had "ActiveX" in the Meta, Keywords tag --
	but no obvious links to ActiveX content.

<p>	There was alot of good info on Java, Linux, HTML,
	Ada, TCL and many other topics.  I wouldn't be surprised
	if there was something about ActiveX somewhere below
	this page.  <br>

	Suggestion: Sean -- Install Glimpse!<br>

	(I've copied many of the owners/webmasters at the 
	sites I'm referring to here).

<li><a href="http://www.dimensionx.com/products/lr/download/index.html">ActiveX
Resources</a>,

	only had one reference to Linux.  This noted that
	the "Liquid Reality Toolkit" is a "is a set of Java class 
	libraries that gives you VRML functionality."

<p>Sounds interesting and wholly unrelated to ActiveX.
</ul>

<p>Conclusion:

	Microsoft's mumblings to Linux users about porting IE and
	ActiveX to Linux is interesting.  The mumbling is more 
	interesting than any product they deliver is likely to be.  
	I still don't know what ActiveX "does" well enough to 
	understand what "supporting ActiveX under Linux" would mean.

<p>	It seems that ActiveX is a method of calling OCX and DLL
	code.  That would imply that *using* ActiveX controls on 
	Linux would require support for OCS and DLL's -- which would 
	essentially mean porting all of the Windows API to work
	under Linux.

<p>	Now I have alot of trouble believing that Microsoft will
	deliver *uncompromised* support for Windows applications
	under Linux or any other non-Microsoft OS.  

<p>	Can you imaging Bill Gates announcing that he's writing a 
	multi-million dollar check to support the WINE project?  
	If that happens I'd suggest we call in the Air Force with 
	instructions to rescue the poor man from whatever UFO 
	snatched him -- and get the FBI to arrest the imposter!

<p>	What's amazing is that this little upstart collection of
	freeware has gotten popular enough that the largest software
	company in the world is paying any attention to it at all.

<p>	Given Microsoft's history we have to assume that any 
	announcement they make regarding Linux is carefully 
	calculated to offer them some substantial benefit in
	their grand plan.  That grand plan is to dominate the 
	world of software -- to be *THE* software that controls
	everything (including your toaster and your telephone)
	(and everyone???).

<p>	This doesn't mean that we should react antagonistically
	to these announcements.  The best bet -- for everyone
	who must make development or purchasing plans  for any
	computer equipment -- is to simply cut through as much
	of the hype as possible and ask:

		What are the BENEFITS of the package
		that is shipping NOW?

<p>	Don't be swayed by people who talk about FEATURES
	(regardless of whether they are from from Microsoft, 
	the local used car lot, or anywhere else).

<p>	The difference between BENEFITS and FEATURES is simply
	this -- 

		Benefits are relevant to you.

<p>	The reason software publishers and marketeers in general
	push "features" is because they are engaged in MASS 
	marketing.  Exploring and understanding individual 
	set of requirements is not feasible in MASS marketing.

<p>	(Personally one of the features that I find to be a 
	benefit in the Linux  market is the lack of hype.  I 
	don't have to spend time translating marketese and 
	advertisian into common English).


<p>	I hope this answers your question.  The short answers are:

<p>		Is it true (that MS is porting ActiveX to *ix)?

<p>			The rumor is widespread by their employees
			-- but there are no "official" announcements
			that can be found on their web site with 
			their own search engine.

<p>		When might we see it?

			Who nows.  Let's stick with NOW.

<p>	Finally let me ask this:

	What would you do with ActiveX support under Linux?
	Have you tried WABI?  Does ActiveX work under Windows 3.1
	and/or Windows 3.11?  Would you try it under WABI?

<p>	What are your requirements (or what is your wishlist)?

		(Perhaps the Linux programming community can 
		 meet your requirements and/or fullfill your 
		 wishes more directly).

<p><hr><p> 
<!--================================================================-->

<a name="pack"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
What Packages Do I Need?
</h3>
<P> <B> 

From: buck, <a href="mailto:buck@athenet.net">buck@athenet</a>

<p>I just installed Redhat 4.1 and was not sure what packages that I really
needed so I installed a lot just to be safe. The nice thing is that
Redhat 4.1 has the package manager that I can use to safely remove
items. Well seeing as how my installation was about 400 megs I really
need to clean house here to reclaim space. Is is save to remove the
developement packages and a lot of the networking stuff that I
installed. And what about the shells and window managers that I don't
use. I have Accelerated X so I know that I can get rid of a lot off the
X stuff. I need my space back!
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	Since you just installed this -- and haven't had much time
	to put alot of new, unrecoverable data on it -- it should be
	"safe" to do just about anything to it.  The worst that will
	happen if you trim out to much is that you'll have to re-install.

<p>	I personally recommend the opposite approach.  Install the 
	absolute minimum you think is usable.  Then *add* packages
	one at a time.

<p>	I also strongly suggest creating a /etc/README file.  
	Create it *right after* you reboot you machine following
	the install process.  Make a dated note in there for 
	each *system* level change you make to your system.
	(My rule of thumb is that anything thing I edited 
	or installed as 'root' is a "system" level change).


<P>Most of my notes are in the form of comments near the top
	of any config files or scripts that support them. Typical 
	notes in /etc/README would be like:

		
		<PRE>Sun Apr 13 15:32:00 PDT 1997: jimd

			Installed mgetty.  See comments in 
			/usr/local/etc/mgetty/*.config.

		Sun May  4 01:21:11 PDT 1997: jimd

			Downloaded 2.0.30 kernel.
			unpacked into /usr/local/src/linux-2.0.30
			and replace /usr/src/linux symlink 
			accordingly.

			Picked *both* methods of TCP SYN
			cookies.  Also trying built-in kerneld
			just about everything is loadable modules.
			Adaptec SCSI support has to be built-in
			though.

			Needed to change rc files to do the
			mount of DOS filesystem *after* rc.modules.
			
	... etc.</pre>

<p>	Notice that these are free form -- a date, and login
	name (not ROOT's id -- but whoever is actualy doing
	work as root).  I maintain a README even on my 
	home machines.  

<p>	The goal is to keep notes that are good enough that 
	I could rebuild my system with all the packages I 
	currently use -- just using the README. It tells me 
	what packages I installed and what order 
	I installed them in.  It notes what things seemed 
	important to me at the time (like the note that 
	trying to start a kernel whose root filesystem is on
	a SCSI disk requires that the kernel be compile with
	that driver built-in -- easy to overlook and time consuming
	to fix if you forget it).

<p>	Sometime I ask myself questions in the README -- like:

		"Why is rnews throttling with this error:..."

	(and an excerpt from my /var/log messages).

<p>	This is handy if you later find that you need to correlate
	an anomaly on your system with some change made by your
	ISP -- or someone on your network.

<p>	Of course you could succumb to the modern trend -- buy
	another disk drive.  I like to keep plenty of those
	around.  (I have about 62Mb of e-mail currently cached
	in my mh folders -- that's built up since I did a fresh
	install last August -- with a few megs of carry over from
	my previous installation).
<p>
--
Jim                                 

<p><hr><p> 
<!--================================================================-->

<a name="users"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Users and Mounted Disks
</h3>
<P> <B> 

To: John E. (Ned) Patterson, <a href="mailto:jpatter@flanders.mit.edu">jpatter@flanders.mit.edu</a>,br>
 
<p>As a college student on a limited budget, I am forced to comprimise
between Win95 and Linux.  I use linux for just about everything, but
need the office suite under Win95 since I can't afford to buy
something for Linux.  (Any recommendations you have for cheep
alternatives would be appreciated, but that is not the point of the
question.)

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I presume you mean MS Office.  (Caps mean a bit here).
	I personally have managed to get by without a couple of 
	Office (Word or Excel) for some time.  However I realize 
	that many of us have to exchange documents with <sarcasm>
	"less enlightened"</sarcasm> individuals (like professors
	employers and fellow students).

<p>	So getting MS Office so you can handle .DOC and .XLS 
	(and maybe PowerPoint) files is only a venial sin in 
	the Church of Linux (say a few "Hail Tove's" and go in
	peace).

<p>	As for alternatives:  Applixware, StarOffice, CliqSuite,
	Corel Application Suite (in Java), Caldera's Internet Office
	Suite, and a few others are out there.  Some of them can 
	do some document conversions from (and to??) .DOC format.
	
<p>	Those are all applications suites.  For just spreadsheets
	you have Xess, Wingz and others.

<p>	In addition there are many individual applications.
	Take a look at the Linux Journal Buyer's Guide Issue for
	a reasonably comprehensive list of commercial applications
	for Linux (and most of the free was as well).

<p>	Personally I use vi, emacs (in a vi emulation mode -- to 
	run M-x shell, and mh-e), and sc (spreadsheet calculator).

<p>	Recently I've started teaching myself TeX -- and I have
	high hopes for LyX though I haven't even seen it yet.

<p>	Unfortunately there is no good solution to the problem of 
	proprietary document formats. MS DOC and MS XLS files are
	like a stranglehold on corporate America.  I can't really 
	blame MS for this -- the competition (including the 
	freeware community) didn't offer a sufficiently attractive
	alternative.  So everyone seems to have stepped up to the
	gallows and stuck their own necks in it.

<p>	"Owning" an ubiquitous data format is the fantasy of 
	every commercial software company.  You're customers will
	pass those documents around to their associates, vendors,
	even customers, and *expect* them to read it.  Obviously 
	MS is trying to leverage this by "integrating" their 
	browser, mailer, spreadsheet, and word processors together
	with OLE, DSOM, ActiveX and anything else they can toss
	together.

<p>	The idea is to blur everything together so that customers
	link spreadsheets and documents into their web pages and
	e-mail -- and the recipients are then forced to have the
	same software.  Get a critical mass doing that and 
	"everyone" (except a few fringe Unix weirdos like me)
	just *HAS* to belly up and buy the whole suite.

<p>	This wouldn't be so bad -- but then MS has to keep revenues
	increasing (not just keep them flowing -- but keep them
	*increasing*).  So we get upgrades.  Each component of your
	software system has to be upgraded once every year or two --
	and the upgrade *MUST* change some of the data (a one way
	conversion to the new format) -- which transparently makes
	your data inaccessible to anyone who's a version behind. 

<p>	Even that wouldn't be so bad.  Except that MS also has its
	limits.  It can't be on every platform (so you can't access
	that stuff from your SGI or your Sun or your HP 700 or your
	OS/400).  Not that MS *couldn't* create applications for
	these platforms.  However that might take away some of Intel's
	edge -- and MS can't *OWN* the whole OS architecture on your
	Sun, SGI, HP or AS/400.

<p>	But enough of that diatribe.  Let's just say -- I don't
	like proprietary file formats.
 
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
I mount my Win95 partition under /mnt/Win95, and would like to have
write permission enabled for only certain users, much like that which
is possible using AFS.  Recognizing that is not terribly feasable, I
have resorted to requireing root to mount the partition manually, but
want toi be able to write to it as a random user, as long as it is
mounted.  The rw option for mount does not seem to cut the mustard,
either.  it allows write for root uid and gid, but not anyone else.
Any suggestions?

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

	You can mount your Win95 system to be writable by a 
	specific group.  All you have to do is use the right
	options.  Try something like:
<pre>
mount -t umsdos -w -ogid=10,uid=0,umask=007 /dev/hda1 /mnt/c
</pre>
<p>	(note: you must use numeric GID and UID values here
	-- mount would look them up by name!)

<p>	This will allow anyone in group 10 (wheel on my system)
	to write to /mnt/c.

<p>	There are a few oddities in all of this.  I personally
	would prefer to see a version of 'mount' -- or an option
	to 'mount' that would mount the target with whatever 
	permissions and modes the underlying mount point had
	at mount time.  In other words, as an admin., I'd like to
	set the ownership and permissions on /mnt/c to something
	like joeshmo user with a mode of 1777 (sticky bit set).
	Then I'd use a command like:

<pre>		mount -o inherit /mnt/c /dev/hda1
</pre>
<p>	Unfortunately I'm not enough of a coder to feel comfortable
	make this change (yet) and my e-mail with the current 
	maintainer of the Linux mount (resulting from the last time
	I uttered this idea in public) suggests that it won't come
	from that source.

<p>	(While we were at it I'd also add that it would be nice
	to have a mount -o asuser -- which would be like the 
	user option in that it would allow any user (with access
	to the SUID mount program) to mount the filesystem.  The
	difference would be that the resulting mount point would be
	owned by the user -- and the nodev, nosuid etc, options would
	be enforced.)

<p>	Getting back to your question:

<p>	Another way to accomplish a similar effect (allowing
	some of your users to put files on under you /mnt/Win95
	directory) would be to create a /usr/Win95 directory --
	allow people to write files into that and use a 
	script to mirror that over to the /mnt/Win95 tree.

<p>	(Personally I think the whole this is pretty dangerous
	 -- so using the -o gid=... is the best bet).

<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="map"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
[q] Map Left Arrow to Backspace
</h3>
<P> <B> 
To: <ahref="mailto:wenbing@statcan.ca">wenbing@statcan.ca</a><br>

<p>I have a client who would like to use the left arrow key to backspace 
and erase characters to the left of the cursor. Is this possible? And
how? Thanks for an answer.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">
	
<p>Read the Keyboard-HOWTO (section 5).

	The loadkeys and xmodmap man pages, and the 
	Backspace-Mini-HOWTO are also related to this. It is 
	possible to completely remap your keys in Linux and in 
	X Windows.  You can also set up keybindings that are 
	specific to bash (using the built in bind command) and
	to bash and other programs that use the "readline" 
	library using the .inputrc file.

<p>	The Keyboard-HOWTO covers all of this.
<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="pull"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Adding Programs to the Pull Down Menus
</h3>
<P> <B> 

To: Ronald B. Simon, <a href="mailto:rbsimon@anet.bna.boeing.com">rbsimon@anet.bna.boeing.com</a><br>

<p>I have written several utility programs that I use all the time.  I 
would like to add them to either the Application or Utility "pull 
down" menu of the Start menu.  Could you address this in your Linux 
Gazette article?

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I assume you are referring to the menus for your 
	X "Window Manager."

<p>	Since you don't specify which window manager you're using
	(fvwm, fvwm95, twm, gwm, ctwm, mwm, olwm, TheNextLevel ---
	there are lots of wm's out there) -- I'll have to guess
	that you're using fvwm (which is the default) on most
	XFree86 systems.  The fvwm95 (which is a modification of
	fvwm to provide a set of menus and behaviors that is 
	visually similar to that of Windows '95) uses the same 
	file/menu format (as far as I know).

<p>	The way you customize the menus of almost any wm is to 
	edit (possibly creating) an rc file.  For fvwm that would be
	~/.fvwmrc

<p>	Here's an excerpt from mine (where I added the Wingz 
	demo):
<pre>
Popup "Apps"
        Exec    "Wingz"         exec /usr/local/bin/wingz &
        Nop     ""
        Exec    "Netscape"      exec netscape &
        Exec    "Mosaic"        exec Mosaic &
        Nop     ""
        Exec    "Elm"           exec xterm -e elm &
        Nop     ""
EndPopup

	You'd just add a line like:

	Exec	"Your App"	exec /path/to/your/app &

	.... to this.

	If you add a line like:

	PopUp	"My Menu"	MyMenu

	... and a whole section like:

PopUp "MyMenu"
	Exec	"One App"	exec /where/ever/one.app &
	Exec	"Another Toy"   exec /my/bin/toy &
EndPopUp
</pre>

<p>	... you'll have created your on submenu.

	Most other Window Managers have similar features and 
	man pages to describe them.
<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="nt"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
Linux and NT
</h3>
<P> <B> 

To: Greg C. McNichol, <a href="mailto:greg_c_mcnichol@em.fcnbd.com">greg_c_mcnichol@em.fcnbd.com</a><br>

<p>I am new to LINUX (and NT 4.0 for that matter) and would like any and all 
information I can get my hands on regarding the dual-boot issue. Any help 
is appreciated.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	More than you wanted to know about:

<p>Booting Multiple Operating Systems

<p>	There are several mini-HOW-TO documents specifically
	covering different combinations of multi-boot.  Here's
	some that can be found at: 

<a
href="http://www.linuxresources.com//LDP/HOWTO/HOWTO-INDEX.html">http://www.linuxresources.com//LDP/HOWTO/HOWTO-INDEX.html</a>
<ul>
<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+DOS+Win95">
Linux+DOS+Win95 mini-HOWTO</a><br>
  
How to use Linux and DOS and Windows95 together.
          Updated 10 September 1996.

<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+OS2+DOS">Linux+DOS+Win95
mini-HOWTO</a><br>
          How to use Linux and OS/2 and DOS together.
          Updated 20 May 1996.

<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+DOS+Win95+OS2">Linux+OS2+DOS
mini-HOWTO</a><br>
          How to use Linux and DOS and OS/2 and Win95 together.
          Updated 6 March 1996.

<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+Win95">Linux+DOS+Win95+OS2</a><br>
          How to use Linux and Windows95 together.
          Updated 25 June 1996.

<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+WinNT">
Linux+WinNT mini-HOWTO</a><br>
          How to use Linux and WindowsNT together.
          Updated 19 February 1997.

<li><a href="http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+WinNT++">
Linux+WinNT++ mini-HOWTO</a> by Kurt Swendson<br> 
How to use Linux and
WindowsNT together, with NT preinstalled.
          Updated 21 December 1996.
</ul>

<p>	Personally I think the easiest approach to make 
	Linux co-exsist with any of the DOS derived OS'
	(Win  '95, OS/2, or NT) is to use Han Lerman's
	LOADLIN package.  Available at "Sunsite":

<a href="ftp://sunsite.unc.edu/pub/Linux/system/Linux-boot/lodlin16.tgz">ftp://sunsite.unc.edu/pub/Linux/system/Linux-boot/lodlin16.tgz</a>
 (85k)


<p>	To use this -- start by installing a copy of DOS
	(or Win '95).  Be sure to leave some disk space
	unused (from DOS/Win '95's perspective) -- I like
	to add whole disks devoted to Linux.

<p>	Now install Linux on that 2nd, 3rd or nth hard drive --
	or by adding Linux partitions to the unused portion of
	whichever hard drives you're already using.  Be sure to 
	configure Linux to 'mount' your DOS partition(s)
	(make them accessible as parts of the Unix/Linux directory
	structure).  While installing be sure to answer "No"
	or "Skip" to any questions about "LILO"  (Feel free to 
	read the various HOW-TO's and FAQ's so you'll understand
	the issues better -- I'd have to give a rather complete
	tutorial on PC Architecture, BIOS boot sequence and 
	disk partitioning to avoid oversimplifying this last item)

<p>	Once you're done with the Linux installation find and 
	install a copy of LOADLIN.EXE.  The LOADLIN package 
	is a DOS program that loads a Linux kernel.  It can be
	called from a DOS prompt (COMMAND.COM or 4DOS.COM) or 
	it can be used as a INSTALL directive in your CONFIG.SYS 
	(which you'd use with any of the multi-boot features
	out there -- including those that were built into DOS
	6.x and later).  After installation you'd boot into DOS
	(or into the so-called "Safe-Mode" for Windows '95) and
	call LOADLIN with a batch file like:
<pre>
		C:
		CD \LINUX
		LOADLIN.EXE RH2013.KRN root=/dev/hda2 .....
</pre>
<p>	(Note the value of your root= parameter must correspond
	to the Linux device node for the drive and partition on
	which you've installed Linux.  This example shows the 
	second partition on the first IDE hard drive.  The first
	partition on the second IDE drive would be /dev/hdb1
	and the first "logical" partition within an extended partition
	of your fourth SCSI hard drive would be /dev/sdd5.  The
	PC Architecture specifies room for 4 partitions per drive.
	Exactly one of those (per drive) may be an "extended" partition.
	An extended partition may have an arbitrary number of 
	"logical" drives.  The Linux nomenclature for logical drives
	always starts at 5 since 1 through 4 or reserved for the 
	"real" partitions).

<p>	The root= parameter may not be necessary in some cases
	since the kernel has a default which was compiled into
	it -- and which might have been changed with the rdev 
	command.  rdev is a command that "patches" a Linux kernel
	with a pointer to it's "root device."

<p>	This whole concept of the "root device" or "root filesystem"
	being different than the location of your kernel may be 
	confusing at first.  Linux (and to a degree other forms
	of Unix) doesn't care where you put you kernel.  You can 
	put it on a floppy.  That floppy can be formatted with a DOS, 
	Minix or ext2 filesystem -- or can be just a "raw" kernel
	image.  You can put your kernel on ANY  DOS filesystem
	so long as LOADLIN can access it.

<p>	LOADLIN and LILO are "boot loaders"  they copy the 
	kernel into RAM and execute it.  Since normal DOS
	(with no memory managers loaded -- programs like EMM,
	QEMM, and Windows itself) has no memory protection
	mechanisms it is possible to load an operating sytem 
	from a DOS prompt.  This is, indeed, how the Netware 3.x
	"Network Operating System" (NOS) has always been loaded
	(with a "kernel" image named SERVER.EXE).  It is also
	how one loads the TSX-32 (a vaguely VMS like operating 
	system for 386 and later PC's).

<p>	My my example RH2013.KRN is the name of a kernel file.
	Linux doesn't care what you name it's kernel file.  I
	use the convention of naming mine LNXvwyy.KRN -- where
	v is the major version number, w is the minor version and
	yy is the build.  LNX is for a "general use" kernel that
	I build myself, RH is a kernel I got from a RedHat CD,
	YGG would be from an Yggdrasil, etc).

<p>	One advantage of using LOADLIN over LILO is that can
	have as many kernels and your disk space allows.  You can
	have them arranged in complex hierarchies.  You can have as
	many batch files passing as many different combinations of 
	of kernel parameters as you like.  LILO is limited to
	16 "stanzas" in its /lilo.conf file.

<p>	The other advantage of LOADLIN over LILO is that it is
	less scary and hard to understand for new users.  To them
	Linux is just a DOS program that you have to reboot to get 
	out of.  It doesn't involve any of that mysterious 
	"master boot record" stuff like a computer virus.

<p>	A final advantage of LOADLIN over LILO is that LOADLIN
	does not require that the root file system be located 
	on a "BIOS accessible" device.  That's a confusing 
	statement -- because I just tossed in a whole new 
	concept.  The common system BIOS for virtually ALL 
	PC's can only see one or two IDE hard drives (technically 
	ST-506 or compatible -- with a WD8003 (???) or register 
	compatible controller -- however ST-506 (the old MFM and
	RLL drives) haven't been in use on PC's since the XT)
	To "see" a 3rd or 4th hard drive -- or any SCSI hard 
	drive the system requires additional software or firmware
	(or an "enhanced BIOS").  There is a dizzying array of 
	considerations in this -- which have almost as many 
	exceptions.  So to get an idea of what is "BIOS" accessible
	you should just take a DOS boot floppy -- with no CONFIG.SYS
	at all -- and boot off of it.  Any drive that you can't see
	is not BIOS accessible.

<p>	Clearly for the vast majority of us this is not a problem.
	For the system I'm on -- with two IDE drives, two internal
	SCSI drives, one internal CD reader, an external SCSI 
	hard drive, a magneto optical drive, a 4 tape DAT autochanger
	and a new CD-Writer (which also doubles as a CD reader, of
	course) -- with all of that it makes a difference.
	
<p>	Incidentally this is not an "either/or" proposition.
	I have LILO installed on this system -- and I have
	LOADLIN as well.  LILO can't boot my main installation
	(which is on the SCSI drives.  But it can boot a second
	minimal root installation -- or my DOS or OS/2 partitions.

<p>	(I'm not sure the OS/2 partition is still there -- I 
	might have replaced that with a FreeBSD partition at
	some point).

<p>	Anyway -- once you have DOS and Linux happy -- you can 
	install NT with whatever "dual boot" option it supports.
	NT is far less flexible about how it boots.  So far as 
	I know there is no way to boot into DOS and simply
	run NT.

<p>	It should be noted that loading an OS from DOS (such as
	we've described with LOADLIN, or with FreeBSD's FBSDBOOT.EXE
	or TSX-32's RUNTSX.EXE) is a ONE WAY TRIP!   You load them
	from a DOS prompt -- but DOS is completely removed from 
	memory and there is no way to exit back to it.  To get back
	to DOS you much reboot.  This isn't a new experience to 
	DOS users.  There have been many games, BBS packages and
	other pieces of software that had not "exit" feature.

<p>	(In the case of Netware there is an option to return to 
	DOS -- but it is common to use an AUTOEXEC.NCF (netware
	control file) that issues the Netware command REMOVE DOS
	to free up the memory that's reserved for this purpose).

<p>	In any event those mini-HOWTO's should get you going.
	The rest of this is just background info.
	
<p>
--
Jim 

<p><hr><p> 
<!--================================================================-->

<a name="serv"></a>
<h3><img align=bottom alt=" " src="../gx/ques.gif">
pcmcia 28.8 Modems and Linux 1.2.13 Internet Servers
</h3>
<P> <B> 

To: Brian Justice <bboyd@netscope.net>

<p>I was browsing the web and noticed your web page on Linux.  I am not 
familar with Linux but have an ISP who uses the software on their 
server. 

<p>I was wondering if anyone at your organization knew of any problems with 
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I'm the only one at my organization -- Starshine is a 
	sole proprietorship.
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">

<p>Pentium notebooks with 28.8 modems connecting to Linux 1.2.13 internet 
servers that would do the following:
<ul>
   <li>drop connection at 28.8 after connected for several minutes
    <li>have trouble on the initial connection or reconnection
</ul>
</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	It sounds like you're saying that the Pentium Notebook
	is running some other OS -- like Windows or DOS and that
	it is using a PCMCIA modem to dial into another system
	(with unspecified modem and other hardware -- but which 
	happens to run Linux).

<p>	If that's the case then you're troubleshooting the
	wrong end of the connection.

<p>	First identify which system is having the problem --
	use the Pentium with the "piecemeal" (PCMCIA) modem to
	call a BBS or other ISP at 28.8.  Try several.  

<p>	Does your Pentium sytem have problems with all or most of them?  

<p>	If so then it is quite likely a problem with the combination 
	of your Pentium, your OS, and your piecemeal modem.  

<p>	Try booting the Pentium off of a plain boring copy of DOS 
	(with nothing but the PCMCIA drivers loaded).  Repeat the 
	other experiments.  Does it still fail on all or most of
	them?

<p>	If so then it is probably the PCMCIA drivers.  

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>Regular desktop 28.8 modems seem to work fine.  I have a few 14.4 PCMCIA
modems that seem to work fine.

<p>Would incorrect settings cause this?  Or could this be a program glitch
that doesn't support these 28.8 modems due to the low level of the
release?  I noticed their are higher versions of Linux out there.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	"incorrect settings" is a pretty vague term.  Yes. The 
	settings on your hardware *AND THEIRS* and the settings
	in your software *AND THEIRS* has to be right.  
	Yes.  The symptoms of incorrect settings (in the server 
	hardware, the modem hardware, the OS/driver software or the 
	applications software *AT EITHER END OF THE CONNECTION* could 
	cause sufficiently sporadic handshaking that one or the other 
	modem in a connection "gives up" and hangs up on the other.
	
<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>The BIG question is "Have you heard of any 28.8 PCMCIA modem problems
with Linux internet servers? "  If so, could you drop me a few lines so
I can talk this over with my ISP.   If not , do you know of any other
sites or places I can check for info about this subject.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I've heard of problems with every type of modem for every
	type of operating system running on every platform.
	None of them has been specific to PCMCIA modems with 
	Linux.  I've operated a couple of large BBS' (over a 100
	lines on one and about 50 on the other) and worked with
	a number of corporate modem pools and remote access servers.

<p>	I don't understand why your ISP would want a note from
	me before talking to you.

<p>	It sounds like your asking me to say:

		"Oh yeah!  He shouldn't be running Linux there!"

	... or to say"

		"1.2.13!  That fool -- he needs to upgrade to 2.0.30!"

	... so you can then refer this "expert" opinion to some
	support jockey at your ISP.

<p>	Now if you mean that your ISP is running Linux 1.2.13
	on a Pentium laptop with PCMCIA modems -- and using that
	as a server for his internet customers -- I'd venture to 
	say that this is pretty ludicrous.

<p>	If you were running Linux on your laptop and having problems 
	with your PCMCIA modem I wouldn't be terribly surprised.
	PCMCIA seems to be an unruly specification -- and the designers
	of PCMCIA equipment seem to have enough trouble in their 
	(often unsuccessful) attempts to support simple DOS and
	Windows users.  The programmers that contribute drivers for
	Linux often have to work with incomplete or nonexistent 
	specifications for things like video cards and chipsets --
	and PCMCIA cards of any sort.

<p>	I mostly avoid PCMCIA -- it is a spec that is ill-suited
	to any sort of peripheral other than *MEMORY CARDS*
	(which is, after all, what the letters MC stand for in this
	unpronounceable stream of gibberish that I dubbed "piecemeal"
	a few years ago).

<P><B>
<img align=bottom alt=" " src="../gx/ques.gif">
<p>Any help would be appreciated.

</B><P>
<img align=bottom alt=" " src="../gx/ans2.gif">

<p>	I could provide much better suggestions if I had more
	information about the setup.  I could even provide
	real troubleshooting for my usual fees.

<p>	However, if the problem really is specific to your
	connections with your ISP (if these same 28.8 "piecemeal"
	modems work fine with say -- your Cubix RAS server or
	your favorite neighborhood BBS), then you should probably
	work with them to resolve it (or consider changing
	ISP's).

<p>	As a side note:  Most ISP's use terminal servers on their
	modem banks.  This means that they have their modems plugged
	into a device that's similar to a router (and usually made be
	a company that makes routers).  That device controls the
	modems and converts each incoming session into an rlogin or
	"8-bit clean" telnet session on one more more ethernet
	segments.  

<p>	Their Unix or other "internet servers" don't have any 
	direct connections to any of the normal modems.  (Sometimes 
	an sysadmin will connnect a modem directly to the serial ports
	of one or more of these systems -- for administrative access
	so they can call on a special number and bypass the terminal 
	servers, routers, etc).

<p>	It's possible that the problem is purely between the two
	brands of modems involved.  Modern modems are complex
	devices (essentiall dedicated microcomputers) with substantial
	amounts of code in their firmware.  Also the modem business
	sports cutthroat competition -- with great pressure to add
	"enhancements," a lot of fingerpointing, and *NO* incentive 
	to share common code bases for interoperability's sake.
	So slight ambiguities in protocol specification lead to 
	sporadic and chronic problems.  Finally we're talking about
	analog to digital conversion at each end of the phone line.
	The phone companies have *NO* incentive to provide good
	clean (noise free) phone lines to you and your ISP.  They make
	a lot more money on leased lines -- and get very little
	complaint for "voice grade" line quality.

<p>	The problem is that none of us should have been using modem
	for the last decade.  We should have all had digital signals
	coming into our homes a long time ago.  The various phone
	companies (each a monopoly in it's region -- and all stemming
	from a small set of monopolies) have never had any incentive
	to implement this, every incentive NOT to (since they can charge
	a couple grand for installationn and several hundred per month
	on the few T1's they to do sell -- and they'll never approach
	that with digital lines to the home.  They do, however, have 
	plenty of money to make their concerns heard in regulatory
	bodies throughout the government.  So they cry "who's going
	to pay for it?" so loudly and so continuously that no one can
	hear the answer of the American people. Our answer should be 
	"You (monopolies) will pay for it -- since we (the people) 
	provided you with a legal monopoly and the funds to build OUR
	copper infrastructure"  (but that answer will never be heard).

<p>	If you really want to read much more eloquent and much 
	better researched tirades and diatribes on this topic --
	subscribe to Boardwatch magazine and read Jack Rickard
	(the editor) -- who mixes this message with new information
	about communications technology every month.
	
<p> 
--
Jim 

<P> 

<!--================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, James T. Dennis <BR> 
Published in Issue 18 of the Linux Gazette June 1997</H5></center>

<P> <hr> <P> 
<!--================================================================-->
<A HREF="./lg_toc18.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif" 
ALT="[ FRONT PAGE ]"></A> 
<A HREF="lg_bytes18.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./bash.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>bash String Manipulations</H2>
<H4>By Jim Dennis,
<a href="mailto:jimd@starshine.org">jimd@starshine.org</a></H4>
</center>
<P><HR><P>
<P>
The <i>bash</i> shell has many features that are 
sufficiently obscure you almost never see them used.  One of
the problems is that the man page offers no examples. <P>

Here I'm going to show how to use some of these features to do
the sorts of simple string manipulations that are commonly 
needed on file and path names. <H2>

Background </H2><P>

In traditional Bourne shell programming you might see references
to the <i>basename</i> and <i>dirname</i> commands.
These perform simple string manipulations on their arguments. You'll
also see many uses of <i>sed</i> and <i>awk</i> or
<i>perl -e</i> to perform simple string manipulations.<P>

Often these machinations are necessary perform on lists of filenames
and paths. There are many specialized programs that are conventionally
included with Unix to perform these sorts of utility functions: 
<i>tr</i>, <i>cut</i>, <i>paste</i>, and <i>join</i>.

Given a filename like <i>/home/myplace/a.data.directory/a.filename.txt
</i> which we'll call <b>$f</b> you could use commands like:

	<blockquote><pre>
	<i>dirname</i> <b>$f</b> 
	<i>basename</i> <b>$f</b> 
	<i>basename</i> <b>$f</b> .txt
	</pre></blockquote>

... to see output like:
	<blockquote><pre><i>
	/home/myplace/a.data.directory
	a.filename.txt
	a.filename </i></pre></blockquote>

Notice that the GNU version of <i>basename</i> takes an 
optional parameter.  This handy for specifying a filename "extension"
like <b>.tar.gz</b> which will be stripped off of the output.  Note that
<i>basename</i> and <i>dirname</i> don't verify that these parameters 
are valid filenames or paths.  They simple perform simple
string operations on a single argument. You shouldn't use wild cards
with them -- since <i>dirname</i> takes exactly one argument
(and complains if given more) and <i>basename</i> takes one argument
and an optional one which is not a filename. <P>

Despite their simplicity these two commands are used frequently in 
shell programming because most shells don't have any built-in string
handling functions -- and we frequently need to refer to just the
directory or just the file name parts of a given full file specification. <P>

Usually these commands are used within the "back tick" shell operators
like  <i>TARGETDIR=`dirname $1`</i>.  The "back tick" operators
are equivalent to the <i>$(...)</i> construct.  This latter construct
is valid in Korn shell and <i>bash</i> -- and I find it easier to read
(since I don't have to squint at me screen wondering which direction the
"tick" is slanted). <P><H2>

A Better Way </H2>

Although the <i>basename</i> and <i>dirname</i> commands
embody the "small is beautiful" spirit of Unix -- they may push the
envelope towards the "too simple to be worth a separate program" end
of simplicity. <P>

Naturally you can call on <i>sed</i>, <i>awk</i>, TCL or
<i>perl</i> for more flexible and complete string handling.
However this can be overkill -- and a little ungainly. <P>

So, <i>bash</i> (which long ago abandoned the "small is beautiful"
principal and went the way of <i>emacs</i>) has some built in
syntactical candy for doing these operations.  Since <i>bash</i>
is the default shell on Linux systems then there is no reason not to 
use these features when writing scripts for Linux.<P>

	<ul><lh>
	If your concerned about portability to other shells and
	systems -- you may want to stick with <i>dirname</i>,
	<i>basename</i>, and <i>sed</i></lh></ul><P>


<H2>
The <i>bash</i> Man Page </H2><P>

The <i>bash</i> man page is huge.  In contains a complete
reference to the "readline" libraries and how to write a <b>.inputrc</b>
file (which I think should all go in a separate man page) -- and a
run down of all the <i>csh</i> "history" or <b>bang!</b> operators
(which I think should be replaced with a simple statement like:
"Most of the <b>bang!</b> tricks that work in <i>csh</i> work the
same way in <i>bash</i>"). <P>

However, buried in there is a section on <b>Parameter Substitution</b>
which tells us that $foo is really a shorthand for ${foo} which is 
really the simplest case of several ${foo<i>:operators</i>} and similar
constructs. <P>

Are you confused, yet? <P>

Here's where a few examples would have helped.  To understand the 
man page I simply experimented with the echo command and several 
shell variables.  This is what it all means: 

	<ul><lh>
	Given:<ul><lh>
		foo=/tmp/my.dir/filename.tar.gz </lh></ul>
		</lh></ul>

	<ul>
	We can use these expressions:<dl><dt>
		path = ${foo%/*} <dd>
			To get: /tmp/my.dir (like <i>dirname</i>)<dt>
		file = ${foo##*/} <dd>
			To get: filename.tar.gz (like <i>basename</i>)<dt>
		base = ${file%%.*} <dd>
			To get: filename <dt>
		ext  = ${file#*.} <dd>
			To get: tar.gz
			</dl></ul>

	<ul><B>Note that the last two depend on the 
	assignment made in the second one</b></ul>

Here we notice two different "operators" being used inside the 
parameters (curly braces).  Those are the <b>#</b> and the <b>%</b>
operators.  We also see them used as single characters and in pairs.
This gives us four combinations for trimming patterns off the 
beginning or end of a string:<DL><DT>
	${variable%pattern} <DD>
		Trim the shortest match from the end <DT>
	${variable##pattern} <DD>
		Trim the longest match from the beginning <DT>
	${variable%%pattern} <DD>
		Trim the shortest match from the end <DT>
	${variable#pattern} <DD>
		Trim the shortest match from the beginning 
		
		</DL><P>

It's important to understand that these use shell "globbing"
rather than "regular expressions" to <b>match</b> these patterns. 
Naturally a simple string like "txt" will match sequences of exactly
those three characters in that sequence -- so the difference between
"shortest" and "longest" only applies if you are using a shell 
wild card in your pattern.<P>

A simple example of using these operators comes in the common
question of copying or renaming all the *.txt to change the 
.txt to .bak (in MS-DOS' COMMAND.COM that would be REN *.TXT *.BAK).<P>

This is complicated in Unix/Linux because of a fundamental difference
in the programming API's.  In most Unix shells the expansion of a
wild card pattern into a list of filenames (called "globbing") is done
by the shell -- before the command is executed.  Thus the command normally
sees a list of filenames (like "foo.txt bar.txt etc.txt") where DOS
(COMMAND.COM) hands external programs a pattern like *.TXT.  <P>

Under Unix shells, if a pattern doesn't match any filenames the parameter 
is usually left on the command like literally.  Under <i>bash</i>
this is a user-settable option.  In fact, under <i>bash</i> you can
disable shell "globbing" if you like -- there's a simple option to do this.
It's almost never used -- because commands like <i>mv</i>, and
<i>cp</i> won't work properly if their arguments are passed to them
in this manner.<P>

However here's a way to accomplish a similar result:

	<blockquote>
	for i in *.txt; do cp $i ${i%.txt}.bak; done
		</blockquote>

... obviously this is more typing. If you tried to create a
shell function or alias for it -- you have to figure out how to 
pass this parameters.  Certainly the following seems simple enough:

	<blockquote>
	function cp-pattern {
	for i in $1; do cp $i ${i%$1}$2; done
		</blockquote>

... but that doesn't work like most Unix users would expect.  You'd
have to pass this command a pair of specially <em>chosen</em>, and
<em>quoted</em> arguments like:

	<blockquote>
	cp-pattern '*.txt' .bak
		</blockquote>

... note how the second pattern has no wild cards and how the first is
quoted to prevent any shell globbing.  That's fine for something you
might just use yourself -- if you remember to quote it right.  It's 
easy enough to add check for the number of arguments and to ensure that
there is at least one file that exists in the $1 pattern.  However it 
becomes much harder to make this command reasonably safe and robust.  
Inevitably it becomes less "unix-like" and thus more difficult to use
with other Unix tools.<P>

I generally just take a whole different approach.  Rather than trying
to use <i>cp</i> to make a backup of each file under a slightly
changed name I might just make a directory (usually using the date
and my login ID as a template) and use a simple <i>cp</i> command
to copy all my target files into the new directory.<P>

Another interesting thing we can do with these "parameter expansion"
features is to iterate over a list of components in a single variable.<P>

For example, you might want to do something to traverse over every 
directory listed in your path -- perhaps to verify that everything
listed therein is really a directory and is accessible to you.<P>

Here's a command that will echo each directory named on your path
on it's own line:

	<blockquote>
	p=$PATH
	until [ $p = $d ]; do d=${p%%:*}; p=${p#*:}; echo $d; done
		</blockquote>

... obviously you can replace the <i>echo $d</i> part of this
command with anything you like. <P>

Another case might be where you'd want to traverse a list of directories
that were all part of a path.  Here's a command pair that echos each
directory from the root down to the "current working directory":

	<blockquote>
	p=$(pwd)
	until [ $p = $d ]; do p=${p#*/}; d=${p%%/*}; echo $d; done
		</blockquote>

... here we've reversed the assignments to <i>p</i> and <i>d</i>
so that we skip the root directory itself -- which must be "special cased"
since it appears to be a "null" entry if we do it the other way.  The 
same problem would have occurred in the previous example -- if the value
assigned to <i>$PATH</i> had started with a ":" character. <P>


Of course, its important to realize that this is not the only, or 
necessarily the best method to parse a line or value into separate 
fields.  Here's an example that uses the old <i>IFS</i> variable
(the "inter-field separator in the Bourne, and Korn  shells as well as 
<i>bash</i>) to parse each line of <i>/etc/passwd</i> and extract 
just two fields:

		
		<blockquote><pre>
		cat /etc/passwd | ( \
			IFS=: ; while read lognam pw id gp fname home sh; \
				do echo $home \"$fname\"; done \
				)
			</pre></blockquote>

Here we see the parentheses used to isolate the contents in a subshell
-- such that the assignment to IFS doesn't affect our current shell.
Setting the IFS to a "colon" tells the shell to treat that character as 
the separater between "words" -- instead of the usual "whitespace" that's
assigned to it.  For this particular function it's very important that
IFS consist solely of that character -- usually it is set to "space,"
"tab," and "newline.<P>

After that we see a typical <i>while read</i> loop -- where we
read values from each line of input (from <i>/etc/passwd</i> into
seven variables per line.  This allows us to use any of these fields
that we need from within the loop.  Here we are just using the <i>
echo</i> command -- as we have in the other examples.<P>

My point here has been to show how we can do quite a bit of 
string parsing and manipulation directly within <i>bash</i>
-- which will allow our shell scripts to run faster with less overhead
and may be easier than some of the more complex sorts of pipes and 
command substitutions one might have to employ to pass data to the
various external commands and return the results. <P>

Many people might ask: <i>Why not simply do it all in <b>perl</b>?</i>
I won't dignify that with a response.  Part of the beauty of Unix is
that each user has many options about how they choose to program something.
Well written scripts and programs interoperate regardless of what particular
scripting or programming facility was used to create them.  Issue the
command <i>file /usr/bin/*</i> on your system and and you may be 
surprised at how many Bourne and C shell scripts there are in there<P>

In conclusion I'll just provide a sampler of some other 
<i>bash</i> parameter expansions:

	<DL><DT>
	<i>${parameter:-word}</i><DD>
	Provide a default if <i>parameter</i> is unset or null.<br>
	Example:<ul><lh>
	      <i> echo ${1:-"default"}</i></lh></ul><DT>

Note:  this would have to be used from within a
functions or shell script -- the point is to show 
that some of the parameter substitutions can be use
with shell numbered arguments.   In this case the
string "default" would be returned if the function
or script was called with no $1 (or if all of the 
arguments had been <i>shift</i>ed out of existence.
       
	<i>${parameter:=word}</i><DD>
	Assign a value to <i>parameter</i> if it was previously
	unset or null.<dt>
	Example:<ul><lh>
	       <i>echo ${HOME:="/home/.nohome"}</i></lh></ul><DD>

	${parameter:?word}<DD>
	Generate an error if <i>parameter</i> is unset or null by
	printing <i>word</i> to <i>stdout</i>.<dt>

	Example:<ul><lh>
	      <i>: ${HOME:="/home/.nohome"} </i></lh></ul><DD>
       ${TMP:?"Error: Must have a valid Temp Variable Set"}
       </DL>
       
This one just uses the shell "null command" (the : command) to
evaluate the expression.  If the variable doesn't exist or has a 
null value -- this will print the string to the standard error
file handle and exit the script with a return code of one.<P>

Oddly enough -- while it is easy to redirect the standard error
of processes under <i>bash</i> -- there doesn't seem to be an
easy portable way to explicitly generate message or redirect output
<b>to</b> stderr.  The best method I've come up with is to use 
the /proc/ filesystem (process table)  like so:

	<ul><ul>
	function error { echo "$*" > /proc/self/fd/2 }
	</ul></ul>

... <i>self</i> is always a set of entries that refers to the current
process -- and <i>self/fd/</i> is a directory full of the currently
open file descriptors.  Under Unix and DOS every process is given
the following pre-opened file descriptors:  stdin, stdout, and stderr.
<p><dl><dt>

       ${parameter:+word}<dd>
       Alternative value.
       ${TMP:+"/mnt/tmp"} <br>
       
       use /mnt/tmp instead of $TMP but do nothing if TMP was
       unset.  This is a weird one that I can't ever see myself
       using.  But it is a logical complement to the ${var:-value} 
       we saw above.<dt>


	${#variable}<dd>
	Return the length of the variable in characters.<br>

	Example:<ul><lh>
       echo The length of your PATH is ${#PATH} </lh></ul><DD>
	</DL>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Jim Dennis<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./lg_answer18.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./gnu.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>Brave GNU World: Towards A Bioregional, Community-based Linux Support
Net</H2>
<H4>By Michael Stutz,
<a href="mailto:stutz@dsl.org">stutz@dsl.org</a></H4>
</center>
<P><HR><P> 

<p>I believe there's strong potential now for the growing LUG phenomenon to
intertwingle with both the Linux Documentation Project and the Linux support
network of the c.o.l.* newsgroups and create the next "level" of support for
Linux. The net result of this would be a self-documenting, technical 
support, training and social network on an Internet-wide scale (perhaps some
would say that's what it already is -- then I mean it would be the same only
exponentially better). Right now, I see a lot of work (documentation,
debugging, support) being duplicated. If these efforts could be combined
(LUG + LDP + c.o.l.*), it would eliminate a lot of this excess work; the net
result would would be greater than its parts, a synergy.

<p>Many LUGs give demos and post the notes on their web servers. That
information is diffused across many obscure sites, but bringing these
efforts together with the LDP folks, I wonder if a new breed of HOWTOs
(DEMOs?) could be created; a common indexing scheme could have a list of all
demos or tutorials ever given at any LUG, both searchable and listed by
subject or other criteria.

<p>And while the c.o.l.* newsgroups are invaluable for a great many things,
sometimes local help is preferable. With the right organization,
community-based LUGs could be the first stop for a Linux user's questions
and problems, with an easy forwarding mechanism to go up a chain to be
broadcast to the next larger bioregion, then continent-wide and finally, if
the question is still not answered, world-wide.

<p>By not duplicating the work, we'll be freeing up our time to develop even
more things than the current rate, plus the increased support net, replete
with documentation and local support, will allow for a greater user base.
More ideas could be implemented to strengthen this base, such as
"adopt-a-newbie" programs. For instance, there's a guy in town named Rockie
who's in this rock band called Craw; I once saw in a zine he published that
he was starting a volunteer initiative to collect old donated computer
equipment, refurbish them, and make them available to musicians who
otherwise wouldn't be able to use computers. Why not take that a step
further and make them Linux boxes? Not only would you get a non-corporate,
rock-solid OS, but you'd have an instant support network in your own town.
This kind of community-based approach seems the best way to "grow" GNU/Linux
at this stage.

<p>This community-based LUG network would be capable of handling any and all
GNU/Linux support, including the recently-discussed Red Hat Support
Initiative, as well as Debian support, Slackware support, etc. It's above
and beyond any single "distribution" and in the interest of the entire Linux
community.

<p>I think the key to all this is planning. It need not happen all at once.
It's happening already, with local LUGs making SQL databases of LUG user's
special interests and/or problems, and their own bioregional versions of the
Consultants-HOWTO, etc. What is needed most of all is a formal protocol, a
set of outlines and guidelines, that all LUGs, when ready, can initiate --
from technical details such as "What format to develop the database?" to
everything else. It need not be centralized -- like the rest of Linux, it
will probably come together from all points in the network -- but our base
is large enough now that taking a look at the various Linux efforts from a
biological and geographical community-based standpoint, and re-coordinating
from there, is something that only makes sense.


<p>Copyright (C) 1997 Michael Stutz; this information is free; it may be
redistributed and/or modified under the terms of the GNU General Public
License, either Version 2 of the License, or (at your preference) any later
version, and as long as this sentence remains.

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Michael Stutz<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./bash.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./building.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>Building Your Linux Computer Yourself</H2>
<H4>By Josh Turial,
<a href="mailto:josht@janeshouse.com">josht@janeshouse.com</a></H4>
</center>

<P><HR><P>

<P>I've been in the habit for years of building my own PCs, partly for
the cost savings, partly because I'm a geek, and partly (mostly), because
I've found the best way to tune a system exactly to my liking is to pick
only and exactly the parts that I need. Once I discovered Linux a couple of
years ago, I had the perfect match for my hobby. I'll lay out on these
pages what I've learned by trial and error, what to look for in a DIY
computer, and how to best mix-and-match according to your desires and budget.

<P>For starters, the key to building your own system is to find the best sources
for parts. Computer Shopper is probably the DIY bible, crammed with
mail--order ads from companies selling parts. I prefer the face-to-face
purchase, myself. Most of my buying takes place at the ubiquitous
"computer flea markets" that take place every month or so in most
major metropolitan areas. In Greater Boston (my stomping grounds), there are
two major shows put on; KGP and Northern. These are held in halls around the
metro area, and there's one every few weeks within driving distance. 
Typically, many vendors attend all the shows in a given area.

<P>Most vendors are pretty reliable in my area (your mileage may vary), and are
usually willing to play the deal game. This is where your objectives come
into play.

<P>Fortunately, Linux isn't too picky about the hardware it runs on--just
about any old CPU will suffice. The major areas of concern are in deciding
whether or not to use IDE or SCSI drives and what type of video card to
install. Assuming that you will use a standard Linux
distribution, the screaming video card that plays Doom at warp speed under DOS
may not be supported by Xfree 86. For instance, the immensely popular Trident
9440 VGA chipset only recently became supported by X, though it shipped with
Windows 95and OS/2 drivers. Anyhow, in making these decisions, I have a
simple checklist:
<ul>
<li>Will the system only run Linux, or will you dual-boot another OS?

<li>Are you going to power-use the system?

<li>Will you connect to the Internet over a network, or will you use a modem
and dial-up?
</ul>
<P>The answers to these questions should help determine what you need to
purchase. First off, let's cover processor type/speed and RAM. Linux is
somewhat more efficient in its consumption of system resources than DOS (or
pretty much any other Intel OS), so you may not necessarily need the screaming
Pentium 200 that you need for your Windows 95 system. In the Pentium class
processors, currently the 100 and 133 MHz Pentiums are the best values in
bang-for-the-buck specs. Both chips are well under $200, and the
100 MHz processor is close to $100. I tend to suggest those processors that
operate on a 66 MHz motherboard bus clock (like the above two chips--the P166
and P200 are also in that category). Generally speaking, the faster clock
speed of the Pentium 120 and 150 are offset by the slower 60 MHz bus and
higher price. A good PCI motherboard to accompany the chip costs about
$100 to $150. Stick with boards that use the Intel chipset for safest results,
though I have had good luck with other vendors.

<P>If you don't need to go Pentium class, there are some bargains out there.
 AMD makes some very good 486 chips, running at up to 120 MHz. This is about
equivalent in horsepower to the original Pentiums, but without the math
errors. The most recent system I built uses a hybrid motherboard (one older
VL-bus slot, 4 PCI slots), and has an AMD 5x86-133 chip. This processor is
kind of a cross between a 486 and a Pentium, and competes very well with the
Pentium Overdrive upgrades that Intel sells to 486 owners. The 5x86's
performance is roughly on a par with a Pentium-90, and motherboard/processor
combined cost roughly $100 (as opposed to about $150 for the Overdrive itself).

<P>Basically; you can factor out the price/performance scale like this:

<P>
<table>
<tr>
<td>ProcessorBus</td>		<td>Performance</td>				<td>Price</td>
</tr>
<tr>
<td>486 (66-120MHz)</td><td>VL bus</td>		<td>low-decent				$75-$100</td>
</tr>
<tr>
<td>5x86VL PCI or both</td>	<td>low-end Pentium</td>		<td>$100-$120</td>
</tr>
<tr>
<td>Pentium 100PCI only</td>		<td>Good for multiple OS</td>			<td>$200-$250</td>
</tr>
<tr>

<td>Pentium 133PCI only</td>	<td>Fast Linux, games'll rock</td>		<td>$300-$350</td>
</tr>
<tr>
<td>Pentium 166PCI only</td>	<td>Wow, that's fast!</td>	<td>$475-$550</td>
</tr>
<tr>
<td>Pentium 200PCI only</td>	<td>Ahead ludicrous speed, cap'n!</td>	<td>$700+</td>
</tr>
<tr>
<td>Pentium ProPCI only<td>	<td>If you need it, buy it built...</td>
</tr>
</table>


<P>When you buy the motherboard, there is another factor that has recently become
worth considering: what form factor do you use? Newer Pentium and Pentium
Pro-based motherboards are often available in the ATX form factor.
 The board is easier to service, and the cases are easier to take apart. ATX
boards and cases are a little tougher to find, but there is no real cost
difference between ATX and the traditional Baby-AT form factor, so
you may wish to consider the ATX alternative at purchase time.

<P>If you buy the motherboard and case from the same vendor, often they will
mount it in the case for you. If you do it ourself, be careful to make sure
that the power supply is properly connected, both to the motherboard and to
the power switch. Power supplies have two keyed connectors attaching them to
the motherboard. It is difficuly, but not impossible, to wire them wrong (I
have a friend who did), so make sure the black wires on the power leads are
touching on the inside:

ADD DIAGRAM HERE
<P>The motherboard also should be connected to the case with at least two
spacers that screw down in addition to all the plastic posts that will be in
the case kit. This insures that cards fit properly, and keeps the board
stable.

<P>Besides the processor/motherboard combination, there are other performance
issues, of course. RAM is finally cheap enough that you should buy at least
16 MB worth (about $100 at current street prices). Linux will run OK in 8 MB
(and even 4 MB is OK for text-based work), but why scrimp there when it costs
so little to do it right? If you buy from a show vendor, make sure they test
it in front of you. Any reputable vendor has their own RAM tester. 
Generally, there is no real price difference between conventional fast-page
RAM and the slightly faster EDO variety, but make sure your motherboard uses
the type of RAM you're buying. Most better motherboards will happily
auto-detect the type of RAM you use and configure themselves correctly. But
you can't mix, so make sure you only install one type, whatever that is. 
Newer Pentium chipsets support the newer SDRAM, which promises even more
speed. I have not yet tried it in a system, so I cannot tell you whether or
not that is so. Buy 32 MB if you can afford it--you won't regret it.

<P>There's also the IDE-SCSI decision. IDE interfaces are built into most
modern motherboards, so it costs nothing extra. And IDE hard drives are a
little cheaper, and IDE CD-ROMs are fast, cheap (under $80 for a 4x drive),
and easy to set up. But the controllers only support four devices total (two
ports, with two devices each), and each IDE channel is only as fast as the
slowest device on it (meaning you really can only have two hard drives, and
the CD-ROM has to go on channel 2). And modern multitasking OSs like
Linux can't get their best performance out of IDE. But it's cheap
and easy. SCSI is higher performance, and has none of IDE's restrictions
(up to 7 devices per controller, no transfer rate limit beyond the
adapter's), but the controller will set you back $70 (for a basic Adaptec
1522) to $200 (a PCI controller) plus. The drives don't cost much more,
and you can only get the highest performance drives in SCSI versions. SCSI
CD-ROM drives are a little harder to find, but the basic 4x drive will only
cost you about $125. And SCSI tape drives (you were planning to back up your
data, weren'>t you?), are much easier to install and operate than their
non-SCSI counterparts (faster, too). I'd say the decision is one to be
made after you've priced the rest of the system out. If you can afford
it, SCSI will make for a better system in the long run.

<P>The video card decision is also an important one. The critical part of this
decision is picking a card that uses a chipset (the actual brains of the card)
which is supported by XFree86, the standard Linux XWindows with most
distributions. A few distributions (Caldera, Red Hat) ship with commercial X
implementations that have a little more flexibility in video support. I find
S3-based video cards to be the most universally supported--the S3 driver in
XFree86 is very solid and works even with most of the generic, no-name video
cards on the market. The S3 cards generally have a large (about 1.5" x
1.5") chip with the S3 brand name prominently displayed on it. Diamond
and Number Nine make extensive use of S3 chips in their video card lines, to
name a couple of brands. Among other SVGA chipset makers, Cirrus and Trident
are also well-supported. Only the latest X versions include support for the
popular Trident 9440 chips, so be careful before buying a video card with that
chipset. XFree86 includes a very complete readme with the status of support
for most video cards/chipsets, so consult it if you have any questions.

<P>Your sound card (if you want one) is a relatively simple decision. The
SoundBlaster 16 is the defacto standard for sound cards, and is supported by
virually all software. Some motherboards even include the SB16 chipset on
them. If at all possible, buy your card in a jumpered version, rather than
the SoundBlaster 16 Plug-and-Play that is popular today. Most vendors have
jumpered versions available. There are also SB16-compatible cards out on the
market, and they are definitely worth considering. Expect to pay around $80
for your sound card.

<P>Possibly the choice that'll get me in the most trouble is the Ethernet
card selection (if your system is going on a LAN). A Novell NE2000 clone is
the cheapest choice you can make (the clones cost around $20), but most clones
will hang the machine at boot time if the kernel is probing for other Ethernet
card brands when the NE2000 is set to its default address of 300h. The
solution is to either boot from a kernel with no network support (then
recompile the kernel without the unneeded drivers), or to move the address of
the NE2000 to another location. I've used 320h without problems to avoid
this hang.

<P>But the best way around the problem is to use a major-brand card. I currently
rely on 3Com's EtherLink III series cards (the 3C5x9), which are
universally supported, and software-configurable (from DOS, so keep a DOS
floppy around). It's available in ISA or PCI versions, ISA being
cheaper. This card costs around $90 from most vendors. I know that's
more expensive than some motherboards, but it's a worthwhile investment.

<P>If you are using dial-up access to the Internet instead (or just want a modem
anyways), you can approach buying a modem with two alternatives. If your
motherboard has built-in serial ports (almost all the non-VL bus boards do),
then you could buy an external modem. I prefer them to internal modems, since
the possibility of setting an address incorrectly is then gone, ad you can
always tell if it is working from the status lights on the front of the modem.
 Internal modems generally cost a little less, but there's a greater risk
of accidentally creating an address or interrupt conflict in the process of
installing it. An additional problem is that many modems sold now are
plug-and-play compatible. Unless you're already running Windows 95,
P&P is a scourge on the Intel computing world (Macs do P&P in a
fashion that actually works). Because most Intel-based OSs need to know
the interrupt and memory location of peripherals at boot time, any inadverdent
change caused by a P&P device can adversely impact the boot process. 
Linux can find many devices regardless (SCSI controllers, most Ethernet
cards), but serial ports and sound devices are hard-mapped to interrupts at
the OS level. So try to make sure that any such devices can be operated in a
non-P&P mode, or in the case of modems, buy an external one if possible to
avoid the situation entirely.

<P>Remember, there are really two bottom-line reasons to build your Linux box
yourself. One is to save money (and I hope I've shown you how to do
that), but the real main reason is to have fun. Computing is a fun hobby, and
building the system yourself can be a fun throwback to the early days when a
computer was bought as a bag of parts and a schematic. I've been
building machines like this for several years, and never had trouble--not to
mention that I've gotten away with bringing in a lot of stuff under my
wife's nose by buying them a part at a time! (Oops, the secret's out)
So, for your next computer, give homebrewing a whirl. It'ss
easier than you think, and what better companion for a free, home-brewed OS
than a cheap, home-brewed PC?

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Josh Turiel<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./gnu.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./tmp.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>Cleaning Up Your /tmp...The Safe Way</H2>
<H4>By Guy Geens,
<a href="mailto:ggeens@iname.com">ggeens@iname.com</a></H4>
</center>
<P><HR><P>

<H3>Introduction</H3>

<P>Removing temporary files left over in your <TT>/tmp</TT> directory,
is not as easy as it looks like. At least not on a multi-user system that's
connected to a network.</P>

<P>If you do it the wrong way, you can leave your system open to attacks
that could compromise your system's integrity.</P>

<H3>What's eating my disk space?</H3>

<P>So, you have your Linux box set up. Finally, you have installed everything
you want, and you can have some fun! But wait. Free disk space is slowly
going down.</P>

<P>So, you start looking where this disk space is going to. Basically,
you will find the following disk hogs:</P>

<UL>
<LI>Formatted man pages in<TT>/var/catman</TT>; </LI>

<LI>The <TT>/tmp</TT> and <TT>/var/tmp</TT> hierarchies.</LI>
</UL>

<P>Of course, there are others, but in this article, I'll concentrate on
these three, because you normally don't lose data when you erase the contents.
At the most, you will have to wait while the files are regenerated.</P>

<H3>The quick and dirty solution</H3>

<P>Digging through a few man pages, you come up with something like this:
</P>

<P>find /var/catman -type f -atime 7 -print | xargs -- rm -f --</P>

<P>This will remove all formatted man pages that have not been read for
7 days. The <TT>find</TT> command makes a list of these, and sends them
to the <TT>xargs</TT>. x<TT>args</TT> puts these files on the command line,
and calls <TT>rm -f</TT> to delete them. The double dashes are there so
that any files starting with a minus will not be misinterpreted as options.</P>

<P>(Actually, in this case, find prints out full path names, which are
guaranteed to start with a /. But its better to be safe than sorry.)</P>

<P>This will work fine, and you can place this in your crontab file or
one of your start-up scripts.</P>

<P>Note that I used <TT>/var/catman</TT> in the previous example. You might
be thinking ``So, why not use it for <TT>/tmp</TT>?'' There is a good reason
for this. Let me start by elaborating on the difference between <TT>/var/catman</TT>
and <TT>/tmp</TT> directories. (The situation for <TT>/var/tmp</TT> is
the same as for /tmp. So you can change all instances of <TT>/tmp</TT>
by <TT>/var/tmp</TT> in the following text.)</P>

<H4>Why /var/catman is easy</H4>

<P>If you look at the files in <TT>/var/catman</TT>, you will notice that
all the files are owned by the same user (normally <TT>man</TT>). This
user is also the only one who has write permissions on the directories.
That is because the only program that ever writes to this directory tree
is <TT>man </TT>. Let's look at <TT>/usr/bin/man</TT>: </P>

<PRE>-rwsr-sr-x 1 man man 29716 Apr 8 22:14 /usr/bin/man*</PRE>

<P>(Notice the two letters `s' in the first column.)</P>

<P>The program is running setuid man, i.e., it takes the identity and privileges
of this `user'. (It also takes the group privileges, but that is not really
important in our discussion.) <TT>man</TT> is not a real user: nobody will
ever log in with this identity. Therefore, man (the program) can write
to directories a normal user cannot write to.</P>

<P>Because you know all files in the directory tree are generated by one
program, it is easy to maintain.</P>

<H4>And now /tmp</H4>

<P>In <TT>/tmp</TT>, we have a totally different situation. First of all,
the file permissions:</P>

<PRE>drwxrwxrwt 10 root root 3072 May 18 21:09 /tmp/</PRE>

<P>We can see that <B>everyone</B> can write to this directory: everyone
can create, rename or delete files and directories here.</P>

<P>There is one limitation: the `sticky bit' is switched on. (Notice the
t at the end of the first column.) This means a user can only delete or
rename files owned by himself. This prohibits users peskering each other
by removing the other one's temporary files.</P>

<P>If you were to use the simple script above, there are security risks
involved. Let me repeat the simple one-line script from above:</P>

<PRE>find /tmp -type f -atime 7 -print | xargs -- rm -f --</PRE>

<P>Suppose there is a file <TT>/tmp/dir/file</TT>, and it is older than
7 days. </P>

<P>By the time <TT>find</TT> passes this filename to <TT>xargs</TT>, the
directory might have been renamed to something else, and there might even
be another directory <TT>/tmp/dir</TT>.</P>

<p>(And then I didn't even mention the possibility of embedded
newlines. But that can be easily fixed by using -print0 instead of
-print.)

<P>All this could lead to a wrong file being deleted, Either
intentionally or by accident. By clever use of symbolic links, an
attacker can exploit this weakness to delete some important system
files.

<p>For an in-depth discussion of the problem, see the Bugtraq mailing
list archives. (Thread ``<a
href="http://www.geek-girl.com/bugtraq/1996_2/0054.html">[linux-security]
Things NOT to put in root's crontab''</a>).</P>

<P>This problem is inherently linked with find's algoritm: there can be
a long time between the moment when find generates a filename internally
and when it is passed on to the next program. This is because find recurses
subdirs before it tests the files in a particular directory.</P>

<H4>So how do we get around this?</H4>

<P>A first idea might be:</P>

<P>find ... -exec rm {} \;</P>

<P>but unfortunately, this suffers from the same problem, as the `exec'
clause passes on the full pathname.</P>

<P>In order to solve the problem, I wrote this <A HREF="cleantmp.html">perl
script </A>, which I named <TT>cleantmp</TT>.</P>

<P>I will explain how it works, and why it is safer than the aforementioned
scripts.</P>

<P>First indicate I'm using the File::Find module. After this statement,
I can call the &amp;find subroutine.</P>

<PRE>use File::Find;
</PRE>

<P>Then do a chroot to <TT>/tmp</TT>. This changes the root directory for
the script to <TT>/tmp</TT>. It will make sure the script can't access
any files outside of this hierarchy.</P>

<P>Perl only allows a chroot when the user is root. I'm checking for this
case, to facilitate testing.</P>

<PRE># Security measure: chroot to /tmp

$tmpdir = '/tmp/';

chdir ($tmpdir) || die &quot;$tmpdir not accessible: $!&quot;;

if (chroot($tmpdir)) { # chroot() fails when not run by root 

($prefix = $tmpdir) =~ s,/+$,,;

$root = '/';

$test = 0;

} else {

# Not run by root - test only

$prefix = '';

$root = $tmpdir;

$test = 1;

}</PRE>

<P>Then we come to these lines:</P>

<PRE>&amp;find(\&amp;do_files, $root);

<P>&amp;find(\&amp;do_dirs, $root);</PRE>

<P>Here, I let the find subroutine recurse through all the subroutines
of /tmp. The functions do_files and do_dirs are called for each file found.
There are two passes over the directory tree: one for files, and one for
directories. </P>

<P>Now we have the function <TT>do_files</TT>.</P>

<PRE>sub do_files {

(($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &amp;&amp;

(-f _ || -l _ ) &amp;&amp;

(int(-A _) &gt; 3) &amp;&amp;

! /^\.X.*lock$/ &amp;&amp;

&amp;removefile ($_) &amp;&amp; push @list, $File::Find::name; 
}</PRE>

<P>Basically, this is the output of the find2perl program, with a little
changes.</P>

<P>This routine is called with $_ set to the filename under inspection,
and the current directory is the one in which it resides. Now let's see
what it does. (In case you don't know perl: the &amp;&amp; operator short-circuits,
just like in C.)</P>

<OL>
<LI>The first line gets the file's parameters from the kernel; </LI>

<LI>If that succeeds, we check if it is a regular file or a symbolic link
(as opposed to a directory or a special file); </LI>

<LI>Then, we test if the file is old enough to be deleted (older than 3
days); </LI>

<LI>The fourth line makes sure X's lockfiles (of the form <TT>/tmp/.X0-lock
</TT>are not removed; </LI>

<LI>The last line will remove the file, and keep a listing of all deleted
files. </LI>
</OL>

<P>The removefile subroutine merely tests if the $test flag is set, and
if not, deletes the file. </P>

<P>The do_dirs subroutine is very similar to this one, and I won't go into
the details. </P>

<H4>A few remarks</H4>

<P>I use the access time to determine the file's age. The reason for
this is simple. I sometimes unpack archives into my /tmp directory.
When it creates files, tar gives them the date they had in the archive
as the modification time. In one of my earlier scripts, I did test on
the mtime. But then, I was looking in an unpacked archive, at the same
time when cron started to clean up. (Hey?? Where did my files go?)
</P>

<P>As I said before, the script checks for some special files (and
also directories in do_dirs). This is because they are important for
the system. If you have a separate /tmp partition, and have quota
installed on it, you should also check for quota's support files -
quota.user and quota.group.</P>

<P>The script also generates a list of all deleted files and directories.
If you don't want this output, send the output to <TT>/dev/null</TT>. </P>

<H3>Why this is safe</H3>

<P>The main difference with the find constructions I have shown before
is this: the file to be deleted is not referenced by its full pathname.
If the directory is renamed while the script is scanning it, this doesn't
have any effect: the script won't notice this, and delete the right files.
</P>

<P>I have been thinking about weaknesses, and I couldn't find one. Now
I'm giving this to you for inspection. I'm convinced that there are no
hidden security risks, but if you do find one, <a
href="mailto:ggeens@iname.com">let me know</a>.</P>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Guy Geens<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./building.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./clueless.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

<P> <HR> <P> 
<!--===================================================================-->
<center>
<H4>By Mike List,
<a href="mailto:troll@net-link.net">troll@net-link.net</a></H4>
</center>

<h4>Welcome to installment 5 of Clueless at the Prompt:
a new column for new users.</h4>
<hr>
<p><h4> Getting Serious</h4>
<p>If you've been experimenting with linux, reading all the docs you can
get your hands on, downloading software to try, and generally cleaning up
after the inevitable ill advised rm as root, you are probably starting to
get enough confidence in linux to use it to do more than browse the
internet. After all, why use Gates when you can jump the fences?
This month I'm going to discuss some strategies for damage control, and
how you can safely upgrade without losing valuable files and
configurations, as well as some more general scouting around the
filesystem.
<hr>                                    
<p><h4>Partitions as Safety Devices</h4><p>
If you have your entire linux installation on one partition, or partition,
you could be putting your files and accmulated data in jeopardy as well as
making the business of upgrading more difficult.
<p>
I understand that some distributions, notably Debian, are capable of
upgrading any part of the system's component software without a full
install, but I'm running Slackware, and it's generally recommended that
when certain key system components are upgraded, a full reinstall is the
safest way to avoid conflicts between old and new parts. What to do when
the time comes can be much simpler if you have installed at least your
/home direcory on a separate partition.
<p>
When you do a fresh install you are asked to describe mount points for
your partitions. You are also asked if you want to format those
partitions. If your /home directory doesn't contain much in the way of
system files you can opt to skip formatting it, thereby reducing the
chance that you'll have to use your backup to recover lost files in those
directories. No, I'm not suggesting tht you don't have to backup your
/home or other personal files, since there is no reliable undelete for
linux that I'm aware of at this time. However, if you are just
experimenting with linux and using a separate OS to do your important
work and it's located on another disk, you may not feel to compelled to
backup much in the way of linux files. Sooner or later though, if you are
committed(or ought to be :) ) enough to linux to drop the other system,
you WILL want to rethink that omission.   
<hr><h4>Formatting Floppies</h4><p>
When you format a floppy disk in MSDOS you do several operations in one
fell swoop. You erase files, line up the tracks, sectors, etc, and install
a MSDOS compatible filesystem. Another thing to recognize is that MS
mounts the floppy drive as a device, while in linux the device is mounted
as a part of the filesystem, to a specific directory.
 <p>
There is a suite of utilities called mtools that can be used to create DOS
formatted floppies, as well as some other MS specific operations, but I
haven't had a lot of fun with it. I use the standard utilities instead
Here is how I format a floppy disk:
<pre>
     fdformat /dev/fd0xxx
</pre><p>
where xxx is the full device name. My floppy drive is /dev/fd0u1440
but your mileage may vary. Try ls'ing your /dev directory to see.
I installed from floppies, so I'm not real sure about CDROM installation  
but I took note of the drive specified to install the system. When the
drive finishes formatting, you can type:
<pre>
     mkfs -t msdos /dev/fd0xxxx
</pre><p>
once again if necessary adding any specifiers.
Your disk should be formatted.</p>
<hr>
<h4>Writing to your Floppy Disk</h4><p>
You are probably sitting there with a newly msdos formatted floppy disk
and wondering how to write to it. If you use mtools, you are on your own,
but don't feel bad you will save some steps, ie. mount and umount the
floppy drive before and after writing to the drive, but it seems that I
always fail to remember some option when I try to use mtools, so I don't
use them. I type :
<pre>
     mount -t msdos /dev/fd0xxxx /mnt
</pre><p>
you can specify another mount point besides /mnt if you would like,
perhaps a different mount point for each filesystem type that you might
want to use, ext2, or minix for example, but if you or people that you
work with use MS the msdos format might be the best, at least for now.
<p>
You can put an entry in your /etc/fstab that specifies the mount point for
your floppy drive, with a line that looks something like:
<pre>
     /dev/fd0         /mnt      msdos       rw,user,noauto  0   0 
</pre><p>
This particular line will keep the floppy drive from mounting on bootup
(noauto), and allow users to mount the drive. You should take the time to
alert your users that they MUST mount and umount /dev/fd0 each time they
change a disk, otherwise they will not get a correct ls when they try to
read from the mount point.
Assuming that this line is added to the /etc/fstab file the correct
command for mounting the drive is:
<pre>
     mount /dev/fd0
</pre> <p>
which will automatically choose /mnt as the mount point.To read from the
drive, the present working directory must be changed by:
<pre>
     cd /mnt
</pre><p>
after which the contents of the disk can be read or written to> 
Linux is capable of reading files from several filesystem types, so it's a
pretty good first choice, since you can share files with DOS users.
<p>
Anyway, assuming you didn't get any error messages, you are ready to copy
a file to the disk using the: 
<pre>
     cp anyfile.type /mnt
</pre><p>
assuming tha /mnt is the mount point that you specified in the mount
command, you should have  copied the file to your floppy disk. Try:
<pre>
     ls /mnt
</pre><p>
you should see the file you just cp'ed. if not, you should retry the mount
command, but if you didn't get any error messages when you tried to mount
the drive, you should be OK. To verify that you did write to the floppy
instead of the /mnt directory, (there is a difference, if no drive is
mounted it's just a directory) you can:
<pre>
     umount /dev/fd0xxxx
</pre><p>
and then try:
<pre>
     ls /mnt
</pre><p>
upon which you should get a shell prompt. If you get the file name that
you tried to copy to floppy, merely rm it and try the whole routine again.
If you find this confusing, read up on mtools by:
<pre>
    info mtools
</pre><p>
You may like what you see, give them a try. As I said I haven't had much
luck with them, but basically the mformat command should do the
abovementioned format tasks in one pass. Mcopy should likewise copy the
named file to the floppy without the need to separately mount the drive.
<hr>
<h4> Other Filesystems</h4><p>
There are several filesystems, as mentioned above that can be read by 
linux. Minix, ext2, ext, xiaf, vfat, msdos(I'm still a little bit foggy
on the difference between these two).Still others can be read with the use
of applications, amiga for instance. That's why it makes sense to split up
what is a single step process in DOS.
<hr>
<h4>Humbly acknowledging...</h4><p>
I got a lot of mail regarding the locate command, which I'm woefully
guilty of spreading misinformation about. The real poop is that locate is
a byproduct of a  command, updatedb, which can be run at any time. It is
run as default in the wee hours of the morning from /usr/bin/crontab,
which is where I got the idea to leave the computer on overnight.
<hr>
 Next Time- Let me know what you would like to see in here and I'll
try to
oblige just e-mail<a
href="mailto:troll@net-link.net">troll@net-link.net
</a> me and ask, otherwise I'll just write about what gave me trouble
and
how I got past it.</h4></p>
<p> TTYL, Mike List </p>

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Mike List<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./tmp.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./disk_hog.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>DiskHog: Using Perl and the WWW to Track System Disk Usage</H2>
<H4>By Ivan Griffin,
<a href="mailto:Ivan.Griffin@ul.ie">Ivan.Griffin@ul.ie</a></H4>
</center>
<P><HR><P>

<p>
An irksome job that most system administrators have to perform at some stage
or other is the implementation of a disk quota policy.  Being a maintainer of
quite a few machines (mostly Linux and Solaris, but also including AIX)
without system enforced quotas, I needed an automatic way of tracking disk
quotas.  To this end, I created a Perl script to regularly check users disk 
usage, and compile a list of the largest hoggers of disk space.  Hopefully,
in this way, I can politely intimidate people into reducing the size of their
home directories when they get ridiculously large.
</p>

<p>
The <tt>du</tt> command summarises disk usage for a given directory hierarchy.
When run in each users home directory, it can report how much disk space
the user is occupying.  At first, I had written a shell script to run
<tt>du</tt> on a number of user directories, with an awk back-end to provide
nice formatting of the output.  This proved difficult to maintain if new users
were added to the system.  Users home directories were unfortunately located
in different places on each operating system.
</p>

<p>
Perl provided a convenient method of rewriting the shell / awk scripts into
a single executable, which not only provided more power and flexibility but
also ran faster!  Perl's integration of standard Unix system calls and C
library functions (such as <tt>getpwnam()</tt> and <tt>getgrname()</tt>) makes
it perfectly suited to tasks like this.  Rather than provide a tutorial on
the Perl language, in this article I will describe how I used Perl as a
solution to my particular need.  The complete source code to the Perl
script is shown in listing 1.
</p>

<p>
The first thing I did was to make a list of the locations in which users
home directories resided, and isolate this into a Perl array.  For each
sub-directory in the directories listed in this array, a disk usage
summary was required.  This was implemented by using the Perl system
command to spawn off a process running <tt>du</tt>.
</p>

<p>
The <tt>du</tt> output was redirected to a temporary file.  The temporary file
was named using the common $$ syntax, which is replaced at run time by the
PID of the executing process.  This guaranteed that multiple invocations
of my disk usage script (while unlikely) would not clobber each others
temporary working data.
</p>

<p>
All the sub-directories were named after the user who owned the account.  This
assumption made life a bit easier in writing the Perl script, because I could
skip users such as <tt>root</tt>, <tt>bin</tt>, etc.
</p>

<p>
I now had, in my temporary file,  a listing of a disk usage and username, one
pair per line of the file.  I wanted to split these up into an associated hash
of users and disk usage, with users as the index key.  I also wanted to
keep a running total of the entire disk usage, and also the number of
users.  Once Perl had parsed all this information from the temporary file,
I could delete it.
</p>

<p>
I decided the Perl script would dump its output as an HTML formatted page.
This allowed me great flexibility in presentation, and also permitted the
information to be available over the local intranet - quite useful when 
dealing with multiple heterogeneous environments.
</p>

<p>
Next I had to work out what information I needed to present.  Obviously the
date when the script had run was important, and a sorted table listing
disk usage from largest to smallest was essential.   Printing the <i>GCOS</i>
information field from the password file allowed me to view both
real names, and usernames.  I also decided it might be nice to provide a
hypertext link to the users homepage, if one existed.  So extracting their
official home directory from the password file, and adding on to it the
standard user directory extensions to it (typically <tt>public_html</tt> or
<tt>WWW</tt>) allowed this. 
</p>

<p>
Sorting in Perl usually involves the use of the spaceship operator (
<tt><=></tt>).  The sort function sorts a list and returns the sorted list
value.  It comes in many forms, but the form used in the code is:
</p>

<pre>

sort sub_name list

</pre>

<p>
where <tt>sub_name</tt> is a Perl subroutine.  <tt>sub_name</tt> is call
during element comparisons, and it must return an integer less than, equal to,
or greater than zero, depending on the desired order of the list elements.
<tt>sub_name</tt> may also be replaced with an inline block of Perl code.
</p>

<p>
Typically sorting numerically ascending takes the form:
</p>

<pre>

@NewList = sort { $a &lt;=&gt; $b } @List;

</pre>

<p>
whereas sorting numerically descending takes the form:
</p>

<pre>

@NewList = sort { $b &lt;=&gt; $a } @List;

</pre>

<p>
I decided to make the page a bit flashier by adding a few of those omnipresent
coloured ball GIFs.  Green indicates that the user is within allowed limits.
Orange indicates that the user is in a danger buffer zone -  no man's land,
from which they are dangerously close to the red zone.  The red ball indicate
a user is over quota, and depending on the severity multiple red balls may be
awarded to really greedy, anti-social users.
</p>

<p>
Finally, I plagued all the web search engines until I found a suitable
GIF image of a pigglet, which I included on the top of the page.
</p>

<p>
The only job left was to include the script to run nightly as a cron job.
It needed to be run as root in order to accurately assess the disk usage
of each user - otherwise directory permissions could give false results.
To edit roots cron entries (called a <tt>crontab</tt>), first ensure you have
the environment variable <tt>VISUAL</tt> (or <tt>EDITOR</tt>) set to your
favourite editor.  Then type
</p>

<pre>

crontab -e

</pre>

<p>
Add the line from listing 2 to any existing crontab entries.  The format of
crontab entries is straightforward.  The first five fields are integers,
specifying the minute (0-59), hour (0-23), day of the month (1-31), month of
the year (1-12) and day of the week(0-6, 0=Sunday).  The use of an asterix as a
wild-card to match all values is permitted, as is specifying a list of
elements separated by commas, or a range specified by start and end (separated
by a minus).  The sixth field is the actual program to being scheduled.
</p>

<p>
A script of this size (which multiple invocations of <tt>du</tt>) takes some
time to process.  As a result, it is perfectly suited for scheduling under
cron - I have it set to run once a day on most machines (generally during the
night, which user activity is low).   I believe this script shows the
potential of using Perl, Cron and the WWW to report system statistics.
Another variant of it I have coded performs an analysis of web server log
files.  This script has served me well for many months, and I am confident it
will serve other sysadmins too.
</p>

<hr size=4>
<pre>

#!/usr/local/bin/perl -Tw

# $Id: issue18.html,v 1.1.1.1 1997/09/14 15:01:46 schwarz Exp $
#
# Listing 1:
# SCRIPT:       diskHog
# AUTHOR:       Ivan Griffin (ivan.griffin@ul.ie)
# DATE:         14 April 1996
#
# REVISION HISTORY:
#   06 Mar 1996 Original version (written using Bourne shell and Awk)
#   14 Apr 1996 Perl rewrite
#   01 Aug 1996 Found piggie image on the web, added second red ball
#   02 Aug 1996 Added third red ball
#   20 Feb 1997 Moved piggie image :-)

#
# outlaw barewords and set up the paranoid stuff
#
use strict 'subs';
use English;

$ENV{'PATH'} = '/bin:/usr/bin:/usr/ucb'; # ucb for Solaris dudes
$ENV{'IFS'} = '';

#
# some initial values and script defines
#
$NumUsers = 0; 
$Total = 0; 
$Position = 0; 

$RED_ZONE3 = 300000;
$RED_ZONE2 = 200000;
$RED_ZONE = 100000;
$ORANGE_ZONE = 50000;

$CRITICAL = 2500000;
$DANGER   = 2200000;

$TmpFile = &quot;/var/tmp/foo$$&quot;;
$HtmlFile = '&gt;/home/sysadm/ivan/public_html/diskHog.html';
$PerlWebHome = &quot;diskHog.pl&quot;;

$HtmlDir = &quot;WWW&quot;;
$HtmlIndexFile = &quot;$HtmlDir/index.html&quot;;
$Login = &quot; &quot;;
$HomeDir=&quot; &quot;;
$Gcos = &quot;A user&quot;;

@AccountDirs = ( &quot;/home/users&quot;, &quot;/home/sysadm&quot; );
@KeyList = (); 
@TmpList = ();

chop ($Machine = `/bin/hostname`);
# chop ($Machine = `/usr/ucb/hostname`); # for Solaris


#
# Explicit sort subroutine
#
sub by_disk_usage
{
    $Foo{$b} &lt;=&gt; $Foo{$a};  # sort integers in numerically descending order
}


#
# get disk usage for each user and total usage
#
sub get_disk_usage 
{
    foreach $Directory (@AccountDirs)
    {
        chdir $Directory or die &quot;Could not cd to $Directory\n&quot;;
        # system &quot;du -k -s * &gt;&gt; $TmpFile&quot;; # for Solaris 
        system &quot;du -s * &gt;&gt; $TmpFile&quot;;
    }

    open(FILEIN, &quot;&lt;$TmpFile&quot;) or die &quot;Could not open $TmpFile\n&quot;;

    while (&lt;FILEIN&gt;)
    {
        chop;
        ($DiskUsage, $Key) = split(' ', $_);

        if (defined($Foo{$Key}))
        {
            $Foo{Key} += $DiskUsage;
        }
        else
        {
            $Foo{$Key} = $DiskUsage;

            @TmpList = (@KeyList, $Key);
            @KeyList = @TmpList;
        };

        $NumUsers ++;
        $Total += $DiskUsage;
    };

    close(FILEIN);
    unlink $TmpFile;
}


#
# for each user with a public_html directory, ensure that it is
# executable (and a directory) and that the index.html file is readable
#
sub user_and_homepage 
{
    $User = $_[0];

    ($Login, $_, $_, $_, $_, $_, $Gcos, $HomeDir, $_) = getpwnam($User)
        or return &quot;$User&lt;/td&gt;&quot;;

    if ( -r &quot;$HomeDir/$HtmlIndexFile&quot; )
    {
        return &quot;$Gcos &lt;a href=\&quot;/~$Login\&quot;&gt;($User)&lt;/a&gt;&quot;;
    }
    else
    {
        return &quot;$Gcos ($User)&lt;/td&gt;&quot;;
    };
}

#
# generate HTML code for the disk usage file
#
sub html_preamble
{
    $CurrentDate = localtime;

    open(HTMLOUT, $HtmlFile) or die &quot;Could not open $HtmlFile\n&quot;;
    printf HTMLOUT &lt;&lt;&quot;EOF&quot;;
&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 3.0//EN&quot;&gt;

&lt;!--
  -- Automatically generated HTML
  -- from $PROGRAM_NAME script
  --
  -- Last run: $CurrentDate
  --&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;
Disk Hog Top $NumUsers on $Machine
&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor=&quot;#e0e0e0&quot;&gt;
&lt;h1 align=center&gt;Disk Hog Top $NumUsers on $Machine&lt;/h1&gt;

&lt;div align=center&gt;
&lt;table&gt;
&lt;tr&gt;
    &lt;td valign=middle&gt;&lt;img src=&quot;images/piggie.gif&quot; alt=&quot;[PIGGIE!]&quot;&gt;&lt;/td&gt;
    &lt;td valign=middle&gt;&lt;em&gt;This is a &lt;a href=$PerlWebHome&gt;Perl&lt;/a&gt;
        script which runs&lt;br&gt;
        automatically every night&lt;/em&gt;&lt;br&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;b&gt;Last run started&lt;/b&gt;: $StartDate&lt;br&gt;
&lt;b&gt;Last run finished&lt;/b&gt;: $CurrentDate
&lt;/p&gt;

&lt;p&gt;
&lt;table border=2&gt;
&lt;tr&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;td&gt;
EOF

    if ($Total &gt; $CRITICAL) 
    {
        print HTMLOUT &quot;CRITICAL!!! - Reduce Disk Usage NOW!&quot;;
    }
    elsif (($Total &lt;= $CRITICAL) && ($Total &gt; $DANGER))
    {
        print HTMLOUT &quot;Danger - Delete unnecessary Files&quot;;
    }
    else
    {
        print HTMLOUT &quot;Safe&quot;;
    }


    printf HTMLOUT &lt;&lt;&quot;EOF&quot;;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/P&gt;

&lt;hr size=4&gt;

&lt;table border=2 width=70%%&gt;
    &lt;tr&gt;
        &lt;th colspan=2&gt;Chart Posn.&lt;/th&gt;
        &lt;th&gt;Username&lt;/th&gt;
        &lt;th&gt;Disk Usage&lt;/th&gt;
    &lt;/tr&gt;

EOF
}

#
#
#
sub html_note_time
{
    $StartDate = localtime;
}



#
# for each user, categorize and display their usage statistics
#
sub dump_user_stats
{
    foreach $Key (sort by_disk_usage @KeyList)
    {
        $Position ++;

        print HTMLOUT &lt;&lt;&quot;EOF&quot;;
    &lt;tr&gt;\n
        &lt;td align=center&gt;
EOF

        #
        # colour code disk usage
        #
        if ($Foo{$Key} &gt; $RED_ZONE) 
        {
            if ($Foo{$Key} &gt; $RED_ZONE3)
            {
                print HTMLOUT &quot;        &lt;img src=images/ball.red.gif&gt;\n&quot;;
            }

            if ($Foo{$Key} &gt; $RED_ZONE2)
            {
                print HTMLOUT &quot;        &lt;img src=images/ball.red.gif&gt;\n&quot;;
            }

            print HTMLOUT &quot;        &lt;img src=images/ball.red.gif&gt;&lt;/td&gt;\n&quot;;
        }
        elsif (($Foo{$Key} &lt;= $RED_ZONE) && ($Foo{$Key} &gt; $ORANGE_ZONE))
        {
            print HTMLOUT &quot;        &lt;img src=images/ball.orange.gif&gt;&lt;/td&gt;\n&quot;;
        }
        else
        {
            print HTMLOUT &quot;        &lt;img src=images/ball.green.gif&gt;&lt;/td&gt;\n&quot;;
        }

        print HTMLOUT &lt;&lt;&quot;EOF&quot;;

        &lt;td align=center&gt;$Position&lt;/td&gt;
EOF

        print HTMLOUT &quot;        &lt;td align=center&gt;&quot;;
        print HTMLOUT &user_and_homepage($Key);
        print HTMLOUT &quot;&lt;/td&gt;\n&quot;;

        print HTMLOUT &lt;&lt;&quot;EOF&quot;;
        &lt;td align=center&gt;$Foo{$Key} KB&lt;/td&gt;
    &lt;/tr&gt;

EOF
    };
}

#
# end HTML code
#
sub html_postamble
{
    print HTMLOUT &lt;&lt;&quot;EOF&quot;;
    &lt;tr&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th align=left colspan=2&gt;Total:&lt;/th&gt;
        &lt;th&gt;$Total&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;/div&gt;

&lt;hr size=4&gt;
&lt;a href=&quot;/&quot;&gt;[$Machine Home Page]&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;
EOF


    close HTMLOUT ;

#
# ownership hack
#
    $Uid = getpwnam(&quot;ivan&quot;);
    $Gid = getgrnam(&quot;users&quot;);

    chown $Uid, $Gid, $HtmlFile;
}


#
# main()
#

&html_note_time;
&get_disk_usage;
&html_preamble;
&dump_user_stats;
&html_postamble;

# all done!
</pre>

<div align=center>
<b>Listing 1. diskHog.pl script source.</b>
<hr size=4 width=30%>
</div>


<pre>

0 0 * * * /home/sysadm/ivan/public_html/diskHog.pl

</pre>
<div align=center>
<b>Listing 2. root's crontab entry.</b>
<hr size=4 width=30%>
</div>

<div align=center>
<img src="./gx/diskHog.small.gif"><br>
<b>Figure 1. diskHog output.</b>
<hr size=4 width=30%>
</div>

</td>
</tr>
</table>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Ivan Griffin<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./clueless.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./dosemu.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4> &quot;Linux Gazette...<I>making Linux just a little more
fun!</I>&quot; </H4>

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

<center> <H2>dosemu & MIDI: A User's Report</H2> <H4>By Dave Phillips,
<a href="mailto:dlphilp@bright.net">dlphilp@bright.net</a></H4> </center>
<P><HR><P>
<BASE="/root/htmlstuff/var/dp_dosemu.html"></a> <p> First, the
necessary version info: <ul> <li>Linux kernel 2.0.29 <li>dosemu
0.66.1 <li>Sound Driver 3.5.4 </ul> And then there's the hardware:
<ul> <li>AMD 486/120 <li>MediaVision Pro Audio Spectrum 16 (PAS16)
soundcard w. MIDI interface adapter <li>Music Quest MQX32M
MIDI interface <li>two Yamaha TX802 synthesizers </ul> <p> <a
href="http://www.ednet.ns.ca/~macleajb/dosemu.html">dosemu</a>
 is an MS-DOS emulator for Linux. The <a
href="http://lexington.lasermoon.co.uk/uncompressed.shtml/texinfo/dosemu_1.html">on-line
manual</a> describes it as <blockquote>"...a user-level program which uses
certain special features of the Linux kernel and the 80386 processor
to run MS-DOS in what we in the biz call a DOS box. The DOS box, a
combination of hardware and software trickery, has these capabilities:
<ul> <li>    the ability to virtualize all input/output and processor
control instructions <li>    the ability to support the word size and
addressing modes of the iAPX86 processor family's real mode, while
still running within the full protected mode environment <li>    the
ability to trap all DOS and BIOS system calls and emulate such calls
as are necessary for proper operation and good performance <li>    the
ability to simulate a hardware environment over which DOS programs are
accustomed to having control.  <li>    the ability to provide MS-DOS
services through native Linux services; for example, dosemu can provide
a virtual hard disk drive which is actually a Linux directory hierarchy.
</ul> The hardware component of the DOS box is the 80386's virtual-8086
mode, the real mode capability described above. The software component
is dosemu."</blockquote> <p> I installed version 0.66.1 because I read
that it supported MIDI, and I was curious to find whether I would be
able to run my favorite DOS MIDI sequencer, Sequencer Plus Gold from
<a href="http://www.voyetra.com">Voyetra</a>. Installation proceeded
successfully, and after some initial fumbling (and a lot of help from
the Linux newsgroups), I was running some DOS programs under Linux.  <p>
However, the MIDI implementation eluded me. I followed the directions
given in the dosemu package: they are simple enough, basically setting
up a link to /dev/sequencer. But since Sequencer Plus requires a Voyetra
API driver, I ran into trouble: the VAPI drivers wouldn't load.  <p> I
tried to use the VAPIMV (Voyetra API for Media Vision) drivers, but they
complained that MVSOUND.SYS wasn't loaded. These drivers are specific
to the PAS16 soundcard, so I was puzzled that they couldn't detect
MVSOUND.SYS (which was indeed successfully loaded by config.sys). I
also tried using the SAPI drivers, Voyetra's API for the SoundBlaster:
the PAS16 has a SB emulation mode which I had enabled in MVSOUND.SYS,
but those drivers wouldn't load, again complaining that MVSOUND.SYS
wasn't installed. VAPIMQX, the driver for the MQX32M, refused to
recognize any hardware but a true MQX. Checking the Linux sound driver
status with 'cat/dev/sndstat' reported my MQX as installed, but complete
support for the sound driver (OSS/Free) has yet to be added to dosemu.
<p> Since MVSOUND.SYS was indeed installed (I checked it in dosemu
using MSD, the Microsoft Diagnostics program), and since the MIDI
interface on the soundcard was activated, I began to wonder whether that
interface could be used. I tested the DOS MIDI programming environment
<a href="ftp://ftp.cs.pdx.edu/pub/music/ravel">RAVEL</a>, which is
"hardwired" internally to only an MPU-401 MIDI interface: to my surprise
and satisfaction, the soundcard's MIDI interface worked, and I now had a
DOS MIDI program working under Linux.<p> Following that line of action,
I figured that the Voyetra native MPU driver just might load. I tried
VAPIMPU: it failed, saying it couldn't find the interrupt. I added the
command-line flag /IRQ:7 and the driver loaded. I now had a Voyetra MIDI
interface device driver loaded, but would Sequencer Plus Gold run ?
<p> Not only does Sequencer Plus run, I am also able to use Voyetra's
Sideman D/TX patch editor/librarian for my TX802s. And I can run RAVEL,
adding a wonderful MIDI programming language to my Linux music & sound
arsenal.  <p> All is not perfect: RAVEL suffers the occasional stuck
note, and the timing will burp while running Seq+ in xdos, particularly
when the mouse is moved. The mouse is problematic with Seq+ in xdos
anyway, sometimes locking cursor movement. Since my configuration
for the dosemu console mode doesn't support the mouse, that problem
doesn't arise there. Switching to another console is possible; this is
especially useful if and when dosemu crashes. Also, programs using VGA
"high" graphics will crash, but I must admit that I have barely begun to
tweak the video subsystem for dosemu. It may eventually be possible to
run Sound Globs, Drummer, and perhaps even M/pc, but for now it seems
that only the most straightforward DOS MIDI programs will load and
run without major problems.  <p> And there is a much greater problem:
only version 1.26 of the VAPIMPU driver appears to work properly. A more
recent version (1.51) will not load, even with the address and interrupt
specified at the command-line. However, Rutger Nijlunsing has mentioned
that he is working on an OSS/Free driver for dosemu which would likely
permit full use of my MQX interface card. When that arrives I may be able
to utilize advanced features of Seq+ such as multiport MIDI (for 32 MIDI
channels) and SMPTE time-code.  <p> [Since writing the above text, I have
tweaked /etc/dosemu.conf for better performance in both X and console
modes. Setting <b>hogthreshold 0</b>seems to improve playback stability. I
have yet to fix the problem with the mouse in xdos, but it isn't much of
a real problem.  <p> Linux is free, dosemu is free, RAVEL is free. My
DOS MIDI software can't be run in a DOS box under Win95 with my hardware:
it <i>can</i>be done, but I'd have to buy another soundcard. Linux will run
its DOS emulator, with MIDI and sound support, from an X window or from a
virtual console (I have six to choose from). If I want to run Sequencer
Plus in DOS itself, I have to either drop out of Win95 altogether
(DOS mode) or not boot into Win95 at all. With Win95 I get one or the
other; with Linux, I get the best of all possible worlds.  <p><hr><p>
<center><a href="mailto:dlphilp@bright.net">Dave Phillips</a></center> <p>
<center><a href="http://www.bright.net/~dlphilp/linux_soundapps.html">Some
Interesting Sound & Music Software For Linux</a></center>


<!--===================================================================-->
<P> <hr> <P> <center><H5>Copyright &copy; 1997, Dave Phillips<BR>
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> <A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM
SRC="../gx/indexnew.gif" ALT="[ TABLE OF CONTENTS ]"></A> <A
HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A> <A HREF="./disk_hog.html"><IMG
SRC="../gx/back2.gif" ALT=" Back "></A> <A HREF="./gm.html"><IMG
SRC="../gx/fwd.gif" ALT=" Next "></A> <P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<!-- =============================================================
		This Page Designed by Michael J. Hammel.
		Permission to use all graphics and other content for private,
		non-commerical use is granted provided you give me (or the 
		original authors/artists) credit for the work.

		CD-ROM distributors and commercial ventures interested in 
		providing the Graphics Muse for a fee must contact me,
		Michael J. Hammel (mjhammel@csn.net), for permission.
     ============================================================= !-->

<!--  The Button box as a client side imagemap -->
<MAP NAME="nav-main">
<AREA SHAPE="rect" HREF="#mews" coords="3,10 158,56">
<AREA SHAPE="rect" HREF="#musings" coords="5,85 142,116">
<AREA SHAPE="rect" HREF="#resources" coords="5,152 177,182">
</MAP>


<TABLE width=560>
<tr>
	<td width=441 valign="top" align=left cellpadding=0 cellspacing=0>

		<!-- The title graphics -->
		<IMG SRC=../gx/hammel/gm3.gif ALT="Welcom to the Graphics Muse"
				ALIGN="left" WIDTH="441" HEIGHT="216" border="0"></td>

	<td width=119 align=right valign="bottom">
		<table>
		<tr>
			<td align=center>
				<FONT size=2>
				Set your browser to the width of the line below for best viewing.
				</FONT>
				<!-- The Copyright -->
				<BR><FONT size=1>
				&copy 1997 by
				<A HREF="mailto:mjhammel@csn.net">mjh</A>
				</FONT></td>
			</tr>
		</table></td>

<tr>
	<!-- Provide a measure for readers to adjust their browsers to. 
	  -- These pages should fit on a 640 pixel wide window, so laptop
	  -- users should be able to read them too.
	  -->
	<td width=100% cellspacing=0 cellpadding=0 
			valign=bottom align=center colspan=2>
		<HR>
		</td>
</table>

<TABLE width=560>
<tr>
	<!-- td width=177 align=left valign=top>
		-->
	<td width=17% align=left valign=top>
		<IMG SRC=../gx/hammel/buttons3.gif ALT="Button Bar"
				ALIGN="left" WIDTH="177" HEIGHT="185" 
				USEMAP="#nav-main" border="0"></td>


	<td width=83% align=left valign=top>
		<!-- What is a Graphics Muse? -->
		<FONT size=4><B>muse:</B></FONT>
		<OL>
			<LI><I>v;</I> to become absorbed in thought
			<LI><I>n;</I> [ fr. Any of the nine sister goddesses of learning and the
				arts in Greek Mythology ]: a source of inspiration
		</OL>
		<IMG SRC=../gx/hammel/w.gif ALT="W" ALIGN="left" 
			HSPACE="0" VSPACE="0" WIDTH="36" HEIGHT="28">elcome 
		to the Graphics Muse!  Why a "muse"?  
		Well, except for the sisters aspect, the above definitions are
		pretty much the way I'd describe my own interest in computer graphics:  
		it keeps me deep in thought and it is a daily source of inspiration.

		<!-- Text based navigation -->
		<P>
		<CENTER>
		<FONT size=2>
		[<A HREF="#mews">Graphics Mews</A>]
		[<A HREF="#musings">Musings</A>]
		[<A HREF="#resources">Resources</A>]
		</FONT>
		<CENTER></td>

</table>

<TABLE width=560>
<tr>
	<td>
	<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
		HSPACE="8" WIDTH="1" HEIGHT="1">
	<IMG SRC=../gx/hammel/t.gif ALT="T" ALIGN="left" 
		HSPACE="0" VSPACE="0" WIDTH="26" HEIGHT="28">his 
	column is dedicated to the use, creation, distribution, and discussion of 
	computer graphics tools for Linux systems.  
	This month I'll finally get around to the article on HF-Lab, John
	Beale's wonderful tool for creating 3D Heightfields.  I've been meaning
	to do this for the past few months.  I made sure I made time for it this
	month.
	<BR clear=both>
	&nbsp; &nbsp; &nbsp;
	The other article from me this month is a quick update on the 3D modellers
	that are available for Linux.  I didn't really do a comparative review,
	its more of a "this is whats available, and this is where to find them".
	A full comparative review is beyond the scope of this column.  Perhaps
	I'll do one for the Linux Journal sometime in the future.
	<BR clear=both>
	&nbsp; &nbsp; &nbsp;
	I had planned to do a preview of the Gimp 1.0 release which is coming
	out very soon.  However, I'll be doing a full article on the Gimp for
	the November graphics issue of the Linux Journal and decided to postpone
	the introduction I had planned for the Muse.   
	At the same time I had decided to postpone my preview,
	Larry Ayers contacted me
	to see if I was still doing my Gimp article for the Muse.
	He had planned on doing one on the latest version but didn't want
	to clash with my article.  I told him to feel free and do his
	since I wasn't doing one too.  He has graciously offered to place
	the preview here in the Muse and it appears under the "More Musings..."
	section.  

	<P>
	
	</td>
</table>


<!-- Netscape has a bug when applying a Name tag to an image, so we have to
     stick the image in a table so the image will be the top item on the
     page.
  -->
<A NAME="mews">
<table width=560>
<tr>
<td align=left>
<IMG SRC=../gx/hammel/mews.gif ALT="Graphics Mews" ALIGN="left" 
	HSPACE="0" VSPACE="0" WIDTH="242" HEIGHT="53">
</td>
</table>
</A>

<BR clear=both>
<TABLE width=560 border=0>
<tr>
	<td colspan=4>
	<BR clear=both>
	&nbsp; &nbsp; &nbsp;
		Disclaimer:
		Before I get too far into this I should note that any of the news items I
		post in this section are just that - news.  Either I happened to run 
		across
		them via some mailing list I was on, via some Usenet newsgroup, or via
		email from someone.  I'm not necessarily endorsing these products (some of
		which may be commercial), I'm just letting you know I'd heard about 
		them in the past month.
		<P>

<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td colspan=4>
		<H4>
		Zgv v2.8
		</H4>
		&nbsp; &nbsp; &nbsp;
		Zgv is a graphic file viewer for VGA and SVGA displays
		which supports most popular formats. (It uses svgalib.)
		It provides a graphic-mode file selector to select
		file(s) to view, and allows panning and fit-to-screen
		methods of viewing, slideshows, scaling, etc.
		
		<P>
		Nothing massively special about this release, really, but some of the
		new features are useful, and there is an important bugfix.
		
		<UL>
			<LH><B>New features added</B></LH>
			<LI>PCX support. (But 24-bit PCXs aren't supported.)
		
			<LI>Much faster generation of JPEG thumbnails, thanks to Costa
				Sapuntzakis.
		
			<LI>Optionally ditch the logo to get a proper, full-screen selector,
				with `f' or `z', or with `fullsel on' in config file.
		
			<LI>Thumbnail files can be viewed like other images, and thumbnail 
				files
				are their own thumbnails - this means you can browse thumbnail
				directories even if you don't have the images they represent.
		
			<LI>`-T' option, to echo tagged files on exit.
		</UL>
		
		
		<UL>
			<LH><B>Bugfixes</B></LH>
		
			<LI>Thumbnail create/update for read-only media and DOS filesystems
				fixed. It previously created all of them each time rather than only
				doing those necessary.
		
			<LI>Fixed problem with uncleared display when switching from zoom mode
				to scaling up.
		
			<LI>The switching-from-X etc. now works with kernel 2.0.x. Previously 
				it hanged. (It should still work with 1.2.x, too.)
		
			<LI>Now resets to blocking input even when ^C'ed.
		
			<LI>Various documentation `bugs' fixed, e.g. the `c' and `n' keys
				weren't previously listed.
		</UL>
		
		
		<UL>
			<LH><B>Other changes</B></LH>
		
			<LI>ANSIfied the code. This caught a couple of (as it turned out)
				innocuous bugs. (Fortuitously, they had no ill effect in practice.)
		
			<LI>Updated PNG support to work with libpng 0.81 (and, hopefully, any
				later versions).
		
			<LI>Sped up viewing in 15/16-bit modes a little.
		
			<LI>Incorporated Adam Radulovic's patch to v2.7 allowing more files in
				the directory and reducing memory usage.
		</UL>
		
		Zgv can be found either in
		<BR>
		<A HREF="ftp://sunsite.unc.edu:/pub/Linux/Incoming">
		sunsite.unc.edu:/pub/Linux/Incoming</A> or
		<BR>
		<A HREF="ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers">
		sunsite.unc.edu/pub/Linux/apps/graphics/viewers</A>.  
		<BR>
		The files of interest
		are zgv2.8-src.tar.gz and zgv2.8-bin.tar.gz.

		<P>
		Editors Note:  
		I don't normally include packages that aren't X-based, but the
		number of announcements for this month were relatively small so I
		thought I'd go ahead and include this one.  I don't plan on making
		it a practice, however.

		</td>

<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td colspan=2 width="50%" valign=top>
		<H4>
		Attention: OpenGL and Direct3D programmers
		</H4>
		&nbsp; &nbsp; &nbsp;
		<A HREF="mailto:mjk@fangio.asd.sgi.com">
		Mark Kilgard</A>, author of <I>OpenGL Programming for the X Window
		System</I>, posted the following announcement on the 
		<A HREF="news:comp.graphics.api.opengl">
		comp.graphics.api.opengl</A> newsgroup.  I thought it might
		be of interest to at least a few of my readers.

		<FONT size=2>
		<P>
		The URL below explains a fast and effective technique for applying
		texture mapped text onto 3D surfaces.  The full source code for a
		tool to generate texture font files (.txf files) and an API for
		easy rendering of the .txf files using OpenGL is provided.

		<P>
		For a full explanation of the technique including sample images
		showing how the technique works, please see:

		<BR>
		<A HREF="http://reality.sgi.com/mjk_asd/tips/TexFont/TexFont.html">
		http://reality.sgi.com/mjk_asd/
		<BR>
			&nbsp; &nbsp; &nbsp;
			tips/TexFont/TexFont.html</A>

		<P>
		Direct3D programmers are invited to see how easy and powerful OpenGL
		programming is.  In fact, the technique demonstrated is not
		immediately usable on Direct3D because it uses intensity textures (I
		believe not in Direct3D), polygon offset, and requires alpha testing,
		alpha blending, and texture modulation (not required to be implemented
		by Direct3D). I mean this to be a constructive demonstration of the
		technical inadequacies of Direct3D.
		</FONT>

		</td>

	<td colspan=2 width="50%">
		<table>
		<tr>
			<td colspan=2>
			<P>
			<FONT size=2>
			I hope you find the supplied source code, texture font
			generation utility, sample .txf files, and explanation quite useful.
			</FONT>

			<P>
			Note: for those that aren't aware of it, Direct3D is Microsoft's
			answer to OpenGL.  Despite their original support of OpenGL, they
			aparently decided to go with a different 3D standard, one they
			invented (I think).  Anyway, the discussion on
			comp.graphics.api.opengl of late has been focused on which of the two
			technologies is a better solution.

			</td>

		<tr>
			<td colspan=2 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
				<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
					HSPACE="0" WIDTH="0" HEIGHT="0"></td>

		<tr>
			<td width=1 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
				<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
					WIDTH="0" HEIGHT="0"></td>

		<td>
			<H4>
			Epson PhotoPC and PhotoPC 500 digital cameras
			</H4>
			&nbsp; &nbsp; &nbsp;
			Epson PhotoPC and PhotoPC 500 are digital still cameras.  They are
			shipped with Windows and Mac based software to download the pictures
			and control the camera parameters over a serial port.

			<P>
			Eugene Crosser wrote a C library and a command-line tool to 
			perform the same tasks under UNIX.  See

			<P>
			&nbsp; &nbsp; &nbsp;
        	<A HREF="ftp://ftp.average.org/pub/photopc/">
        	ftp://ftp.average.org/pub/photopc/</A>
	
			<P>
			MD5(photopc-1.0.tar.gz)= 9f286cb3b1bf29d08f0eddf2613f02c9

			<P>
			Eugene Crosser; 2:5020/230@fidonet; 
			<A HREF="http://www.average.org/~crosser/">
			http://www.average.org/~crosser/</A>

			<P>
			</td>

		</table>
		</td>


<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td colspan=4>
		<H4>ImageMagick V3.8.5</H4>
		&nbsp; &nbsp; &nbsp;
		Alexander Zimmerman has released a new version of ImageMagick.
		The announcment, posted to comp.os.linux.announce, reads
		as follows:
		<BLOCKQUOTE>
		I just uploaded to sunsite.unc.edu
		<P>
   	ImageMagick-3.8.5-elf.lsm
		<BR>
   	ImageMagick-3.8.5-elf.tgz
		<P>
		This is the newest version of my binary distribution of ImageMagick.
		It will move to the places listed in the LSM-entry at the end of this
		message. Please remember to get the package  libIMPlugIn-1.1  too,
		to make it working.
		<P>
		This version brings together a number of minor changes made to
		accomodate PerlMagick and lots of minor bugs fixes including
		multi-page TIFF decoding and writing PNG.
		<P>
		ImageMagick (TM), version 3.8.5, is a package for display and
		interactive manipulation of images for the X Window System.
		ImageMagick performs, also as command line programs, among others
		these functions:

		<UL>
			<LI>Describe the format and characteristics of an image 
			<LI>Convert an image from one format to another 
			<LI>Transform an image or sequence of images 
			<LI>Read an image from an X server and output it as an image file 
			<LI>Animate a sequence of images 
			<LI>Combine one or more images to create new images 
			<LI>Create a composite image by combining several separate images 
			<LI>Segment an image based on the color histogram 
			<LI>Retrieve, list, or print files from a remote network site 
		</UL>
		ImageMagick supports also the Drag-and-Drop protocol form the OffiX
		package and many of the more popular image formats including JPEG,
		MPEG, PNG, TIFF, Photo CD, etc.

		<table>
		<tr>
			<td rowspan=3 valign=top>
			<B>
			Primary-site:   
			</B>
			</td>
			<td>
				ftp.wizards.dupont.com /pub/ImageMagick/linux
			</td>
		<tr>
			<td>
                 986k ImageMagick-i486-linux-ELF.tar.gz
			</td>
		<tr>
			<td>
                 884k PlugIn-i486-linux-ELF.tar.gz
			</td>

		<tr>
			<td rowspan=6 valign=top>
			<B>
				Alternate-site: 
			</B>
			</td>
			<td>
			sunsite.unc.edu /pub/Linux/apps/graphics/viewers/X
			</td>
		<tr>
			<td>
                 986k ImageMagick-3.8.5-elf.tgz
			</td>
		<tr>
			<td>
                   1k ImageMagick-3.8.5-elf.lsm
			</td>
		<tr>
			<td>
                sunsite.unc.edu /pub/Linux/libs/graphics
			</td>
		<tr>
			<td>
                 884k libIMPlugIn-1.1-elf.tgz
			</td>
		<tr>
			<td>
                   1k libIMPlugIn-1.1-elf.lsm

		<tr>
			<td rowspan=5 valign=top>
			<B>
				Alternate-site: 
			</B>
			</td>

			<td>
			ftp.forwiss.uni-passau.de /pub/linux/local/ImageMagick
			</td>

		<tr>
			<td>
                 986k ImageMagick-3.8.5-elf.tgz
			</td>
		<tr>
			<td>
                   1k ImageMagick-3.8.5-elf.lsm
			</td>
		<tr>
			<td>
                 884k libIMPlugIn-1.1-elf.tgz
			</td>
		<tr>
			<td>
                   1k libIMPlugIn-1.1-elf.lsm
			</td>
		</table>


		</td>

<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td width=50%>
		<H4>
		VARKON Version 1.15A
		</H4>
		&nbsp; &nbsp; &nbsp;
		VARKON is a high level development tool for
		parametric CAD and engineering applications
		developed by Microform, Sweden.
		1.15A includes new parametric functions for
		creation and editing of sculptured surfaces
		and rendering based on OpenGL.

		<P>
		Version 1.15A of the free version for Linux
		is now available for download at:
		<BR>
		<A HREF="http://www.microform.se">
		http://www.microform.se</A>
 
		</td>

	<td bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>
	<td bgcolor="#ffffff" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			WIDTH="0" HEIGHT="0"></td>

	<td width=49%>
		<H4>
		Shared library version of xv 3.10a
		</H4>
		&nbsp; &nbsp; &nbsp;
		xv-3.10a-shared is the familiar image viewer program with all current
		patches modified to use the shared libraries provided by libgr.
		<P>
		xv-3.10a-shared is available from 
		<A HREF="ftp://ftp.ctd.comsat.com/pub/">
		ftp://ftp.ctd.comsat.com/pub/</A>.
		libgr-2.0.12.tar.gz is available from
		<A HREF="ftp://ftp.ctd.comsat.com/pub/linux/ELF/">
		ftp://ftp.ctd.comsat.com:/pub/linux/ELF/</A>.
 
		</td>

<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td colspan=4>
		<H4>
		t1lib-0.2-beta - 
		A Library for generating Bitmaps from Adobe Type 1 Fonts
		</H4>
		&nbsp; &nbsp; &nbsp;
		t1lib is a library for generating character- and string-glyphs from
		Adobe Type 1 fonts under UNIX. t1lib uses most of the code of the X11
		rasterizer donated by IBM to the X11-project. But some disadvantages
		of the rasterizer being included in X11 have been eliminated. Here are
		the main features:
		
		<UL>
			<LI>t1lib is completely independent of X11 (although the program
				provided for testing the library needs X11)
			<LI>fonts are made known to library by means of a font database file at
				runtime
			<LI>searchpaths for all types of input files are configured by means
				of a configuration file at runtime
			<LI>characters are rastered as they are needed
			<LI>characters and complete strings may be rastered by a simple 
				function call
			<LI>when rastering strings, pairwise kerning information from 
				.afm-files may optionally be taken into account
			<LI>an interface to ligature-information of afm-files is provided
			<LI>rotation is supported at any angles
			<LI>there's limited support for extending and slanting fonts
			<LI>new encoding vectors may be loaded at runtime and fonts may be
				reencoded using these encoding vectors 
			<LI>antialiasing is implemented using three gray-levels between 
				black and white
			<LI>a logfile may be used for logging runtime error-, warning- and 
				other messages
			<LI>an interactive test program called "xglyph" is included in the
				distribution. This program allows to test all of the features of the
				library. It requires X11.
		</UL>
		
		Author: Rainer Menzner 
		(<A HREF="mailto:rmz@neuroinformatik.ruhr-uni-bochum.de">
		rmz@neuroinformatik.ruhr-uni-bochum.de</A>)
		<P>
		You can get t1lib by anonymous ftp at:
		<BR>

		<A HREF="ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib/t1lib-0.2-beta.tar.gz">
		ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/
		<BR>
		&nbsp;&nbsp;&nbsp;
			pub/software/t1lib/t1lib-0.2-beta.tar.gz</A>

		<P>
		An overview on t1lib including some screenshots of xglyph can be
		found at:
		<BR>
		<A HREF="http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/rmz/t1lib.html">
		http://www.neuroinformatik.ruhr-uni-bochum.de/
		<BR>
		&nbsp;&nbsp;&nbsp;
			ini/PEOPLE/rmz/t1lib.html</A>
		</td>
  
<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>

<tr>
	<td colspan=4>
		<H4>
      Freetype Project - The Free TrueType Font Engine
		<BR>
		Alpha Release 4
		</H4>
		&nbsp; &nbsp; &nbsp;
		The FreeType library is a free and portable TrueType font rendering
		engine.  This package, known as 'Alpha Release 4' or 'AR4', contains the
		engine's source code and documentation.


		<P>
		What you'll find in this release are:
		<UL>
			<LI> better portability of the C code than in the previous release.
			<LI> font smoothing, a.k.a. gray-level rendering.
			Just like Win95, only the diagonals and curves are smoothed, while the
			vertical and horizontal stems are kept intact.
			<LI> support for all character mappings, as well as glyph indexing and
			translation functions (incomplete).
			<LI> full-featured TrueType bytecode interpreter !!
			The engine is now able to hint the glyphs, thus producing an excellent
			result at small sizes.  We now match the quality of the bitmaps
			generated by Windows and the Mac!  Check the 'view' test program for a
			demonstration.
			<LI> loading of composite glyphs.
			It is now possible to load and display composite glyphs with the 'zoom'
			test program.  However, composite glyph hinting is not implemented yet
			due to the great incompleteness of the available TrueType
			specifications.
		</UL>

		Also, some design changes have been made to allow the support of the
		following features, though they're not completely implemented yet:
		<UL>
      <LI> multiple opened font instances
      <LI> thread-safe library build
      <LI> re-entrant library build
      <LI> and of course, still more bug fixes ;-)
		</UL>

		Source is provided in two programming languages: C and Pascal, with some
		common documentation and several test programs.
		The Pascal source code has been successfully compiled and run with Borland
		Pascal 7 and fPrint's Virtual Pascal on DOS and OS/2 respectively.
		The C source code has been successfully compiled and run on various
		platforms including DOS, OS/2, Amiga, Linux and several other variants of
		UNIX.  It is written in ANSI C and should be very easily ported to any
		platform.
		Though development of the library is mainly performed on OS/2 and Linux, 
		the
		library does not contain system-specific code.
		However, this package contains some graphics drivers used by the test
		programs for display purposes on DOS, OS/2, Amiga and X11.

		<P>
		Finally, the FreeType Alpha Release 4 is released for informative and
		demonstration purpose only.  The authors provide it 'as is', with no
		warranty.

		<P>
		The file freetype-AR4.tar.gz (about 290K)
		is available now at 
		<A HREF="ftp://sunsite.unc.edu/pub/Linux/X11/fonts">
		ftp://sunsite.unc.edu/pub/Linux/X11/fonts</A>
		or at the FTP site in:
		<A HREF="ftp://ftp.physiol.med.tu-muenchen.de/pub/freetype">
		ftp://ftp.physiol.med.tu-muenchen.de/pub/freetype</A>

		<P>
       Web page:
		<BR>
          <A HREF="http://www.physiol.med.tu-muenchen.de/~robert/freetype.html">
          http://www.physiol.med.tu-muenchen.de/~robert/freetype.html</A>
		<BR>
		The home site of the FreeType project is
		<BR>
           <A HREF="ftp://ftp.physiol.med.tu-muenchen.de/pub/freetype">
           ftp://ftp.physiol.med.tu-muenchen.de/pub/freetype</A>

		<BR>
		There is also a mailing list:
		<BR>
           <A HREF="mailto:freetype@lists.tu-muenchen.de">
          freetype@lists.tu-muenchen.de</A>

		<BR>
		Send the usual subscription commands to:
		<BR>
           <A HREF="mailto:majordomo@lists.tu-muenchen.de">
           majordomo@lists.tu-muenchen.de</A>

		<P>
		<table>
		<tr>
			<td valign=top> Copyright 1996 
				</td>
			<td valign=top>
				David Turner <turner@enst.fr>
				</td>
		<tr>
			<td valign=top rowspan=2> Copyright 1997 
				</td>
			<td valign=top>
				Robert Wilhelm  &lt;robert@physiol.med.tu-muenchen.de&gt;
				</td>
		<tr><td valign=top> Werner Lemberg  &lt;a7971428@unet.univie.ac.at&gt;
			</td>
		</table>
		</td>

	</td>


<tr>
	<td colspan=4 bgcolor="#ffffff" cellpadding=1 cellspacing=0 valign=top>
	<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
		VSPACE="5" HSPACE="10" WIDTH="1" HEIGHT="1"></td>
<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=1 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>
<tr>
	<td colspan=4 bgcolor="#ffffff" cellpadding=1 cellspacing=0 valign=top>
	<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
		VSPACE="5" HSPACE="10" WIDTH="1" HEIGHT="1"></td>

<tr>
	<td colspan=4>
		<!--
		  -- Did You Know Section
		  -->
		<H4>Did You Know?</H4>
		...the Portal web site for <B>xanim</B> has closed down.
		The new primary sites are:
		<BLOCKQUOTE>
        <A HREF="http://xanim.va.pubnix.com/home.html">
        http://xanim.va.pubnix.com/home.html</A>
			<BR>
        <A HREF="http://smurfland.cit.buffalo.edu/xanim/home.html">
        http://smurfland.cit.buffalo.edu/xanim/home.html</A>
			<BR>
        <A HREF="http://www.tm.informatik.uni-frankfurt.de/xanim/">
        http://www.tm.informatik.uni-frankfurt.de/xanim/</A>
			<BR>
        The latest revision of xanim is 2.70.6.4.
		</BLOCKQUOTE>

		<P>
		I got the following message from a reader.  Feel free to contact
		him with your comments.  I have no association with this project.
		<BLOCKQUOTE>
		I'm currently working on an application to do image processing and
		Computer Vision tasks.
		In the stage of development, I would like to know what the
		community expects from such a product, so if you would like the status 
		of the work, please come and visit:
		<BR>
		<A HREF="http://www-vision.deis.unibo.it/~cverond/cvw">
		http://www-vision.deis.unibo.it/~cverond/cvw</A>
		<BR>
		Expecially the "sample" section, where you can see some of the
		application's functionality at work, and leave me a feedback.
		Thanks for your help.  Cristiano Verondini
		<A HREF="mailto:cverondini@deis.unibo.it|">
		cverondini@deis.unibo.it|</A>
		</BLOCKQUOTE>


		<!--
		  -- Q and A Section
		  -->
		<P><FONT size=3><B>Q and A</B></FONT>
		<P>
		<I>Q: Can someone point me to a good spot to download 
			some software to make a good height map?
		</I>
		<P>A: 
			I'd suggest you try either John Beale's hflab available at:
			<A HREF="http://shell3.ba.best.com/~beale/">
			http://shell3.ba.best.com/~beale/</A>
			Look under sources. You will find executables for Unix and
			source code for other systems. It is pretty good at manipulating
			and creating heightfields and is great at making heightfields 
			made in a paint program more realistic.

			<BR>
			&nbsp; &nbsp; &nbsp;
			For the ultimate in realism use dem2pov by Bill Kirby, also
			available at John Beale's web site 
			to convert DEM files to TGA heightfields. You can get
			DEM files trough my DEM mapping project at
			<A HREF="http://www.sn.no/~svalstad/hf/dem.html">
			http://www.sn.no/~svalstad/hf/dem.html</A>
			or directly from
			<A HREF="ftp://edcftp.cr.usgs.gov/pub/data/DEM/250/">
			ftp://edcftp.cr.usgs.gov/pub/data/DEM/250/</A>

			<BR>
			&nbsp; &nbsp; &nbsp;
			As for your next question about what the pixel values of
			heightfields mean, there are three different situations:
			<OL>
				<LI>High quality heightfields use a 24bit TGA or PNG
					file to store 16 bit values with the most significant byte 
					in the red component, the least significant byte in the green 
					component and the blue component empty.
				<LI> 8bit GIF files store a colour index where the colour with
					index number 0 becomes the lowest part of the heightfield
					and the colour
					with index number 255 becomes the highest part.
				<LI> 8bit greyscale GIF files; the darkest colours become the
					lowest part of the heightfield and the lightest colours 
					becomes the higherst part.
			</OL>
			<FONT size=2>
			From
			Stig M. Valstad via the IRTC-L mailing list
			<BR>
			<A HREF="mailto:svalstad@sn.no">
			svalstad@sn.no</A>
			<BR>
			<A HREF="http://www.sn.no/~svalstad">
			http://www.sn.no/~svalstad</A>
			</FONT>

		<P>
		<I>Q: Sorry to pester you but I've read your minihowto on
			graphics in Linux and I still haven't found what I'm
			looking for.  Is there a tool that will convert a collection
			of TGA files to one MPEG file in Linux?
		</I>
		<P>A: 
		I don't know of any off hand, but check the following pages.  They might
		have pointers to tools that could help.

		<BR>
		<CENTER>
		<A HREF="http://sunsite.unc.edu/pub/multimedia/animation/mpeg/berkeley-mirror/">
		http://sunsite.unc.edu/pub/multimedia/animation/mpeg/berkeley-mirror/</A>
		<A HREF="http://xanim.va.pubnix.com/home.html">
		http://xanim.va.pubnix.com/home.html</A> (this is Xanim's home page).
		</CENTER>
		You probably have to convert your TGA's to another format 
		first, then encode
		them with mpeg_encode (which can be found at the first site listed above).

		<P>
		<I>Q: Where can I find some MPEG play/encode tools?
		</I>
		<P>A: 
		<A HREF="http://sunsite.unc.edu/pub/multimedia/animation/mpeg/berkeley-mirror/">
		http://sunsite.unc.edu/pub/multimedia/animation/mpeg/berkeley-mirror/</A>

		<P>
		<I>Q: 
			Where can I find free textures on the net in BMP, GIF, JPEG, and 
			PNG formats?
		</I>
		<P>A: 
		Try looking at:
		<BR>
		&nbsp; &nbsp; &nbsp;
		<A HREF="http://axem2.simplenet.com/heading.htm">
		http://axem2.simplenet.com/heading.htm</A>

		<P>
		These are the textures I've started using in my OpenGL demos.
		They are very professional.  There are excellent brick and
		stone wall textures.  If you are doing a lot of modeling of
		walls and floors and roads, the web site offers a CD-ROM
		with many more textures.

		<P>
		Generally, I load them into "xv" (an X image viewer utility)
		and resample them with highest-quality filtering to be on
		even powers of two and then save them as a TIFF file.  I
		just wish they were already at powers of two so I didn't have
		to resample.

		<P>
		Then, I use Sam Leffler's very nice libtiff library to read
		them into my demo.  I've got some example code of loading TIFF
		images as textures at:
		<BR>
		&nbsp; &nbsp; &nbsp;
		<A HREF="http://reality.sgi.com/mjk_asd/tiff_and_opengl.html">
		http://reality.sgi.com/mjk_asd/tiff_and_opengl.html</A>

		<P>
		<FONT size=2>
		From: Mark Kilgard 
		&lt;<A 
			HREF="mailto:mjk@fangio.asd.sgi.com">mjk@fangio.asd.sgi.com</A>&gt;,
		author of <I>OpenGL Programming for the X Window System</I>, via the 
		<A HREF="news:comp.graphics.api.opengl">
		comp.graphics.api.opengl</A> newsgroup.
		</FONT>

		<P>
		<I>Q: Why can't I feed the RIB files exported by AMAPI directly
			into BMRT?
		</I>
		<P>A: 
		According to 
		<a HREF="mailto:shem@warehouse.net">shem@warehouse.net</A>:
		<BLOCKQUOTE>
		Thomas Burge from Apple who has both the NT and Apple versions of
		AMAPI explained to me what the situation is - AMAPI only exports
		RIB entity files; you need to add a fair chunk of data before
		a RIB WorldBegin statement to get the camera in the right place and
		facing the right way. As it were, no lights were enabled and my camera
		was positioned underneath the object, facing down! There is also a
		Z-axis negation problem in AMAPI, which this gentleman pointed out to me
		and gave me to the RIB instructions to compensate for it.
		</BLOCKQUOTE>

		<P>
		<I>Q: 
		Is there an OpenGL tutorial on-line?  The sample
		code at the OpenGl WWW center seems pretty advanced to me. 
		</I>
		<P>A: 
		There are many OpenGL tutorials on the net.  Try looking at:
		<BR>
		<A HREF="http://reality.sgi.com/mjk_asd/opengl-links.html">
		http://reality.sgi.com/mjk_asd/opengl-links.html</A>

		<P>
		Some other good ones are:
		<UL>
			<LI>OpenGL overview -
			<A HREF="http://www.sgi.com/Technology/openGL/paper.design/opengl.html">
				http://www.sgi.com/Technology/openGL/paper.design/opengl.html</A>
			<LI> OpenGL with Visual C++ -
			<A HREF="http://www.iftech.com/oltc/opengl/opengl0.stm">
			http://www.iftech.com/oltc/opengl/opengl0.stm</A>
			<LI> OpenGL and X, an intro -
			<A HREF="http://www.sgi.com/Technology/openGL/mjk.intro/intro.html">
			http://www.sgi.com/Technology/openGL/mjk.intro/intro.html</A>
		</UL>

		<FONT size=2>
		From Mark Kilgard
		</FONT>

		<P>
		<I>Q: So, like, is anyone really reading this column?
		</I>
		<P>A: 
			I have no idea.  Is anyone out there?
 
		</td>

<tr>
	<td colspan=4 bgcolor="#ffffff" cellpadding=1 cellspacing=0 valign=top>
	<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
		VSPACE="5" HSPACE="10" WIDTH="1" HEIGHT="1"></td>
<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=1 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>
<tr>
	<td colspan=4 bgcolor="#ffffff" cellpadding=1 cellspacing=0 valign=top>
	<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
		VSPACE="5" HSPACE="10" WIDTH="1" HEIGHT="1"></td>
</table>



<P>
<A NAME="musings">
<table>
<tr>
<td>
<IMG SRC=../gx/hammel/musings.gif ALT="Musings" ALIGN="left" 
	HSPACE="0" VSPACE="0" WIDTH="247" HEIGHT="52">
</td>
</table>
</A>
<BR clear=both>

<TABLE width=560>
<tr>
	<td valign=top>
		<H4>
		3D Modellers Update
		</H4>
		&nbsp; &nbsp; &nbsp;
		Recently there has been a minor explosion of 3D modellers.  Most of the 
		modellers I found the first time out are still around although
		some are either no longer being developed or the developers have
		not released a new version in some time.  Since I haven't really
		covered the range of modellers in this column since I started back
		in November 1996, I decided it was time I provided a brief overview
		of whats available and where to get them.
		<BR>
		&nbsp; &nbsp; &nbsp;
		The first thing to do is give a listing of what tools are 
		available.  The following is the list of modellers I currently
		know about, in no particular order:
		<P>
		<CENTER>
		<table>
		<tr>
			<td valign=top>
				<UL>
					<LI>AC3D
					<LI>SCED/SCEDA
					<LI>Midnight Modeller
					<LI>AMAPI
					<LI>Bentley Microstation 95
				</UL>
				</td>
			<td valign=top>
				<UL>
					<LI>Aero
					<LI>Leo3D
					<LI>MindsEye
					<LI>3DOM
				</UL>
				</td>
		</table>
		</CENTER>
		There is also the possibility that bCAD is available for Linux
		as a commercial port, but I don't have proof of this yet.  Their web
		site is very limited as to contact information so I wasn't able to
		send them email to find out for certain.  The web pages at 3DSite
		for bCAD do not list any Unix ports for bCAD, although they appear
		to have a command line renderer for Unix.
		<BR>
		&nbsp; &nbsp; &nbsp;
		There are
		also a couple of others that I'm not sure how to classify, but the
		modelling capabilities are not as obvious so I'll deal with them in
		a future update (especially if the contact me with details on their
		products).
		
		<BR>
		&nbsp; &nbsp; &nbsp;
		All of these use graphical, point-and-click style interfaces.  There
		are other modellers that use programming languages but no graphical
		interface, such as POV-Ray, Megahedron and BMRT (via its RenderMan
		support).  Those tools not covered by this discussion.

		<BR>
		&nbsp; &nbsp; &nbsp;
		The list of modellers can be broken into three categories:  stable,
		under development, and commercial.  The stable category
		includes AC3D, SCED/SCEDA, and Midnight Modeller.  Commercial 
		modellers are the AMAPI and Megahedron packages, and Bentley
		Microstation.  The latter is actually free for
		non-commercial unsupported use, or $500 with support.  Below are
		short descriptions of the packages, their current or best known status and
		contact information.  The packages in the table are listed
		alphabetically.

		<P>
		<table width=560 border=2>
		<tr>
			<th colspan=4 align=center bgcolor=#99ffff>
				Product and description</th>
		<tr>
			<th width=20% align=left bgcolor=#3399ff>
				Imports</th>
			<th width=20% align=left bgcolor=#3399ff>
				Exports</th>
			<th width=20% align=left bgcolor=#3399ff>
				Availability</th>
			<th width=20% align=left bgcolor=#3399ff>
				Contact</th>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="./gx/hammel/3dom.gif">3DOM</A> -
				<FONT size=2>
				Very early development.  I haven't tried this one yet.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				Unknown
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				Unknown
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Freeware
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="http://www.cs.kuleuven.ac.be/cwis/research/graphics/3DOM/">
				 http://www.cs.kuleuven.ac.be/cwis/research/graphics/3DOM/
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="../gx/hammel/ac3d.jpg">AC3D</A> -
				<FONT size=2>
				OpenGL based vertex modeller with multiple, editable views plus
				a 3D view.  Includes ability to move, rotate, resize, position,
				and extrude objects.  
				Objects can be named and hidden.  Includes support for 2D
				(line (both poly and polylines) , circle, rectangle, ellipse, 
				and disk) and 3D (box, sphere, cylinder and mesh).  Fairly nice
				3D graphical interface that looks like Motif but doesn't
				require Motif libraries.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				Imports DXF, Lightwave, Triangle, vector formatted object files.
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				Generates RenderMan, POV-Ray 2.2, VRML, Massive, DVS, Dive and 
				Triangle formatted object files.
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Shareware
				</FONT>
				</td>
			<td align=center>
				<A HREF="http://www.comp.lancs.ac.uk/computing/users/andy/ac3dlinux.html">
				<FONT size=2>
				http://www.comp.lancs.ac.uk/
					<BR>computing/users/andy/ac3dlinux.html</A>
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				Aero -  The following is taken from the documentation
				that accompanies the package:
				<FONT size=2>
				<BLOCKQUOTE>
				AERO is a tool for editing and simulating scenes with rigid body
				systems. You can use the built-in 4-view editor to create a virtual
				scene consisting of spheres, cuboids, cylinders, planes and fix
				points. You can link these objects with rods, springs, dampers and
				bolt joints and you can connect forces to the objects. Then you can
				begin the simulation and everything starts moving according to the
				laws of physics (gravitation, friction, collisions). The simulation
				can be viewed as animated wire frame graphics. In addition you can
				use POV-Ray to render photo-realistic animation sequences.
				</BLOCKQUOTE>
				This package requires the FSF Widget library, which I don't
				have.  The last time I tried to compile that library it didn't
				work for me, but maybe the build process works better now.
				Anyway, I haven't seen this modeller in action.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				Proprietary ASCII text format
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				POV-Ray
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="http://www.informatik.uni-stuttgart.de/ipvr/bv/aero/">
				http://www.informatik.uni-stuttgart.de/ipvr/bv/aero/</A>
				<BR>
				<A HREF="ftp://ftp.informatik.uni-stuttgart.de/pub/AERO">
				ftp://ftp.informatik.uni-stuttgart.de/pub/AERO</A>
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="./gx/hammel/amapi.jpg">AMAPI</A> - 
				<FONT size=2>
				Fairly sophisticated, including support for NURBS and a
				macro language.  Interface is quit unique for X applications,
				probably based on OpenGL.  
				The version available from Sunsite doesn't
				work quite right on my system.  Some windows don't get drawn
				unless a refresh is forced and the method for doing a refresh
				is kind of trial-and-error.  The trial version of 2.11 has 
				the same problem.  Perhaps this is a problem with the OpenGL
				they use, although a check with ldd doesn't show any
				dependencies on OpenGL.  I wish this worked.  I really like
				the interface.
				<P>
				Yonowat, the maker of AMAPI, 
				has a trial version, 2.11, available for download from their
				web site.  They are also porting another of their products
				AMAPI Studio 3.0, a more advanced modeling tool, to Linux.
				The web site doesn't mention when it might be ready but the
				description on the pages look *very* interesting.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				DXF, 3DS R3 and R4, IGES, Illustrator, Text,
				has its own proprietary format
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				DXF, CADRender, Text, AMAPI, 3DS R3 and R4, Ray Dream Designer,
				Lightwave, 3DGF, Truespace V2.0, Caliray, POV 3.0, IGES,
				Explore, VRML, STL, Illustrator, RIB
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Shareware - $25US, $99US will get you a 200 page printed
				manual.  Personal use copies for Linux are free for a year,
				but commercial, government, and institutional users must
				register their copies.
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="http://www.informatik.uni-stuttgart.de/ipvr/bv/aero/">
				http://www.informatik.uni-stuttgart.de/ipvr/bv/aero/</A>
				<BR>
				<A HREF="ftp://ftp.informatik.uni-stuttgart.de/pub/AERO">
				ftp://ftp.informatik.uni-stuttgart.de/pub/AERO</A>
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="./gx/hammel/leo3d.jpg">Leo3D</A> - 
				<FONT size=2>
				The following is taken from the README file in the Leo3D
				distribution:
				<BLOCKQUOTE>
				Leo 3D is a real time 3D modelling application which enables you 
				to create realistic 3D scenes using different rendering 
				applications (such as Povray or BMRT for example). It also 
				exports VRML files. 
				<P>
				What distinguishes Leo 3D from most other modelling applications 
				is that all object transformations are done directly in the 
				viewing window (no need for three seperate x, y, and z windows). 
				For example, to move an object, all you need to do is grab and 
				drag (with the mouse) one of the 'blue dots' which corresponds to 
				the 2D Plane for which you wish to move the object.  Scaling and 
				rotation is done in the same way with the yellow and magenta dots 
				respectively.
				</BLOCKQUOTE>
				This modeller has a very cool interface based on OpenGL, GLUT, TCL
				and Tix.  I had problems with it when trying to load 
				files, but just creating and shading a few objects was quite easy 
				and rather fun, actually.  This modeller certainly has some of the 
				most potential of the non-commercial modellers that I've seen.  
				However, it still has some work to do to fix a few obvious bugs.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				DXF
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				POV-Ray, RenderMan, VRML 1.0, JPEG
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Shareware - $25US
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="ftp://s2k-ftp.cs.berkeley.edu/pub/personal/mallekai/leo3d.html">
				ftp://s2k-ftp.cs.berkeley.edu/pub/personal/mallekai/leo3d.html</A>
				(Yes, thats an ftp site with an HTML page.)
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				Bentley Microstation 95 and MasterPiece -
				<FONT size=2>
				Commercial computer-aided design product
				for drafting, design, visualization, analysis, database
				management, and modeling
				with a long history on MS, Mac and other
				Unix platforms.  Includes programming support with a BASIC
				language and linkages to various commericial databases
				such as Oracle and Informix.
				The product seems quite sophisticated based
				on their web pages, but I've never seen it in action.  I have
				seen a number of texts at local bookstores relating to the
				MS products, so I have a feeling the Linux ports should be
				quite interesting.  Bentley's product line is quite large.
				This looks like the place to go for a
				commercial modeller, although I'm not certain if they'll
				sell their educational products to the general public or not.
				If anyone finds out please let me know.  Note that the Linux
				ports have not been released (to my knowledge - I'm going by
				whats on the web pages).
				</FONT>
				</td>
		<tr>
			<td align=left>
				<FONT size=2>
				DXF, DWG and IGES 
				</FONT>
				</td>
			<td align=left>
				<FONT size=2>
				Unknown
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Commercial, primarily targeted at educational markets, however
				they appear open to public distributions and ports of their
				other packages if enough interest is shown by the Linux
				community.
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
					<A HREF="http://www.bentley.com/ema/academic/aclinux.htm">
					http://www.bentley.com/ema/academic/aclinux.htm</A>
					<BR>
					<A HREF="http://www.bentley.com/ema/academic/academic.htm">
					http://www.bentley.com/ema/academic/academic.htm</A>
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="./gx/hammel/mnm.jpg">Midnight Modeller</A> -
				<FONT size=2>
				A direct port of the DOS version to Linux.  The X interface
				looks and acts just like the DOS version.  On an 8 bit 
				display the colors are horrid, but its not so bad on 24 bit
				displays.  It seems to have a problem seeing all the
				directories in the current directory when trying to open files.
				<P>
				The DOS version is being ported to Windows but it doesn't
				appear a port of this version will be coming for Linux.
				The original Linux-port author says he's still interested in doing
				bug fixes but doesn't expect to be doing any further
				feature enhancement.
				</FONT>
				</td>
		<tr>
			<td align=left>
				<FONT size=2>
				DXF, Raw
				</FONT>
				</td>
			<td align=left >
				<FONT size=2>
				DXF, Raw
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Freeware
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="ftp://ftp.infomagic.com/pub/mirrors/.mirror1/sunsite/apps/graphics/rays/pov/mnm-linux-pl2.static.ELF.gz">
				ftp://ftp.infomagic.com/pub/mirrors/.mirror1/
				<BR>
					&nbsp; &nbsp; &nbsp;
					sunsite/apps/graphics/rays/pov/
				<BR>
					&nbsp; &nbsp; &nbsp;
					mnm-linux-pl2.static.ELF.gz</A>
				<BR>
				<A HREF="ftp://ftp.infomagic.com/pub/mirrors/.mirror1/sunsite/apps/graphics/rays/pov/mnm-linux-pl2.static.ELF.README">
				ftp://ftp.infomagic.com/pub/mirrors/.mirror1/
				<BR>
					&nbsp; &nbsp; &nbsp;
					sunsite/apps/graphics/rays/pov/
				<BR>
					&nbsp; &nbsp; &nbsp;
					mnm-linux-pl2.static.ELF.gz</A>
				<BR>
				Author: Michael Lamertz
				&lt;<A HREF="mailto:mlamertz@odars.de">mlamertz@odars.de</A>&gt;
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="mindseye.html">MindsEye</A>

				<FONT size=2>
				A new modeller in very early development which is based
				on both OpenGL/MesaGL and QT.  Is designed to allow 
				plug-ins.  The project has a mailing list for developers
				and other interested parties and appears to have more
				detailed design specifications than most "community developed"
				projects of this nature.  Its been a while coming, but the
				modeller is starting to take shape.  Last I looked they
				were beginning to work on adding autoconf to the build
				environment, which is a very good thing to do early on
				in a project, like this one is.
				</FONT>
		<tr>
			<td align=left>
				<FONT size=2>
				DXF, others planned
				</FONT>
				</td>
			<td align=left >
				<FONT size=2>
				Unknown
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				GNU GPL
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="http://www.ptf.hro.nl/free-d/">
				http://www.ptf.hro.nl/free-d/</A> - Web Site
				<BR>
				<A HREF="ftp://ftp.cs.umn.edu/users/mein/mindseye/">
				ftp://ftp.cs.umn.edu/users/mein/mindseye/</A> - source code
				</FONT>
				</td>
		</table>

		<P>
		<table width=560 border=1>
		<tr>
			<td colspan=4 align=left valign=top  bgcolor=#99ffff>
				<A HREF="./gx/hammel/sced.jpg">SCED/SCEDA</A> -
				<FONT size=2>
				The following is taken from the README file in the
				SCED distribution:
				<BLOCKQUOTE>
				Sced is a program for creating 3d scenes, then exporting them
				to a wide
				variety of rendering programs. Programs supported are:
 				POVray, Rayshade, any VRML browser, anything that reads Pixar's RIB
 				format, and Radiance. Plus a couple of local formats, for me.  
				<P>
				Sced uses constraints to allow for the accurate placement of
				objects, and provides a maintenance system for keeping this
				constraints satisfied as the scene is modified.
				</BLOCKQUOTE>
				This is a very sophisticated modeller, but the Athena interface
				makes it look less powerful than it is.  I used this modeller
				for many of the scenes I created when I first started into 3D
				and still like its constraint system better than what is 
				available in AC3D (which doesn't really have constraints in
				same sense, I don't think).  SCED's biggest limitation is
				its lack of support for importing various 3D formats.
				<P>
				SCEDA is a port of SCED that allows for keyframed animation.
				Objects are given initial and ending positions and the modeller
				creates the frames that will fill in the spaces between these 
				two points.
				</FONT>
				</td>
		<tr>
			<td align=left valign=top>
				<FONT size=2>
				Proprietary scene format and OFF (wireframe format)
				</FONT>
				</td>
			<td align=left valign=top>
				<FONT size=2>
				POV 3.0, Radiance, RenderMan, VRML 1.0
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				Freeware (GPL'd)
				</FONT>
				</td>
			<td align=center>
				<FONT size=2>
				<A HREF="http://http.cs.berkeley.edu/~schenney/sced/sced.html">
  				http://http.cs.berkeley.edu/~schenney/sced/sced.html</A>
				<BR>
				<A HREF="ftp://ftp.cs.su.oz.au/stephen/sced">
  				ftp://ftp.cs.su.oz.au/stephen/sced</A>
				<BR>
				<A HREF="ftp://ftp.povray.org/pub/pov/modellers/sced">
  				ftp://ftp.povray.org/pub/pov/modellers/sced</A>
					</A>
				</FONT>
				</td>
		</table>

		</td>
<tr>
	<td bgcolor="#000000" cellpadding=1 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			WIDTH="1" HEIGHT="1"></td>

</table>

<TABLE width=560>
<tr>
	<td valign=top width="48%">
		<!-- Book Review -->
		<H4><I>
		HF-Lab
		</I> </H4>
		&nbsp; &nbsp; &nbsp; 
		Height fields are convenient tools for representing terrain
		data that are supported directly by POV-Ray and through the
		use of displacement maps or patch meshes in BMRT.  With
		POV-Ray and displacement maps in BMRT, a 2D image is used 
		to specify the height of a point based on the color and/or 
		intensity level for the point in the 2D image.  The renderer
		uses this image, mapped over a 3D surface, to create mountains,
		valleys, plateaus and other geographic features.  Creating
		a representative 2D image is the trick to realistic landscapes.
		<A HREF="http://www.best.com/~beale">
		HF-Lab</A>, 
		an X based interactive tool written by 
		<A HREF="mailto:beale@best.com">
		John Beale</A>,
		is an easy to use and extremely useful tool for creating these
		2D images.
		<BR>
		&nbsp; &nbsp; &nbsp; 
		Once you have retrieved the source, built (instructions are 
		included and the build process is fairly straightforward, although
		it could probably benefit from the use of imake or autoconf) and
		installed it you're ready to go.  HF-Lab is a command line oriented
		tool that provides its own shell from which commands can be entered.
		To start HF-Lab using BASH type

		<P clear=both>
		<FONT size=2>
		&nbsp;
		% export HFLHELP=$HOME/hf/hf-lab.hlp
		<BR>
		&nbsp;
		% hlx
		</FONT>

		<P clear=both>
		and in csh type
		<P clear=both>

		<FONT size=2>
		&nbsp;
		% setenv HFLHELP $HOME/hf/hf-lab.hlp 
		<BR>
		&nbsp;
		% hlx
		</FONT>

		<P clear=both>
		Note that the path you use for the HFHELP environment variable
		depends on where you installed the hf-lab.hlp file from the distribution.
		The build process does not provide a method for installing this file
		for you so you'll need to be sure to move the file to the appropriate
		directory by hand.  You definitely want to make sure this file is
		properly installed since the online help features in HF-Lab are
		quite nice.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		The first thing you notice is the 
		<A HREF="hf1.html">
		shell prompt</A>.  From the prompt you type in one or more
		commands that manipulate the current height field (there can be more
		than one, each of which occupies a place on the stack).  We've
		started by using the online help feature.  Typing <I>help</I> by itself
		brings up the list of available commands, categorized by type.  Typing
		<I>help &lt;command&gt;</I> (without the brackets, of course) gets you 
		help on a particular command.  In 
		<A HREF="hf1.html">
		Figure 1</A> the help for the <I>crater</I> command is shown.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		Now lets look at the available features.  John writes in the 
		documentation that accompanies the source:
		<BLOCKQUOTE>
		HF-Lab commands fall into several categories: those for generating
		heightfields (HFs), combining or transforming them, and viewing them are
		the
		three most important. Then there are other 'housekeeping' commands to move
		HFs around on the internal stack, load and save them on the disk, and set
		various internal variables.
		</BLOCKQUOTE>
		Generating HFs are done with one of <I>gforge, random, constant,</I>
		and <I>zero</I>.  The first of these, <I>gforge</I>, is the most 
		interesting as it will create fractal-based fields.  <I>Random</I>
		creates a field based on noise patterns (lots of spikes, perhaps
		usable as grass blades up close in a rendered scene) while
		<I>constant</I> and <I>zero</I> create level planes.  
		<I>Zero</I> is a just a special case of constant where the height 
		value is 0.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		Each HF that is generated gets placed on the <I>stack</I>.  
		The stack is empty to start.  Running one of the HF generation commands
		will add a HF to top of the stack.  By default there are 4 slots 
		in the stack that can be filled, but this number can be changed using
		the <I>set stacksize</I> command.  The HFs on the stack can be
		popped, swapped, duplicated, and named and the whole stack can be
		rotated.  Also, rotation can be between the first 3 HFs on the stack.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		The normal proces for creating
		a HF usually includes the following steps:
		<OL>
			<LI>Generate one or two HFs with gforge
			<LI>Manipulate the HFs with the <I>crater</I> or <I>pow</I> commands.
			<LI>View the HF in 3D.
			<LI>Manipulate some more.
			<LI>Check it again.
			<LI>Continue, ad infinitum.
		</OL>
		Manipulating a HF can be done in several ways.  First, there are a
		set of commands to operate on a single HF, the <I>One
		HF-Operators</I>.  A few of the more interesting of these are the
		<I>pow, zedge, crater, fillbasin,</I> and <I>flow</I> commands.
		<I>Zedge</I> flattens the edges of the HF (remember that a HF is
		really just a 3D representation of a 2D image, and those images
		are rectangular).  <I>Crater</I> adds circular craters to the HF
		of various radii and depths.  <I>Fillbasin</I> and


		<P clear=both>
		<CENTER>
		<A HREF="#next-column">-Top of next column-</A>
		</CENTER>
		</td>

	<td bgcolor="#000000" cellpadding=1 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>


	<td valign=top width="51%" cellpadding=0 cellspacing=0>
	<table>
	<tr>
		<td valign=top cellpadding=0 cellspacing=0>
			<UL>
				<LH>
					<A NAME="next-column">
					<B>More Musings...</B>
					</A>
					</LH>
				<LI>
					<A HREF="gimp.html">
					Gimp 1.0
					</A> - Larry Ayers provides a preview of
					the newest version of the Unix worlds
					answer to Adobe Photoshop.

			</UL>
			<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
				VSPACE="5" WIDTH="1" HEIGHT="1">
		</td>

	<tr>
		<td bgcolor="#000000" cellpadding=1 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			WIDTH="1" HEIGHT="1"></td>

	<tr>
		<td valign=top cellpadding=0 cellspacing=0>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="8" WIDTH="1" HEIGHT="1">
		<BR clear=both>
		<I>flow</I> can be used together to etch out river valleys.  There
		are examples, <A HREF="hf1.html#erosion">erosion1.scr</A> and
		<A HREF="hf1.html#erosion">erosion2.jpg</A>
		in the distribution which show this.
		

		<BR clear=both>
		&nbsp; &nbsp; &nbsp; 
		There are two ways to view the images you create with HF-Lab
		from within the application.  One is to view 
		the 2D greyscale image that will be saved to file.  Viewing the
		2D image is done with the <I>show</I> command.
		The other method is as an representative
		rendering of the HF in 3D, so that you'll get a better idea
		of what the final rendering will be with POV or BMRT.  Viewing
		the 3D images is done in a secondary shell (although it is
		also possible to simply ask that shell to display the image
		and return immediately to the command shell - this is probably
		what you'll do once you've gotten more experienced with HF-Lab).
		The <I>view</I> command enters the user into the 3D viewing
		shell.  From here you can set the level of detail to show,
		the position of a lightsource or the cameras eye, lighten,
		darken, tile and change the scale of the display. 
		To exit the secondary shell you simply type <I>quit</I>.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		HF-Lab supports a number of different file formats for
		reading and writing:  PNG, GIF, POT, TGA, PGM, MAT, OCT, and RAW.
		Most of these formats have special purposes, but for use with
		POV-Ray and BMRT you should save files in TGA format.  POV-Ray
		can use this format directly, but for use with BMRT you will
		need to convert the TGA image to TIFF format.  Using TGA allows
		you to save the image information without data loss and 
		conversion from TGA to TIFF is relatively easy using XV, NetPBM,
		or ImageMagick.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		Since creating a reasonably realistic HF can be a long session
		of trial and error you may find it useful to use the builtin scripting
		capability.  John provides a very good set of sample scripts
		along with the source.  A quick glance at one of these, 
		<A HREF="erosion1.scr">erosion1.scr</A>,
		shows that multiple commands can be run at a time.  This is also
		possible from the <B>HF&gt;</B> prompt, so you can try these
		commands one at a time to see what effect each has.  Once you have
		a rough guess as the to process you need to create the scene you
		want, you should place this in a script and then edit the script
		to get the detail level desired.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		HF-Lab creates its images through the use of lots of mathematical
		tricks that are far beyond the scope of this column.  I'd love
		to say I understand all of them, but I only have a limited
		understanding of fractals and their use in creating terrain maps
		and I have no real understanding of Fast Fourier Transforms or
		Inverse Fast Fourier Transforms.  These latter two are methods
		of filtering a HF in order to smooth or sharpen features.  Filters
		include a high pass filter (<I>hpfilter</I>), low pass filter
		(<I>lpfilter</I>), band pass filter (<I>bpfilter</I>) and
		band reject filter (<I>brfilter</I>).  Although
		I don't understand the math behind them, I was able to use 
		a High Pass Filter to take a simple gforge-created HF and turn
		it into a very nice heightfield that simulates a 
		<A HREF="hf1.html#leather">leathery surface</A>.  This HF was created 
		in only two steps:
		<OL>
			<LI>gforge 400 2.2
			<LI>hpfilter 0.095 30
		</OL>
		So you can see how powerful this tool can be.  Using height fields
		in BMRT, or as bump maps in POV, can produce some very interesting
		textures!

		<BR>
		&nbsp; &nbsp; &nbsp; 
		There are many other features of HF-Lab which I have not covered.
		And in truth, I really didn't give much detail on the features I
		did discuss.  John gives much better descriptions of some of the
		features in the README file that accompanies the source and I
		highly recommend you read this file while you experiment with
		HF-Lab for the first few times.  He has gone to great lengths
		to provide very useful online help and sample scripts.  The
		interface may not be point-and-click, but it certainly is not 
		difficult to learn.

		<BR>
		&nbsp; &nbsp; &nbsp; 
		When I first came across John Beale and HF-Lab I was quite 
		impressed with its ease of use for creating interesting landscapes.
		I haven't really used it much since the early days of my 3D
		rendering lifetime, but since writing this article I've rediscovered
		how powerful this tool can be.  Originally I viewed the tool only
		as a tool for creating landscapes, ie as a tool for modelling 
		a world.  Now I see how it can be used to create surface features
		of all kinds that can be used as textures and not just models.
		I think I'll be making more use of this tool in the future.

		</td>
	</table>
	</td>



</table>


<P>
<A NAME="resources">
<table>
<tr>
<td>
<IMG SRC=../gx/hammel/resources.gif ALT="Resources" ALIGN="left" 
	HSPACE="0" VSPACE="0" WIDTH="246" HEIGHT="57">
</td>
</table>
</A>

<BR clear=both>
The following links are just starting points for finding more information
about computer graphics and multimedia in general for Linux systems.  If
you have some application specific information for me, I'll add them to my
other pages or you can contact the maintainer of some other web site.  I'll
consider adding other general references here, but application or site
specific information needs to go into one of the following general 
references and not listed here.

<BR clear=both>
<P>

<A HREF="http://www.csn.net/~mjhammel/linux-graphics-howto.html">
Linux Graphics mini-Howto
</A>

<BR>
<A HREF="http://www.csn.net/~mjhammel/povray/povray.html">
Unix Graphics Utilities
</A>  

<BR>
<A HREF="http://www.digiserve.com/ar/linux-snd/">
Linux Multimedia Page
</A>  

<P>
Some of the Mailing Lists and Newsgroups I keep an eye on and where I get alot
of the information in this column:

<P> <A HREF="http://www.XCF.Berkeley.EDU/~gimp/">
		The Gimp User and Gimp Developer Mailing Lists</A>.
<BR> <A HREF="http://www.irtc.org">
		The IRTC-L discussion list</A>
<BR> <A HREF="news:comp.graphics.rendering.raytracing">
		comp.graphics.rendering.raytracing</A>
<BR> <A HREF="news:comp.graphics.rendering.renderman">
		comp.graphics.rendering.renderman</A>
<BR> <A HREF="news:comp.graphics.api.opengl">
		comp.graphics.api.opengl</A>
<BR> <A HREF="news:comp.os.linux.announce">
		comp.os.linux.announce</A>

<br>


<P>
<A NAME="future">
<H2>Future Directions</H2>
</A>
Next month:
<UL>
	<LI><I>BMRT Part 3: Advanced Topics</I> or a short tutorial on
		writing an OpenGL application.  I'm currently working on a little
		Motif/OpenGL application which I plan on using to create models for 
		use with
		BMRT.  I'd like to finish it before I return to BMRT, but I 
		have promised the third part on BMRT for July.  I'm not sure which
		I'll get to, especially since I also have an article for the Linux Journal
		due July 1st.
	<LI>..and who knows what else
</UL>
<BR>
<A HREF="mailto:mjhammel@csn.net">
Let me know what you'd like to hear about!</A>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Michael J. Hammel<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./dosemu.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./bomb.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<!-- =============================================================
		This Page Designed by Michael J. Hammel.
		Permission to use all graphics and other content for private,
		non-commerical use is granted provided you give me (or the 
		original authors/artists) credit for the work.

		CD-ROM distributors and commercial ventures interested in 
		providing the Graphics Muse for a fee must contact me,
		Michael J. Hammel (mjhammel@csn.net), for permission.
     ============================================================= !-->

<A NAME="hf1">
<table>
<tr>
<td>
<H2>More...</H2>
<BR clear=both>
<IMG SRC=../gx/hammel/musings.gif ALT="Musings" ALIGN="left" 
	HSPACE="0" VSPACE="0" WIDTH="247" HEIGHT="52">
</td>
</table>
</A>
<BR clear=both>

<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
	VSPACE="5" WIDTH="1" HEIGHT="1">
<BR clear=both>
<table width=100%>
<tr>
	<td width="100%" align=right>
	<FONT size=1>
	&copy 1997 <A HREF="mailto:mjhammel@csn.net">Michael J. Hammel</A>
	</FONT></td>
<tr>
	<td bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>
</table>

<P>
<CENTER>
<IMG SRC="./gx/hammel/hf1.jpg" align=middle>
<P clear=both>
<B>Figure 1</B>: HF-Lab command line interface

<P clear=both>
<A NAME="erosion"></A>
<table>
<tr>
	<td> <IMG SRC="./gx/hammel/hf2.jpg" align=left>
	<td> <IMG SRC="./gx/hammel/hf3.jpg" align=left>
<tr>
	<td align=center>
		<B>Figure 2</B>: HF produced from erosion1.scr
	<td align=center>
		<B>Figure 3</B>: HF produced from erosion2.scr
</table>

<P>
<IMG SRC="./gx/hammel/hf4.jpg" align=middle>
<P clear=both>
<B>Figure 4</B>: leathery surface, which I created completely by accident
</CENTER>

<P>
<table width=100%>
<tr>
	<td colspan=4 bgcolor="#000000" cellpadding=0 cellspacing=0 valign=top>
		<IMG SRC=../gx/hammel/cleardot.gif ALT="indent" ALIGN="left" 
			HSPACE="0" WIDTH="0" HEIGHT="0"></td>
</table>


<P>

<table width=100%>
<tr>
	<td align=right>
		<FONT size=1>
		&copy 1997 by <A HREF="mailto:mjhammel@csn.net">Michael J. Hammel</A>
		</FONT>
</table>


<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

<P> <HR> <P> 
<!--===================================================================-->
<center><img alt="GIMP 1.00 Preview" src="./gx/ayers/title.gif"></center>
<center>
<H4>By Larry Ayers,
<a href="mailto:layers@vax2.rainis.net">layers@vax2.rainis.net</A></H4>
</center>

<hr>

<center><h3>Introduction</h3></center>

<p>Allow me to state up front that I'm not a computer graphics professional
(or even much of an amateur!) and I've never used any of the common commercial
tools such as Photoshop.  Thus it's not too surprising that my efforts to use
version 0.54 of the Gimp, the GNU-licensed image-editing tool developed by
Spencer Kimball and Peter Matis, often were frustrating.  But one day I
happened upon the developer's directory of the Gimp FTP site and saw there a
beta release, version 0.99.9.  This sounded awfully close to version 1.00, so
I thought I'd give it a try.

<p>At first it absolutely refused to compile.  After downloading this large
archive, I wasn't about to give up, and after several false starts I found
that if I compiled each subdirectory first, followed by installation of the various libs
 and running <em>ldconfig</em> to let <i>ld.so</i> know about them, the main
Makefile in the top directory would compile without errors.  The Motif libs
aren't needed with this release, as the new Gimp ToolKit (GTK) has been
implemented as a replacement.

<p>An analogy occurred to me as I gradually discovered how complicated and
powerful this application is.  It's the XEmacs of image editors!  The plug-ins
and scripts are like Emacs LISP extensions and modes, both in their
relationship with the parent application and in their origin: contributed by a
wordwide community of users and developers.

<p>This release does have a few problems.  Occasionally it will crash, but politely; 
i.e. it doesn't kill the X-server or freeze the system.  The benefits of this
release far outweigh these occasional inconveniences,  especially for a rank
beginner.


<center><h3>Structural Changes</h3></center>

<p>Image editing is a notorious consumer of memory.  This new version has a
method of attempting to minimize memory usage called tile-based
memory management.  This allows the Gimp to work with images larger than
can be held in physical memory.  Disk space is heavily used instead, so make
sure you have plenty of swap!

<p>A new file format specific to the Gimp, (<i>*.xcf</i>), allows an image to
be saved with it's separate layers, channels, and tiles intact.  In ordinary
image formats all such information disappears when the image is saved.  This
would be ideal if an image had to be changed at a later date, allowing
effective resumption of an editing session.

<p>An extension is like a plug-in but is not called from or associated with a
specific image; the first of these is described in the next section.

<center><h3>Script Fu</h3></center>

<p>The Gimp now has a built-in scripting language, based on Scheme, which
bears some resemblance to LISP.  An extension called Script Fu (which can be
started from the Gimp menubar) can read these scripts and perform a series of
image manipulations on user-specified text or images, using user-selected
fonts and colors.  What this means for a beginner like myself is that a
complicated series of Gimp procedures (which would probably take me a day to
laboriously figure out) is now automated.  A collection of these scripts is
installed along with the other Gimp files, and more are periodically released
by skilled Gimp users.  Many of the scripts facilitate the creation of text
logos and titles suitable for use in web pages.

<p>Here is a screenshot of the Script Fu window:<br>
<p>
<img alt="Script Fu Window" src="./gx/ayers/scriptfu.gif">

<p>As you can see, entry-boxes are available for filling in.  Most scripts
have default entries, and scripts will certainly fail if the default font is
not available on your system.

<p>This script-processing ability should greatly expand the popularity of the
Gimp.  I showed Script-Fu to my teenage kids and they took to it like ducks
to water, whereas before they had been intimidated by the Gimp's complexity
and deeply nested menus.  A little easy success can give enough impetus to
explore further. 

<center><h3>Plug-Ins</h3></center>

<p>I believe that among the most important factors contributing to the
success and continuing development of the Gimp are the built-in "hooks"
allowing third-party plug-in modules to add capabilities to the program.  The
GTK ends up doing all of the mundane tasks such as creating windows and their
components; all a plug-in needs to do is manipulate graphics data.  One result 
is that the plug-ins are surprisingly small considering what they can accomplish.

<p>One reason the release of Gimp version 1.00 has been delayed is that the
plug-ins which had been written for version 0.54 won't work with version 1.00
(or any of the recent betas).  This was partly due to the switch from Motif to
the GTK, and partly to the new memory-management scheme.  The plug-in
developers have been busily modifying their modules and the great majority
have been successfully ported.  Since the release of 0.99.9 several
interesting new plug-ins have been released, including:<br>

<ul>
  <li>IFSCompose, by Owen Taylor, is a utility for the interactive creation of 
      Iterated Function System fractals, which can  then be included in an
      image.  See my review of Xlockmore in this issue for a brief description 
      of this fractal type.

  <li>CML Explorer, by Shuji Narazaki, creates Coupled Map Lattice images;
      these are models of complex systems' time-changes and the results can be 
      striking patterns.  This is a complex plug-in with many parameters to
      tweak.  The best way to get an idea of what it can do is to download
      parameter files from
      <a href="http://www.inetq.or.jp/~narazaki/Products/gimp-plugin.html">this site</a>.

  <li>Whirl and Pinch is a merging of two older plug-ins (you guessed it --  Whirl
      and Pinch!).  Federico Mena Quintera is the author, as well as being one 
      of the Gimp developers.

  <li>FP, or FilterPack, is a useful utility for adjusting the color-balance
      of an image in a variety of ways, with thumbnail images showing the
      results of changes as you make them.  It was written by Pavel
      Greenfield; his page 
      <a href=http://www.geocities.com/SoHo/5277"">here</a> explains and
      illustrates its usage. 
</ul>

<p>As well as these and other new plug-ins, many of the old ones were enhanced 
in the process of adapting them to the  new release.  Several now have
real-time preview windows, in which the results of changes can be seen without 
committing them.

<center><h3>Tutorials</h3></center>

<p>The Gimp has never had much documentation included with the archive.  This
will eventually be remedied; the Gimp Documentation Project, analogous to the
Linux Documentation Project, will be making documentation freely available.
Until the fruits of that project begin to appear there are some excellent
tutorials, written by various charitable Gimp users and developers and available
on the WWW.    <a href="http://abattoir.cc.ndsu.nodak.edu/~nem/gimp/tuts/">
The Gimp Tutorials Collection</a> is a site which has links to many of the
tutorials out there.  The tutorials situation is in flux at the moment, as
some are specific to Gimp 0.54 while others are intended for the newer betas.

<p>A site which has helped me get started is
<a href="http://lemming0.lem.uni-karlsruhe.de/~jens/">
Jens Lautenbacher's Home Page.</a>  His tutorials are very lucid and easy to
follow, and are specific to version 0.99.9.  This site is also an inspiring
example of how the Gimp can contribute to the design of a web-page.


<center><h3>News and Compendia</h3></center>

<p>If you'd like to keep up with the rapidly evolving Gimp scene, these links
are among the best I've found and can serve as starting points.<br>

<ul>
  <li><a href="http://kiwi.cs.berkeley.edu/~gimp/">
      Archived messages</a> from the three Gimp mailing lists; new plug-ins are
      announced here and source patches are posted.
  <li><a href="http://www.nuclecu.unam.mx/~federico/gimp/index.html">
      Federico Mena Quintera's Gimp page</a> is full of links, tips, and news.
  <li>The Gazette's own Michael J. Hammel has a series of
      <a href="http://www.csn.net/~mjhammel/gimp/gimp.html">
       Gimp pages</a>
      containing information, tips and tutorials.
  <li>Zachary Beane maintains this oft-updated Gimp
      <a href="http://xach.dorknet.com/gimp/news/index.html">
       news page</a>; there is
      quite a bit of other good Gimp-related stuff at his site.  
  <li> And of course the<a href="http://www.XCF.Berkeley.EDU/~gimp/">
      official Gimp home page!</a>
</ul>

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Larry Ayers<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

<P> <HR> <P> 
<!--===================================================================-->
<center><img alt="BOMB" src="./gx/ayers/bomb_title.gif"></center>

<center>
<H2>An Interactive Image Generator</H2>
<H4>By Larry Ayers,
<a href="mailto:layers@vax2.rainis.net">layers@vax2.rainis.net</a></H4>
</center>

<center><img src="./gx/ayers/line.gif"></center>

<center><h3>Introduction</h3></center>

<p>Last month I wrote about Cthugha, a sound-to-image converter and display
engine.  Bomb is another image-generating program, but the sound component is
subsidiary.  The images produced have an entirely different character than
those produced by Cthugha.  Rather than working with and displaying audio
data, bomb uses a variety of algorithms to generate images.  Most of these are
one form or another of artificial life (John Conway's Life is the most
familiar of these), while some others are fractal, reaction-diffusion, or IFS-related.

<p>Bomb is a console Svgalib program, with no X11 version at this time. 

<center><h3>Bomb's Images</h3></center>

<p>The output of bomb has a distinctive character, due in large part to the
color palettes used by the program, which are contained in the file
<i>cmap-data</i>.  The images have a naturalistic, painting-like character,
with earth-tones predominating.  The reason for this is that Scott Draves
generated the palettes using his program <b>image2cmap</b>, which extracts a
representative 256-color palette from an image file.  Scott used a variety of
scanned photographs as input.  The result is that bomb is strongly marked by
Scott Draves' esthetic preferences.

<p>The format of the <i>cmap-data</i> file is ascii text, with an example
palette's first lines looking like this:<br><code>
<p>
(comment leafy-face)<br>
(cmap<br>
(42 37 33) (31 23 25) (23 19 22) (20 20 24) [etc]
</code>

<p>This is similar to the format of the palette files used by Fractint and
Cthugha; it probably wouldn't be too difficult to convert one format to the other.

<p>The images are displayed full-screen, at 320x200 resolution.  This gives
them a somewhat chunky, pixel-ish appearance, and also seems to contribute to the 
painting-like quality.  Many of the screens are reminiscent of a magnified
view of microorganisms;  there is an illusion of opaque, non-human purpose.

<p>Here are a pair of sample bomb screens.  The program has a built-in capture 
facility with the images saved as <b>ppm</b> files.<br>
<p>

<center><img alt="Bomb Screen #1" src="./gx/ayers/bomb1.gif"></center>

<p>
<center><img alt="Bomb Screen #2" src="./gx/ayers/bomb2.gif"></center>

<hr>

<center><h3>Compilation and/or Installation</h3></center>

<p>The bomb archive file is rather large, over two megabytes; installed the
bomb directory occupies nearly four and one-half mb., which seems like a lot
for a relatively small program.  Most of this space is taken up by the
<b>suck</b> subdirectory.  <b>Suck</b> contains about 200 <i>TIFF</i> image
files.  Some of the bomb modes use these images as seeds.  The program will
work fine without these images, so if you're short of disk space they could be 
deleted; another approach is to weed through the images and retain just a few
favorites.  If examined with an image viewer the <i>TIFF</i> files can be seen 
to be mostly basic, small black-and-white images, including large
heavily-serifed single letters and logo-like images from a variety of
cultures.  When used as a seed, the image appears nearly full-screen
but is eventually "eaten" by the pullulating AI organisms until it is
unrecognizable.

<p>Another subdirectory, called <strong>dribble</strong>, is where your
screen-captures end up.  Each captured <i>PPM</i> image takes up 197 kb., so
it is wise to check the directory from time to time and weed through the captures.

<p>Bomb is rather picky about the versions of the required JPEG and TIFF libs
on your system; they must be compatible with each other in some mysterious
way.  Initially I couldn't get it to run at all, but a reinstallation of the
two graphics lib packages (from the same distribution CD, so that
theoretically they would be compatible) cured this.  Oddly enough my previous
TIFF and JPEG libs, though updated independently of each other, worked with
other programs which required them.  Another argument for staying with a
distribution!

<p>A binary is included in the distribution; the source is there if for some
reason the binary won't work, or if you'd like to modify it.

<p>This program is one of those which is designed to be run from its own
directory; in other words, you just can't move the executable to a pathed
directory and leave the datafiles somewhere else.  The easiest way to install
it is to unarchive the package right where you want it to stay.  Then when you 
want to run bomb, <i>cd</i> to its directory and start it from there.

<center><h3>Controlling the Display</h3></center>

<p>You can get by using bomb just knowing that the spacebar randomizes all
parameters and control-c quits.  I found it worthwhile to print out the
section of the readme file which details the various keyboard commands, as
nearly every key does something.

<p>A different mode of keyboard control is enabled by pressing one of the
first four number keys.  Scott calls this the "mood organ", and when in this
mode subtle parameters of the currently active display-type can be changed.
In this state the entire keyboard changes parameters within the current mode;
it's completely remapped, and can be returned to the default mode by pressing
the "1" key.

<p>Left to its own devices, bomb periodically randomizes its parameters.  Some 
combinations of color-map and algorithm are more appealing than others, so
that if it seems stuck in a type of image you don't like, just press the
spacebar and give it a fresh start.   Another approach is to key in some
preferred parameters; the display will still randomly change but will remain
within the category selected.  

<p>Bomb is the sort of program I like to set running when I'm doing something
else within sight of the computer; if something interesting appears some
tweaking will often nudge the program along a fruitful channel.

<center><h3>Obtaining the Archive</h3></center>

<p>The current version of bomb (version 1.14) can be obtained from
<a href="ftp://sunsite.unc.edu/pub/Linux//apps/graphics/hacks/svgalib/">
Sunsite</a> or from
the <a href="ftp://hopeless.mess.cs.cmu.edu/spot">Bomb Home FTP site</a>.

<center><h3>Is There Any Real Use For Such Programs?</h3></center>

<p>Aside from the obvious real-time entertainment value, programs such as
bomb, cthugha, and xlockmore can serve as grist for the Gimp, the incredible
(but difficult to learn) GNU image-processing tool.  Lately I've been
fascinated by the 0.99.9 developer's version of the Gimp.  In this release an
image can be saved as a <b>*.pat</b> file, which is a Gimp-specific image
format used most often as flood-fill material.  There is a "Patterns" window
which, when invoked, shows thumbnails of all of the <b>*.pat</b> files in the
Gimp pattern directory, including new ones you've dropped in.  These are
available for flood-fill if, in the "Tool Options" dialog, <i>patterns</i>
rather than <i>color</i> has been checked.  (Don't ask how long it took me to
discover this!)  Many of the bomb modes will produce tileable images, which
makes them particularly useful as background fill material.  The tricky aspect 
of this (as is true with any animated image generator) is capturing the screen 
at the right time.  All too often the perfect image fleetingly appears (on its
way to /dev/null) and is gone before you can save it.

<p>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Larry Ayers<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./gm.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./e2compr.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center><img alt="E2compr" src="./gx/ayers/e2compr.gif"></center>
<center><img alt="Disk Compression" src="./gx/ayers/e2compr2.gif"></center>
<center><img alt="For Linux" src="./gx/ayers/e2compr3.gif"></center>

<center>
<h4><a href="mailto:layers@vax2.rainis.net">by Larry Ayers</a></h4>
</center>

<hr>

<p>OS/2 used to be my main operating system, and there are still a few OS/2
applications which I miss.  One of them is Zipstream, a commercial product
from the Australian firm Carbon Based Software.  Zipstream enables a
partition to be mirrored to another drive letter;  all files on the mirrored
virtual partition are transparently decompressed when accessed
and recompressed when they are closed.  The compression and decompression
are background processes, executed in a separate thread during idle processor
time.  Zipstream increased the system load somewhat, but the benefits
more than adequately compensated for this.  I had a complete OS/2 Emacs
installation which only occupied about four and one-half megabytes!

<p>A few weeks ago I was wandering down an aleatory path of WWW links and came
across <a href="http://netspace.net.au/~reiter/e2compr.html">
the e2compr home page </a>.  This looked interesting: a new method of
transparent, on-the-fly disk compression implemented as a kernel-level
modification of the ext2 filesystem.  Available from that page are kernel
patches both for Linux 2.0.xx and 2.1.xx kernels.  I thought it might be worth 
investigating so I downloaded a set of patches, while I thought about how I
may be just a little too trusting of software from unknown sources halfway
across the world.

<p>The set of patches turned out to be quite complete, even going so far as to
add a choice to the  kernel configuration dialog.  As well as patches for source files
in <i>/usr/src/linux/fs/ext2</i>, three new subdirectories are added, one for
each of the three compression algorithms supported.  The patched kernel source
compiled  here without any problems.  Also available from the above web-page is a
patched version of <strong>e2fsprogs-1.06</strong> which is needed to take full
advantage of <em>e2compr</em>.  If you have already upgraded to
<strong>e2fsprogs-1.07</strong> (as I had) the patched executables (<i>e2fsck,
chattr</i>, and <i>lsattr</i> seem to coexist well with the remainder of the
<strong>e2fsprogs-1.07</strong> files.

<hr>

<center><h3>Origins</h3></center>

<p>Not surprisingly, a small hard-drive was what led Antoine Dumesnil de
Maricourt to think about finding a method of automatically compressing and
decompressing files.  He was having trouble fitting all of the Linux tools he
needed on the 240 mb. disk of a laptop machine, which led to a search for
Linux software which could mitigate his plight.

<p>He found several methods implemented for Linux, but they all had
limitations.  Either they would only work on data-files (such as zlibc), or
only on executables (such as tcx).  He did find one package, DouBle, which
would do what he needed, but it had one unacceptable (to Antoine at least)
characteristic.  DouBle transparently compresses and decompresses files, but
it also compresses ext2 filesystem administrative data, which could lead to
loss of files if a damaged filesystem ever had to be repaired or
reconstructed.

<p>Monsieur de Maricourt, after some study of the extended-2 filesystem code,
ended up by writing the first versions of the <em>e2compr</em> patches.  The
package is currently maintained by <a href="mailto: reiter@netspace.net.au">
Peter Moulder</a>,
for both the 2.0.x and the 2.1.x kernels.

<center><h3>Usage and Performance</h3></center>

<p><em>E2compr</em> is almost too transparent.  After rebooting the patched
kernel of course the first thing I wanted to do was to compress some
nonessential files and see what  would happen.  Using the modified <kbd>chattr</kbd>
command, <kbd>chattr +c  *</kbd> will set the new compression flag on every file in
the current directory.  Oddly enough, though, running <kbd>ls -l</kbd> on the
directory afterwards shows the same file sizes!  I found that the only way to
tell how much disk space has been saved is to run <kbd>du</kbd> on the
directory both before and after the compression attribute has been toggled.
Evidently <kbd>du</kbd> and <kbd>ls</kbd> use different methods of determining 
sizes of files.  If you just want to see if a file or directory has been
compressed, running the patched <kbd>lsattr</kbd> on it will result in
something like this:<br><pre>

<kbd>%-&gt; lsattr libso312.so
--c---- 32 gzip9     libso312.so
</kbd></pre>

<p>The "c" in the third field shows that the file is compressed, "gzip9" is
the compression algorithm used, and "32" is the blocksize.  If a file hasn't
been compressed the output will just be a row of dashes.

<p>E2compr will work recursively as well, which is nice for deeply nested
directory hierarchies.  Running the command:<br><pre>

<kb>%-&gt;chattr -R +c  /directory/*</kb></pre>

<p>will compress everything beneath the specified directory.

<p>If an empty directory is compressed with <i>chattr</i>, all files
subsequently written in the directory will be automatically compressed.

<p>Though the default compression algorithm is chosen during kernel
configuration, the other two can still be specified on the command line. I
chose gzip, only because I was familiar with it and had never had problems.
The other two algorithms, lzrw3a and lzv1, are faster but don't compress quite 
as well.  A table in the package's <em>README</em> file shows results of a
series of tests comparing performance of the three algorithms.

<p>The delay caused by decompression of accessed files I haven't found
to be too noticeable or onerous. One disadvantage in using e2compr is that
file fragmentation will increase somewhat;  Peter Moulder (the current
maintainer) recommends against using any sort of disk defragmenting utility in 
conjunction with e2compr.

<p>I have to admit that, although e2compr has caused no problems whatsoever
for me and has freed up quite a bit of disk space, I've avoided compressing
the most important and hard-to-replace files.  The documentation specifically
mentions the kernel image (vmlinuz) and swap files as files <em>not</em> to
compress.

<p>It's ideal for those software packages which might not be used very often
but are nice to have available.  An example is the StarOffice suite, which I
every now and then attempt to figure out; handicapped by lack of
documentation, I'm usually frustrated.  I'd like to keep it around, as it was
a long download and maybe docs will sometime be available.  E2compr halved its
size, which makes it easier to decide to keep.  

<p>Another use of e2compr is compression of those bulky but handy directories
full of HTML documentation which are more and more common these days.  They
don't lend themselves to file-by-file compression with gzip; even though
Netscape will load and display gzipped HTML files, links to other files will
no longer work with the <i>.gz</i> suffix on all of the files. 

<center><h3><font color=firebrick>Warning!</font></h3></center>

<p>E2compr is still dubbed an alpha version by its maintainer, though few
problems have been reported.  I wouldn't recommend attempting to install it if 
you aren't comfortable compiling kernels and, most important, reading
documentation!  


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Larry Ayers<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./bomb.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./xlock.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

<P> <HR> <P> 
<!--===================================================================-->
<center><img alt="Xlockmore" src="./gx/ayers/xlock.jpg"></center>

<center>
<H4>By Larry Ayers,
<a href="mailto:layers@vax2.rainis.net">layers@vax2.rainis.net</a></H4>
</center>

<hr>

<h3><center>Introduction</center></h3>

<p>Several years ago, in the dark backward and abysm of (computing) time,
Patrick J. Naughton collected several screen hacks and released them to other
Unix users as a package called Xlock.  A screen hack is a clever bit of
programming which will display a changing image to the computer screen.
People felt vaguely guilty about wasting time writing these little programs
and gazing at the hypnotic, often geometrical patterns which they produced,
and thus the concept of the screensaver was born.  The rationale was that if a
screen statically displayed text (or whatever) for a long period of time, a
faint imprint of the display would "burn in" and would thereafter be faintly
visible on the monitor screen.  This actually did happen with early monitors,
but modern monitors are nearly impervious to the phenomenon (i.e, it would
take months).  Nonetheless, the screensaver has survived, which is evidence
that its appeal ranges beyond the merely prudent and practical.

<p><a href="mailto: bagleyd@bigfoot.com">David A. Bagley</a> has become the
current maintainer of Xlock, which is now known as Xlockmore, due to the many
new modes included in the package.

<center><h3>Evolution</h3></center>

<p>Xlockmore can be thought of as a museum of screen hacks.  The old Xlock
modes are all still included, and some of them (at least to this jaded
observer) aren't particularly impressive.  On the other hand, there is a
certain haiku-like charm to certain of the older modes.  The pyro mode, for
example, manages to convey something of the appeal of a fireworks display with 
nothing more than parabolically arcing dots which explode just over the peak
of the trajectory.

<p>Over the years as computers have become more powerful the complexity of the
added modes has increased.  Some of the newer ones are CPU-intensive and need
a fast processor to run well.

<p>David Bagley must be receiving contributed modes and bugfixes quite often,
as he releases a new version every couple of months.  Some of the newer modes
are amazing to behold and take full advantage of modern graphics hardware.

<center><h3>OpenGL Modes</h3></center>

<p>I'm sure most of you have seen some of the OpenGL screensavers which many
Win95 and NT users run.  Even though many of them advertise one product or
another, they tend to be visually compelling, with a three-dimensional and
shaded appearance.   In the latest Xlockmore package the option is offered to
compile in several flashy new modes based on the Mesa OpenGL libraries.

<p><em>Gears</em> is an impressive Mesa mode:  nicely shaded gears
turning against each other while the group slowly rotates.<br>
<p>
<img alt="Gears screenshot" src="./gx/ayers/gears.gif">

<hr>

<p>The <em>Pipes</em> mode, displaying a self-building network of 3D pipes, is
also OpenGL-dependent. Marcelo F. Vianna came up with this one.  Luckily most
Linux distributions these days have prebuilt Mesa packages available.<br>

<p>
<img alt="Pipes screenshot" src="./gx/ayers/pipes.gif">

<hr>

<p>Ed Mackey contributed the <em>Superquadrics</em> mode, which displays
esoteric mathematical solids morphing from one to another.  He also is
responsible for porting the <em>Gears</em>  mode to
Xlockmore. 

<hr>

<center><h3>Mathematical Modes</h3></center>

<p>Jeremie Petit, a French programmer, has written one of the most intriguing
"starfield" modes I've ever seen. It's called <em>Bouboule</em>, and if you
can imagine an ellipsoidal aggregation of stars...  I really can't describe
this one well, and a screenshot wouldn't do it justice.  It's appeal is in
part due to the stately movement of the star-cloud, somehow reminiscent of a
carnival Tilt-A-Whirl ride in slow motion.

<p>Another excellent mode which doesn't show well in a screenshot is
<em>Ifs</em>.  If you have never seen Iterated Functions Systems images
 (Fractint and Dick Oliver's Fractal Graphics program display them well) this
mode would be a good introduction.  IFS fractals seem to have two poles: at
one extreme they are severely geometrical (Sierpinski's pyramid comes to mind)
and at the other, organic-looking forms which resemble ferns, shells, and
foliage predominate.  The <em>Ifs</em> mode induces a cloud of particles to
fluidly mutate between various of these IFS forms.  The result (at least to my
mathematically-inclined eyes) is often spectacular.

<p>The upcoming <em>Gimp</em> version 1.0 will include a
nicely-implemented plug-in called <em>IFS-Explorer</em>, which enables the
creation of IFS forms in an interactive fashion.

<p>Massimino Pascal, another Frenchman, wrote <em>Ifs</em>,
and as if that wasn't enough, he has contributed another math-oriented mode
called <em>Strange</em>.  This one recruits the ubiquitous cloud of particles
and convinces them to display mutating strange attractors.  They <em>are</em>
strange to behold, diaphanous sheets and ribbons of interstellar dust (or is
that subatomic dust?) twisting and folding into marvellously intricate
structures which <em>almost</em> look familiar.

<p>The eminent British physicist Roger Penrose invented (discovered?) a
peculiar method of tiling a plane in a non-repeating manner many years ago.
The Penrose tiling (as it came to be known) was popularized by several
articles by Martin Gardner in his Mathematical Recreations column,  which
appeared in Scientific American magazine in the late sixties and seventies.
The tessellation or tiling is based on a rhombus with angles of 72 and 108 degrees.  The
resulting pattern at first glance seems symmetrical, but looking closer you
will notice that it varies from region to region.  Timo Korvola wrote the
xlock mode, and it can render two of the several variations of the tiling.

<p>An aside: recently Roger Penrose noticed the Penrose tiling embossed into
the surface of a roll of toilet paper, of all things.  He previously had patented the
pattern, thinking that it might be profitably implemented in a puzzle game, so 
now he has sued the manufacturer.  It'll be an interesting and novel trial, I imagine.

<br>
<p>
<img alt="Sample Penrose Window" src="./gx/ayers/penrose.gif">
<hr>

<p>Another mathematical mode, very spare but elegant and pleasing to
regard, is Caleb Cullen's Lisa mode.  This one displays an animated lissajous
loop which bends and writhes in a remarkably three-dimensional manner.
As with so many of these modes, a still shot doesn't really do it justice.<br>
<p>
<img alt="Lisa Window" src="./gx/ayers/lisa.gif">
<hr>

<p>The modes I've described are just a sampling of newer ones;  the
Xlockmore package contains many others, and more are continually added. 

<center><h3>Configuration</h3></center>

<p>Xlockmore is included with most Linux distributions and tends to be taken
for granted; the default configuration files for Fvwm and Afterstep (which
most users use as templates for customization) include root-menu items for
several of the older modes.  I'd like to encourage anyone who has used
Xlockmore to take the time to download the current version (4.02 as I write
this).  Not only because of the newer screensaving modes, but also because
compiling it from source allows you to easily tailor Xlockmore to your tastes.  

<p>Here is the procedure I follow when compiling an Xlockmore release:  first
I'll try to compile it "as is", just running the configure script and then
compiling it.  If by chance it can't find, say, your X11 or Xpm libs, you may
have to point the Makefile in the right direction by editing in the correct
paths.  

<p>If you are unfamiliar with Xlockmore, now is a good time to try out all of
the modes.  The quickest way to run through all of them is to run Xlock from
an xterm window, with the following command line: <br>

<p><kbd>xlock -inwindow -mode [name of mode]</kbd>

<p>A window will open up with the mode displayed.  Dismiss it with a left-
mouse-button click, press the up-arrow key to redisplay the command, and edit the 
command for the next mode.  Keep track of the ones you would rather not keep,
perhaps in a small editor window.  There are three files which need to be
edited: the <b>Makefile</b>, <b>mode.c</b>, and <b>mode.h</b>.  Just edit out
references to the unwanted modes (you can <i>grep</i> for the mode names to
find the line numbers).   Recompile, and you will have a smaller executable
with only your selected modes included.  You also will now be able to run
xlock with the <b>-fullrandom</b> switch, which will display a random mode
selected from the ones you chose to keep.

<p>Something to consider -- since at this point you have a compiled source
tree there on your hard disk, you might want to take a look at the source
files for some of the modes.  In general, the <i>*.c</i> files for the various
modes are unusually well commented.  If you are curious about the origin or
author of a mode, you'll find it in the source.  There are often parameters
that can be changed, if you like to experiment, and some files can be altered
to suit your processor speed.  A few modes even have entire commented-out
sections which can be uncommented and thus enabled.  It may not work, but if
you save the original <b>xlock</b> executable before you start fooling with
the source you can always revert to it.  An advantage of keeping a built
source tree while experimenting is that if you modify a single <b>C</b> file,
recompilation is quick as only the modified file is recompiled. After all, one
of the oft-touted virtues of Linux (and free software in general) is that
source is available.  Why not take advantage of the fact?

<center><h3>Availability</h3></center>

<p>The source archive for Xlockmore-4.02 can be obtained from
 <a href="ftp://ftp.x.org/contrib/applications/">ftp.x.org</a> or from
<a href="ftp://sunsite.unc.edu/pub/Linux/X11/screensavers/">Sunsite</a>.


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Larry Ayers<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./e2compr.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./redhat.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<P>SSC is expanding Matt Welsh's <I>Linux Installation & Getting
Started</I> by adding chapters about each of the major distributions. Each
chapter is being written by a different author in the Linux community.
Here's a sneak preview--the Red Hat chapter by Henry Pierce.--editor 
<P><HR><P>
<center>
<H2>Red Hat Linux</H2>
<H4>By Henry Pierce,
<a href="mailto:hmp@boris.infomagic.com">hmp@boris.infomagic.com</a></H4>
</center>
<P><HR><P>
<H3>Contents:</H3>
<ul>
<li><a href="./redhat.html#start">Getting Started With Red Hat</a>
<li><a href="./redhat.html#obtain">Obtaining Red Hat Linux</a>
<li><a href="./redhat.html#planning">Planning Your Installation</a>
<li><a href="./redhat.html#upgrade">A Note About Upgrading Red Hat
Linux</a>
<li><a href="./redhat.html#choose">Choosing Your Installation Method</a>
<li><a href="./redhat.html#floppy">Creating the Installation Floppy Kit</a>
<li><a href="./redhat.html#setting">Setting Up Yourr Installation Media</a>
<li><a href="./redhat.html#recommend">Recommendations</a>
<li><a href="./redhat.html#fips">Using FIPS</a>
<li><a href="./redhat.html#install">Installing Red Hat Linux</a>
<li><a href="./redhat.html#rest">Walking Through the rest of the
Installation</a>
<li><a href="./redhat.html#lilo">Understanding the LILO Prompt</a>
<li><a href="./redhat.html#logging">Logging in the First Time</a>
<li><a href="./redhat.html#shut">Shutting Down Linux</a>
</ul>
<P><HR><P> 


<p>The Red Hat distribution is an ever-growing and popular commercial
distribution from Red Hat Software, Inc. Even though
it is a "Commercial" distribution under the <I>Official Red Hat Linux</I>
label purchased directly from Red Hat Software Inc., it may be downloaded from
the Internet or purchased from third party CD-ROM vendors (see Appendix B)
as well. 

<p>Much of Red Hat's growing popularity is due to its Red Hat Package Management
Technology (RPM) which not only simplifies installation, but software
management as well. This in fact, is one of the goals of the Red Hat
distribution: to reduce the system administration burdens of obtaining, fixing
and installing new packages so that Linux may be used to get some real work
done. RPM provides software as discrete and logical packages. For example, the
Emacs editor binary executable file is bundled together in a single package
with the supporting files required for configuration of the editor and the
extension of basic functionality. 
 
<p>The version of Red Hat described here is version 4.0/4.1, released October
1996/December 1996. Installation of earlier installations of Red Hat do differ
in their installation procedures than the version described here. Installation
of later versions of Red Hat should be very similar to the information given
here. This document focuses on Intel based installation of Red Hat Linux.
However, many aspects of installing the Alpha and Sparc versions of Red Hat
are similar to Intel Systems which are out lined here.

<a name="start"></a>
<p><h3>Getting Started With Red Hat</h3>
 
<p>The process of installing or upgrading Red Hat Linux requires backing up the
existing operating system, obtaining the Red Hat distribution, planning your
installation, preparing the hard disk, making the appropriate installation
diskettes, going through the installation program and, finally, rebooting your
system with the newly installed operating system. For those who currently have
Red Hat Linux 2.0 or higher installed, you may upgrade by following the same
process outlined here except you should choose "UPGRADE" instead of
"INSTALL" when prompted by the installation program. 

<a name="obtain"></a>
<p><h3>Obtaining Red Hat Linux</h3>

<p>There are only two ways of obtaining the Red Hat Linux Distribution:
on CD-ROM from Red Hat Software, Inc.\ or other 3rd party CD-ROM
distributor or via FTP from:

<a href="ftp://ftp.redhat.com/pub/redhat">ftp://ftp.redhat.com/pub/redhat</a>

or anyone of the frequently less busy Red Hat mirror sites. No matter
how Red Hat Linux is obtained, you should read the Red Hat Errata
which contains a list of known problems for the release you
install. You can obtain the current errata via:

<a href="http://www.redhat.com/errata">http://www.redhat.com/errata</a>

or by send email to <a href="mailto:errata@redhat.com">errata@redhat.com</a>.  If you obtained Red Hat Linux
from a 3rd party CD-ROM distributor (such as InfoMagic, Inc.) they
often delay releasing their CD-ROM kit for 2 weeks to a month+ after a
major new release of Linux so they can include the inevitable bug
fixes and updates that follow on the CD-ROM an saving the trouble of
downloading them.

<a name="planning">Planning Your Installation</a>
<p><h3>Planning Your Installation</h3>

<p>Planning an installation of Linux cannot be understated. The success or
failure of installing or upgrading Linux is directly related to how well you
know your hardware and understand how Linux should be installed on the target
computer. This section outlines basic installation planning and considers
common mistakes and oversights that prevent the successful installation of
Linux. This is also true for people upgrading Red Hat Linux version 2.0 or
higher to version 4.X. In either case, it cannot be understated that you
should <B>back up</B> you existing system before going further. In the rare
cases that something should go wrong when you have not <B>backed up</B> your
system that results in the loss of an existing operating system, your data is lost. So if it is worth saving, <B>back up</B>
your system before continuing. I now get off my soap box.

<p><h4>What Is RPM Anyway?</h4>

<p>Before we begin, it is worth taking a moment to discuss Red Hat Package
Management (RPM) Technology as it is the core of installing and maintaining
Red Hat Linux and helps you simplify the planning of installing and provides
Red Hat Linux's ability to upgrade from an older version of Red Hat Linux to a
current one. 

<p>Traditionally, software under Linux and Unix system has been
distributed as a series of <pre><I>package</I>.tar <I>package</I>.tgz
<I>package</I>.tar.gz</pre> or <pre><I>package</I>.tar.Z</pre> files. They often
required the system administrator who installs the packages to
configure the package for the target system, install the auxiliary and
documentation files separately, and setup any configuration files by
hand. And if the package requires another supporting package that
isn't installed, you won't know a package is missing until you try to
use the new package. And the more add-on packages installed, the
harder it is to keep track of them. Then if you want to remove or
upgrade such a package, you have to remember where all the files for
the package are, and remove then. And if you are upgrading a package,
and forgot a pesky configuration file, then the upgraded package may
not work correctly.  In summary, the traditional method of
distributing software does provide centralized management system of
installing nor upgrading software packages which is crucial to easing
the administrative burdens of managing the system.
 
<p>RPM, in contrast, is designed to manage software packages by defining
how a package is built and collecting information about the package
and its installation process the during package's build process. This
allows RPM to create an organized packet of data in the header of a
<pre><I>package</I>.rpm</pre> that can be added to an organized database that
describes where the package belongs, what supporting packages are
required, are the required packages installed and a means to determine
package dependency information. These are, in fact, describe the
design goals of RPM: the ability to upgrade an individual component or
the entire system without re-installing while preserving the
configuration files for the system/package; be able querying the RPM
database to find the location of files, packages or other relevant
package information; to perform package verification to make sure
packages are installed properly or can be installed at all; to keep
source packages "pristine" (provide the package author's
original source with second party patches separate) so that porting
issues can be tracked. Because RPM does this management for you, you
can install, upgrade, or remove a package with a single command line
in text mode or a few clicks of the mouse in the X Window Package
Management Tool. Simple examples of using RPM from the command line
are:

<pre>rpm --install <I>package</I>.rpm</pre>--this will install package 
<pre>rpm --upgrade <I>package</I>.rpm</pre>--this will upgrade package 
<pre>rpm --erase <I>package</I></pre>--this will remove/erase package 
 
<p>There are many more complicated things RPM can do such as querying a
package to find out if it is installed, what version the package is,
or query an uninstalled package for information. In essence, it does
almost everything a package management tool should do. And Red Hat has
GPL'd this innovative system.


<p><B>Anatomy of An RPM Package</B>

<p>Essentially, RPM works by maintaining a central database of installed
packages, the packages files and its version. A properly built
<pre><I>package</I>.rpm</pre> has all of the following characteristics: its
name will identify the package, the version of the package, the build
revision of the package, the architecture the package is intended for,
and of course the extension "rpm" to identify it as an rpm
based package.  

Take, for example, <pre>bash-1.14.7-1.rpm</pre>. The name,
itself, contains a lot of useful information: the package is "bash",
the Bourne Again Shell, it is version 1.14.7 and it is build 1 of the
current version for Red Hat, it was built for an Intel or compatible
386 or higher CPU, and of course, it is in "rpm" format. So, if you
see a package called bash-1.14.7-2.i386.rpm, you know it is a second
build of bash v1.14.7 and probably contains fixes for problems with
build 1 and obviously more current. And while the internal
organization of an *.rpm is beyond the scope of this discussion, a
properly built package contains an executable file, the configuration
files (if any), the documentation (at least man pages for the
package), any miscellaneous files directory related to the package,
and record of where the packages files should be installed and a
record of any required packages. Upon successful installation of a
\&lt;package\&gt;.rpm, information about the package is registered in
the RPM database. A more thorough discussion of RPM may be found in the
RPM-HOWTO available from:

<a href="http://www.redhat.com/support/docs/rpm/RPM-HOWTO/RPM-HOWTO.html">http://www.redhat.com/support/docs/rpm/RPM-HOWTO/RPM-HOWTO.html</a>

<a name="upgrade"></a>
<p><h3>A Note About Upgrading Red Hat Linux</h3>

<p>From the discussion above, you should have the sense that RPM is a powerful
tool, so powerful in fact, that Red Hat Linux is one of the few Linux and Unix
distributions that can truly claim to upgrade from an old release to a current
release. If you are planning to upgrade, you should know that only upgrades
from version 2.0 of Red Hat Linux and onward are supported due to major
changes in Linux's binary format. Otherwise, upgrades can be performed from
the same methods of installation: CD-ROM, NFS, FTP and a Hard Drive. As of
Red Hat Linux v4.0, the upgrade option is incorporated into the Boot Diskette
instead of being a program. For example, if you upgraded in the past from v2.1
to v3.0.3 and now want to upgrade to version 4.0, you will need to create the
Boot Diskette (instead of looking for an upgrade script) just like those
installing Red Hat 4.X from scratch. However, it will not reformat you
partitions nor delete your configuration files.


<h4>Know Your Hardware</h4>

<p>Given the scope and variety of hardware, it is not surprising many people
become confused. However, taking a little time to collect the following
information will save much frustration and the time frustration costs when
things don't install or work correctly: 

<ul>
<li>Any existing operating systems on the target system and the hard
drives on which they are installed.

<li>Hard drive: interface type; the hard drive settings; the number of
cylinders, heads, and sectors. The main consideration is whether your hard
drive uses a SCSI or an IDE interface. If it is SCSI, you should know the SCSI
ID of the drive for its settings. If it is an IDE drive, you should know if
the drive(s) are on the primary or secondary IDE controller and which drives
are set to "master" or "slave". The settings are crucial
in determining whether LILO (LInux LOader) should be used to manage the
booting of your operating system(s). 

<li>SCSI adaptor: You should know the make and model. This is useful in
troubleshooting if you have a supported card that is not detected.		 
<li>Memory: amount of installed RAM. Used to consider the amount of swap
space. 

<li>Network Card: You should know the make and model. 

<li>CD-ROM: If you are installing from CD-ROM, you must know its
make and model and settings as you would for a hard drive.

<li>Mouse: You need to know if you have a PS/2, serial or bus
mouse. You also need to know what protocol it uses. This is necessary
for both the character based mouse server and for configuration of the
X Window System (if you choose to install it).

<li>Video Card: If you want to run the X Window System, you must
know the brand and model of your card to configure the system to run
X.

<li>Monitor: If your want to run the X Window System, you must know
the allowable vertical and horizontal synchronization frequencies for
X to work.
</ul>

<p>Again, taking the time to list the above information before going further will
save you time and frustration and make the installation both easier and
smoother. If your system didn't come with literature detailing the above
parameters for your hardware, you should consult with your system vendor or
the manufacturer of the equipment. Other useful information to have if you are
going to be on a network are the TCP/IP networking settings for your system
(check with your system administrator for these if you don't already know
them). 

<a name="choose"></a>
<h3>Choosing Your Installation Method</h3>

<p>Red Hat Linux may be installed or upgraded via CD-ROM, FTP, NFS or from an
existing Hard Drive partition. Installation nor Upgrading is not supported
from floppy diskettes containing Red Hat packages. Which supported method
chosen depends on your needs, available equipment, availability of Red Hat
Linux and time. For example, if you are a network administrator that needs to
update or install 16 Linux boxes over the weekend, an NFS install is generally
the most prudent way. If you have a Red Hat CD-ROM for your personal machine,
then a CD-ROM install is order or Hard Drive install if your CD-ROM drive
isn't supported. If you don't have the CD-ROM and simply want to try Red Hat
out and have a couple of hours to spare, then an FTP/Hard Drive install is a
reasonable choice with a 28.8 speed modem or faster connection to the
Internet. No matter which method you choose, the installation of Red Hat is
similar in all cases. To begin, everyone needs to have the following files
available and then create the Installation Floppy Kit described below to
install Red Hat.

<a name="floppy"></a>
<h3>Creating the Installation Floppy Kit</h3>

<p>To create the Installation Floppy Kit, you need to obtain the following: 

<ol>
<li>The Red Hat Boot diskette, boot.img which is available via:
<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img">ftp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img</a>
or in the
<pre>$\backslash$images</pre> directory on a properly laid out Red Hat
CD-ROM. Obviously, this is required for all installation
methodologies.

<li>The Red Hat Supplemental Diskette, supp.img, which is available
via:
<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/images/supp.img">ftp://ftp.redhat.com/pub/redhat/current/i386/images/supp.img</a>
or in
the <pre>$\backslash$images</pre> directory on a properly laid out Red Hat
CD-ROM. This diskette is required if you are method of install is not
CD-ROM based or you need PCMCIA support for any devices such as a
CD-ROM on the laptop to install properly. This diskette can also be
used with the Boot Diskette for an emergency start disk for an
installed system.

<li>The program RAWRITE.EXE which is available via:
<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/dosutils/rawrite.exe">ftp://ftp.redhat.com/pub/redhat/current/i386/dosutils/rawrite.ext</a>
or
in the <pre>$\backslash$DOS</pre> directory on a properly laid out Red Hat
CD-ROM. This program is run from and existing DOS or Windows 95 system
to create usable diskettes from the boot.img and supp.img described
above If you have an existing Linux/Unix system, the <pre>dd</pre> command can
be used instead. This is described later in the document.

<li>DOS and Windows 95 users installing Red Hat Linux for the first
time on a machine that will have Linux installed as a second operating
system should also obtain:
<a href="ftp://ftp.redhat.com/pub/redhat/dos/fdips11.zip">ftp://ftp.redhat.com/pub/redhat/dos/fdips11.zip</a>
and unzip into
<pre>C:$\backslash$FIPS</pre> if you need to free space on your hard drive. This
utility can non-destructively shrink and existing DOS 16-bit FAT
(Please see Using FIPS for compatibility notes). This will achieve
will unpack into the program files FIPS.EXE and RESTORB.EXE which are
to be placed on the emergency boot disk made below. Your should also
read FIPS.DOC (part of the package fips11.zip) for information on
using FIPS not covered in this document.

<li>Create an Emergency Boot Diskette for an existing operating
system on the target machine that Linux will be installed on as a
second operating system must be created. This diskette should contain
basic tools for trouble shooting. For example, a DOS or Windows 95
emergency boot diskette should include a copy of FDISK.EXE,
SCANDISK.EXE (or CHKDSK.EXE), DEFRAG.EXE and RESTORB.EXE as a
minimum. This diskette is also used to back up an existing partition
table for those that will use FIPS.EXE to non-destructively shrink
existing partitions. By backing up the partition table, you can
restore it with RESTRORB.EXE if the need arises.
</ol>

<p><h4>Creating the Boot and Supplemental Diskettes</h4>

<p>A note about creating the Boot and Supplemental Diskettes: If you are
re-formating existing diskettes, DO NOT use <pre>format /s A:</pre> to
format the diskettes, just use <pre>format A:</pre>. The diskette images
need the entire capacity of the diskette and <pre>/s</pre> switch seems
to prevent the diskette images from being properly copied to the
floppies. For the emergency diskette below, you will of course want to
use the /s switch.
 
<p>One blank DOS formatted floppy is needed to create the Boot Diskette
and one blank DOS formatted diskette is needed for the Supplemental
Diskette. This diskette set is used for both installing or upgrading
Red Hat Linux. Starting with Red Hat 4.0, a "one boot diskette fits
all" strategy is employed to install or upgrade Red Hat Linux from
the CD-ROM, FTP, NFS or Hard Drive medium. Other distributions (and
older RHS distributions require you to match a boot image to your
hardware, RHS v4.0 and higher do not). The Boot Diskette is made from
the file "boot.img" and is located in the <pre>\images</pre>
directory on the Red Hat CD-ROM or can be downloaded from:
<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img">ftp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img</a>
 or one of Red Hat's mirror sites. If you are installing to a laptop
with PCMCIA hardware, or from a Hard Drive, NFS or FTP you will need
to create the Supplemental Diskette made from the file "supp.img"
which is located in the <pre>\images</pre> directory on the Red Hat CD-ROM
or can be downloaded from:

<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img">htp://ftp.redhat.com/pub/redhat/current/i386/images/boot.img</a><br>

or one of Red Hat's mirror sites.

<p>The Boot Diskette image contains the bootable kernel and the module support
for most combinations of hardware and the Supplemental Diskette contains
additional tools for non CD-ROM installs. You should make the Supplemental
Diskette even if you are installing from CD-ROM because the Boot and
Supplemental Diskette can be used as an emergency boot system if something
should go wrong with the install or with your system after it is installed and
allow to examine the system. 
 
<p>NOTE: some will notice the size of the boot.img and supp.img being 1.47MB
which is larger than 1.44MB. Remember that the unformatted capacity of a
1.44MB is really 1.47MB and that boot.img and supp.img are exact byte for byte
images of a floppy diskette. They will fit using one of the tools below:

<h4>Using RAWRITE to Create the Boot and Supplemental Diskettes</h4>

<p>The utility <pre>RAWRITE.EXE</pre> may be used from DOS, Windows 95 or OS/2
to create the Boot and Supplemental Diskettes. <pre>RAWRITE</pre> can be
found in the <pre>\DOSUTILS</pre> directory on the Red Hat CD-ROM
or it can be downloaded from:

<a href="ftp://ftp.redhat.com/pub/redhat/current/i386/dosutils/rawrite.exe">ftp://ftp.redhat.com/pub/redhat/current/i386/dosutils/rawrite.ext</a>

or one of Red Hat's mirror sites. Once you have obtained it, copy <pre>
RAWRITE.EXE</pre> to <pre>C:\DOS</pre> or <pre>C:\WINDOWS</pre>
directory (or other system directory in the command path) which will
place the <pre>RAWRITE</pre> utility in your command path. From the CD-ROM
(presuming it is the D: drive or which ever drive and directory you
downloaded RAWRITE.EXE to on the system) to use <pre>RAWRITE</pre>, copy it
to one of your system directories:

<pre>D:\DOSUTILS> copy RAWRITE.EXE C:\WINDOWS
</pre> 
<p>Once rawrite has been copied to a system directory (such as
<pre>C:\DOS</pre> or <pre>C:\WINDOWS</pre>, change to the images
directory on the CD-ROM or to the directory you copied boot.img and
supp.img to and do the following to create the Boot Diskette:

<pre>C:\> D: 
D:\> cd \images 
D:\images> rawrite 
Enter disk image source file name: boot.img
Enter target diskette drive: a: 
Please insert a formatted disk into drive A: and press -Enter-: 
</pre>
<p>Once rawrite is done creating the Boot Diskette, remove the diskette from the
floppy drive and label it "Red Hat Boot Diskette". Remember, Red Hat
Linux 4.X uses a "one boot disk fits all" strategy so you don't have
to worry about matching a boot image to your hardware as earlier distributions
of Red Hat required. 
 
<p>To create the Supplemental Diskette, follow the instructions above but
substitute "supp.img" for "boot.img". Remember to label
this diskette "Red Hat Supplemental Diskette".

<h4>Using dd Under Linux or Unix</h4>

<p>If you are creating the Boot and Supplemental Diskettes from and
existing Linux or Unix box, make sure it has a 1.44-3.5" floppy
available and you know how your system refers to the floppy device. If
you don't know how the system accesses the floppy device, ask you
system administrator. For Linux, Floppy Drive A: is called /dev/fd0
and Floppy Drive B: is called /dev/fd1. To create the diskettes under
Linux, `cd` to the system directory containing the boot.img and
supp.img image files, insert a blank formatted diskette and type the
following enter <pre>dd if=boot.img of=/dev/fd0</pre> to make the Boot
Diskette. Once dd is done, remove the diskette from the floppy drive,
label it "Red Hat Boot Diskette" and set it aside.  Then insert a
second formatted diskette and type <pre>dd if=supp.img
of=/dev/fd0</pre>. Once dd is done, remove the diskette from the floppy
drive, label it "Red Hat Supplemental Diskette" and set it aside.

<h4>Creating an Emergency Boot Diskette</h4>

<p>If you are installing Linux to a machine that has an existing operating
system, make sure you create an emergency start diskette with useful
diagnostic and recovery tools. Exactly how you want to create such a diskette
various from operating system to operating system. However, MS-DOS 6.X and
Windows 95 will be covered here and should give you some ideas for other
operating systems. 
 
<p>Windows 95 users should press <I>"Start---Settings---Control---Panel---
Add/Remove Software"</I> and select the <I>"Startup Disk"</I>
tab. Insert a blank, DOS formatted disk and press <I>"Create
Disk"</I>.  When Windows 95 is done, you will have a boot diskette for
Windows 95 containing use tools such as FDISK.EXE, SCANDISK.EXE and
DEFRAG.EXE. Once the diskette is created, you need to copy
<pre>C:FIPS\RESTORB.EXE</pre> (obtained and unpacked
above) to the Windows 95 Boot Diskette you made. When you are done,
remove the diskette and label it "Windows 95 Emergency Boot Diskette
and Partition Table Back Up".

<p>MS-DOS 6.X users need to place a blank MS-DOS formatted diskette into floppy
drive A: and do the following to create their emergency boot diskette: 

<pre>C:\> format A:\
C:\> copy C:\DOS\FDISK.EXE A:\
C:\> copy C:\DOS\SCANDISK.EXE A:\
C:\> copy C:\DOS\DEFRAG.EXE A:\
C:\> copy C:\DOS\SYS.COM A:\
C:\> copy C:\FIPS\RESTORB.EXE A:\
</pre>
<p>Once you are done creating the diskette, remove it from the floppy drive and
label it "MS-DOS Emergency Boot disk and Partition Table Back Up". 

<p>You are ready to continue!

<a name="setting"></a>
<h3>Setting Up Your Installation Media</h3>

<p>Once you have created the Installation Floppy Kit, you should ensure
your installation method is properly setup for using the Red Hat
installation diskettes. For CD-ROM, NFS, FTP and Hard Drive
installation methods, the medium must have the directory
<pre>\RedHat</pre> on the "top level" with the directories
<pre>\base</pre> and <pre>\RPMS</pre> underneath:
<pre>RedHat 
   |----> \RPMS (contains binary the .rpm s to be installed) 
   |----> \base (contains a base system and files to setting up the hard drive)
</pre>
<p>CD-ROMs will, of course have additional directories but the key
directories needed for the installation are <pre>\RedHat</pre> on
the top level of the CD-ROM with <pre>\base</pre> and
<pre>\RPMS</pre> underneath on third party CD-ROMs. Obviously,
Red Hat Software will ensure their <I>Official Red Hat Linux</I> CD-ROM
will have the proper directory structure. So, if you are installing
from CD-ROM, you may go to Preparing Your System for Installation. For
the other types of installs, read the section appropriate section for
your installation medium:

<h4>Setting Up for an NFS Installation</h4>

<p>For NFS installs, you will either need a Red Hat CD-ROM on a machine
(such as an existing Linux box) that can support and export an <B>
ISO-9660 file system with Rockridge Extensions</B> or you need to mirror
one of the Red Hat distribution with the directory tree organized as
indicated above. And of course the proper files in each directory. The
directory <pre>\RedHat</pre> then needs to be exported to the
appropriate machines on the network that are to have Red Hat Linux
installed or upgraded.  This machine must be on a Ethernet, you can
not do an NFS install via dialup link.

<h4>Setting Up For a Hard Drive Installation</h4>

<p>Hard Drive installs need to have the <pre>\RedHat</pre> directory
created relative to the root directory of the partition (it doesn't
matter which partition) that will contain the Red Hat distribution
obtained either from CD-ROM or an FTP site.  For example, on the
primary DOS partition the path to <pre>\RedHat</pre> should be
<pre>C:\RedHat</pre>. On a DOS 16-bit FAT file system, it does not
matter that the <pre><I>package</I>.rpm</pre> names get truncated. All you need
to do is make sure <pre>\RedHat\base</pre> contains the
base files from a CD-ROM or FTP site and
<pre>\RedHat\RPMS</pre> contain all the
<pre><I>package</I>.rpm</pre> files from the CD-ROM or FTP site. The you can
install or upgrade from that partition. If you have an existing Linux
partition not needed for an installation or upgrade, you can set it up
as outlined here as well and use it.
 
<p>TIP: NFS and Hard Drive installs can provide more flexibility in the packages
available to install. NFS and Hard Drive installs/upgrades implied that you
can be selective about which packages are placed in the RPMS directory. For
example, if you only want a text based system, then the X-based packages may
be excluded. Also, if there are updates for the Red Hat system you wish to
install, they may be placed in the RPMS directory in place of the
distributions original packages. The only caveat for customizing the available
packages for installing or upgrading Red Hat Linux is that package
dependencies are meet. That is, if package A needs package B to be installed,
both packages must be present to meet the interdependencies. This may,
however, take a little experimenting to ensure all package dependencies are
met. For more information, please see "Customizing
Your NFS or Hard Drive Installation" below.

<h4>FTP Installations</h4>

<p>For FTP installs over the Internet, all you need is the IP address of your
nearest FTP server and the root directory path for the Red Hat Linux system
you wish to install. If you don't know the nearest FTP site, consult with your
system administrator or your ISP. If you are intending to do an FTP install
over a low band width connection (defined as anything slow than a 128K ISDN
link), it is highly recommend that you FTP the file files to a hard drive with
an existing DOS partition and then do the hard
drive install install described in this chapter. The total size of the
binary packages available in the <pre>/RedHat/RPMS</pre> directory is currently around
170MB which will take many hours to install. If anything goes wrong with the
installation such as the link goes down, you will have to start over again. If
you ftp the files first, setup your hard drive for installing Linux, it is
then less work and less flustering to recover from a failed install. You don't
even have to download all the files in <pre>/RedHat/RPMS</pre> to successfully install a
minimal system that can grow with your needs. Please see Customizing
Your NFS or Hard Drive Installation for details.


<h4>Customizing Your NFS or Hard Drive Installation</h4>

<p>One of the interesting things you can do with Red Hat Linux is customize the
install process. However, this is not for the faint of heart. Only those
already familiar with Red Linux or Linux in general should attempt customizing
the install. As of Red Hat v4.X, the <pre>/RedHat/RPMS</pre> directory contains
approximately 170MB of rpm files. RPM does compress these packages and can
assume the package will need and average 2-3MB of hard drive space for every
1MB of <pre>package .rpm</pre> available for installation. For example, if the
<pre>package .rpm</pre> is 6MB in size, you will need between 12 to 18MB of free
space to install the package.  If you know what software you want and don't
want,  much of the software provided will not have value for the installation,
and for for low band width connects, it is not feasible to download the entire
tree. With this in mind, an installation can be customized to remove unwanted
software. 
 
<p>Customizing the packages to install is an advantage and possible for the
following types of installs: FTP, NFS and Hard Drive methods. CD-ROM cannot
be written to (but you can copy the files to the hard drive and do a hard
drive install with the customized package list). FTP and NFS installs can only
be designed if you have administrator access to the server(s) on your network
or your system administrator is willing to work with you. The following
installation situations make customizing the installation desirable: Obtaining
Red Hat Linux via FTP over a low band width connection or designing a suite of
software to be used by all installation of a network of Red Hat Linux boxes. 
 
<p>To customize the installation, you must obtain the <pre>/base/comps</pre> file which will
provide you with the list of packages the a full install would normally have.
Then then packages you actually want to install from <pre>/base/comps</pre> need be
download. Then, the <pre>/base/comps</pre> needs to be edited to reflect the packages you
obtained and are going to install. (NOTE: if you have local
package.rpms you can add them to the comps file as well).

<h4>Understanding the COMPS file</h4>

<p>The Red Hat installation program uses the file <pre>/RedHat/base/comps</pre>
(the file here is an example from RHS v4.0) to determine what packages are
available in the <pre>/RedHat/RPMS</pre> directory for each category to be installed. The
file is organized by category and each category contains a list of packages
Red Hat believes are the minimum required for that section. NOTE: only the
<pre>package</pre> part of a packages name
<pre>package-version-build.rpm</pre> is listed in the file.
This means the comps file is generally usable from one version of Red Hat to
the next. A section in this file has the structure: 

<pre>number <I>category</I> 
<I>package</I> 
... 
end 
</pre> 
<p>That is a tag to identify the category number, the category, a list of the
package names in the category and the tag "end" to mark the end of
the category. 
 
<p>Without exception, everyone needs the all of the software packages listed in
the <B>Base</B> section of the file. The other sections, though, generally can
be customized or eliminated to suit a particular need. For example, there are
three types of <B>Networked Stations</B>: "plain", Management, and
Dialup. An examination of these sections shows that many of the software
packages are listed in all three categories, but some software packages are
specific to the category. If you are creating a <B>Dialup Networked Station</B>,
then you can safely eliminate the "Plain" and "Management"
sections and any software unique to those categories. Conversely, if you only
need basic networking capability for a networked work stations, the other
sections can be eliminated from the file as well as the unique software to
each of those sections. All you need do is make sure you have the all the
software packages listed in that category. If you have some local custom
packages (those not provided by Red Hat Software), you should add them to an
existing category that is appropriate rather than creating a new category. 
 
<p>Because the list of packages in each category only contains the name
of the package, i.e., not the entire
<pre>package-name-version-build.rpm</pre>, you can
substitute any updates Red Hat has made available in the <pre>updates</pre>
directory on:

<a href="ftp://ftp.redhat.com/pub/redhat/current/updates">ftp://ftp.redhat.com/pub/redhat/current/updates</a><br>

or one of Red Hat's mirror sites for the original package found in the
distribution's original <pre>/RedHat/RPMS</pre> directory.  The means
installation program is relatively version insensitive. The only
caveats here are that package dependencies are met . When an rpm'd
package is built, RPM itself tries to determine what packages
must be installed for another package to work (the rpm developer also
has direct control of this as well---he can add dependencies that rpm
might not ordinarily detect). This is where a little experimentation,
or research may be needed. For example, one way to determine package
dependencies (if you have user access to your NFS server on an
existing Red Hat Linux Box) is to telnet or login into it or if you
have the CD-ROM, mount it and cd to the <pre>RedHat/RPMS</pre> directory and
query the packages for its dependencies:

<pre>[root@happy RPMS] rpm -q -p -R bash-1.14.7-1.i386.rpm 
libc.so.5 
libtermcap.so.2 </pre>

<p>The "-q" puts RPM in query mode, the "-p" tells RPM to
query an uninstalled package and the "-R" tells RPM to list the
target package's dependencies required. In this example, we see libc.so.5 and
libtermcap.so.2 are required. Since libc and termcap are part of the base of
required software (as is bash really), you must insure the libc and libtermcap
packages (the dependency packages) are present to be able to install bash (the
target). Overall, as long as you get the entire <B>base</B> packages
installed, you will be able to boot the system when the Installation Program
completes. This means you can add additional packages to Red Hat as required
even if the Installation Program reports a package failed to install because
dependencies were not met. 
 
The following table describes the categories of software are found in
<pre>/base/compsin</pre> of Red Hat v4.0:
<p>
<table cellpadding=10>
<tr>
<td valign=top><B>RPM Category</B></td> <td><B>Required?</B></td> <td><B>Comments</B><br></td>
</tr>
<tr>
<td>BASE</td> <td>Yes</td> <td>Should not be customized.<br></td> 
</tr>
<tr>
<td>C Development</td> <td>Highly Recommend</td> <td>Need the minimal system 
              to compile a kernel<br></td>
</tr>
<tr> 
<td>Development Libs</td> <td>Highly Recommend</td><td>Need the minimal system
                 to compile a kernel<br></td>
</tr>
<tr>
<td>C++ Development</td> <td>Optional</td> <td>C++ Development<br></td>
</tr>
<tr> 
<td>Networked Workstation</td> <td>Recommend; Required & Whether you are on an Ethernet or
for other network software</td> 
                       <td>going to dialup networking, you 
                       need to install this package suite 
                       You shouldn't customize this.<br></td> 
</tr>
<tr>
<td>Anonymous FTP/Gopher Server</td> <td>Optional</td> <td>If your Linux box is going to 
serve files via FTP or Gopher<br></td> 
</tr>
<tr>
<td>Web Server</td> <td>Optional</td> <td>Useful for Web Developers for local 
development, required if you serve 
web pages.<br></td>
</tr>
<tr> 
<td>Network Management Workstation</td> <td>Optional</td> <td>Has additional tools useful for 
dialup as well as Ethernet network<br></td>
</tr>
<tr> 
<td>Dialup Workstation</td> <td>Recommended</td> <td>Required if you are going to dialup<br></td>
</tr>
<tr> 
<td>Game Machine</td> <td>Optional</td> <td>Need I say more? Fortunes are 
required for humor :-)<br></td>
</tr>
<tr>
<td>Multimedia Machine</td> <td>Optional</td> <td>If you have supported hardware<br></td>
</tr>
<tr>
<td>X Window System</td> <td>Optional</td> <td>If you want to run X<br></td>
</tr>
<tr> 
<td>X Multimedia Support</td> <td>Optional</td> <td>If you have supported hardware<br></td>
</tr>
<tr>
<td>TeX Document Formatting</td> <td>Optional</td> <td>Customize as needed<br></td>
</tr>
<tr> 
<td>Emacs</td> <td>Recommend</td> <td>The One True Editing Environment<br></td>
</tr>
<tr>
<td>Emacs with X</td> <td>Recommend</td> <td>Requires X<br></td>
</tr>
<tr> 
<td>DOS/Windows Connectivity</td> <td>Optional</td> <td>Huh?<br></td>
</tr>
<tr> 
<td>Extra Documentation</td> <td>Required</td> <td>Man pages and should ALWAYS 
be installed. Other packages optional.<br></td>
</tr>
</table>

<a name="recommend"></a>
<h3>Recommendations</h3>

<p>It is difficult to determine exactly what any one installation will
require.  However, someone installing via FTP should get the <B>
Base</B> system and the <B>Dialup Networked Station</B> and install
these. Then additional software can be obtained and added as the need
arises. Of course if you want to do C programming, you should get the
relevant packages and edit the comps file appropriate.

<p>One last caveat: If you encounter a file during the install that requires
another package you don't have available, or you make a mistake in the comps
file, you can generally finish the install and have a bootable working system.
You can correct the problem by manually adding the failed packages and their
dependencies later. Overall, get the entire Base system and a Networked Station
packages installed and you can add anything you need or want later. 

<h4>Preparing Your System to Install</h4>

<p>Before continuing, if you have an existing operating system, and have
not yet backed up your data, you must back it up now. While most of
the time installing Linux will not result in the loss of data, the
possibility exists, and the only way to guarantee a recovery in such a
catastrophic event is to <B>back up your data</B>.

<p>At this point with the information collected above and having decided on an
installation method above, preparing your system should offer no obstacles.
Essentially, you need to make sure you have free and unpartitioned space on
one the system's hard drives. (NOTE: there is a file system type known as
UMSDOS that some distributions use as an optional way to install Linux onto an
existing DOS file system; Red Hat Linux does not support this type of
installation.) If you are installing on a system that will only have Linux and
does not currently have an operating system installed, then you are set to
partition your hard drive and can go to the next section.
If you have an existing operating system, such as DOS/Windows 3.1, Windows 95,
OS/2 or another operating system, then things are a bit more complex. The
following should help determine what you need to do to free hard drive space: 

<ul>
<li>DOS or Windows 95 using DOS 16-bit FAT: You may use utility
FIPS.EXE that is part of the Installation Floppy Kit described above
that will allow you to non-destructively make a single DOS 16-bit file
allocation table (FAT) into two or more DOS 16-bit FATs. These new,
empty partitions can be deleted, creating free space to be used for
Linux partitions. See FIPS.EXE below. If you have a CD-ROM containing
Red Hat, there should be a directory called <pre>\dosutils</pre>
containing a copy of FIPS.EXE. Otherwise, the FIPS package can be
downloaded from:

<a href="ftp://ftp.redhat.com/pub/redhat/dos/fips11.zip">ftp://ftp.redhat.com/pub/redhat/dos/fips11.zip</a>
<br>
or one of Red Hat's mirror sites.
 
<p>NOTE: Microsoft has introduced a new 32-bit FAT system with recent
Windows 95 releases. This 32-bit FAT system cannot be shrunk by the
current version of FIPS.EXE. In Windows 95, if you check under <I>My
Computer</I> | <I>Control Panel</I> | <I>System</I> and your Windows 95
kernel version ends in a "B", Windows 95 is likely to be using a
32-bit FAT.

<li>OS/2, Windows NT, DOS 32-bit FAT and Other Users: You will need to either
back up existing partitions and delete them, or if using a single partition,
delete the partition and re-install the operating system into a smaller
partition, leaving free space to be used for Linux partitions. 
</ul>


<h4>Planning to Partitioning The Hard Drive</h4>

<p>Linux has its own version of the program <pre>fdisk</pre> used to create native
Linux and swap partitions. However, the details of its use are described later
in this guide. However, discussion of the concepts on how to partition your
hard drive are important now so reasonable decisions can be made on how much
and how to make free space available on the target system. 

<p>One way of installing Linux is to use two partitions---one for the
operating system and one for the swap file in the free space on your
hard disk. However, this is not an ideal way for Linux to be
installed. While some hardware configurations may only allow this type
of organization, the recommend method is to use a minimum four partitions
for Linux: One for <pre>/</pre> (the "root" partition), one for <pre>/var</pre>, one
for <pre>/home</pre> and one for swap.  Unlike logical DOS drives which are
assigned a drive letter, Linux partitions are "glued" together into
one virtual directory tree. This scheme takes advantage of how Linux
operates in the real world. Essentially, each file system reflects the
life time of a file: the files on the <pre>/</pre> partition have the longest
"time to live" because they are infrequently updated and often last
as long as the operating system itself does on the hardware; The <pre>/home</pre>
partition represents medium file life times that can be measured in
weeks or days, such as user documents; <pre>/var</pre> represents files with the
shortest life time (such as log files), measured in minutes or even
seconds. This type of setup also suggests a backup strategy: the root
file system only needs to be backed up when a new program is added or
configuration files are changed. The <pre>/home</pre> partition can be put on
some sensible full/incremental back up schedule while /var never needs
to be backed up, with the exception of <pre>/var/spool/mail</pre>.  A more
through discussion of this can be found in Kristian Koehntopp's
Partition mini-HOWTO and Stein Gjoen's Multiple Disks Layout
mini-HOWTO.

<p>A PC can have either have a maximum of four primary partitions or have three
primary partitions and 1 extended which can contain many "logical"
drives.  One model in which to understand this are Russian Stacking
Dolls. Basically, Russian Stacking Dolls are containers within
containers but each container is a discrete doll. A partition is a
mechanism describing a container within the master container of the
hard drive that an operating system does not leave the confines of. A
normal PC hard drive can have up to four primary containers (Primary
Partitions) or three primary containers and one extended container (Extended
Partition) that contains Logical containers (Logical
Drives/Partitions). This means you can have one primary partition for
DOS/Windows, one primary partition for the root file system, one primary
partition for a swap partition, and one Extended partition containing
logical drives for <pre>/var</pre> and one logical drive for <pre>/home</pre> (as well as
other "optionally" defined partitions). However, Linux can and it is
often prudent to have more than the partitions outlined here. Due to
some design limitations in typical PCs BIOS, there are limitations on
how partitions can be setup and still be boot partitions.

<p>Overall, IBM designers didn't think that a PC would ever have 1 GIG drives 15
years ago when the PC was originally designed. As a result, a PC BIOS is
limited to a 10-bit address for describing the initial geometry of a hard
drive. This happens to correspond to one of the values used in calculating the
location of a piece of data on a hard disk known as cylinders. A 10-bit number
is sufficient to describe the numbers 0 through 1023 in decimal notation. A
drive with 1024 cylinders, 16 heads and 63 sectors per track, is approximately
504MB. This is important for 2 primary reasons: Most boot loaders have to
depend on BIOS to get a drives initial geometry for calculating the beginning
of a partition and the average drive size on the market these days is 1.2 GIG
which contain 2,000+ cylinders. Luckily, most newer system (usually those with
a BIOS designed in 1994 or later) have a BIOS that supports Logical Block
Addressing (LBA). LBA mode is a means of supporting Large Hard Drives by 1/2
or 1/4 the number of cylinders and doubling (or quadrupling) the number of
heads. This allows for the proper calculation of drive geometry while working
within the constraints of BIOS. So a drive with 2048 cylinders, 16 heads and
63 sectors per tract will, under LBA mode, have 1024 cylinders, 32 heads, and
63 sectors per tract. Now, we can potentially use any primary partition as a
boot partition. 

<p>Now, with all this theory and practical advice, it is time to provide some
example of how this can be put together; the first example is an 850MB drive
with LBA mode enabled which might be divided:
<pre>
Partition	File System Type	Use	Size
/dev/hda1	MS-DOS	DOS/Win95	400MB 
/dev/hda2	Linux Native (ext2)	/	325MB 
/dev/hda3	Linux Swap	Swap	32MB 
/dev/hda4	Extended	N/A	93MB 
/dev/hda5	Linux Native (ext2)	/var	40MB 
/dev/hda6	Linux Native (ext2)	/home	53MB 
</pre>

<p>This table might be useful for a machine used by a single person. There a
couple of things to note here. First, the labeling of partitions by Linux. The
<pre>/dev</pre> is the Linux directory where "device files" are kept (this is
different than a device driver but it is related to device drivers) that Linux
uses to identify devices by user programs. The next part, <pre>hda</pre>,
means "hard disk <B>A</B>" used to designate "Fixed Disk
1" as it is called under DOS. But it also means that the drive is an IDE
drive. SCSI drives would use <pre>sda</pre> for "SCSI Disk <B>A</B>.
The whole line <pre>/dev/hda1</pre> means the 1st partition on hard disk <B>A</B>.
As for the sizes that are being used here, they are a little arbitrary, but
fall under the following guidelines: A virtual decision was made to use half
of the drive for DOS or Windows 95 and roughly half for Linux. So, 400MB was
allocated for DOS and it is presumed that is enough for those needs. The <pre>/</pre>
root file system is 325MB which is enough for the base Linux system (usually
about 50MB), programming tools such as C, C++, perl, python and editors such
as vi and EMACS as well as the X Window System and some additional space for
extra useful packages you might find in the future. If you do not plan to run
X, you can subtract 150MB from this total. The swap partition is determined by
multiplying 2x physical ram installed on our virtual machine (which has 16MB of
core RAM installed). If you are tight on space or have less than 16MB of ram,
you should have at least a 16MB swap partition. However, you must have a swap
partition defined.  40MB is used for <pre>/var</pre> which includes enough space for log
files and email handling for one or two people. and 53MB for <pre>/home</pre> provides
plenty of space for a user or two to work in. 


<h4>How Much Space Do You Really Need?</h4>

<p>By now, an installation method has been chosen and a view of what partitioning
for Linux has been discussed. But how much space do I really need? The answer
is: "It depends."  To make a decision on how much space is needed,
This a the goal(s) of why you are installing Linux must be reviewed because it
has a direct bearing on the space needed to meet these goal(s). If you install
everything, you will need about 550MB for all the binary packages and
supporting files. This does not include swap space or space for your own
files. When these are factored in, a minimum of 650MB or more is needed. If
your goal is more modest such as having a text only system with the C
compiler, the kernel source tree, EMACS, basic Internet dialup support, then
125 to 150MB of hard drive space is sufficient. If your plans are more
demanding such as having a web development platform and X then 450MB or
so described in the model above should be enough. If you are planning to start
and ISP or commercial web site, then 2 or more GIGs of hard drive space may be
needed depending on the scope of services being offered. The overall rule of
thumb is having to much real estate is a good thing, not having enough is bad.
To help you decide how much space is enough, here are some basic
formulas/values for different needs: 
<p>
<table>
<tr>
<td><B>Use of Partition</B></td> <td><B>Recommend</B></td> <td><B>Size Comments</B><br></td>
</tr>
<tr>
<td>Swap</td> <td>2 x Physical RAM</td> <td>If less than 16MB of RAM installed, 
16MB is a must. If space is tight, 
and 16MB RAM installed, 1 x Physical
RAM is the minimum recommended.<br></td> 
</tr>
<tr>
<td>Root system, no X</td> <td>100 - 200MB</td> <td>Depends on tools such as compilers, 
etc. needed<br></td> 
</tr>
<tr>
<td>Root system, with X & 250-350MB</td><td>Depends on tools such as compilers, 
etc., needed<br></td> 
</tr>
<tr>
<td>/home</td> <td>5 - Infinite MB</td>	<td>Depends on being single or multiple 
users and needs<br></td> 
</tr>
<tr>
<td>/var</td> <td>5 - Infinite</td> <td>Depends on news feeds, # of users, etc.<br></td>
</tr>
<tr>
<td>/usr/local</td><td>25 - 200MB</td> <td>Used for programs not in RPM format 
or to be kept separate from the rest of Red Hat<br></td> 
</tr>
</table>
<a name="fips"></a>
<h3>Using FIPS</h3>

<p>Many people installing Linux have one hard drive with a single DOS or
Windows 95 partition already using the entire hard drive, or they may
have two drives with 1 DOS or Windows 95 partition per drive. FIPS is
a utility that can non-destructively shrink a 16-bit DOS FAT in use by
DOS 3.X or higher and many implementations of Windows 95. (NOTE: if
you are using revision "B" of the Windows 95 kernel, you may be
using FAT32 which FIPS currently cannot shrink.) If you meet the
requirements above, then you can shrink an existing primary partition
on any drive. NOTE: FIPS cannot shrink logical drives or extended
partitions.  If you have Red Hat on CD-ROM, the utility should be in
the <pre>\dosutils</pre> directory on the CD-ROM. If you have
downloaded Red Hat Linux, you should also download FIPS package
available from:

<a href="ftp://ftp.redhat.com/pub/redhat/dos/fips11.zip">ftp://ftp.redhat.com/pub/redhat/dos/fips11.zip</a>
<br>
or one of the many Red Hat's mirror sites. You should also read
FIPS.DOC included with this package for details on FIPS operation.

<p>A few caveats about using FIPS: As a reminder, you should <B>back up</B> your
existing data before using it. While it is rare for FIPS to damage a
partition, it can happen, and backing up your data is the only way to recover
from such a catastrophe. FIPS can only be used on primary DOS 16-bit FAT
partitions. It cannot be used on any other types of partitions, nor can FIPS
be used on Extended partitions or Logical drives. It can only split primary
partitions. Before running FIPS, you must run SCANDISK to make sure any
problems with your partition are fixed. Then you must run DEFRAG to place all
the used space at the beginning of the drive and all the free space at the end
of the drive. FIPS will split an existing primary partition into to two
primary DOS 16-bit FAT partitions: One containing your original installation
of DOS/Windows 95, and one empty, unformatted DOS 16-bit DAT partition that
needs to be deleted using the DOS or Windows 95 <I>fdisk</I> program. The
following steps outline how to use FIPS.EXE: 

<ol>
<li>Copy <pre>FIPS.EXE</pre> to <pre>C:\WINDOWS</pre> or <pre>C:\DOS</pre>.
This will place <pre>FIPS.EXE</pre> in your command path.

<li>Create or use the bootable DOS or Windows 95 emergency disk
described in the Installation Floppy kit above and place the program
<pre>RESTORB.EXE</pre> on the disk if you have not already done so. FIPS
gives you the ability to back up your existing partition table,
allowing you to return your system to its previous state using
<pre>RESTORB.EXE</pre>.

<li>Run <pre>scandisk</pre> and <pre>defrag</pre> (included with DOS 6.X and
higher). This makes sure there are no errors on your hard drive and
places all the free space at the end of the drive.

<li>Make sure you are in DOS mode (i.e., not running Windows 3.X or
Windows 95).

<li>Type <pre>fips</pre>. An introductory message will appear and you
will be prompted for which hard drive on which to operate (if you have
more than 1).  Most people will choose "1" for the first hard disk
to shrink.

<li>After confirming that you wish to continue, you will be asked to
make a backup copy of your existing boot and root sectors on the
bootable disk made above. This will allow you to restore the hard
drive if needed.

<li>FIPS will ask if all the free space on your existing partition
should be used to create a second partition, with an initial partition
table if you accept the defaults. If this isn't acceptable, say "no"
and then use the up and down arrow keys to adjust the amount of space
used for the second partition. Once you are happy with the division,
hit Enter to stop editing. If the sizes with the new partition table
are acceptable, choose "c" to continue. If not, choose "r" to
re-edit the table.

<li>One last chance is given to quit FIPS without making changes or
writing out the new partition table. If you are happy, write it out!

<li>Once FIPS is done, re-boot your computer to have FIPS changes
take effect.

<li>Next, use DOS's <pre>fdisk</pre> to delete the second DOS partition. This
will leave unallocated space to be used by Linux's version of f:disk
later to create Linux native and Linux swap partitions.
</ol>
<p>With the appropriate things done in this section for installing Linux,
you are now ready to Install Red Hat Linux!

<a name="install"></a>
<h3>Installing Red Hat Linux</h3>

<p>By now, you should have created an Installation Floppy Kit, Prepared
Your Hard Drive, and Have your Installation Media ready. for the
install. The details of the installation follow, however, you first
begin by booting your system and configuring the install program to
install from your selected medium. Once this is done, the installation
proceeds with the same steps for each everyone one after that. At this
point, you need to begin by booting your computer with the diskette
labeled "Boot Diskette".

<h3>Using Your Installation Media</h3>

<p>As the boot diskette starts up, the kernel will attempt to detect any
hardware which the boot diskette has drivers compiled directly in to
it. Once booting is complete, a message asking if you have a color
screen appears (if you do, select OK). Next comes the Red Hat
Introduction Screen welcoming you to Red Hat Linux. Choose OK to
continue. The next questions asks if you need PCMCIA support which you
need to say yes to if you are installing to a laptop; say yes and
insert the Supplemental Diskette when prompted. Once PCMCIA support is
enabled (if needed), you will be presented with a screen asking what
type of installation method you will be using.  Follow the
instructions for the installation method you've chosen described in the following sections.


<h4>Installing From CD-ROM</h4>

<p>If installing from CD-ROM, you should choose "Local CD-ROM" by
highlighting it from the list of installation types. Once you choose
"Local CD-ROM" and click "OK", you will be asked if you have a
SCSI, IDE/ATAPI or Proprietary CD-ROM that you wish to install
from. This is where some of the hardware research pays off: if you
have a recently made 4X or faster CD-ROM drive that was bundled with a
Sound Blaster or other sound card, you most likely have an IDE/ATAPI
type drive. This is one of the most confusing issues facing you.

<p>If you choose SCSI, you will be asked what kind of SCSI card and be presented
a list. Scroll down the list until you find your SCSI card. Once you have
choose it, you will be asked if you wish to AUTOPROBE for it or SPECIFY
OPTIONS. Most people should choose "AUTOPROBE" which will cause the
setup to scan for your SCSI card and enable the SCSI support for you card when
found 

<p>Once the Installation Program has successfully located the Red Hat CD-ROM, you
should proceed to "Walking Through the Rest of the Installation." 


<h4>Installing From The Hard Drive</h4>

<p>If you are installing from a hard drive, then highlight this option
and choose "OK". If you have not already choose PCMCIA support, you
be prompted to insert the Supplemental Diskette.


<h4>Installing via NFS</h4>

<p>If you are installing via NFS, then highlight this option and choose
"OK". You will next be asked to choose which Ethernet card you have
installed on the target machine so the Installation Program may load
the correct Ethernet driver. Highlight the appropriate card from the
list and then select "OK" allowing the Installation Program to
AUTOPROBE for you card.  However, if you machine hangs, you will need
to do <pre>Ctrl-\Alt-Delete</pre> to reboot the
system. Most of the time, when this happens, it is because the probing
"touches" a non Ethernet card. If this should happen, try again and
choose "SPECIFY OPTIONS" and give data about your card in the form
of:

<pre>ether=IRQ,IO\_PORT,eth0
</pre>This will instruct the probe to look at the location specified by the
values <pre>IRQ</pre> and <pre>IO\_PORT</pre> for an Ethernet card. For
example, if you Ethernet card is configured for IRQ 11 and IO\_PORT
0x300, you would specify:

<pre>ether=11,0x300,eth0</pre>

<p>Once your card has been successfully found, you will be prompted for
TCP/IP information about your machine and the NFS server with the
Linux installation.  First, you will be asked to provide the target
machines <I>IP Address, Netmask, Default Gateway</I>, and <I>Primary
Name Server</I>. For example: 
<pre>
IP Address:          192.113.181.21
Netmask:             255.255.255.0
Default Gateway:     192.113.181.1
Primary Nameserver:  192.113.181.2
</pre>
<p>Once you press OK, you will prompted for the target machines <I>
Domainname</I> and <I>Hostname</I>. For example, if you domain name is
infomagic.com and hostname is vador, enter:
<pre>
Domainname:               infomagic.com
Host name:                vador.infomagic.com
Secondary nameserver IP:  Enter if needed
Tertiary nameserver IP:   Enter if needed
</pre>
The last screen will prompt you for the NFS server and the exported
directory containing the Red Hat distribution. For example, if you NFS
server is redhat.infomagic.com, enter:

<pre>
NFS Server name:    redhat.infomagic.com
Red Hat Directory:  /pub/mirrors/linux/RedHat
</pre>
Again, if you do not know these values, check with you system
administrator.  Once you have entered the values, choose "OK" to
continue. If the Installation program reports and error locating the
Red Hat distribution, make sure you have the correct values filled in
above and that your network administrator has given the above target
machine information export permission.


<h4>Installing via FTP</h4>

<p>An FTP install is very similar to the NFS install outlined above.  You
will be prompted for the Ethernet card and your machines TCP/IP
information.  However, you will be asked for the <I>FTP site name</I>
and <I>Red Hat directory</I> on the Red Hat mirror site. instead of NFS
server information.  There is one caveat about performing an FTP
install: find the closest and least busy FTP site to your location.
If you don't know how to do this, check with your network
administrator.

<p>TIP: If your hardware isn't detected, you may need to provide an
override for the hardware to be enabled it properly. You may also want
to check:

<a href="http://www.redhat.com/pub/redhat/updates/images">http://www.redhat.com/pub/redhat/updates/images</a>
<br>
to see if Red Hat has updated boot diskettes for your hardware.

<a name="rest"></a>
<h3>Walking Through the rest of the Installation</h3>

<ol>

<li>Next, you will be asked if you are installing to a New System or
Upgrading RedHat 2.0 or higher. If you are upgrading, you will not be
offered the chance to partition your hard drive or configure anything
with your system except LILO.  Press either INSTALL or UPGRADE to
continue.

<li>If you are upgrading, you will be asked for the root partition
of your existing Red Hat system.  Highlight the appropriate partition
of your existing Red Hat system and Press "OK".  If you are
installing for the first time, you will need to partition your hard
disk with free space determined above.  The following discussion is an
example based on Planning to Partition the Hard Drive.  If you do not
have any free space on your hard disk to create partitions and are
using a 16-bit FAT such as that used by DOS or most Windows 95
installations, please review the Using FIPS section of this document.
To use fdisk, highlight the disk you wish to partition from the list
presented to you by the Installation Program.  You will be dropped
from the "graphic" screen and presented with a black and white
screen with the following prompt:

<pre>Command (m for help):
</pre>
<p>This rather mysterious prompt is Linux's fdisk's command prompt.  If
you press `m`, you will get a list of commands with a short definition
of what each does.  However, the most useful one to start with is
"p".  This will print your existing partition on the screen.  If you
have existing partition(s) on the drive they will be displayed.  Make
sure you can create at least one 25-50MB partition that starts before
cylinder 1024 and ends on or before cylinder 1023 as this type of
locations is required by LILO to be able to boot the root partition
which will in turn allow the kernel to take over you system which is
not restricted in the way LILO is.  Once the kernel boots your system,
it queries the hardware directory and ignore BIOS.

<p>To create a primary root partition of 50MB according to our example
above, enter "n".  First, you will be asked for a partition number
between one and four. Our example in Planning to Partition the Hard
Drive suggests two.  You will be asked if the partition is to be a
primary or extended, enter `p` primary.  Next you are asked to enter
the beginning cylinder which should be the first available cylinder
from the range given.  After you hit enter, you will be asked for the
ending cylinder.  Since we want to make this partition 50MB, you can
enter +50M and fdisk will calculate the nearest ending cylinder for a
space of about 50MB.  Once you have done this, enter the "p" command
so you can make sure the new partition ends on or before cylinder
1023.  If the new partition doesn't, use the "d" command to delete
partition two and try again except enter +40MB for the new primary
partition and check again with the "p" command.  Keep doing this until
you get a root partition below cylinder 1024.  Overall, if you cannot
create a root partition of at least +25M below cylinder 1024, then you
will either need to free more space below cylinder 1024 or not use
LILO.

<p>Next, according to our example, you will want to create a swap
partition that is 2 x physical ram installed.  Creating a swap
partition requires two steps, first using the "n" command to create a
primary partition (three in the example).  Following the instructions
above, except enter the value of +(2 x physical RAM) MB.  For the swap and
other partitions, we don't care what there beginning and ending
cylinders are because they are not crucial for LILO to work
correctly---only the root partition is.  Once you have created the
Linux native partition to be used as the swap partition, you need to
use the "t" command to change the partition ID to type "82" when
prompted.  This changes the partition ID so Linux well recognize it as
a swap partition.  When you have successfully done this, the "p"
command will report that you have a native Linux partition and a Linux
swap partition.

<p>Now, since we need two more partition, but the hard drive in a PC can
only support four primary partitions and three primary partitions have been
used, we need to create an Extended partition that occupies the rest
of the drive that will allow the creation of Logical drive with end
the extended partition.  This time, to create the Extended partition
with the "n" command, enter four for the partition number and choose
"e" when prompted to create an Extended partition.  When asked for the
beginning cylinder, use the first one available and for the last
cylinder, enter the last available cylinder.  You are now ready to
create Logical drives for <pre>/var</pre> and <pre>/home</pre> according to our example.

<p>To create a logical drive of 40MB to be used as <pre>/var</pre>, enter "n" to
create a partition.  Because there is no longer a choice of Primary or
Extended, you are not prompted for this information but instead asked
if this is to be partition five.

<p>Once you have completed this, you will be asked for the starting
cylinder which should be the first available cylinder.  For the ending
cylinder, enter +40M for the size as the size was entered above.  For
the <pre>/home</pre> partition, you may have a choice.  If your drive is larger
than the 850MB suggested in the example, you can enter +53Mb as
indicated above and use the extra space for partition such as
<pre>/var/spool/mail</pre> and <pre>/usr/local</pre>.  Otherwise, just use the last
available cylinder to define <pre>/home</pre>.  Once you are done creating
partitions, you can use the "p" command to print the partition one
last time to review it.  However, you won't modify any thing until you
use the "w" command to write the partition out to the hard disk.  If
you decided not to modify the partition table at this time, choose "e"
to exit without modifying the partition table.  NOTE: When creating
Logical partitions, you must reboot the system in order for Logical
Partitions to be usable.  Simply go through the options as you did up
to being asked to partition you drive.  However, say no the second
time around and proceed to the next step.

<li>Once you have created the necessary Linux Native and Linux Swap
partitions. You are required to have one swap partition. After the
swap partition is initialized, you will then be asked which
partition(s) you intended to install Linux to (if upgrading, simply
indicate your existing root partition): You must configure and choose
one partition for the root partition. Highlight the root partition.
Then (unless you are upgrading) you will be presented with a table of
other available partitions.  Choose the appropriate partitions and
"EDIT" to indicated which partitions will be used for which
directories.  If you have more than one partition for the Linux
installation, now is the time to designate them as well.

<li>Next is the Software Package Selection. First, a list of
software categories to install is presented, followed by a chance to
customize which software packages from each category is to be
installed. If you have not installed Red Hat or other distribution of
Linux before, simply choose the category of software you wish to
install and let the setup program install the defaults for each
categories. If you find you need a package that wasn't installed
originally, you can always install it easily later.  While the
software is installing, you will see a progress indicator and should
get a cup or two of coffee. Installation can take anywhere from
thirty minutes to an hour or so, depending on software choices and hardware
configuration.

<li>After the software installation is done, you will be asked to
configure you mouse. Again, choose what is appropriate for your
hardware.

<li>Next is the X Window System configuration. We recommend you wait 
until after you boot your system for the first time to configure X. 
If something goes wrong with the X configuration, you may need to start 
the installation procedure from the beginnings the Installation Program 
isn't able to recover.

<li>If you do not have an Ethernet Card, DO NOT configure your
network at this time. If you do have a network card and didn't
configure it earlier, you should configure it now.  Configuring for a
dialup network should be done after the installation is complete.

<li>Next, you need to configure the system clock. UTC is a good
choice if you are on a network and want daylight savings time handled
properly. Local Time is good if the computer is a stand-alone machine.

<li>If you do not have a US Keyboard, you will need to configure for
the country keyboard you have at this time.

<li>You will now be prompted for the system password for the root
account.  Write it down and don't forget it as it is a non-trivial
matter to recover the password and you will need it to access the
system when you first reboot.

<li>Finally, you will be asked to configure LILO.  If you have not
installed a root partition that begins and ends between cylinder
0-1023, DO NOT INSTALL LILO!  If, when you reboot the system for the
first time LILO does not allow you to boot your system correctly, use
the Emergency DOS/WINDOWS 95 boot diskette and type the following at
the <pre>A:\> fdisk /mbr</pre>.  This will allow your system to
boot into an existing DOS or Windows 95 system as it did before LILO
was installed.  You can then use the Red Hat Boot Diskette from v4.1
with the following parameters at the boot: prompt to you system on the
hard drive:

<pre>boot: rescue root=/dev/???? ro load\_ramdisk=0
</pre><br>
Where <pre>????</pre> is the root partition such hda2 in the 
example used in this document.

</ol>
<p>Once the installation procedure is completed, you are ready to reboot your
system and use Linux! 

<h3>After Installing Red Hat</h3>

<p>Now that you have installed Linux and are booting your system for the
first time, there are some useful things to know about using your
system such Understanding the LILO prompt, Logging In for the First
Time and Using RPM.

<a name="lilo"></a>
<h3>Understanding the LILO prompt</h3>
 
<p>If you have installed LILO to manage one or more operating systems,
the following useful things should be known:

<p>When you power-on or reboot the system you get the "LILO" prompt
which you have hopefully configured for a 30 second or so delay before
it boots the system. When LILO appears on the screen, if you do
nothing, the default operating system will boot at the prescribed time
out period. However, from LILO, you can control several aspects of how
Linux boots, or tell LILO to boot an alternative operating system. If
you wish to override the default behavior of LILO, pressing the
<pre>Shift</pre> key at the appearance of LILO will cause a "boot:"
prompt to appear. Pressing <pre>Tab</pre> at this prompt will produce a
list of available operating systems:

<pre>LILO boot: 
dos linux 
boot:
</pre> 
<p>This tells use that "dos" is the default operating system that will
boot if nothing is typed, or to boot Linux, type "linux" (without
the quotes). However LILO lets you pass overrides to the Linux kernel
which will override the kernels default behavior. For example, you may
have been experimenting with the start-up configuration files and done
something that prevents the system from coming up properly, so you
want to boot the system up to the point (but not after which) it reads
the configuration files. The override for this is "single":

<pre>boot: linux single</pre>
<br>
will boot the system into single user mode so you can take corrective
action.  This is also useful if your system won't come all the way up
to the login: prompt some other reason.

<a name="logging"></a>
<h3>Logging In the First Time</h3>

<p>Now that you are faced with the "login:"  prompt for the first time
you may be wondering how to get into the system. At this point on a
newly installed system, there is only one account to login to which is
the administrative account "root". This account is used to manage
your system and doing such things as configuring your system, adding
and removing users, add/removing software, etc. To login into the
account, type "root" (without the quotes) at the login: prompt and
hit enter. You will then be prompted for the password you entered
during setup. Enter that password at the password: prompt. The system
prompt <pre>[root@locahost] #</pre> will appear once you have successfully
negotiated the login. The system prompt tells you two things: you are
logged in as "root" and in this case your machine is called
"localhost". If you named your machine during the installation
process, then your machine name will appear instead of
"localhost". Now that you are logged in, you can use such commands
as <pre>ls</pre> to list files, <pre>cd</pre> to change directory, and <pre>more</pre> to look at
the contents of ASCII test files. The root account also has its own
home directory, <pre>/root</pre>. A home directory is where a valid system
accounts places you in the file system hierarchy once you have
successfully logged in. Some Unix systems use <pre>/</pre> instead, so don't
be fooled if you don't see any files if you type "ls"; there aren't
any in the root home directory.

<h4>Creating A User Account</h4>

<p>One of the first things you should do on a newly installed system is
to create a regular user account for yourself and plan on using the
root account only for administrative functions. Why is this important?
Because if you make a critical error in manipulating files you are
working on, you can damage the system. Another reason is that programs
run from the root account have unlimited access to the system
resources. If a poorly written program is run from the root account, it
may do unexpected things to the system (because a program run as root
has root access, a program run as a user has restricted resource
access) which will also damage it. To create a user account, you will
want to use the <pre>adduser</pre> and <pre>passwd</pre> commands:

<pre>[root@bacchus]# adduser hmp
Looking for first available UID...501 
Looking for first available GID...501 
Adding login: hmp...done. 
Creating home directory: /home/hmp...done 
Creating mailbox: /var/spool/mail/hmp...done 
Don't forget to set the password. 
$[$root@bacchus$]$\# passwd hmp 
New password: \textsl{new\_passwd} 
New password (again): \textsl{new\_passwd} 
Password Changed. 
passwd: all authentication tokens updated successfully
</pre> 
<p>The new account is now be created and is ready to use. Other things
that may need to be done as root are configuring X Window System,
configuring dialup services, and configuring printer services. These
topics are covered elsewhere.

<h4>Accessing the CD-ROM and Floppy</h4>

<p>One concept under Linux for accessing devices that confuses new users
is that things like CD-ROM disks and floppy diskettes are not
automatically made available when inserted in the drive. Linux
abstracts a device to be file (although in the case a special type of
file), And much like a word processor, you have to tell the system
that you want to open a file or close a file. The command used to open
(make a device available) a device is <pre>mount</pre> and the command to close
(tell the system you are no longer using a device) is <pre>umount</pre>. When
you open a device under Linux, you make it part of the directory tree
and navigate with the <pre>cd</pre>, <pre>ls</pre> and <pre>cp</pre> (copy) command normally. Red
Hat Linux suggests making removable or temporary devices available
under the directory <pre>/mnt</pre>. They create the directory <pre>/mnt/floppy </pre>by
default, but not <pre>/mnt/cdrom</pre>. So, the first time you want to access the
CD-ROM, you will need to create the directory <pre>/mnt/cdrom</pre> by typing:

<pre>[root@bacchus]\# mkdir /mnt/cdrom
</pre>
<p>Once you have created the directory, you can access the CD-ROM by typing: 

<pre>[root@bacchus]\# mount -t iso9660 -r /dev/\textsl{cdrom\_device} /mnt/cdrom
</pre>
<p>The break down of the command line above is this: the "-t" switch
tells the mount command the next argument is a file system type, in
this case "iso9660" is the format on most computer CD-ROM
diskettes. The "-r" is a read-only flag since the CD-ROM is
read-only. The next argument, <pre>/dev/{\sl cdrom\_device}</pre>, is the
device file you wish to open. If you performed a CD-ROM install, you
want to replace \textsl{cdrom\_device} with the designation of your
CD-ROM such as:
<p>
<table>
<tr>
<td><B>Device File</B></td> <td><B>CD-ROM type</B><br></td>
</tr>
<tr>
<td>hd[a,b,c,d]</td>    <td>for IDE/ATAPI CD-ROMs<br></td>
</tr>
<tr> 
<td>scd[0,1,2,...]</td> <td>for SCSI cdrom drives<br></td>
</tr>
<tr> 
<td>sbpcd</td>       <td>for Sound Blaster 2X speed drives<br></td>
</tr>
<tr> 
<td>mcd or mcdx</td>   <td>for Mitsumi 2X drives<br></td>
</tr>
</table>
<p>There are other drive types as well, but these are the most
common. Some literature refers to <pre>/dev/cdrom</pre> which is a symbolic
link. For example, if you have a Secondary IDE/ATAPI drive set as the
master drive, the command:

<pre>ln -sf /dev/hdc /dev/cdrom</pre><br>

will create a symbolic link so that the CD-ROM drive can be referred to as
<pre>/dev/cdrom</pre> as well as <pre>/dev/hdc</pre>. 
 
<p>Floppy drives are assessed in a similar manner: 

<pre>mount -t msdos /dev/fd0 /mnt/floppy</pre>
 
<p>Will make a floppy formatted under DOS in drive "a" available under
the directory /mnt/floppy. If you want to access the floppy diskette in the b
drive, substitute /dev/fd1 for /dev/fd0. 
 
<p>When you are finished with a device such as a CD-ROM or floppy diskette, it is
extremely important that you "close" the file before removing it
from the system. This needs to be done for a variety of reasons, but if you
don't and try to remove it you can make the system unstable and floppies may
get erased. To release a device from the file system, type: 

<pre>umount /dev/fd0 (to un-mount a floppy) 
umount /dev/cdrom (to un-mount a cdrom drive)
</pre>
<p>For more information on either of these commands, please see the man pages
(e.g., by entering <pre>man mount</pre>).
<a name="shut"></a>
<h3>Shutting Down Linux</h3>

<p>It is extremely important that the power is not simply shut off while Linux is
running. You can damage or even make the system un-bootable by doing so. The
proper way to shutdown Linux is to log in as root  and type: 

<pre>[root@bacchus]\# shutdown -h now
</pre><br> 
which will cause Linux to write out any files it still has in memory and close
down active programs cleanly. When you get the message <pre>The system
has halted</pre>, it is safe to turn the power off. If you want to reboot
the computer with out shutting of the power, use: 

<pre>[root@bacchus]\# shutdown -r now
</pre><br> 
which performs all the insectary shutdown work but directs
the computer to restart instead.


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Henry Pierce<BR> 
Published in Issue 18 of the Linux Gazette, May 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./xlock.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./sybase.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>

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

<center>
<H2>SQL Server and Linux: No Ancient Heavenly Connections, But...</H2>
<H4>By Brian Jepson,
<a href="mailto:bjepson@ids.net">bjepson@ids.net</a></H4>
</center>

<center>
<hr>
<strong>Prologue: Composite Conversations with Fictional
Detractors</strong>
<hr>
</center>

Rain fell on the concrete sidewalk, bringing out that
indescribable smell of the city. Mr Fiction and I were
enjoying the weather, sitting at a table under the newly
installed awning just outside of the AS220 cafe. We
<strong>should</strong> have been inside, perhaps building
more Linux boxen for the AS220 computer lab, or maybe
writing the two-way replication script between our in-house
Linux server and the machine that hosts our web pages
(<a href="http://www.ids.net/~as220">http://www.ids.net/~as220</a>). 
No, instead, we were breathing
in the Providence air, enjoying the smell and feeling of the
city before it got too hot, too muggy, before
<strong>we</strong> got too
lazy.<p>

Mr. Fiction isn't completely convinced about Linux; perhaps
he never will be. Nevertheless, he dutifully helps me when
I'm trying to bring up Linux on an old Compaq 386 with the 
weirdest memory chips, or when we need to build the kernel
yet again, because I've decided that I'm ready to trust
ext2fs file system compression or some such whim.<p>

This time, Mr. Fiction was baiting me. "Alright, Brian. How
can Linux help me here? I've got a client who is using
SQL Server on Windows NT for her company-wide databases. She'd
really like to publish this data on her Intranet using HTML
and CGI. While she's really happy with Microsoft for a database
server platform, she's not convinced that it's good as a
web server. We're looking into Unix-based solutions, and we
really need a platform that allows us to write CGI script
that can connect to the database server. But since Linux
doesn't have connectivity to..."<p>

That's when I had to stop him; Linux <strong>can</strong>
connect to Sybase SQL Server. What's more, it
<strong>can</strong> also connect to Microsoft SQL Server. Some
time ago, Sybase released an a.out version of their 
Client-Library (CT-Lib) for Linux. Greg Thain (<a
href="mailto:thain@ntdev1.sunquest.com">thain@ntdev1.sunquest.com</a>)
has converted the
libraries to ELF. As a result, anyone using an elf-based
Linux later than 2.0 should be able to link applications against these
libraries. There's a nice section on this issue that's available
in the Sybase FAQ, at <a
href="http://reality.sgi.com/pablo/Sybase_FAQ/Q9.17.html">http://reality.sgi.com/pablo/Sybase_FAQ/Q9.17.html</a>,
and the libraries themselves can be downloaded from:
<pre>
   <a href="ftp://mudshark.sunquest.com/pub/ctlib-linux-elf/ctlib-linux-elf.tgz">ftp://mudshark.sunquest.com/pub/ctlib-linux-elf/ctlib-linux-elf.tgz</a>.
</pre>

If you are using an a.out system, you can take your chances
with the libraries that Sybase originally released. These
are available at:
<pre>
   <a
href="ftp://ftp.sybase.com/pub/linux/sybase.tgz">ftp://ftp.sybase.com/pub/linux/sybase.tgz</a>
</pre>

<center>
<hr>
<strong>A Neon Joyride with CT-Lib</strong>
<hr>
</center>

If you've read this far, I'm going to assume that you have
access to an SQL Server. I've used these libraries
with the Sybase System 11 we have running at work on a
Solaris 2.4 system, and the examples for this article were
developed using Microsoft SQL Server 6.0 running on Windows
NT 4.0. If you don't have
SQL Server, but would like to experiment, you can download
an evaluation version of SQL Server Professional for Windows
NT at:
<pre>
   <a
href="http://www.sybase.com/products/system11/workplace/ntpromofrm.html">http://www.sybase.com/products/system11/workplace/ntpromofrm.html</a>
</pre>

If you do this, it goes without saying that you'll need another
computer (running Windows NT) that's connected to your Linux
box via TCP/IP. Sadly, there is no version of Sybase or Microsoft
SQL Server that runs on Linux. However, if you have
access to a machine that is running SQL Server, then you
will likely find this article interesting.<p>

In order to make use of these examples, you need to have
been assigned a user id and password on the SQL Server to
which you will connect.
You should also know the hostname of the server,
and most importantly, the port on which the server listens.
If you installed the server yourself, you will know all of
this. Otherwise, you will need to get this information from
your sysadmin or dba.<p>

The first thing to tackle is the installation and
configuration of the Client-Library distribution. The
<code>ctlib-linux-elf.tar.gz</code> file includes a top-level
<code>sybase</code> directory. Before you extract it, you
should probably pick a permanent home for it; common places
are <code>/opt</code> or <code>/usr/local</code>. When you
extract it, you should be sure that you are root, and make
sure your working directory is the directory that you've chosen. The process
might look something like this:

<pre>
   bash-2.00$ su
   Password: 
   bash-2.00# cd /usr/local
   bash-2.00# tar xvfz ctlib-linux-elf.tar.gz
</pre>

While you will be statically linking these libraries in with
application programs, any program that uses the Sybase
libraries will need to find the directory. There are two
ways to deal with this, and I usually do both. The first is
to create a user named <code>sybase</code>. This user's home
directory should be the Client-Library directory into which you
extracted <code>ctlib-linux-elf.tar.gz</code>. The user
won't need to log in, and I'm not aware of any
programs that need to <code>su</code> to that user id. I believe the user needs
to be there so that <code>~sybase</code> can be resolved to the
directory you chose. Here's the relevant line
from <code>/etc/passwd</code> for the sybase user:

<pre>
   sybase:*:510:100:SYBASE:/usr/local/sybase:/bin/true
</pre>

Of course, your UID and GID may differ, and you can
certainly use the <code>adduser</code> utility to add the
sybase user. The critical thing is to ensure that you've set
the home directory correctly.<p>

The second thing you can do to help applications find the
Sybase directory is to create an environment variable called
$SYBASE. This should simply include the name of the
Client-Library home directory:

<pre>
   bash-2.00$ export SYBASE=/usr/local/sybase
</pre>

The <code>interfaces</code> file included in the
top of the Client-Library home directory
(<code>/usr/local/sybase/interfaces</code> in this example) must be set up
correctly in order for anything to work. The interfaces file
allows your clients to associate a symbolic name with a
given server. So, any server you wish to query must be
configured in the interfaces file. If you've already got an
interfaces file in non-TLI format (this is the name of the
network API used by Sybase on Solaris, and the interfaces file differs
as well), you should be able to use it or adapt it. Even if
you don't, you can write your own entries. Here's a sample
entry (that's a tab on the second line, and it
<strong>is</strong> very important):
<pre>
   ARTEMIS
           query tcp ether artemis 1433
</pre>
The parts of this entry that you are concerned about are:<p>

<center>
<table border  bgcolor="#DDDDDD" width="80%">
<tr valign="TOP"><td>ARTEMIS</td>
<td>This is the name by which client programs will refer to the server. 
It doesn't have to be the same as the host name.</td></tr>
<tr valign="TOP"><td>artemis</td>
<td>This is the host name of the server.</td></tr>
<tr valign="TOP"><td>1433</td>
<td>This is the TCP/IP socket that the server listens on.</td></tr>
</table>
</center>
<p>
Here's an interfaces file that includes entries for both a
Sybase SQL Server (running on Solaris) and a Microsoft SQL
Server, running on Windows NT (comments begin with #). Note
that the entries ARTEMIS and
NTSRV refer to the same server:<p>

<center>
<table border  bgcolor="#DDDDDD" width="80%">
<tr><td>
<pre>
## DEV_SRVR on Sol2-5 (192.168.254.24)
##       Services:
##              query   tcp     (5000)

DEV_SRVR
        query tcp ether Sol2-5 5000

## NTSRV on artemis (192.168.254.26)
##       Services:
##              query   tcp     (1433)

NTSRV
        query tcp ether artemis 1433

## ARTEMIS on artemis (192.168.254.26)
##       Services:
##              query   tcp     (1433)

ARTEMIS
        query tcp ether artemis 1433
</pre>
</td></tr>
</table>
</center>

<center>
<hr>
<strong>SQSH - an Excellent Alternative to isql</strong><br>
(or is isql a poor alternative to SQSH?)
<hr>
</center>

SQSH is a freely redistributable alternative to the isql
program that is supplied with Sybase SQL Server. It's
basically a shell that makes it easy to send SQL statements
to the server. It's written by Scott Gray (<a
href="mailto:gray@voicenet.com">gray@voicenet.com</a>), a
member of the Sybase FAQ Hall of Fame. The SQSH home page is
at <a
href="http://www.voicenet.com/~gray/">http://www.voicenet.com/~gray/</a>
and includes the latest release of SQSH as well as the SQSH
FAQ and a lot of other information.<p>

SQSH can be compiled on Linux; this should be simple for anyone 
who is familiar with compiling C programs, such as the Linux kernel, 
Perl, or other tools you may have installed from source. The
first thing to do is to extract the SQSH archive, preferable
in some place like <code>/usr/src</code>. I usually do installations as
root; some people wait until just before the 'make install'
portion to become root. You can extract the distribution
with the following command:
<pre>
   bash-2.00# tar xvfz sqsh-1.5.2.tar.gz 
</pre>
And then you can enter the source directory with:
<pre>
   bash-2.00# cd sqsh-1.5.2
</pre>
(of course, if you are building a newer version, you will
need to use a different file name and directory)<p>

There are two files in the source directory that you must
read; README and INSTALL. If you'd like to compile SQSH with
bash-style command history editing, you'll need to get your
hands on the GNU Readline library, unless it's already
installed on your system. I believe that it's no longer
packaged as a separate library, and is now part of the bash
distribution, available at:
<pre>
   <a
href="ftp://prep.ai.mit.edu/pub/gnu/">ftp://prep.ai.mit.edu/pub/gnu/</a>
</pre>

Before you do anything, you'll need to make sure you set the
$SYBASE environment variable, which I discussed earlier in
this article. Then, you should run the configure script.
This process might look like:
<pre>
   bash-2.00# export SYBASE=/usr/local/sybase/
   bash-2.00# ./configure 
   creating cache ./config.cache
   checking for gcc... gcc
   [etc., etc.]
</pre>

If you've installed the GNU Readline library, and you want
to use it with SQSH (who wouldn't?) you should add the
following option to ./configure:
<pre>
   bash-2.00# ./configure -with-readline
</pre>

After you've run configure, you should examine the Makefile,
and follow the instructions at the top. Generally,
./configure does everything right, but you should
double-check. If everything looks okay, you can type:
<pre>
   bash-2.00# make
</pre>

And sit back and wait. If everything went fine, you should
have a new <code>sqsh</code> executable that you can install with:
<pre>
   bash-2.00# make install
</pre>

In order to run it, you must supply a server name (-S),
username (-U),
and password (-P). The server name corresponds to the name that
was set up in your <code>interfaces</code> file. Once you've
started sqsh, you can issue SQL commands. To send whatever
you've typed to the server, you can type <code>go</code> by
itself on a line. To clear the current query, you can type
<code>reset</code>. If you'd like to edit the current query,
you can type <code>vi</code>. Among many other features,
sqsh features the ability to use shell-style redirection after the
'go' keyword. Here's a sample session:<p>

<center>
<table border  bgcolor="#DDDDDD">
<tr><td>
<pre>
bash-2.00# sqsh -Ubjepson -Psecretpassword -SARTEMIS
sqsh-1.5.2 Copyright (C) 1995, 1996 Scott C. Gray
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
1> use pubs  /* the pubs sample database */
2> go
1> SELECT au_lname, city
2> FROM authors 
3> go | grep -i oakland
 Green                                    Oakland             
 Straight                                 Oakland             
 Stringer                                 Oakland             
 MacFeather                               Oakland             
 Karsen                                   Oakland             
1> sp_who
2> go       
 spid   status     loginame     hostname   blk   dbname     cmd             
 ------ ---------- ------------ ---------- ----- ---------- ----------------
      1 sleeping   sa                      0     master     MIRROR HANDLER  
      2 sleeping   sa                      0     master     LAZY WRITER     
      3 sleeping   sa                      0     master     RA MANAGER      
      9 sleeping   sa                      0     master     CHECKPOINT SLEEP
     10 runnable   bjepson                 0     pubs       SELECT          
     11 sleeping   bjepson                 0     pubs       AWAITING COMMAND

(6 rows affected, return status = 0)
1> 
</pre>
</td></tr>
</table>
</center>

<center>
<hr>
<strong>CGI, Sybperl and Linux: All the Colours in my Paintbox</strong>
<hr>
</center>

Getting back to Mr. Fiction's problem, we need to answer a big 
question; <i>How can we connect a Linux web server to
Sybase?</i> If you've done a lot of CGI programming, you've
probably, but not necessarily, used a little bit of Perl.
Perl is an excellent tool for CGI development; its modular
design makes it easy to extend. In the examples which
follow, we'll see how to use the CGI module in conjunction
with Sybperl. Combining these tools, we'll be able to easily
build CGI applications that can connect to an SQL Server
database.<p>

It's probably best to use a Perl that has been installed
from source. In the past, I have had trouble with binary
distributions, and so, I always install the Perl source code
and build it myself. You should obtain and extract the
following modules from CPAN (Comprehensive Perl Archive
Network):

<pre>
   <strong>CGI.pm:</strong>  <a
href="http://www.perl.com/CPAN/modules/by-module/CGI/CGI.pm-2.36.tar.gz">http://www.perl.com/CPAN/modules/by-module/CGI/CGI.pm-2.36.tar.gz</a>
   <strong>Sybperl:</strong> <a
href="http://www.perl.com/CPAN/modules/by-module/Sybase/sybperl-2.07.tar.gz">http://www.perl.com/CPAN/modules/by-module/Sybase/sybperl-2.07.tar.gz</a>
</pre>

Installing the CGI module is quite simple. You need to
extract it, enter the directory that's created, and follow
the instructions in the README file. For most Perl modules,
this will follow the form:

<pre>
   bash-2.00# tar xvfz MODULE_NAME.tar.gz
   bash-2.00# cd MODULE_NAME
   bash-2.00# less README
   [ ... you read the file ...]
   bash-2.00# perl Makefile.PL
   [ ... some stuff happens here...]
   bash-2.00# make
   [ ... lots of stuff happens here...]
   bash-2.00# make test
   [ ... lots of stuff happens here...]
   bash-2.00# make install
</pre>

You should double check to make sure that CGI.pm is not
already installed; if you install it, you should do it as
root, since it needs to install the module into your
site-specific module directories. Here's the commands I 
typed to make this happen for the CGI
extension (note that there are no tests defined for CGI.pm,
so I didn't need to do 'make test'):
<pre>
    bash-2.00# tar xvfz CGI.pm-2.36.tar.gz 
    bash-2.00# cd CGI.pm-2.36
    bash-2.00# perl Makefile.PL 
    bash-2.00# make
    bash-2.00# make install
</pre>

Once you've installed it, you can use it in your Perl
programs; do a 'perldoc CGI' for complete instructions.<p>

Installing Sybperl is a little more involved. 
If you don't want to build Sybperl yourself, you can
download a binary version from:
<pre>
   <a
href="ftp://mudshark.sunquest.com/pub/ctlib-linux-elf/sybperl.tar.gz">ftp://mudshark.sunquest.com/pub/ctlib-linux-elf/sybperl.tar.gz</a>
</pre>

If you do want to go ahead and build it yourself,
first extract it and enter the source directory:
<pre>
   bash-2.00# tar xvfz sybperl-2.07.tar.gz 
   bash-2.00# cd sybperl-2.07/
</pre>


Again, it's really important that you read the README file.
Before you run 'perl Makefile.PL,' you will need to set up a
couple of configuration files. The first is CONFIG. This
file lets you set the following parameters:<p>
<table border  bgcolor="#DDDDDD">
<tr valign="top"><td>DBLIBVS</td>
<td>The version of DBlib that you have installed. Under
Linux, only CTlib is available, so this should be set to
0.</td></tr>
<tr valign="top"><td>CTLIBVS</td>
<td>This should be set to 100, as indicated in the
file.</td></tr>
<tr valign="top"><td>SYBASE</td>
<td>This is the directory where you installed the
Client-Library distribution. It should be the same as
$SYBASE or ~sybase.</td>
<tr valign="top"><td>EXTRA_LIBS</td>
<td>These are the names of additional libraries that you
need to link against. The Sybase Client-Library distribution
typically includes a library called libtcl.a, but this
conflicts with the Tcl library installed under many versions
of Linux. So, this has been renamed libsybtcl.a in the Linux
version of CTlib. This option should also include libinsck.a. The
value for this configuration option should be set to
'-lsybtcl -linsck'.</td></tr>
<tr valign="top"><td>EXTRA_DEFS</td>
<td>It does not appear that this needs to be changed, unless
you are using Perl 5.001m, in which case you need to add
-DUNDEF_BUG.</td></tr>
<tr valign="top"><td>LINKTYPE</td>
<td>Under Linux, I am not aware of anyone who has managed to
get a dynamically loadable version of Sybperl to build.
I have not been able to get it to compile as a dynamic
module, so I always set this to 'static', which results in a
new perl executable being built.</td></tr>
</table><p>

Here's my CONFIG file:<p>
<center>
<table border  bgcolor="#DDDDDD" width="80%">
<tr><td>
<pre>
#
# Configuration file for Sybperl
#
# DBlibrary version. Set to 1000 (or higher) if you have System 10
# Set to 0 if you do not want to build DBlib or if DBlib is not available
# (Linux, for example)
DBLIBVS=0


# CTlib version. Set to 0 if Client Library is not available on your
# system, or if you don't want to build the CTlib module. The Client
# Library started shipping with System 10.
# Note that the CTlib module is still under construction, though the
# core API should be stable now.
# Set to 100 if you have System 10.
CTLIBVS=100

# Where is the Sybase directory on your system (include files &
# libraries are expected to be found at SYBASE/include & SYBASE/lib
SYBASE=/usr/local/sybase

# Additional libraries.
# Some systems require -lnsl or -lBSD.
# Solaris 2.x needs -ltli
# DEC OSF/1 needs -ldnet_stub
# See the Sybase OpenClient Supplement for your OS/Hardware
# combination.
EXTRA_LIBS=-lsybtcl -linsck

# Additional #defines.
# With Perl 5.001m, you will need -DUNDEF_BUG.
# With Perl 5.002, none are normally needed, but you may wish to
# use -DDO_TIE to get the benefit of stricter checking on the
# Sybase::DBlib and Sybase::CTlib attributes.
#EXTRA_DEFS=-DUNDEF_BUG
EXTRA_DEFS=-DDO_TIE


# LINKTYPE
# If you wish to link Sybase::DBlib and/or Sybase::CTlib statically
# into perl uncomment the line below and run the make normally. Then,
# when you run 'make test' a new perl binary will be built.
LINKTYPE=static
</pre>
</td></tr>
</table>
</center><p>

The next file that you need to enter is the PWD file. This
contains three configuration options; UID (user id), PWD
(password), and SRV (server name). It is used to run the
test, after the new perl binary is built. Here's my PWD
file:<p>
<center>
<table border  bgcolor="#DDDDDD" width="80%">
<tr><td>
<pre>
# This file contains optional login id, passwd and server info for the test
# programs:
# You probably don't want to have it lying around after you've made
# sure that everything works OK.

UID=sa
PWD=secretpassword
SRV=ARTEMIS
</pre>
</td></tr>
</table>
</center><p>

Now that you've set up the configuration files, you should
type 'perl Makefile.PL' followed by 'make'. Disregard any
warning about -ltcl not being found.
After this is done, you should type 'make test', which will build the new
Perl binary and test it. All of the tests may not succeed,
especially if you are testing against Microsoft SQL Server
(the cursor test will fail).<p>

When you are ready to install Sybperl libraries, you can
type 'make install'. 
You should be aware that the new binary will be
statically linked to the Client-Library, and will be
slightly bigger. If this offends you, you can rename the new
perl to something like sybperl and install it in the
location of your choice. The new perl binary is
<strong>not</strong> installed by default, so you can
install it wherever you want. You will not be able to use
the Sybperl libraries from your other version of Perl; you
will have to use the new binary you created.<p>

For simplicity's sake, let's assume that you are going to
rename the new binary to sybperl, and move to
<code>/usr/local/bin/sybperl</code>. The README file includes alternate
instructions for installing the new binary. The manual is
included in the <code>pod/</code> directory under the Sybperl source
code. You can also read the documentation with 'perldoc
Sybperl'.<p>

Here's a sample Perl program that uses CGI and Sybase::CTlib to 
give the users the ability to interactively query the authors
table that is included with the pubs sample database:<p>
<center>
<table border  bgcolor="#DDDDDD" width="80%">
<tr><td>
<xmp>
#!/usr/local/bin/sybperl

use CGI;
use Sybase::CTlib;

# This is a CGI script, and it will not have the $SYBASE
# environment variable, so let's help it out...
#
$ENV{SYBASE} = '/usr/local/sybase';

# Get a "database handle", which is a connection to the
# database server.
#
my $dbh = new Sybase::CTlib('bjepson', 'secretpassword', 'ARTEMIS');

# Instantiate a new CGI object.
#
my $query = new CGI;

# Print the header and start the html.
#
print $query->header;
print $query->start_html(-title   => "Sybperl Example",
                         -bgcolor => '#FFFFFF');

# Put up a form, a prompt, an input field, and a submit button.
#
print qq[<h1>Sybperl Example</h1><hr>];
print $query->startform;

print qq[Enter part of an author's name: ];
print $query->textfield( -name => 'query_name' );
print $query->submit;

# End the form.
#
print $query->endform;

# If the user entered an author name, find all authors
# whose first and/or last names match the value.
#
if ($query->param('query_name')) {

    # Use the pubs database.
    #
    $dbh->ct_sql("use pubs");

    # Get the value the user typed
    #
    $query_name = $query->param('query_name');

    # Find all of the matching authors. This search
    # is case-sensitive.
    #
    my $sql = qq[SELECT au_fname, au_lname ] .
              qq[FROM authors ] .
              qq[WHERE au_fname LIKE '%$query_name%' ] .
              qq[OR    au_lname LIKE '%$query_name%' ] .
              qq[ORDER BY au_lname, au_fname];
    my @rows = $dbh->ct_sql($sql);

    # Iterate over each row and display the first
    # and last name in separate table cells.
    #
    print qq[<table border>];
    print qq[<th>First Name</th><th>Last Name</th>];
    my $thisrow;
    foreach $thisrow (@rows) {

        # Each row is a reference to an array, which
        # in this case, contains two elements; the
        # values of the first and last names.
        #
        my $au_fname = ${$thisrow}[0];
        my $au_lname = ${$thisrow}[1];
        print qq[<tr><td>$au_fname</td><td>$au_lname</td></tr>];
    }
    print qq[</table>];

}

# End the html.
#
print $query->end_html;
</xmp>
</td></tr>
</table>
</center><p>

And here's an example of the program's output:<p>
<img src="./gx/sybase.gif"><p>

<center>
<hr>
<strong>Everything Has Got to be Just Like You Want it To</strong><br>
(or, things are more like they are now than they ever were before)
<hr>
</center>

I've found the Sybase libraries for Linux to be quite
useful. I find myself in a lot of places where either Sybase
or Microsoft SQL Server sees heavy use. It's nice to be able
to connect, especially when dialing in over a modem. I've
found that sqsh performs much better making the connection
over dialup than isql running on a remote machine, even when
I'm connected with rlogin.<p>

I hope these ramblings have been enjoyable for you; I
think Mr. Fiction's head is spinning, but it's all for the
best. We've had some of the best doctors in the world look
at it, and while no one can agree on exactly
<B>when</B> it will stop spinning, they all agree
that it looks much better that way.<p>

Brian Jepson, <a
href="mailto:bjepson@ids.net">bjepson@ids.net</a>

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, Brian Jepson<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./redhat.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./wkndmech.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 

<H4>
&quot;Linux Gazette...<I>making Linux just a little more fun!</I>&quot;
</H4>
<P><HR><P>
<!--================================================================ -->

<CENTER>
<IMG SRC="../gx/fisk/wkndMech.gif" ALIGN=BOTTOM WIDTH=397 HEIGHT=150>
<H1>Welcome to The Linux Weekend Mechanic!</H1>
<H2>Published in the June 1997 Edition of the Linux Gazette</H2>
<FONT SIZE="2"><B>
Copyright (c) 1997 John M. Fisk &lt;fiskjm@ctrvax.vanderbilt.edu&gt;<BR>
The Linux Gazette is Copyright(c) 1997 <A HREF="http://www.ssc.com/">
Specialized Systems Consultants Inc.</A>
</B></FONT>
</CENTER>

<P><HR>

<H2>Time To Become... <I>The Linux Weekend Mechanic!</I></H2>
<TABLE>
<TR>
    <TD ALIGN=TOP>
    <IMG SRC="../gx/fisk/mechanic.gif" ALIGN=BOTTOM WIDTH=147 HEIGHT=66>

    <TD ALIGN=LEFT VALIGN=TOP>
    You've made it to the weekend and things have finally slowed down.  You
    crawl outa bed, bag the shave 'n shower 'cause it's Saturday, grab that
    much needed cup of caffeine (your favorite alkaloid), and shuffle down
    the hall to the den.  It's time to fire up the Linux box, break out the
    trusty 'ol Snap-On's, pop the hood, jack 'er up, and do a bit of
    overhauling!
</TABLE>

<P><HR><P>

<!-- TABLE OF CONTENTS ================================================ -->
<H2>Table of Contents</H2>

<UL>
    <LI><A HREF="#welcome">Welcome to the June 1997 Weekend Mechanic!</A>
    <LI><A HREF="#wallpapering">Wallpapering with XV:  A Followup</A>
    <LI><A HREF="#vim-perks">VIM Programming Perks</A>
    <LI><A HREF="#closing">Closing Up The Shop</A>
</UL>
<!-- END TABLE OF CONTENTS ============================================ -->

<P><HR><P>

<!-- WELCOME SECTION ================================================== -->
<H2><A NAME="welcome"><IMG SRC="../gx/fisk/attndant.gif" WIDTH=129 HEIGHT=99>
Welcome to the June 1997 Weekend Mechanic!</A></H2>

<P>
Hey, c'mon in!

<P>
Thanks for dropping by!  How y'all been doing?

<P>
So... everyone survive the semester?!  I just finished taking my last final a
day or so ago AND managed to find work (with the folks in Biomedical
Informatics at Vanderbilt Univ. Medical Center :-) within 24 hours of
finishing up.  PHEW!!  Nice to be done.

<P>
Anyway, I'm going to apologize for the potentially &quot;dry&quot; topics in
this month's WM.  I've not been doing much besides programming, cramming, and
making occasional trips to the 'fridge, restroom, and bedroom (pretty much in
that order...).  I ended up doing a fair amount of programming for a couple
classes and got VERY acquainted with a number of the programming tools available
under Linux -- VIM, ctags, xxgdb, ddd, and so forth.  Since this is what I've
been doing of late, I thought that this might be an appropriate topic.  The
proviso is that you understand that you take this strictly as a novice's
introduction to a couple of these tools.

<P>
How's <I>that</I> for being wishywashy... :-)

<P>
Anyway, I've found a few useful things along the way and thought someone might
enjoy my sharing them.

<P>
Also, I want to continue to thank all of you who've taken the time to write
and offer comments and suggestions.  Believe me, I don't claim extensive
knowledge or expertise in most of the things I write about -- these are mostly
discoveries and ideas that I've hit upon and am sharing in the hopes that they
might be helpful.  I welcome corrections, clarifications, suggestions, and
enhancements!  Several of you wrote in with regards to <B>wallpapering using
XV</B> which I'll be sharing below.

<P>
Well, thanks again for stopping by!  Hope you enjoy :-)

<P>
John M. Fisk<BR>
Nashville, TN<BR>
Thursday, 8 May 1997

<!-- END WELCOME SECTION ============================================== -->

<P><HR><P>

<!--  ARTICLE ====================================================== -->
<H2><A NAME="wallpapering"><IMG SRC="../gx/fisk/desklamp.gif" WIDTH=79 HEIGHT=99
ALIGN=BOTTOM></A>Wallpapering with XV:  A Followup</H2>

<P>
My sincerest thanks to <B>Brent Olson, Peter Haas, and Bill Lash</B> for
taking the time to write and offer these suggestions.  I tried tinkering
around with a few of these suggestions and they work like a champ!  Here they
are:

<BLOCKQUOTE>

<P><HR><P>

Date: Wed, 02 Apr 1997 09:24:59 -0800<BR>
From: Brent Olson &lt;brent@primus.com&gt;<BR>
To: fiskjm@ctrvax.Vanderbilt.Edu<BR>
Subject: re:  reducing the colors in a background<BR>

<P>
You've probably already been told this, but in the LG article relating
to reducing the number of colours used in the background, there is no
need to convert the picture first.  It can be done on the fly:

<PRE>
xv -root -quit -maxpect -ncols 16 filename.gif
</PRE>

<P>
Works great on my lousy 8-bit NCD display at work.

<P>
Brent Olson<BR>
mailto:  brent@primus.com

<P><HR><P>

Date: Tue, 08 Apr 1997 08:42:01 +0200 (MET DST)<BR>
From: hap@adv.magwien.gv.at<BR>
To: fiskjm@ctrvax.Vanderbilt.Edu<BR>
Subject: xv - interesting options<BR>

<P>
There are another two interesting options of xv:

<PRE>
-random filepattern   selects a random picture of given given filepattern 
-ncols #colors        to limit number of used colors
</PRE>

<P>
An example out of my .fvwm2rc95:

<PRE>
xv -quit -root -ncols 16 -random /var/X11R6/lib/xinit/pics/*.gif
</PRE>

<P>
Regards, Peter
<PRE>
-- 
 (~._.~)    From the keyboard of Peter Haas (hap@adv.magwien.gv.at)
 _( Y )_    Located at MA14-ADV, Rathausstr.1, A-1082 Wien, Austria
()_~*~_()   Phone +43-1-4000/91126   FAX +43-1-4000/7141
 (_)-(_)    &quot;Big iron&quot; division
</PRE>

<P><HR><P>

From lash@tellabs.com Thu Apr 24 21:20:39 1997<BR>
Date: Thu, 24 Apr 1997 17:52:27 -0500<BR>
From: Bill Lash &lt;lash@tellabs.com&gt;<BR>
To: fiskjm@ctrvax.Vanderbilt.Edu<BR>
Subject: Limiting colors with XV<BR>

<P>
John,

<P>
I read your article on wallpapering with XV.  You suggest choosing
images with a limited number of colors.  You go on to suggest several
options, but you missed a simple solution.  You can tell XV how
many colors to use in displaying the picture using the -ncols option.

<P>
At work, I usually run with a background of 100 colors on an 8-bit
pseudocolor display with the following command line:

<PRE>
xv -root -quit -max -rmode 5 -ncols 100 image.gif
</PRE>

<P>
Bill Lash<BR>
lash@tellabs.com
</BLOCKQUOTE>

<P><HR><P>

<P>
Again, guys, thanks for writing.  Happy wallpapering!

<P>
John

<!-- END ARTICLE ================================================== -->

<P><HR><P>

<!--  ARTICLE ====================================================== -->
<H2><A NAME="vim-perks"><IMG SRC="../gx/fisk/desklamp.gif" WIDTH=79 HEIGHT=99
ALIGN=BOTTOM>VIM Programming Perks</A></H2>

<P>
Well, as I mentioned above, I ended up spending a good deal of time
programming this semester.  Our software engineering team designed and coded a
simple FORTRAN 77 spell checker in C++.  Thing was, the analysis and design
phase consumed 11 of the 14 weeks of the semester AND it was done using
Structured Analysis.  Problem was, we had decided to code this thing in C++
and so ended up almost completely redesigning it using OO Analysis and Design 
during the last couple weeks (when we were <I>supposed</I> to be doing nothing
but coding :-).

<P>
Anyway, this meant a LOT of late nights -- integrating everyone's code got a
bit hairy, since none of us had much experience with team coding.  I was
mighty thankful for the development tools under Linux.  I spent the better
part of 13 hours one Saturday debugging our first effort at integrating the
code -- chasing down Segmentation Faults and infinite loops :-)

<P>
Ahhh... the stuff of programming... :-)

<P>
Along the way I learned a few interesting and nifty things about the VIM
editor, which has been my 'ol workhorse editor for the past couple years now.
I wanted to give this thing another plug as I think it's one of the best
things since sliced bread.  I'll admit that the <B>emacsen</B>, including the
venerable <B>XEmacs</B>, are a LOT more powerful and full featured.  But,
having developed the finger memory for the &quot;one-key-vi-commands&quot;
I've found that I can get a lot of work done fast.  I'd like to 'tip the hat
at this point to <B>Jesper Pedersen and Larry Ayers</B> both of whom have
written very nice articles on emacs and XEmacs in past issues of the LG and
the Linux Journal.  I'd encourage anyone interested in these to have a look at
these articles.  I'll also be mentioning XEmacs below and give you a screen
shot of the latest 19.15 iteration.

<P>
Anyway, here's a few (hopefully) interesting notes and ideas for using the VIM
editor!  

<H3>GVIM -- Going Graphical!</H3>

Yup, that's right!  VIM has gone GUI :-)

<P>
I recently downloaded and compiled the latest beta version of VIM which is
version 5.0e.  If you have the Motif development libraries you can compile VIM
with a Motif interface -- gvim.  This rascal is pretty good sized and not
exactly fleet of foot.  It's a bit slow getting out of the gate on startup and
so it's probably prudent to heed the Makefile suggestions and compile separate
versions of VIM both with and without X support.  I tried starting versions of
vim (at the console) compiled with and without X support and the extra X
baggage definitely slows things down.

<P>
A bit later on in this article I've provided several screen dumps of gvim as
well as a couple other editors and the xxgdb and ddd debuggers.  If you're the
impatient or curious type, please feel free to jump ahead and have a look.
Also, I've included a couple links for additional information.

<P>
Actually, VIM has provided a GUI since around version 4.0.  I've been using
this for some time now and find that it adds a several enhancements over vim
at the console:

<UL>
    <LI>it has a reasonably handsome and functional scrollbar
    <LI>mouse support is automatic and allows VERY easy cursor movement, text
    highlighting, and cut-and-paste operations
    <LI>it provides a customizable menubar
    <LI>it intelligently understands the movement keys -- Home, End, Page Up,
    Page Down, arrow keys -- <I>even</I> in insert mode
    <LI>depending on how you have your .Xmodmap set up, it will intelligently
    handle Back Space, and Delete keys AND you can delete backwards over
    multiple lines!
</UL>

This last point is wonderful.  Anyone who's ever tried to backspace onto the
end of a previous line and gotten that miserable BEEP! will appreciate this.
What's particularly nice about the graphical version of vim is that it
provides several basic features of a GUI style editor while retaining the
speed and flexibility of vi.

<H3>The <I>Big</I> News:  Syntax Highlighting!</H3>

This is truly a godsend and was one of the features that was definitely on the
'ol wish list!  VIM now provides color syntax (lexical) highlighting for a
variety of languages including C, C++, HTML (which I'm using right now...),
Java, Ada95, FORTRAN, Perl, and TeX.  But that's not all...!

<P>
(...this is like the guy hawking the $2.99 Ginzu knives, &quot;<I>they slice,
they dice, here... I can cut through a cinder block wall, this lamp post, a
street sign, AND the hood of this guy's car and never loose an edge!  But 
that's not all... if you act right now...</I>&quot;)

<P>
You get the point.

<P>
What I was going to say was that vim also provides syntax highlighting for
shell scripts (VERY COOL!), makefiles, and the VIM help files (which you'll
see here in just a bit).  All in all, this is pretty nice.  I've been
tinkering around with this a bit and am really starting to like it.  Be aware
that the highlighting isn't quite as &quot;intelligent&quot; as with something
like XEmacs -- it doesn't provide the same degree of sophistication.  Still,
it's very good and, being an order of magnitude smaller and a good deal more
nimble, it's well worth trying.

<P>
VIM installed the support files for syntax highlighting (at least on my
system) under /usr/local/share/vim/syntax.  There are individual files for the
various languages and file types as well as the syntax.vim file that does a
lot of the basic coordination.  You can tinker around with these to get the
&quot;look-n-feel&quot; that you want.  Keep in mind that to get automatic
syntax highlighting you'll need to add something like this to your ~/.vimrc or
~/.gvimrc file:

<PRE>
&quot; Enable automatic color syntax highlighting on startup
source /usr/local/share/vim/syntax/syntax.vim
</PRE>

<P>
I have to admit that I wrestled with this for longer than I should have trying
to figure out how this was done.  Hopefully, this will save you some trouble
:-)

<P>
Again, I've included screen dumps below so that you can see what this looks
like.  In addition, the VIM home page has a couple nice screen shots that you might
want to have a look at.  I should add that syntax highlighting is
individually configurable for the console and the X version.  Now, before you
go dashing off and &quot;<I>rushing in where angels fear to tread...</I>&quot;
you will probably want to have a look at the help files or documentation -- it
gives some basic guidelines for customizing this stuff.

<P>
And speaking of which...

<H3>Help is on the way!</H3>

One of the coolest and most useful things about VIM is the mind numbing amount
of documentation that comes with it.  There's a small library of support
documents covering everything from a blow-by-blow description of <I>each</I>
feature and command to information about showing thanks by providing help for
a needy Uganda.

<P>
And what's more, all of this is provided on-line.  In command mode you simply
type in:

<PRE>
:help
</PRE>

and the window (under gvim) splits and loads up the top level help file.  This
is your gateway to knowledge.

<P>
&quot;<I>...use the Source, Luke</I>&quot;

<P>
The help system is set up in a hypertext fashion.  If you've enabled automatic
syntax highlighting then even the help system is colorized.  To follow a link
you can either hit the letter &quot;g&quot; and then single click with the
mouse on a topic, or you can move the cursor to that topic and hit
&quot;Ctrl-]&quot; (hold down the control key and hit the left square bracket
key -- &quot;]&quot;).  To get back up to where you started, hit
&quot;Ctrl-t&quot;.

<P>
It's that simple :-)

<P>
IMHO, this is one of the most laudable features of VIM.  The documentation is
generally well written and reasonable understandable.  It is VERY thorough
and, since it's available from within the editor, provides a high level of
usability.  It also provides a &quot;Tips&quot; section as well as numerous
&quot;How Do I...?&quot; sections.  It's Must Reading...

<H3>Ask &quot;<I>The Man!</I>&quot;</H3>

Another really useful thing to try is accessing manual pages from within vim.
Say you were writing a shell script and needed to quickly look up something in
the bash manual page or you were setting up a test condition and couldn't
remember the syntax for the &quot;greater than&quot; test, all you have to do
is:

<PRE>
:!man test
</PRE>

and <I>presto!</I>, information.  It's instant gratification at its
best... :-)

<P>
To be honest, I've found that this works a LOT better at the console than
under gvim, although the exact reason eludes me.  Under gvim, I get the
following error:

<PRE>
WARNING! Terminal is not fully functional
</PRE>

got me on this one...

<P>
My suspicion is that it has to do with the termcap stuff built into the
editor.  Forward movement down the manual page (hitting the space bar) is
reasonable smooth, but backward movement is very jerky and screen redraws are
incomplete.  Still, if you can live with that you'll find this VERY
convenient.

<H3>TAG, You're It!</H3>

This is another one of those things that makes life SO much easier.  If you've
not used tags before then brother, it's time to start!

<P>
Basically what tags allow you to do is find that point at which a function or
variable is declared.  For example, suppose you ran across the following
snippet of code:

<PRE>
    HashTable HTbl;
    HTbl.Load(&quot;hash.dat&quot;);
    found = HTbl.Lookup(buf);
    .
    .
    .
</PRE>

and were interested in finding out how the Load method was implemented.  To
jump to the point in the file where this is defined simply move the cursor so
that it sits on &quot;Load&quot;:

<PRE>
    HTbl.Load(&quot;hash.dat&quot;);
         ^
</PRE>

and hit &quot;Ctrl-]&quot; (hold down the control key and hit the right square
bracket key -- &quot;]&quot;).  Beauty of this is, that even if the definition
is not in the file you're currently working on, vim will load up the needed
file and position the cursor at the first line of the function definition.

<P>
This is seriously cool!

<P>
When you're ready to move back to your original location, hit
&quot;Ctrl-t&quot; (which moves you back up the tag stack).  I've been using
<B>Exuberant Ctags, version 1.5, by Darren Hiebert</B> for the past little bit
now and really like this a lot.  As the name implies, it does a pretty
thorough job of scouring your source files for all sorts of useful stuff --
function declarations, typedefs, enum's, variable declarations, macro
definitions, enum/struct/union tags, external function prototypes, and so
forth.  It continues on in the time honored tradition of providing a bazillion
options, but not to fear:  it's default behavior is sane and savvy and
provides a very nice OOBE*.

<P>
<I>*(Out Of Box Experience)</I>

<P>
You should be able to find Darren's Exuberant Ctags (ctags-1.5.tar.gz was the
most recent version on sunsite and its mirrors at the time of writing) at any
sunsite mirror.  I happened across it in the Incoming directory.  You'll
probably find is somewhere under the /devel subdirectory now.  If you get
stuck and really can't find it, drop me a note and I'll see what I can do to
help.  This one is definitely worth having.

<P>
Oh, BTW, using ctags is child's play:  simple give it the list of files that
you want it to search through and it'll create a &quot;tags&quot; file in your
current directory.  Usually, this is something like:

<PRE>
ctags *.cc *.h
</PRE>

if you happen to be doing C++ programming, or:

<PRE>
ctags *.c *.h
</PRE>

if you're programming in C.  That's all there is to it!  Keep in mind that you
can use tags without having to position the cursor on top of some function or
variable.  If you'd defined a macro isAlpha and wanted to jump to your
definition, then simply type in:

<PRE>
:ta isAlpha
</PRE>

and vim will take you to that point.  How 'bout that for easy?  There's a good
deal more info on using tags in the VIM online documentation.  Browse and
enjoy!

<H3>Using the <I>Real</I> Windows...</H3>

Another very handy item that gvim (and vim) provides is multiple windows.
This makes cutting and pasting from one file to another (or from one section
of a file to another) quite easy.  It also is nice if you're reading one file
and editing another (for example, reading an INSTALL file while making changes
to the Makefile).

<P>
To pop up a second (or third, or fourth...) window with a specific file,
simply use something like:

<PRE>
:split ctags.README
</PRE>

This would create a second window and load up the ctags.README file.  If you
want a second window with the current file displayed there, then simply use:

<PRE>
:split
</PRE>

and a second window will be created and the current file loaded into that
window.  Under gvim, moving the cursor from one window to the other is as
simple as mouse clicking in the desired window.  You can also use the
keystrokes

<PRE>
Ctrl-w j (hold down control and hit &quot;w&quot;, then hit j)
Ctrl-w k (hold down control and hit &quot;w&quot;, then hit k)
</PRE>

to move to the window <B>below</B> or the window <B>above</B> the current
window respectively.  But, use the mouse... it's a lot easier :-)

<P>
Resizing the windows is nicely handled using the mouse:  simply click
anywhere on the dividing bar between the two windows and drag the bar to
whatever size you want.  This is really handy if you are using one file as an
occasional reference but want to edit in a full window.  You can resize the
reference file down to a single line when it's not needed.

<P>
Again, there's a lot more information in the online help about using multiple
windows.

<H3><I>SHHHHHhhhh.....!</I> Let Me Tell You A Secret!</H3>

Here's a little something that ought to part of one of those blood oath,
&quot;cross-my-heart-and-hope-to-die&quot;, secret society initiations into
the &quot;Secret Lodge of Some Large North American Mammal Society&quot;

<P>
Ready...? (look furtively around with squinty, shifty gaze...)

<P>
(... the clock ticks loudly in the other room, somewhere in the distance a dog
barks, the room falls into a stifling hush...)

<P>
He clears his throat loudly and in a harsh whisper exclaims...

<P>
&quot;The &quot;%&quot; sign expands to the current buffer's filename!&quot;

<P>
Phew!  Glad that's over... :-)

<P>
Yup, with this little tidbit you can do all sorts of cool and groovy things.
Like what you ask...?  (you knew this was coming, didn't you... :-)

<DL>
    <DT><B>RCS checkin and checkout</B><P>
    <DD>I won't go into using RCS for version control except to say that doing
    checkin's and checkout's from within VIM is VERY easily accomplished doing
    something like:

    <PRE>
    :w!
    :!ci -l %
    :e %
    </PRE>

    <P>
    So what's going on...?  Well, the first line writes the current buffer to
    file, the real good stuff happens on the second line in which you use the
    RCS <B>ci</B> to checkin and lock the current file.  And finally, since
    the checkin process may have altered the file if you've included
	&quot;Header&quot;, &quot;Id&quot;, &quot;Log&quot;, etc.,
    reloads the file with the new RCS information (if any).

    <P>
    Now, for all you VIM jockeys out there, the handy thing to do is use
    &quot;map&quot; to bind this sequence to a single keystroke.  I've bound
    this to Alt-r and it makes the whole operation smooth and painless.
    <P>

    <DT><B>Printing that 'ol file</B><P>
    <DD>This is another favorite trick.  To print the current file from within
    vim simply:

    <PRE>
    :w!
    :!lpr %
    </PRE>

    what could be easier? :-)

    <P>
    Seriously, this is a very convenient means of getting a hard copy of your
    current file.  The one caveat to remember is that you'll probably want to
    commit the contents of your current editing buffer to file <I>before</I>
    you try to print it.

    <P>
    I've been using the <B>apsfilter</B> program for last year or so and
    absolutely love it.  It is a series of shell scripts that automate the
    process of printing.  Basically, it uses the <B>file</B> command to
    determine the type of file to print and then invokes lpr with the
    appropriate print filter.  As a backend, it uses the <B>a2ps</B> program
    to format ASCII into Postscript and then uses Ghostscript to do the actual
    printing.  Now, using something like:

    <PRE>
    lpr [filename]
    </PRE>

    transparently formats the file to Postscript and sends it to the printer.
    I've been quite pleased with this.  You should be able to find this and
    similar programs at any of the sunsite FTP sites under the
    /pub/Linux/system/print (printer?, printing?) subdirectory (sorry, I'm not
    connected to the 'net at the moment and can't recall the exact
    subdirectory name off the top of my head :-).

    <P>
    Also, I've played with the a2ps program itself and found all sorts of cool
    and nifty options -- single page/double page printing, headers, boundary
    boxes, setting font sizes, and so forth.  I particularly like being able
    to set the font size and header information.  And, as always, IHABO*.

    <P>
    *(<I>It Has A Bazillion Options</I>)
    <P>

    <DT><B>Word Counts...</B><P>
    <DD>If you hit the Ctrl-g key combo, VIM prints the filename, number of
    line, and the current position in the file on the bottom status line.
    However, if you want a word or byte count, simply invoke the <B>wc</B>
    program on the file:

    <PRE>
    :w!
    :!wc %
    </PRE>

    which will print out the file's line, word, and byte count.
    <P>
</DL>

<P>
You get the picture.  Basically, any command that takes the form

<PRE>
command [-options] filename
</PRE>

can be used from within VIM doing something like:

<PRE>
:! command [-options] filename
</PRE>

<P>
Note that there are a couple other handy little items you might be interested
in.  If you want to include the contents of a file in the current buffer, OR
if you want to capture the output of a command into the current buffer (for
example, a directory listing), then use:

<PRE>
:r a2ps.README
:r! ls /usr/local/lib/sound/*.au
</PRE>

<P>
The first command would insert the contents of the a2ps.README file in the
current buffer wherever the cursor was located; the second command would
insert the output of an <B>ls</B> listing for the /usr/local/lib/sound/
directory.  That is, you can use this second form for any command that
<I>prints its output to standard out</I>.

<P>
This discussion leads directly into the question of spell checking the
current buffer.  And the answer that <I>I've</I> got is that I haven't found
an easy or convenient way to do this.  I ran across a key mapping definition a
while ago that basically copied the current file to the /tmp directory, ran
ispell on this file, and then copied this file back over the original.  It
worked, but it was clunky.  I've also tried, with some modest success, to do
something like:

<PRE>
:w!
:! ispell %
:e %
</PRE>

which basically commits the current buffer to file, starts a shell and runs
ispell on the file, and then reloads that file once the spell checking is
done.  Thing is, this works at least reasonably well running vim in text mode;
under gvim, ispell gives an error message to the effect:

<PRE>
Screen too small:  need at least 10 lines
Can't deal with non-interactive use yet.

1 returned
</PRE>

<P>
Ideas anyone?

<H3>Running Make!</H3>

The specifics of setting up a makefile are, in academic parlance,
&quot;<I>beyond the scope of this article...</I>&quot;.  (You can, however,
find a good deal of information about makefiles using <B>info</B>; or, more
appropriately, <B>O'Reilly &amp; Assoc.</B> put out a very nice little book
on managing projects using make -- hit up you friendly neighborhood librarian
or find it at your favorite Linux bookstore!)

<P>
I've found that gvim, in particular, provides excellent support for make.
Basically, once you have a working makefile, simply invoke it using:

<PRE>
:make
</PRE>

As the build process proceeds, you'll see all sorts of nifty messages go
whizzing by.  If make terminates on an error, gvim will very kindly load up
the errant file and position the cursor at the line that was implicated as
being the culprit.  This is VERY handy.  Also, if multiple errors are
encountered, you can move from one error to the next using:

<PRE>
:cn
</PRE>

which advances to the next error.  For some reason, the console version of vim
hasn't worked quite a well as gvim.  It doesn't always automatically go to the
first error encountered, although using the &quot;:cn&quot; command seems to
work fine.

<H3>And So Forth...</H3>

<P>
Phew!  How's everyone doing...? Still hanging in there?  I'm almost done here
so stay tuned. :-)

<P>
There are LOTS of other rather nifty features that vim/gvim provides.  
The adventurous will find all sorts of goodies to experiment with in the
online documentation.  Let me call your attention to just a few more and we'll
wrap this up and have a look at some screen shots!

<P>
<B>Unlimited Undo</B>

<P>
The way vim is (generally) configured, it keeps track of ALL the editing
changes you've made to a file.  So, after an hour's worth of editing, should
you decide that <I>War And Peace</B> really didn't need a another chapter,
then you can back out of all your changes by repeatedly hitting the
&quot;u&quot; key.  This reverses the changes you've made to the file in a
sequential fashion.  Now for a major back out, you'd have done well to check
the original file in under RCS and then retrieve this version if you decide
not to keep your current changes.  Still, you can back all the way out if you
don't mind hitting &quot;u&quot; for a while... :-)

<P>
<B>Compressed File Support</B>

<P>
One of the other nice things introduced into vim around version 4.0 was
support for editing compressed files.  Essentially, what this involves is
transparent uncompressing of the file upon the start of editing and
recompressing the file when vim terminates.  This is quite helpful as it
allows you to save a LOT of space if you work with a large number of text
files that can be compressed.  You may also be aware of the fact that the
pager &quot;less&quot; has this support built in and so do most all of the
&quot;emacsen&quot;.

<P>
The support for this is configured in using an entry in your ~/.vimrc or
~/.gvimrc.  I use the stock vimrc example that comes with the distribution:

<PRE>
&quot; Enable editing of gzipped files
&quot;    read: set binary mode before reading the file
&quot;          uncompress text in buffer after reading
&quot;   write: compress file after writing
&quot;  append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre      *.gz set bin
autocmd BufReadPost,FileReadPost    *.gz '[,']!gunzip
autocmd BufReadPost,FileReadPost    *.gz set nobin

autocmd BufWritePost,FileWritePost  *.gz !mv &lt;afile&gt; &lt;afile&gt;r
autocmd BufWritePost,FileWritePost  *.gz !gzip &lt;afile&gt;r

autocmd FileAppendPre           *.gz !gunzip &lt;afile&gt;
autocmd FileAppendPre           *.gz !mv &lt;afile&gt;r &lt;afile&gt;
autocmd FileAppendPost          *.gz !mv &lt;afile&gt; &lt;afile&gt;r
autocmd FileAppendPost          *.gz !gzip &lt;afile&gt;r
</PRE>

<P>
I still haven't completely gotten the hang of the autocmd stuff -- I suspect
that there's all sorts of wild and fun things that you can do with this.
Ahhh... places to go and things to do...!

<P>
<B>Auto-Fill and Auto-Comment Continuation</B>

<P>
Here's yet <I>another</I> nifty little feature that makes life fuller and
richer... :-)

<P>
You can set a text width variable in your ~/.gvimrc file that will do
auto-fill (or auto-wrapping) at that line length.  Currently, I have this set
to 78 so that whenever the line exceeds 78 characters the line is
automagically continued on the next line.  This is a Very Nice Thing when
typing text, although it can be a bit of a nuisance (and can be shut off) when
programming.

<P>
However...

<P>
There's an additional benefit to using this auto-fill thingie... if you're
inserting a comment in C, C++, a shell script, whatever..., all you have to do
is start the first line with a comment character (&quot;/*&quot;,
&quot;//&quot;, &quot;#&quot;) and then start typing.  If the comment extends
to the text width column, it automatically continues this on the next line AND
adds the appropriate comment character!

<P>
Very Slick! :-)

<P>
<B>Choices, Choices...!</B>

<P>
Well, the recurrent theme of the day is &quot;choices!&quot;.  VIM comes with
more options than you can shake a stick at.  I'd encourage you to have a look
at the online docs for a description of these.  Not all of them will be useful
to you but there are a LOT of interesting things that you can configure.  My
own favorite ones include:

<PRE>
set ai                &quot; turn auto indenting on
set bs=2              &quot; allow backspacing over everything in insert mode
set noet              &quot; don't expand tabs into spaces
set nowrap            &quot; disable line wrapping
set ruler             &quot; display row,col ruler
set showmatch         &quot; show matching delimiter for parentheses, braces, etc
set ts=4              &quot; set tab stop width to 4
set tw=78             &quot; always limit the width of text to 78
set sw=4              &quot; set the shift width to 4 spaces
set viminfo='20,\&quot;50  &quot; read/write a .viminfo file, don't store more
                      &quot; than 50 lines of registers
</PRE>

<P>
One thing to call you attention to:  the shift width stuff is something that
you might not have tried yet or come across.  Suppose that you've coded some
horrendous switch statement and then realize that you need to add a while loop
before it.  You code in the while loop stuff and then go back and arduously
re-indent everything in between.

<P>
There's an easier way... :-)

<P>
Simply highlight the lines that you want to indent, either indent in or indent
back out, using the mouse or &quot;:v&quot; (for keyboard highlighting) and
then hit the &quot;&gt;&quot; key to indent the lines in farther or the
&quot;&lt;&quot; key to indent back out.  Now, the nice thing is that you can
set the amount of indentation using the &quot;sw&quot; (shiftwidth) variable.

<P>
Also, keep in mind that while you normally set options in the ~/.vimrc or
~/.gvimrc configuration files, there's nothing to prevent your changing these
options on the fly, and in different parts of your file.  It's pretty common
to turn off autoindentation when you're doing cutting and pasting.  To turn
autoindenting off, simply type in:

<PRE>
:set noai
</PRE>

and off it goes.  To turn it back on use &quot;:set ai&quot;.

<P>
Two other options that I particularly like are the ruler and the showmatch
options.  The ruler option puts a row,column indicator in the status line at
the bottom of the file.  Although the documentation mentions that this can
slow performance a bit, I've found that it works with no noticeable delay
whatsoever.

<P>
The other option is showmatch, which highlights the matching brace, bracket,
or parenthesis as you type.  Be aware that it sounds a warning beep if you
insert a right brace/bracket/parenthesis without its opening mate.  This can
be a little annoying, but the time it saves you a syntax error, you'll be glad
for it.  I did a little bit of LISP programming this Spring in our Theory of
Programming Languages course and was mighty happy to use this!

<H3>Ahhh! Time For The Pictures!</H3>

Congrats!  If you've made it this far you might be interested in finally
having a look at all the good stuff that I've been mentioning here.

<P>
Here's the skinny...

<P>
What I did was create a number of screen dumps of gvim in action -- editing a
*.cc file (show off the syntax highlighting stuff...), using the online help
system (also shows the multi-window look), and displaying a manual page from
within gvim (&quot;Look ma! No hands...!&quot;).  I used the venerable
<B>ImageMagick</B> to make the thumbnail prints after using a combination of
<B>xv, xwpick, and xwd</B> to make the actual screen dumps and crop the pics.

<P>
Also, for the comparison shoppers out there, I've included similar screen
dumps of <B>XEmacs, GNU Emacs, NEdit, and XCoral</B> -- other very nice and
feature-rich editors that some of you will be familiar with.  All of these
provide syntax-highlighting and a set of extended features.

<P>
Finally, I've included a couple shots of the <B>xxgdb</B> and the <B>DDD</B>
debuggers.  I've been using both quite a bit lately and found that they are
absolutely indispensable for tracking down mischievous bugs.  I've included a
couple URL's below as well, but let's start with the Family Photo Album:

<H3>gvim Screen Shots</H3>

<P>
All of these are approximately 20k.

<P>
<A HREF="./misc/gvim.gif">
<IMG SRC="./misc/gvim-th.gif"      WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/gvim-help.gif">
<IMG SRC="./misc/gvim-help-th.gif" WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/gvim-man.gif">
<IMG SRC="./misc/gvim-man-th.gif"  WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>

<H3>The &quot;Other Guys...&quot;</H3>

<P>
All of these are approximately 20-25k

<P>
<A HREF="./misc/xemacs-19.15.gif">
<IMG SRC="./misc/xemacs-19.15-th.gif" WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/emacs.gif">
<IMG SRC="./misc/emacs-th.gif"        WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/nedit.gif">
<IMG SRC="./misc/nedit-th.gif"        WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/xcoral.gif">
<IMG SRC="./misc/xcoral-th.gif"       WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>

<H3>The xxgdb Debugger</H3>

<P>
<A HREF="./misc/xxgdb.gif">
<IMG SRC="./misc/xxgdb-th.gif"        WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>

<H3>The DDD Debugger</H3>

<P>
All of these are approximately 20-25k

<P>
<A HREF="./misc/ddd-2.1.gif">
<IMG SRC="./misc/ddd-2.1-th.gif"      WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/ddd-2.1-data.gif">
<IMG SRC="./misc/ddd-2.1-data-th.gif" WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>
<A HREF="./misc/ddd-2.1-msg.gif">
<IMG SRC="./misc/ddd-2.1-msg-th.gif"  WIDTH=158 HEIGHT=172 ALIGN=BOTTOM></A>

<P>
Let me make just a couple comments about the debuggers.

<P>
First, I've found both of these to be very usable and helpful in terms of
making debugging easier.  They are both front ends to the GNU GDB debugger (and
DDD can be used with a variety of other debuggers as well).  The xxgdb
debugger is the simpler of the two and probably is a good place to start
learning and tinkering if you've not used a graphical debugger before.

<P>
I ended up having to do a bit of tinkering with the resource settings for
xxgdb.  I'm currently using Fvwm95 with a screen resolution of 1024x768 and
8-bit color.  To get all the windows comfortably in 1024x768 I messed around
with the geometry resources.  Also, the file selection box was completely
whacked out -- I did a bit of adjustment to this to provide for a more sane
display.  If you're interested, here's the XDbx resource file I'm currently
using:

<H3><A HREF="./misc/XDbx.ad">Xxgdb resource file</A></H3>

<P>
Also, the DDD debugger shown above is the most current public release --
version 2.1 which just recently showed up in the Incoming directory at
sunsite.  I don't know if it'll still be there, but you have have a try.  If
you don't find it there, try the /pub/Linux/devel/debuggers subdirectory and
see if it hasn't been moved there.

<H3><A HREF="http://sunsite.unc.edu/pub/Linux/Incoming/">Sunsite Linux
Incoming Directory</A></H3>

<P>
Keep in mind that you probably <I>should</I> be using one of the sunsite
mirrors.  If there's one near you, then use it! :-)  There should be dynamic
and static binaries available as well as the source code.  In addition,
there's an absolutely HUGE postscript manual page with lots of nifty pictures
included in the /doc subdirectory in the source file.

<P>
I've not had a chance to use the new DDD debugger as much as xxgdb, but what
I've tried I'm been VERY impressed with.  You'll see from the screen shots
above that it has a much improved GUI as compared to xxgdb.  Also, a number of
new features have been added since the previous 1.4 release.  One feature that
I really like is setting a breakpoint, running the program, and then, by
positioning the mouse pointer over a variable or data structure, getting a
pop up balloon with the current value of that data structure.

<P>
This is huge. It rocks!

<P>
I really don't have time to talk about this, so you'll have to do a bit of
exploring on your own!  Also, note that the folks working on DDD are
encouraging the Motif-havenot's to either use the static binaries or give the
<B>LessTif</B> libraries a try.  Apparently, there have been some successes
using this toolkit already.  I'm sorry that I don't have the URL for LessTif,
but a Yahoo, Alta Visa, etc., search should turn up what you need.

<P>
And lastly (and this really is the last... :-), here's some URL's for the
editors listed above:

<H3><A HREF="http://www.math.fu-berlin.de/~guckes/vim/">VIM Home Page</A></H3>
<H3><A HREF="http://www.xemacs.org/">XEmacs Home Page</A></H3>
<H3><A HREF="ftp://ftp.x.org/contrib/">ftp.x.org FTP site (XCoral)</A></H3>
<H3><A HREF="ftp://sunsite.unc.edu/pub/Linux/X11/xapps/">sunsite.unc.edu
FTP site (NEdit)</A></H3>

<P>
The first two links should put you at the VIM and XEmacs home pages which
provide a wealth of helpful information about each of these excellent editors.
The last two I apologetically provide as approximate FTP links.  The first
will drop you into ftp.x.org in its /contrib subdirectory.  You should be able
to find the latest version of XCoral there, probably under the /editors
subdir.  The version shown above is version 2.5; the latest version of xcoral
is 3.0, which I've not had a chance to compile or tinker with.  The last link
will put you at sunsite in the /X11/xapps subdirectory.  Have a look in the
/editors subdir for the latest source or binaries for NEdit.

<P>
Phew! That was a <I>tour de force</I>!  Glad you hung in there!

<P>
I'd be happy to try to field questions about this stuff or hear back from
anyone with comments or suggestions about any of these excellent programs.

<P>
Hope you enjoyed!

<P>
John

<!-- END ARTICLE ================================================== -->

<P><HR><P>

<!-- ARTICLE ================================================ -->
<H2><A NAME="closing"><IMG SRC="../gx/fisk/desklamp.gif" WIDTH=79 HEIGHT=99
ALIGN=BOTTOM>Closing Up The Shop</A></H2>

<P>
Well, I apologize again for the brevity of this month's column.  I'd hoped to
do a bit more writing on a couple different things, particularly one of the
topics that's near and dear to my heart:  shell scripting.  I'm absolutely
convinced that learning even basic shell scripting will forever sour you to
DOS and will make you think twice even about the Windows stuff.  Shell
programming opens up a tremendous world of possibilities and, probably most
importantly, <I>it puts you in control of your system</I>.  It let's you do
all sorts of cool and groovy things that would be difficult or impossible
under a DOS/Win system.

<P>
As a quick example, I'd recently had an occasion in which I needed to format a
stack of 30-40 floppies (I was planning to do an afio backup of the XEmacs
distribution I'd spent several hours downloading) and decided to use
<I>superformat</I> to do this.  Now superformat is a great little program that
has the typical bazillion options.  Since I needed only a few of these options
for my particular system, I whipped together a shell script to help automate
this process.  It's no marvel of programming genius, but here it is:

<PRE>
#!/bin/sh
#
# fdformt.sh   formats 1.44 HD floppies in the fd0 drive
#
# Author:      John M. Fisk &lt;ctrvax.vanderbilt.edu&gt;
# Date:        6 May 1997

FORMAT_CMD=&quot;superformat -v 3 &quot;
FLOPPY_DEV=&quot;dev/fd0&quot;

while : ; do
    echo -n &quot;Format floppy [y,n]? &quot;
    read yesno
    if [ &quot;yesno&quot; = &quot;y&quot; -o &quot;yesno&quot; = &quot;Y&quot; ]; then
        echo -n &quot;Insert floppy and hit any key to continue...&quot;
        read junk
        ${FORMAT_CMD} ${FLOPPY_DEV}
    else
        break
    fi
done
</PRE>

Now, I'm sure that this could easily be improved upon, but the point was that
it took me all of about 3 minutes to write this, it's easily maintained, and
the logic is simple enough that it needs no documentation.

<P>
Why bring this up?

<P>
Well, I think this points to one of the larger issues with using and running
Linux:  <I>the sense of control</I>.  Thing is, under a Linux system, you have
an impressive arsenal of powerful and mature tools at your disposal that allow
you to do things with you system.  You can make it do what <I>you</I> need and
want it to do.

<P>
Don't get me wrong, I enjoy many of the features of the OS/2, Win95, and MacOS
OS's and I hope that the day will come when office suites and productivity
tools of the highest caliber exist for Linux as they do under these other
OS's.  The thing that sets Linux apart is the freely available set of powerful
tools that provide an unparalleled measure of freedom and control over your
system.

<P>
Think about it...

<P>
Shell scripting, Perl, Tcl/Tk, the entire range of GNU development tools and
libraries, and a suite of immensely powerful utilities and programs.

<P>
That's impressive.

<P>
Anyway, I'm preaching to the choir... :-)

<P>
Also, this is something of &quot;old news&quot;, but I wanted to thank the
folks at <B>RedHat Software, Inc.</B>, the LUG at <B>North Carolina State
University</B>, and the myriad participants in this year's <B>Linux Expo
'97</B>.  It was a blast!

<P>
A bunch of us from MTSU headed East and managed to get to most of the two day
affair.  All in all, with the minor exception of some parking problems, the
whole affair when smoothly and was VERY professionally done.  The talks were
delightful, the facilities very nice, and there were lots of great displays
and vendor booths to visit and check out the latest Linux offerings.  The book
tent out front cleaned out more than one person's wallet, sending them home
laden down with all sorts of goodies.

<P>
All in all, it was a great trip.

<P>
For anyone who went, I was, in fact, the annoying short nerdy looking fella in
the front row with the camera.  Sorry... :-)  

<P>
But, I just got the prints back and have sent a stack of them off to
<B>Michael K. Johnson</B> at RedHat.  Since I don't have a scanner or my own
web site, I figured the Right Thing To Do would be to send the doubles to the
guys at RedHat and let them put up anything they thought worthwhile.  If
you're interested in seeing who some of the various Linux folks are, drop
Michael a note and I'm sure that he'll help out.

<P>
Well, guess it's time to wrap this up.  I had a great year this year at MTSU
and am looking forward to finishing up school here one of these years :-).
I'm also looking forward to having a summer of nothing more than Monday
through Friday, 9:00 - 5:00.  I don't know about you, but I've always got a
long list of projects that I want to work on.  I'm really looking forward to
this.  I've finally started learning <B>emacs</B> -- actually, I've just
gotten the most recent public release of <B>XEmacs</B> and have been having
all sorts of fun trying to figure this one out.  My wife and I will be leaving
tomorrow for a couple weeks in Africa -- actually, Zimbabwe and Zambia.  Her
parents are finishing up work there and will be returning this Fall.  After a
busy year for both of us, we're excited about a vacation and the chance to see
them again.  I should be back by the time this month's LG &quot;hits the
stands&quot;, although if you wrote during much of May, be aware that I'm
definitely going to have a mail black-out! :-)

<P>
So... trust y'all are doing well.  Congrats to all of this year's grads!

<P>
Take care, Happy Linux'ing, and Best Wishes,

<P>
John M. Fisk<BR>
Nashville, TN<BR>
Friday, 9 May 1997<br>
<P><HR><P>

<IMG SRC="../gx/fisk/mailme.gif" ALIGN=MIDDLE WIDTH=38 HEIGHT=30> If you'd like, 
drop me a note at: 
<ADDRESS>John M. Fisk 
<A HREF="mailto:fiskjm@ctrvax.vanderbilt.edu">
&lt;fiskjm@ctrvax.vanderbilt.edu&gt;</A>
</ADDRESS>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1997, John M. Fisk<BR> 
Published in Issue 18 of the Linux Gazette, June 1997</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc18.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./sybase.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./lg_backpage18.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<center>
<H1><IMG SRC="../gx/backpage.gif" alt="Linux Gazette Back Page"></H1>

<H5>Copyright &copy; 1997 Specialized Systems Consultants, Inc.<br>
For information regarding copying and distribution of this material see the
<A HREF="../ssc.copying.html">Copying License</A>.</H5>
</center>

<P> <hr> <P> 

<H3>Contents:</H3>
<ul>
<li><a HREF="./lg_backpage18.html#authors">About This Month's Authors</a>
<li><a HREF="./lg_backpage18.html#notlinux">Not Linux</a>
</ul>

<a name="authors"></a>
<P> <HR> <P> 
<!--======================================================================-->

<center><H3> About This Month's Authors </H3></center>

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

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Larry Ayers</H4>
Larry Ayers lives on a small farm
in northern Missouri, where he is currently engaged in building a
timber-frame house for his family. He operates a portable band-saw mill,
does general woodworking, plays the fiddle and searches for rare
prairie plants, as well as growing shiitake mushrooms. He is also
struggling with configuring a Usenet news server for his local ISP.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Jim Dennis</H4>
Jim Dennis 
is the proprietor of <A href="http://www.starshine.org">
Starshine Technical Services</A>.
His professional experience includes work in the technical 
support, quality assurance, and information services (MIS)
departments of software companies like 
<A href="http://www.quarterdeck.com"> Quarterdeck</A>, 
<A href="http://www.symantec.com"> Symantec/
Peter Norton Group</A>, and 
<A href="http://www.mcafee.com"> McAfee Associates</A> -- as well as 
positions (field service rep) with smaller VAR's.
He's been using Linux since version 0.99p10 and is an active
participant on an ever-changing list of mailing lists and 
newsgroups.  He's just started collaborating on the 2nd Edition
for a book on Unix systems administration.
Jim is an avid science fiction fan -- and was
married at the World Science Fiction Convention in Anaheim.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">John M. Fisk</H4>
John Fisk is most noteworthy as the former editor of the <I>Linux Gazette</I>.
After three years as a General Surgery resident and
Research Fellow at the Vanderbilt University Medical Center,
John decided to &quot:hang up the stethoscope&quot:, and pursue a
career in Medical Information Management. He's currently a full
time student at the Middle Tennessee State University and hopes
to complete a graduate degree in Computer Science before
entering a Medical Informatics Fellowship. In his dwindling
free time he and his wife Faith enjoy hiking and camping in
Tennessee's beautiful Great Smoky Mountains. He has been an avid Linux fan,
since his first Slackware 2.0.0 installation a year and a half
ago.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Guy Geens</H4>
One of Guy Geens's many interests is using Linux. One of his dreams is to
be paid for being a Linux geek. Besides his normal work, he is the (rather
inactive) maintainer of his research group's web pages
<a href="http://www.elis.rug.ac.be/ELISgroups/ve">http://www.elis.rug.ac.be/~ggeens</a>.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Ivan Griffin</H4>
Ivan Griffin is a research postgraduate student in the ECE department at the
University of Limerick, Ireland. His interests include C++/Java, WWW, ATM, the
UL Computer Society (http://www.csn.ul.ie) and of course Linux
(http://www.trc.ul.ie/~griffini/linux.html).

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Michael J. Hammel</H4>
Michael J. Hammel,
is a transient software engineer with a background in
everything from data communications to GUI development to Interactive Cable
systems--all based in Unix. His interests outside of computers
include 5K/10K races, skiing, Thai food and gardening. He suggests if you
have any serious interest in finding out more about him, you visit his home
pages at http://www.csn.net/~mjhammel. You'll find out more
there than you really wanted to know. 

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Mike List </H4>
Mike List is a father of four teenagers, musician, printer (not
laserjet), and recently reformed technophobe, who has been into computers
since April,1996, and Linux since July.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Dave Phillips</H4>
Dave Phillips is a blues guitarist & singer, a computer musician
working especially with Linux sound & MIDI applications, an avid
t'ai-chi player, and a pretty decent amateur Latinist. He lives and
performs in Findlay OH USA.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Henry Pierce</H4>
Henry graduated from St. Olaf College, MN where he first used BSD UNIX
on a PDP-11 and VAX. He first started to use Linux in the
Fall of 1994. He has been working for InfoMagic since June of 1995
as the lead Linux technical person. He is now an avid Red Hat user.

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Michael Stutz</H4>
Michael lives the Linux life. After downloading and patching together his
first system in '93, he fast became a Linux junkie. Long a proponent of the
GNU philosophy (publishing books and music albums under the GPL), he sees in
Linux a Vision. Enough so that he spends his time developing a custom
distribution (based on Debian) and related documentation for writers and
other "creative" types and have formed a consulting firm based on
GNU/Linux.
His company, Design Science Labs,
does Linux consulting for small-scale business and art ventures.
He has written for <I>Rolling Stone</I>, <I>2600</I>: <I>The Hacker
Quarterly</I> and <I>Alternative Press</I>. He's a staff writer for <I>US Rocker</I>,
where he writes about underground rock bands. 

<P> 
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Josh Turial</H4>
Josh Turiel is the IS Manager of a small advertising agency South of
Boston.  He also runs the Grater Boston Network Users Group
(http://www.bnug.org/).  He also writes and does consulting work, as well.
Since he has no life whatsoever as a result, his rare home time is spent
sucking up to his wife and maintaining his cats.

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

<center><H3> Not Linux </H3></center>

<P> <HR> <P> 
<!--======================================================================-->
<P>
Thanks to all our authors, not just the ones above, but also those who wrote
giving us their tips and tricks and making suggestions. Thanks also to our
new mirror sites.
<P> 
<IMG ALIGN=LEFT ALT="" SRC="../gx/rose.gif">My assistant, Amy Kukuk, did
<B>ALL</B> the work this month other than this page. If this keeps up,
I may have to make her the Editor. Thanks
very much for all the good work, Amy. 
<P>
These days my mind seems to be fully occupied with <I>Linux Journal</I>. As
a result, I've been thinking I need a vacation. And, in fact, I do. I had
been planning to take off a week in June to visit my grandchildren in San
Diego, California, but just learned that their current school district is
year round -- no summers off. Somehow this seems anti-kid, anti-freedom
and just plain hideous. I remember the summers off from school as a time
for having fun, being free of assignments and tests -- a time to
sit in the top of a tree in our backyard reading fiction, while the tree gently
swayed in the breeze (I was fairly high up). It was great. I wouldn't want
to ever give up those summers of freedom. I wish I still had them. Ah well,
no use pining for "the good ol' days". The grandkids will get some time off
from school in August, and I will just have to put off the vacation until
then.

<center><H3>Stop the Presses</H3> </center>
Be watching the Hot Linux News (link on The Front Page) on June 7 for an 
important announcement concerning the trademark issue.
<P>
Have fun!

<P> <hr> <P> 
<A HREF="http://www.ssc.com/ssc/Employees/Margie/margie.html">
Marjorie L. Richardson</a><br>
Editor, <i>Linux Gazette</i> <A HREF="mailto:gazette@ssc.com">gazette@ssc.com</a>

<P> <HR> <P>
<!--====================================================================-->
<A HREF="./lg_toc18.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF 
CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG SRC="../gx/homenew.gif" ALT="[ FRONT 
PAGE ]"></A> 
<A HREF="./wkndmech.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<p><hr><p>
<I>Linux Gazette</I> Issue 18, June 1997, http://www.ssc.com/lg/<BR> 
This page written and maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>
<P> 
</BODY>
</HTML>