File: TWDT.html

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

<A HREF="../index.html">Front Page</A> &nbsp;|&nbsp;
<A HREF="../index.html">Back Issues</A> &nbsp;|&nbsp;
<A HREF="../lg_faq.html">FAQ</A> &nbsp;|&nbsp;
<A HREF="../mirrors.html">Mirrors</A> <!-- &nbsp;|&nbsp; --><BR>
<A HREF="../tag-kb.html">The Answer Gang knowledge base</A> (your Linux questions here!) <!-- &nbsp;|&nbsp; --><BR>
<A HREF="http://www.linuxgazette.com/search.html">Search (www.linuxgazette.com)</A> 
<!-- *** BEGIN mirror site search link *** -->
<!-- &nbsp; <A HREF="http://www.linuxgazette.com/search.html">(SITE.COM
mirror)</A> -->
<!-- *** END mirror site search link *** -->

</CENTER>

<HR NOSHADE>
<!--=================================================================-->

<!-- H1><font color="#BB0000">Table of Contents:</font></H1 -->




<!-- *** BEGIN toc *** -->
<UL>
<LI> <A HREF="lg_mail.html">The MailBag</A>
<LI> <A HREF="lg_tips.html">More 2-Cent Tips</A>
<LI> <A HREF="lg_answer.html">The Answer Gang</A>
<LI> <A HREF="lg_bytes.html">News Bytes</A>, <EM>by Michael Conry</EM>
<LI> <A HREF="bint.html">The Ultimate Editor</A>, <EM>by Stephen Bint</EM>
<LI> <A HREF="collinge.html">HelpDex</A>, <EM>by Shane Collinge</EM>
<LI> <A HREF="ecol.html">Ecol</A>, <EM>by Javier Malonda</EM>
<LI> <A HREF="howell.html">Quick-Start Networking</A>, <EM>by Edgar Howell</EM>
<LI> <A HREF="jenkins.html">A Keep-Alive Program You Can Run Anywhere</A>, <EM>by Graham Jenkins</EM>
<LI> <A HREF="lodato.html">Linux-Based Voice Recognition</A>, <EM>by Janine M Lodato</EM>
<LI> <A HREF="okopnik.html">Perl One-Liner of the Month: The Adventure of the Arbitrary Archives</A>, <EM>by Ben Okopnik</EM>
<LI> <A HREF="pramode.html">Fun with Simputer and Embedded Linux</A>, <EM>by Pramode C.E</EM>
<LI> <A HREF="qubism.html">Qubism</A>, <EM>by Jon "Sir Flakey" Harsem</EM>
<LI> <A HREF="ramankutty.html">Yacc/Bison - Parser Generators - Part 1</A>, <EM>by Hiran Ramankutty</EM>
<LI> <A HREF="sunil.html">I Built a Custom Debian CD from Knoppix</A>, <EM>by Sunil Thomas Thonikuzhiyil</EM>
<LI> <A HREF="vinayak.html">Encryption using OpenSSL's crypto libraries</A>, <EM>by Vinayak Hegde</EM>
<LI> <A HREF="lg_backpage.html">The Back Page</A>
</UL>

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




<HR NOSHADE>
<!--=================================================================-->

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

<HR NOSHADE>
<!--=================================================================-->

<A HREF="TWDT.txt.gz">TWDT 1 (gzipped text file)</A><BR>
<A HREF="TWDT.html">TWDT 2 (HTML file)</A><BR>
are files containing the entire issue: one in text format, one in HTML. 
They are provided 
strictly as a way to save the contents as one file for later printing in
the format of your choice; 
there is no guarantee of working links in the HTML version.
<HR NOSHADE>
<!--=================================================================-->

<center>
<I>Linux Gazette</I><img alt="[tm]" src="../gx/tm.gif">, 
<A HREF="http://www.linuxgazette.com/">http://www.linuxgazette.com/</A><BR> 
This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>
<P> 
<H5>Copyright &copy; 1996-2003 Specialized Systems Consultants, Inc.</H5>
</center>

<HR NOSHADE>
<!--=================================================================-->


<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue87/lg_mail.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom"  ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="lg_tips.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom"  ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->

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

<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD>


<center>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Mailbag</FONT></STRONG></BIG></BIG><BR>
<!-- BEGIN wanted -->

<STRONG>From <A HREF="mailto:gazette@ssc.com">The Readers of <i>Linux Gazette</I></A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>

<!-- END header -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">HELP WANTED : Article Ideas</FONT></STRONG></BIG>
<BR>
<STRONG>Submit comments about articles, or articles themselves (after reading <a href="../faq/author.html">our guidelines</a>) to <A HREF="mailto:gazette@ssc.com">The Editors of <i>Linux Gazette</I></A>, and technical answers and tips about Linux to <A HREF="mailto:linux-questions-only@ssc.com">The Answer Gang</A>. 
</STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#wanted.1"
	><strong>H/W detection in Debian ?</strong></a>
<li><A HREF="#wanted.2"
	><strong>ppp over nullmodem cable - no response to  (LCP ConfReq ...)</strong></a>
<li><A HREF="#wanted.3"
	><strong>How can we block mails from users using ipchains</strong></a>
<li><A HREF="#wanted.4"
	><strong>dual boot problem</strong></a>
<li><A HREF="#wanted.5"
	><strong>Custom kernel, not so custom modules</strong></a>
<li><A HREF="#wanted.6"
	><strong>ipchains vs iptables</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">H/W detection in Debian ?</FONT></H3>
Sat, 11 Jan 2003 19:06:15 +0530
<BR>Joydeep Bakshi (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%231">joy12 from vsnl.net</a>)


<P>
Hi all,
</P>

<blockQuote><ol>
<LI>kudzu is the DEFAULT H/W detection tool in RH &amp; harddrake in MDK. is there
anything in debian?


<LI>I have installed <EM>kudzu</EM> in debian 3.0 , but it is not running as a
service. it needs to execute the command <EM>kudzu</EM> manually. more over it
couldn't detect my epson C21SX printer. but under MDK 9.0 kudzu detected the
printer . any solution please ?
</ol></blockQuote>
<P>
thanks in advanced.
</P>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">ppp over nullmodem cable - no response to  (LCP ConfReq ...)</FONT></H3>
Tue, 31 Dec 2002 16:45:02 +0100
<BR>Josef Angermeier jun. (<a href="mailto:linux-questions-only@ssc.com?cc=josef.angermeier@web.de&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%232">josef.angermeier from web.de</a>)


<P>
hi linux gazette
</P>
<P>
first thanks for your great work.
</P>
<P>
id like to connect over a serial cable to a windows 2000  ras server. i
already know that the problem isnt the null modem cable, because i just
could remote control my second computer while using getty and windows's
hyperterminal on the other side. (btw  i first tried gnu/linux's minicom
instead of window's hyperterminal but it seemed to me minicom just works
with a modem a the end of the cable, am i wrong or is there any other
program out there which i should give a try ?) ok ive already read those
Serial-* and PPP* howto but i probably missed something. further, i also set
the same baud rate at the ras server side. so any idea, why i
dont get any reply to my LCP ConfReq Request ??
</P>
<P>
greets
</P>
<P>
josef
</P>

<blockquote><pre>melee:/home/josef/tmp# pppd /dev/ttyS0 nodetach
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 &lt;--&gt; /dev/ttyS0
sent [LCP ConfReq id=0x1 &lt;asyncmap 0x0&gt; &lt;magic 0x143c91f8&gt; &lt;pcomp&gt; &lt;accomp&gt;]
sent [LCP ConfReq id=0x1 &lt;asyncmap 0x0&gt; &lt;magic 0x143c91f8&gt; &lt;pcomp&gt; &lt;accomp&gt;]
sent [LCP ConfReq id=0x1 &lt;asyncmap 0x0&gt; &lt;magic 0x143c91f8&gt; &lt;pcomp&gt; &lt;accomp&gt;]
sent [LCP ConfReq id=0x1 &lt;asyncmap 0x0&gt; &lt;magic 0x143c91f8&gt; &lt;pcomp&gt; &lt;accomp&gt;]
....
</pre></blockquote>
<P>
my <TT>/etc/ppp/options.ttyS0</TT>
</P>

<blockquote><pre>connect 'chat -v -f /etc/ppp/scripts/winserver.chat'
19200
debug
crtscts
local
user josef
noauth
</pre></blockquote>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">How can we block mails from users using ipchains</FONT></H3>
Sun, 5 Jan 2003 22:33:43 -0800
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=vinod@globaledgesoft.com&cc=dan@ssc.com&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%233">SSC sysadmin</a>)
<BR>Question by linux-questions-only@ssc.com, vinod (vinod from globaledgesoft.com)

<P><STRONG>
HI,
</STRONG></P>
<P><STRONG>
I would like to know how to block mails from other users on the same
system.I tried using 'ipchains' &amp; port no,but it didnt work.Please help
me with this.
</STRONG></P>
<P><STRONG>
Thanks
</STRONG></P>
<P>
Perhaps you could be more specific about what you're trying to accomplish.
For example:
</P>

<blockQuote><ul>
<LI>I wish to block all mail from a specific user to me


<LI>I wish to prevent a specific user from sending any mail


<LI>I wish to allow users to send mail, but not to other users
   on the same system


<LI>I wish to prevent any mail from being sent on the system


<LI>??
</ul></blockQuote>

<blockquote><font color="#000066">I'll take this one to the readership as a general request for more
articles about setting up mail systems to do interesting things.  In
fact, some things that aren't really about spam could be a fun read 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
 -- Heather</font></blockquote>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">dual boot problem</FONT></H3>
Mon, 6 Jan 2003 14:29:33 -0500
<BR>Faber Fedor (<a href="mailto:linux-questions-only@ssc.com?cc=Lazybum@sio.midco.net&cc=faber@linuxnj.com&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%234">faber from linuxnj.com</a>)
<BR>Question by Phil Harold (Lazybum from sio.midco.net)

<P><STRONG>
I installed Redhat 8.0 on an existing system that has XP pro on it. XP
is on ide0 and the Redhat is on ide1 XP hard drive is fat file system.
When it boots it asks go to Redhat or dos I dont have dos. How do I
get back to the windows? What needs to be done to change the boot
loader. I thought I had set it up so Linux only booted with a floppy I
guess not
Thanks for any help.
Phil Harold
</STRONG></P>
<P>
Go ahead and choose "DOS".  That will boot into the other partition
which is set up (hopefully) to boot XP.
</P>

<blockquote><font color="#000066">Looks normal so far.  Hardly worthy of the "help wanted" section here
at the <EM>Gazette</EM> ... but nope, it's a stumper.
 -- Heather</font></blockquote>
<P><STRONG>
just before the other symbols it says:
</STRONG></P>
<P><STRONG><BLOCKQuote>
root no verify (hd2,0)
chainloader +1
</BLOCKQuote></STRONG></P>
<P><STRONG>
hit the enter key is when the symbols come looks like greek and chinese
</STRONG></P>

<!-- end 4 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Custom kernel, not so custom modules</FONT></H3>
Fri, 10 Jan 2003 18:25:16 +0100
<BR>Eduardo (<a href="mailto:linux-questions-only@ssc.com?cc=edlm@wanadoo.es&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%235">edlm from wanadoo.es</a>)



<blockquote><font color="#000066">An old question - he had said this relates to
[[<A HREF="../issue64/tag/16.html"
	>http://www.linuxgazette.com/issue64/tag/16.html</A>][issue 64 #16 in The Answer Gang]] - but still a stumper.  We have a lot more readers now;
maybe one of you knows what happened here?
 -- Heather</font></blockquote>
<P>
Hello all,
</P>
<P>
I have exactly the same problem described by Michael Hansen. Modules
doesn't load after recompile Kernel. I'm also a newbie in Linux, but I
see (If you are using red hat at least), it creates a directory
<TT>/lib/modules/2.4.xcustom</TT> (in fact kernel version pass to 2.4.18custom in
my case), but when you do make modules it copies to directory 2.4.x. If
you rename directories the problem comes when you try to install a new
driver that use uname -r command during installation to find modules
directory (uname -r result is 2.4.xcustom). I don't know how solve
this problem.
</P>
<P>
Best regards
</P>

<!-- end 5 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="wanted.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">ipchains vs iptables</FONT></H3>
Wed, 22 Jan 2003 14:39:11 +0100
<BR>Dean Buhrmann (<a href="mailto:linux-questions-only@ssc.com?cc=d.buhrmann@chello.nl&subject=%20Re%3A%20%5BLG%2087%5D%20help%20wanted%20%236">d.buhrmann from chello.nl</a>)


<P>
Dear Answer Gang members,
</P>
<P>
I have a linux home network which is connected to the internet through a
gateway. This computer runs linux with a 2.2.18 kernel. I use IP-chains to
block some unwanted incoming traffic.
One of the machines runs mldonkey. This program needs the ports 4161 and 4162.
I get the following error from server i contact:
</P>

<blockquote><pre>ERROR: Your port 4662 is not reachable. You have a LOWID.
</pre></blockquote>
<P>
This port is open. The solution to this problem seems to be to redirect
incoming packets from the internet for port 4662 directly to the machine
where mldonkey runs.
</P>
<P>
The following iptable should do this:
</P>

<blockquote><pre>iptables -A PREROUTING -t nat -p tcp -d $4 --dport 4662 -j DNAT --to 192.168.1.100
</pre></blockquote>

<blockquote><code><font color="#000033"><br>$4 is the gateway
<br>192.168.1.100 runs mldonkey
</font></code></blockquote>
<P>
I use a 2.2.18 kernel with ipchains on the gateway. In Howto's and other
documentation i can't find a way to do this with ipchains. Do you know if
it's possible and how?
</P>
<P>
Please your help.
</P>
<P>
greetings Dean Buhrmann.
</P>

<blockquote><font color="#000066">Articles about trevails, with details are always welcome when you solve
a strange problem.  Of course there are HOWTO's for ipchains and for
netfilters, but perhaps we could see an article about do something
complicated enough to illustrate differences that might have you prefer
one or the other interface.
 -- Heather</font></blockquote>

<!-- end 6 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->


<!-- END header -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GENERAL MAIL</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#mailbag.1"
	><strong>Re: your mail</strong></a>
<li><A HREF="#mailbag.2"
	><strong>POS Software in Linux</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Re: your mail</FONT></H3>
Mon, 20 Jan 2003 11:45:17 -0500
<BR>Ben Okopnik (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2087%5D%20mailbag%20%231">the <em>LG</em> Answer Gang</a>)
<BR>Question by Larry Leeds (lleeds from cableone.net)

<P><STRONG>
I had an IBM 20G hard drive that had a lot of bogus information in the
master boot record due to formatting it with 2G jumper on and then
formatting with the jumper off. It wouldn't load an OS, and it locked up
every time I tried to run fdisk, norton disk doctor couldn't fix it either,
but your little DOS assembly program
<A HREF="../issue63/okopnik.html"
	>http://www.linuxgazette.com/issue63/okopnik.html</A> saved my hard drive.
</STRONG></P>
<P><STRONG>
Thank you!
</STRONG></P>
<P>
Glad you found it useful, Larry. A number of people have written in with
comments like yours about that particular article; I find it very
pleasant that my work has benefitted that many people.
</P>
<P>
I appreciate your letting me know.
</P>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="mailbag.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">POS Software in Linux</FONT></H3>
Tue, 21 Jan 2003 21:07:25 -0500
<BR>Ben Okopnik (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2087%5D%20mailbag%20%232">the <em>LG</em> Answer Gang</a>)
<BR>Question by Stelian Iancu (stelian.iancu from gmx.net)

<P><STRONG>
Hi!
</STRONG></P>
<P><STRONG>
I was reading the December 2002 issue of LG (btw, great magazine! I've
just re-discovered it, and it's fantastic!) and I saw the PC-MOS thread
originated by Reilly Burke.
</STRONG></P>
<P><STRONG>
I remembered that I saw something like a prototype for a POS software on
the net and I went searching for it. The address is
<A HREF="http://www.dnalounge.com/backstage/src/pos"
	>http://www.dnalounge.com/backstage/src/pos</A> and the author is no other
than jwz (Jamie Zawinski).
</STRONG></P>
<P><STRONG>
As fas as I can see, there is only an idea and a "little prototype" (as
the author describes it), but maybe this prototype can be used for
further developement by somebody else.
</STRONG></P>
<P><STRONG>
HTH!
</STRONG></P>
<P>
If you need a restaurant-specific POS and don't mind going commercial
(for a very small fee as compared to other POSes, actually), I have only
good things to say about the ViewTouch POS 
&lt;<A HREF="http://www.viewtouch.com/"
	>http://www.viewtouch.com</A>&gt; in
spite of its closed-source nature. The interface is <EM>very</EM> well
thought-out and beautifully done; the layout, menu, employee, and
ingredient list configuration is a snap. It supports all the popular
touchscreens, industry-standard narrow printers, and all the standard
cash drawers.  Despite the documentation that insists on "RedHat-only"
compatibility, I've run it under <A HREF="http://www.debian.org/">Debian</A> from day one (three years or so
ago), and it works fine.
</P>
<P>
My biggest concern with it, of course, is that it <EM>is</EM> closed-source. I
would have liked to tweak some minor features for the client I had who
was interested; as well, I wonder what would happen if the developer
disappeared off into the ether... but that's the nature of that
particular beast. It is, however, an interesting and well-executed
option. Interestingly enough, I spotted a major restaurant near
Baltimore (a Brazilian steakhouse in Columbia, MD) using it about a year
ago. The employees using it didn't have any negative comments, either.
</P>
<P><STRONG>
P.S. Keep up the good work!
</STRONG></P>
<P>
Thanks, Stelian. That's the reality <EM>and</EM> the plan. 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</P>

<!-- end 2 -->

<!-- END header -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GAZETTE MATTERS</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#gaz.0"
	><strong>Wanted: Proofreaders</strong></a>
<li><A HREF="#gaz.1"
	><strong>Compilation Problem in Writing Your Own Toy OS (PART II)</strong></a>
<li><A HREF="#gaz.2"
	><strong>publishing</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz.0"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Wanted: Proofreaders</FONT></H3>
Thu Jan 30 11:24:03 PST 2003
<BR>LG Editor Iron (<a href="mailto:gazette@ssc.com">gazette from ssc.com</a>)


<P>
LG is looking for proofreaders.  The main qualifications are a good command of
English grammar, a native or near-native sense of English word usage, and the
ability to recognize and clarify phrases that are too academic, not 
understood outside their own country, or unnecessarily difficult for those
with limited English ability to read.  

<P> Depending on the number of proofreaders, the workload would be at most
one article per month, but more likely one article every 2-3 months.  Of
course, you would be able to refuse articles you don't have time to 
proofread, or if you're not interested in the subject.

<P> If interested, send <A HREF="mailto:gazette@ssc.com">gazette@ssc.com</A>
some samples or URLs of stuff you've written or proofread (any topic, any
length) that demonstrates your wording style.  



<!-- end 0 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Compilation Problem in Writing Your Own Toy OS (PART II)</FONT></H3>
Thu, 19 Dec 2002 07:15:59 -0800 (PST)
<BR>Mohammad Moghal (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2087%5D%20gazette%20matters%20%231">riazdat from yahoo.com</a>)


<P>
Dear Sir,
</P>
<P>
"Writing Your Own Toy OS" is a Great Contribution towards knowledge.
</P>
<P>
I have tried PART I successfully.
</P>
<P>
But, after compiling part II, I booted my system from Drive A. System checked Drive A and was hangged. There was no output of the string.
</P>
<P>
Could you please help me out.
</P>
<P>
Best Regards
</P>
<P>
M. R. Moghal
</P>

<blockquote><font color="#001F3F">Forwarding to the author, Krishnakumar R.
</font></blockquote>
<blockquote><font color="#001F3F">He fixed one of the programs somewhere in the series after it was published,
but I don't remember exactly where.  If you're reading on a mirror, check the
main site, and see whether that program has been changed.
<A HREF="../issue79/krishnakumar.html"
	>http://www.linuxgazette.com/issue79/krishnakumar.html</A>
 -- Mike</font></blockquote>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="gaz.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">publishing</FONT></H3>
Fri, 27 Dec 2002 03:37:09 -0500
<BR>Mike Orr (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2087%5D%20gazette%20matters%20%232"><em>Linux Gazette</em> Editor</a>)
<BR>Question by Felix F. (felix from pz4.org)

<!-- sig -->
<!-- sig -->

<blockquote><font color="#000066">Readers, please note that this was actually an exchange of mails back
and forth between Mike and Felix, rather than one message which Mike
responded to in gory detail.  If anyone out there, either in whole or
in part, takes on the Herculean task of providing paper editions of <EM>LG</EM>
please let us know - we will very happily spread the word!
 -- Heather</font></blockquote>
<P><STRONG>
Have you ever thought of publishing the gazette and require subscriptions? I
would sure like to get a monthly magazine then browsing the gazette online.
</STRONG></P>
<P>
We've had several requests for a print version of LG.  However, the cost of
producing it would be prohibitive.   (Printing, postage, software to track
subscriptions, customer service staff, etc.  And if you want a glossy magazine
rather than just a xerox copy, there's layout costs, more printer's fees, etc.)
Commercial magazines like our <I>Linux Journal</I> can do it because most of
their revenue comes from advertising, but Linux Gazette does not
accept advertising (except sponsorships).
</P>
<P>
We have repeatedly asked if any readers would be willing to set up their own
print-and-distribute service for LG, but nobody has offered.
</P>
<P><STRONG>
What kind of equipment would be required to print-and-distribute services?
</STRONG></P>
<P>
At minimum, a lazer printer, envelopes, stamps, and a list of subscribers.
That's how small, do-it-yourself zines work.  You'd want some kind of
cover or binding unless you're just going to send a stack of loose sheets.
</P>
<P>
But mailing costs alone will soak you, especially since a single issue of LG
is something like fifty printed pages.  (I've never printed an issue, so that's
an estimate.)  Sending fifty pages via first-class mail within the US is $3-4,
so that's $48/year.  Would you pay $48 for LG?  You may be able to get a better
deal with book rate or presorted rate but you'd have to check with the post
office.  But how will you recoup your cost for toner cartridges, paper, printer
repair/replacement (since it will wear out sooner), envelopes, and the time to
write the addresses or attach labels, not to mention the time dealing with
subscription requests, complaints about "I didn't receive my issue", etc?
</P>
<P><STRONG>
Today many free magazines put ads into the magazine and make money to
publish the magazine. It would be a good idea to maybe advertise, but
I'm not sure if LG has a high number of subscribers. I can see where the
management issue would be a problem (billing, distributing, etc).
Hopefully one day maybe. 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</STRONG></P>
<P>
LG has a huge number of readers all over the world.  I don't know the number
because people who read via mirrors or off-line are uncountable.  But there
are mirrors in fifty countries, and I figure any country with a mirror must
have a subtantial LG readership.  Either that, or it at least has one LG
fanatic.... 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</P>
<P>
You bring up an interesting point.  LG itself is not interested in running
ads, at least not at present.  I like to think of LG as an ad-free zone, a
safe haven from ads.  But since LG content is freely redistributable, there's
nothing prohibiting a print-and-deliver service from inserting ads in their
version.
</P>
<P>
Actually, our author Alan Ward in Andorra said he's seen a Spanish print
version of LG on the newsstands there.  I assume it was the Spanish
translation of <I>Linux Journal</I>, which may include some LG articles.
</P>
<P><STRONG>
I've seen few sites publishing their works into magazine (including ads)
and subscribers did not get angry at the ads, because they understood that
to publish costs money and if the work is quality it's worth subscribing
for.
</STRONG></P>
<P><STRONG>
HAPPY NEW YEAR and good luck.
</STRONG></P>
<P>
There <EM>are</EM> a few articles in LG that may not be redistributed in a
commercial print publication (where "commercial" means you're charging any
amount of money for it).  Those articles have a message to that effect at the
bottom of the article.  The ones that come to mind are:
</P>

<ul>
<LI>Some of Shane Collinge's HelpDex cartoons: he sold the print rights to a
certain publisher.  This affects only a limited number of cartoons. <P>

<LI>One or two other articles that have corporate ownership.
</ul>
<P>
In those cases, you will have to contact the author for permission.
</P>

<!-- end 2 -->

<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>This page edited and maintained by the Editors of <I>Linux Gazette</I><br>HTML script maintained by <A HREF="mailto:star@starshine.org">Heather Stern</a> of Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="http://www.linuxgazette.com/copying.html">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 87 of <i>Linux Gazette</i>, February 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="lg_mail.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue87/lg_tips.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom"  ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="lg_answer.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom"  ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->

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

<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD>


<center>
<BIG><BIG><STRONG><FONT COLOR="maroon">More 2&cent; Tips!</FONT></STRONG></BIG></BIG><BR>
<!-- BEGIN tips -->

<STRONG>By <A HREF="mailto:linux-questions-only@ssc.com">The Readers of <i>Linux Gazette</I></A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>

<!-- END header -->
<center><STRONG>See also: The Answer Gang's 
<a href="../tag/kb.html">Knowledge Base</a>
and the <i>LG</i> 
<a href="http://www.linuxgazette.com/search.html">Search Engine</a></STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#tips.1"
	><strong>Two Sound Cards Under Linux</strong></a>
<li><A HREF="#tips.2"
	><strong>rpm in debian ?</strong></a>
<li><A HREF="#tips.3"
	><strong>propagating ownership and permissions</strong></a>
<li><A HREF="#tips.4"
	><strong>boot to windows by default</strong></a>
<li><A HREF="#tips.5"
	><strong>network programming - accepting data</strong></a>
<li><A HREF="#tips.6"
	><strong>Key bindings in X</strong></a>
<li><A HREF="#tips.7"
	><strong>alsa in debian</strong></a>
<li><A HREF="#tips.8"
	><strong>pppd</strong></a>
<li><A HREF="#tips.9"
	></a>telnet processes not disappearing when user closes session incorrectly --or--
<br><A HREF="#tips.9"
	><strong>Is that your FIN_WAIT Answer?</strong></a>

<li><A HREF="#tips.10"
	><strong>direct rendering for nvidia RIVA 128</strong></a>
<li><A HREF="#tips.11"
	><strong>xcdroast post cdrom mount problem</strong></a>
<li><A HREF="#tips.12"
	><strong>iptables: What They Are and What They Do</strong></a>
<li><A HREF="#tips.13"
	><strong>Code folding in Vim</strong></a>
<li><A HREF="#tips.14"
	><strong>Debian "Woody" boot error</strong></a>
<li><A HREF="#tips.15"
	><strong>Proxying with MAC address</strong></a>
<li><A HREF="#tips.16"
	><strong>fwd: Re: [TAG] wrestling with postfix...</strong></a>
<!-- index_text ends -->
</UL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Two Sound Cards Under Linux</FONT></H3>
Tue, 14 Jan 2003 03:02:07 -0500
<BR>N4FWD - Tom Kocourek (<a href="mailto:linux-questions-only@ssc.com?cc=tko@atempest.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%231">tko from atempest.net</a>)



<h4 align="center"><br>	The Need
</h4>
<P>
As an Amateur Radio Operator, I wanted to use "QSSTV" under Linux. This program uses the DSP in a sound card to decode pictures being transmitted on Amateur Radio. However, I did not wish to give up the basic sound ability available under <A HREF="http://www.kde.org/">KDE</A>. Thus I started reading about dual sound cards.
</P>

<h4 align="center"><br>Research
</h4>
<P>
Searches via Google did not turn up much information on dual sound cards, just the usual "HOW TO" references on getting one sound card running. But, one key piece of information did turn up, that multiple sound drivers can coexist!
</P>

<h4 align="center"><br>Some experimentation and...
</h4>
<P>
Multiple sound cards can work together provided:
</P>

<blockQuote><ol>
<LI>Each additional sound card must be a different chip set (ie. different drivers)

<LI>Each sound card must have its own IRQ and distinct control register address space
</ol></blockQuote>

<h4 align="center"><br>Installation checkup
</h4>
<P>
At this point, you have physically installed the additional sound card and have verified that the BIOS has assigned different IRQs to the cards.
</P>
<P>
Now you have booted Linux and have logged in. In Mandrake Linux there is an integrated program called the MCC (or Mandrake Control Center). You can either use MCC or you can execute in a term window:
</P>

<blockquote><pre>	$ /sbin/lsmod | less
</pre></blockquote>
<P>
You are verifying that different drivers have been assigned to each Sound Card. If you are not using one of the more recent distributions of Linux (such as <A HREF="http://www.redhat.com/">Red Hat</A>, Mandrake, or <A HREF="http://www.suse.com/">SuSE</A>), you may have to alter the configuration files by hand to achieve the necessary loading of the proper Sound Card drivers.
</P>
<P>
Next, you run a mixer setting program, like KMIX. If all is ok, the program should display 2 distinct mixers. If not, then you need to recheck the configuration files.
</P>

<h4 align="center"><br>Now for the tough part...
</h4>
<P>
Many sound programs are not well written. That is to say that the program assumes that only one sound card exist in your system. These types of sloppy programs will lock up Linux and require using the reset button
</P>
<P>
Well written programs allow you to set which sound card is to be used. XMMS is a well written program. While it assumes that sound card 0 is the only sound card in the system, It does not lock down Linux. QSSTV is an even better written program in that it allows you to configure which sound card is to be accessed.
</P>
<P>
"ARTSD" is a poorly written program and MUST be disabled when you run dual sound cards in your system. Otherwise, you will be reaching for the reset button!
</P>

<h4 align="center"><br>Lastly...
</h4>
<P>
I am able to play my music via XMMS and Sound Card 0; while QSSTV decodes pictures using Sound Card 1 simultaneously under Linux!
</P>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">rpm in debian ?</FONT></H3>
Tue, 7 Jan 2003 14:17:47 +0530
<BR>Kapil Hari Paranjape (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&cc=kapil@imsc.res.in&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%232%20%20rpm in debian">kapil from imsc.res.in</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)

<P><STRONG>
Hi,
I am a <A HREF="http://www.debian.org/">Debian</A> user and interested to install the rpm packages ( from RH or
MDK cds ) in Debian. but is it possible to do so ? if yse , how ?
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
A debian package:
</BLOCKQUOTE>

<blockquote><pre>Package: alien
Section: admin
Architecture: all
Description: install non-native packages with dpkg
 Alien allows you to convert LSB, Red Hat, Stampede and Slackware Packages
 into Debian packages, which can be installed with dpkg.
 .
 It can also generate packages of any of the other formats.
 .
 This is a tool only suitable for binary packages.
</pre></blockquote>
<BLOCKQUOTE>
This suggests that "apt install alien" would do the trick for you.
</BLOCKQUOTE>
<BLOCKQUOTE>
This works as follows. You run
</BLOCKQUOTE>

<blockquote><pre>   fakeroot alien -r &lt;RPM&gt;
</pre></blockquote>
<BLOCKQUOTE>
This produces a .deb which can be installed.
</BLOCKQUOTE>
<BLOCKQUOTE>
It is a good idea to read the documentation first. In particular,
please heed the warning about <EM>not</EM> installing any critical packages
this way. IF (and this is a big if) some mission critical package you
absolutely must have is <EM>not</EM> in Debian (stable or testing or
unstable), then it is generally better to run "debmake" on the
unpacked source tree to build the relevant debian package.
(of course to do this you should generally have installed
"build-essential").
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
... and created a debian/rules file (a makefile starting with
<BR>#!/usr/bin/make -f).
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
[Kapil] 
The "alien" package is largely for (boo-hiss) non-free stuff that is
only available as binaries packaged as RPMs.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD] 
It is also possible to install the debian rpm package.  You can
then directly use RPM commands.  However, there won't be any
dependency database (dbm files) so all dependency checks will fail.
</BLOCKQUOTE>
<BLOCKQUOTE>
At some point someone may come with with a very clever (and probably
difficult to maintain) adapter that will generate a reasonable RPM/DBM
database set from a Debian <TT>/var/lib/dpkg/info</TT> tree.  Alas that is not
in the cards for now.
</BLOCKQUOTE>
<BLOCKQUOTE>
'alien' is probably the best way to go in most cases.
</BLOCKQUOTE>
<HR width="10%" align="center"><P><STRONG>
Thanks a lot for ur valuable hints. alien is excellent.  but *alien -i*
command didn't check any dependency when I installed open office (making .deb
from Mandrake cd ), hence it could not be started due to  missing libraries.
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
Dependencies are certainly a problem for alien. The way I understand
it, <EM>if</EM> you have the correct libraries installed then the
dependencies are included in the .deb package produced by
"alien". Otherwise "alien" only produces error messages about unmet
dependencies...
</BLOCKQUOTE>
<BLOCKQUOTE>
... a bit of a catch 22 alright!
</BLOCKQUOTE>
<BLOCKQUOTE>
But if you create the .deb files and install them in the "correct"
order (and assuming that there are no cross dependencies!) the
<EM>binary</EM> dependencies should work out correctly. What "alien" does (I'm
guessing here) is it runs "ldd" on the executables and looks for the
package that supplied the relevant library. This is how it is often done
during .deb creation.
</BLOCKQUOTE>
<BLOCKQUOTE>
Non-binary dependencies are probably unresolvable unless you can lay
your hands on an LSB package---whatever that is.
</BLOCKQUOTE>

<blockquote><font color="#000066">The Linux Standards Base is an industry-wide effort to make life easier
for companies that want to produce commercial shrinkwrap products.  If
they adhere to the filesystem layout and principles described there,
then the package should be able to be installed on any Linux distro
which also claims to be LSB compliant.
</font></blockquote>
<blockquote><font color="#000066">The installers haven't quite perfected this as far as to handle
everybody's slight differences in initscript setup, but other than that
it's not too bad.  At the very least a knowledgeable system admin has no
problem grafting such applications into the company-wide server.
 -- Heather</font></blockquote>
<P><STRONG>
1) is it possible to let the kpackage to handle this type of converted .deb
packages and their dependency ?
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
I don't know anything about kpackage but I would guess that if the
information is not in the .deb file there is not much kpackage can do.
</BLOCKQUOTE>
<P><STRONG>
2) if I have a particular directory to store all these converted .deb
packages then how to modify kpackage to display those packages in its tree
view ? ( if it is possible at all )
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
There <EM>are</EM> some debian packages that allow you to create your private
repositories - there is a sledge-hammer called "apt-move" but there may
be something simpler for your requirement.
</BLOCKQUOTE>

<blockquote><font color="#000066">When the deb file is installed, if it has no section it will be placed
in the "Obsolete and Locally Created Packages" section under aptitude.
I assume kpackage has a similar feature, although I've been a bit shy of
the X-windows based apt front-ends, since I prefer to have a minimum of
processes running when updating my systems.
 -- Heather</font></blockquote>
<P><STRONG>
once again thanks 4 ur solution.
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
As far as openoffice and other such packages are concerned your best
bet is the "unofficial apt repositories" (which I forgot to mention in
my list of stable/testing/unstable). You can find these unofficial
repositories at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.apt-get.org"
	>http://www.apt-get.org</A>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
I seem to remember that this site lists a site for openoffice.
You can add that site to the list in <TT>/etc/apt/sources.list</TT>
and you should be able to then use apt-get (or probably kpackage) to
install openoffice with dependencies resolved.
</BLOCKQUOTE>
<BLOCKQUOTE>
Be warned that the unofficial repositories are un-signed packages and
could contain trojans and other such!
</BLOCKQUOTE>
<P><STRONG>
Thanks 4 all ur technical info.
</STRONG></P>
<P><STRONG>
best regards
</STRONG></P>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">propagating ownership and permissions</FONT></H3>
Mon, 30 Dec 2002 08:30:09 -0500
<BR>Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=ben@callahans.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%233%20%20ownership">the <em>LG</em> Answer Gang</a>)


<P>
A while back, I wrote a utility that propagates ownership and
permissions from a sample file to a group of files. Imagine a situation
where you have, say, several dozen documents with a scattershot list of
permissions and owners/groups (since they were created by different
people.) The way to "bring them into line" would be to pick a file that
already has The Right Stuff - it doesn't even have to be in the same
directory - and say:
</P>

<blockquote><pre>cpmod /path/to/example/file *
</pre></blockquote>
<P>
Note that this utility is self-documenting. Its internal "man page" can
be read (as long as "cpmod" is somewhere in your path) with
</P>

<blockquote><pre>perldoc cpmod
</pre></blockquote>
<P>
If you want an actual man page, one can be easily created with
</P>

<blockquote><pre>pod2man cpmod|gzip -c&gt;cpmod.1.gz
</pre></blockquote>
<P>
Put the resulting file somewhere in your man directory structure
(<TT>/usr/share/man/man1</TT>, perhaps).
</P>
<p align="center">See attached <tt><a href="misc/tips/cpmod.pl.txt">cpmod.pl.txt</a></tt></p>
<BLOCKQUOTE>
[JimD] 
In newer GNU utils you can use something like:
</BLOCKQUOTE>

<blockquote><pre>	#!/bin/sh
	reference="$1"; shift
  	for i in "$@"; do
		chown --reference="$reference" "$i"
		chmod --reference="$reference" "$i"
		done
</pre></blockquote>
<P><STRONG>
[Ben] 
Very cool, Jim! I hadn't seen that one before; I was only familiar with
the older versions.
</STRONG></P>
<BLOCKQUOTE>
[JimD] 
(Technically I think you can just make that for i; do ...
since I think that for loops default to being in "$@" if you
don't specify an explicit list.  I know they default, but I'm
not sure if they default to $* or "$@"  --- if you care about the
distinction; as usual the subtleties of soft-quoting are there to
protect degenerate filenames containin whitespace!).
</BLOCKQUOTE>
<BLOCKQUOTE>
In other GNU utils you can use a little trickery like:
</BLOCKQUOTE>

<blockquote><pre>  	#!/bin/sh
	reference="$1";  shift
	UID=$(find "$1" -maxdepth 0 -printf "%U" )
	MODE=$(find "$1" -maxdepth 0 -printf "%m" )
  	for i in "$@"; do
		chown "$UID" "$i"
		chmod "$MODE" "$i"
		done
</pre></blockquote>
<BLOCKQUOTE>
Ben, am I missing some subtleties here?  (Other than the obviously
argument counting, error checking and messages, and some getopts to
provide --help, --owner-only, --mode-only etc.)
</BLOCKQUOTE>
<P><STRONG>
[Ben] 
Not so far as I can see. However, the Perl version is shorter (if you
ignore the included man page.) 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</STRONG></P>

<!-- end 3 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">boot to windows by default</FONT></H3>
9 Jan 2003 05:16:50 -0000
<BR>David Mandala, Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=anuragsahay@rediffmail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%234">the <em>LG</em> Answer Gang</a>)
<BR>Question by anurag  sahay (anuragsahay from rediffmail.com)

<P><STRONG>
Hi Answer guy,
I ahve two questions
</STRONG></P>
<P><STRONG>
1.
I have linux and Windows both loaded on my system.i wanted to
boot    to windows by default.how can i chang the lilo.conf
file.what are the changes to be made there.
</STRONG></P>
<BLOCKQUOTE>
[David] 
The answer to your question about lilo is to edit the <TT>/etc/lilo.conf</TT>
file.
</BLOCKQUOTE>
<BLOCKQUOTE>
Your file might look something like this:
</BLOCKQUOTE>
<p align="center">See attached <tt><a href="misc/tips/linux-and-dos.lilo-conf.txt">linux-and-dos.lilo-conf.txt</a></tt></p>
<BLOCKQUOTE>
Cheers,
Davidm
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD] 
Essentially, add a default= directive to your <TT>/etc/lilo.conf</TT>
(or edit your <TT>/boot/menu.lst</TT> file if you're using GRUB).
Read the lilo.conf man (and/or GRUB info) pages for more detail on
that.
</BLOCKQUOTE>
<BLOCKQUOTE>
The Linux Documentation Project (<A HREF="http://www.tldp.org"
	>http://www.tldp.org</A> ) has an
entire section of HOWTOs on boot loaders and related topics (about
a dozen of them):
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.tldp.org/HOWTO/HOWTO-INDEX/os.html#OSBOOT"
	>http://www.tldp.org/HOWTO/HOWTO-INDEX/os.html#OSBOOT</A>
</BLOCKQuote></BLOCKQUOTE>

<!-- end 4 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">network programming - accepting data</FONT></H3>
9 Jan 2003 05:16:50 -0000
<BR>Kapil Hari Paranjape, Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=anuragsahay@rediffmail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%235">the <em>LG</em> Answer Gang</a>)
<BR>Question by anurag  sahay (anuragsahay from rediffmail.com)

<P><STRONG>
Hi Answer guy,
I ahve two questions
</STRONG></P>
<P><STRONG>
2.
This about unix network programming: How to accept any data
from any given port.
</STRONG></P>
<P><STRONG>
thanking you
<BR>yours anurag
</STRONG></P>
<BLOCKQUOTE>
[Kapil] 
Have a look at the utlities "netcat" and "socat".
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD] 
You could use netcat (often named <TT>/usr/bin/nc</TT>) or socat
directly (from shell scripts, etc) to listen on arbitrary TCP or UDP
ports.  Note: the process has to have 'root' privileges to listen on
"privileged" ports -- those from 1 to 1023 inclusive (or maybe it's
1024 inclusive --- I never remember that one).
</BLOCKQUOTE>
<BLOCKQUOTE>
More to the point, you can read the source code to netcat or socat
(included with most distributions on the "Source Code" disc or
readily downloadable from many archive sites on the net.  As a <A HREF="http://www.debian.org/">Debian</A>
user I find it most convenient to get most sources with a simple
'apt-get source' command.  Debian tracks, index, and automatically
fetches, unpacks and patches the sources for me.  With an 'apt-get
build-dep' command I can also have Debian fetch and install all of
the packages that are required to build almost any other package from
its sources (they're still working on that feature).
</BLOCKQUOTE>
<BLOCKQUOTE>
It makes me reluctant to hunt down the upstream sources, suitable
for other distros and other forms of UNIX.
</BLOCKQUOTE>
<BLOCKQUOTE>
These things change far too frequently, but Google is our friend.
It appears that the current canonical location for finding Hobbit's
netcat sources is at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.atstake.com/research/tools/network_utilities"
	>http://www.atstake.com/research/tools/network_utilities</A>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
... where he (Hobbit) seems to have an e-mail address.  Perhaps he
works at @Stake.
</BLOCKQUOTE>
<BLOCKQUOTE>
As for socat its author, Gerhard Rieger, conveniently list the package's
home page in the man page that comes with the package (at least with the
Debian package): <A HREF="http://www.dest-unreach.org/socat"
	>http://www.dest-unreach.org/socat</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
Reading the sources to these will teach you alot about UNIX network
programming.  In particular netcat has been around for a very long
time and has had VERY FEW bugs reported against it.  It's been
scrutinized by thousands, probably tens of thousands of programmers.
</BLOCKQUOTE>
<BLOCKQUOTE>
You should also buy Richard Stevens' seminal textbook on
<EM>UNIX</EM> <EM>Network</EM> <EM>Programming</EM> (Prentice Hall).  Read more about that at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.kohala.com/start"
	>http://www.kohala.com/start</A>
</BLOCKQuote></BLOCKQUOTE>

<!-- end 5 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Key bindings in X</FONT></H3>
Wed, 22 Jan 2003 07:51:49 +0800
<BR>jamie sims (<a href="mailto:linux-questions-only@ssc.com?cc=jaymz@operamail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%236">jaymz from operamail.com</a>)


<P>
Here's the fix I finally hit upon to get those F keys working
in xterm. I edited a copy of <TT>/usr/X11R6/lib/X11/app-defaults/XTerm</TT> and added the
following:
</P>
<P><BLOCKQuote>
See attached
<a href="misc/tips/XTerm.app-defaults.txt">XTerm.app-defaults.txt</a>
</BLOCKQuote></P>
<P>
I then saved it as .Xdefaults and it works very well.
</P>

<blockquote><font color="#000066">You can use the .Xdefaults file in your home directory to add or
override X internal resources for any application - so make sure that
if you already have some features stored there, that you add this
into it, instead of replacing it.
 -- Heather</font></blockquote>

<!-- end 6 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">alsa in debian</FONT></H3>
Sun, 19 Jan 2003 12:52:21 +0530
<BR>Kapil Hari Paranjape (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&cc=kapil@imsc.res.in&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%237">kapil from imsc.res.in</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)

<P><STRONG>
Hi there,
u know alsa in not built in debian 3.0 by default. but alsa utils... &amp; driver
&amp; header files are present in the 7cd set. could any one please tell me how
to build the alsa modules in debian &amp; the required packages 4 this ?
</STRONG></P>
<P><STRONG>
Note: there are some alsa-modules ( in the cds ) based on 2.4.16 kernel, but
mine is 2.4.18
</STRONG></P>
<P>
Where you got the kernel-image-2.4.18 you should also find the
relevant alsa-modules-2.4.18. Anyway here is the procedure to build
alsa modules for debian.
</P>
<P>
1. Use apt-get to install the relevant alsa-source package. You could
also download the sources from the alsa ftp site --- I haven't tried
that but it should work.
</P>
<P>
2. Install the relevant kernel source package, and the package
kernel-package.
</P>
<P>
3. Unpack the kernel source and alsa-modules in <TT>/usr/src.</TT>
</P>
<P>
4. Run "make-kpkg --config=menuconfig" configure in the kernel source
directory.
</P>
<P>
5. Run make-kpkg kernel-image and make-kpkg modules-image.
</P>
<P>
6. This should build a pair of compatible kernel-image and
alsa-modules package files which you can install with dpkg.
</P>
<P>
7. Of course you need to edit your grub menu or lilo conf file and so
on to run this kernel.
</P>
<P>
8. You can then configure alsa with alsa-conf alsa-base and so on.
</P>
<P>
Remember to set and save the mixer settings so that
<TT>/etc/init.d/alsa</TT> script (which is part of alsa-base) can restore
these settings.
</P>

<!-- end 7 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.8"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">pppd</FONT></H3>
Fri, 3 Jan 2003 11:24:26 -0800
<BR>Mike Iron Orr, Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%238">the <em>LG</em> Answer Gang</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)

<P><STRONG>
pppd command shows a few strings character in RH, but in debian it shows
error
</STRONG></P>
<P><STRONG>
" remote system needs to authenticate itself" &amp; discontinue
</STRONG></P>
<BLOCKQUOTE>
[Ben] 
Ah, I'd missed this part. Neil is right - you don't have the "noauth"
option defined in your "<TT>/etc/ppp/peers/provider</TT>" or whatever options
file you're using.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Iron] 
I haven't used ppp for years (but I will soon, when I set up my mom's computer),
but yes, if you're dialing into an ISP you want "noauth".  Otherwise your Linux
box will require authentication from the server, which it won't do.  The server
thinks *it's* trusted and *you're* the one who has to authenticate yourself.
And even if it was willing to authenticate itself, how could it?  It doesn't
have a password to authenticate itself <EM>with</EM>.  The (nonexistent) password the
servers would authenticate themselves with is different than the user password
you authenticate yourself with.
</BLOCKQUOTE>
<BLOCKQUOTE>
If people are dialing <EM>into</EM> your Linux system, then you want authorization
<EM>for those calls</EM>.
</BLOCKQUOTE>
<P><STRONG>
Thanks 4 the solution,
it is working now.
</STRONG></P>

<!-- end 8 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Is that your FIN_WAIT Answer?</FONT></H3>
Mon, 13 Jan 2003 19:00:25 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com,&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%239">the <em>LG</em> Answer Guy</a>)


<!-- ::
Is that your FIN_WAIT Answer?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I am using RedHat Advanced Server 2.1, Kernel 2.4.9 and am having the
following problem:
</STRONG></P>
<P><STRONG><BLOCKQuote>
If I log on as userA via a telnet session and run Test_pgm and then
disconnect the telnet session by closing the window instead of properly
logging out, this is what is shown from the ps command:
</BLOCKQuote></STRONG></P>

<pre><strong>UID    PID  PPID  C STIME TTY          TIME CMD
userA 8505     1  0 14:00 ?        00:00:00 login -- userA
userA 8506  8505  0 14:00 ?        00:00:00 -bash
userA 8540  8506 87 14:00 ?        00:00:42 Test_pgm
</strong></pre>
<P><STRONG>
Notice that there is no longer a TTY associated with the running program or
the original login and the PPID of the login has been inherited by process
ID#1. Furthermore, if I do a top command, the results show that the CPU Idle
% is zero, with the Test_pgm using up all of the CPU %. The load average
goes through the roof. I've seen it up close to 30.0. However, the system's
performance does not seem to be effected by me or by any of the users. These
processes are not listed as zombies and are never cleaned up by the system
unless I kill the login process or restart the server.
</STRONG></P>
<BLOCKQUOTE>
Most of this seems normal (for a program that's ignoring SIGHUP).  The
loadavg number seems odd.
</BLOCKQUOTE>
<P><STRONG>
This scenario happens whether the user is running an in-house 'C' program or
an operating system utility such as Redhat's setup. Within our own 'C'
programs, I have tried to capture a terminating signal, using the <TT> signal()</TT>
command, but I am not seeing any of the signals
that I would expect to see, such a SIGTERM or SIGHUP.
</STRONG></P>
<P><STRONG>
Does anyone have any ideas as to how to tell RedHat to take down the
processes associated with a telnet when a tty disappears?
</STRONG></P>
<P><STRONG>
Thanks in advance.
<BR>DP
</STRONG></P>
<BLOCKQUOTE>
in.telnetd should be sending a SIGHUP to the process when the TCP
connection is closed (including when the keepalive fails?).
</BLOCKQUOTE>
<BLOCKQUOTE>
Run 'netstat -na' and see if the TCP connection is lingering in
FIN_WAIT state.  This could be a case where your (probably MS-Windows)
telnet client is failing to properly perform the three-way
disconnection handshaking that's required of TCP.  (I recall problems
with some MS Windows FTP clients resulting in similar symptoms on
high volume public FTP servers).
</BLOCKQUOTE>
<BLOCKQUOTE>
Try it with a UNIX telnet client.
</BLOCKQUOTE>
<BLOCKQUOTE>
Try it with ssh.
</BLOCKQUOTE>
<BLOCKQUOTE>
If it works with ssh, perhaps you can use that as leverage with your
users and management to abandon this insecure and deprecated protocol!
(PUTTY is a very good, and free, ssh client for MS Windows operating
systems.  There are many others).
</BLOCKQUOTE>
<BLOCKQUOTE>
Other than that, I would try upgrading the kernel (2.4.9 was pretty
miserable under memory load) and watch one of these sessions with tcpdump
and strace (so you can correlate what's happening on the wire with
what's happening in the process).  Upgrading to RH 7.3 might also be
good since the compilers and libraries in 7.1 and 7.2 had ... issues.
</BLOCKQUOTE>
<BLOCKQUOTE>
Without knowing more about what Test_pgm is supposed to do, I can't
immediately suggest any other workarounds.
</BLOCKQUOTE>

<!-- end 9 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.10"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">direct rendering for nvidia RIVA 128</FONT></H3>
Sun, 19 Jan 2003 00:13:51 +0100
<BR>Yann Vernier (<a href="mailto:linux-questions-only@ssc.com?cc=rscottf@ieee.org&cc=yann@algonet.se&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2310">yann from algonet.se</a>)
<BR>Question by linux-questions-only@ssc.com, Scott Frazier (rscottf from ieee.org)

<P><STRONG>
I have a nvidia velocity 128 video card, which uses the RIVA 128
accelerator chip.  I'm running Mandrake 9.0, which sets it up with
glx (3D capability), but with no  direct rendering (uses software
rendering).  Needless to say this REALLY slows it down for games.
Does anyone know how  I might resolve this?
I've tried changing an entry in the XF86Config file, in the
MODULES section.  I added the line Load "dri", to no avail.
I'm pretty sure the card is dri capable, as it is able to do bus
mastering, which is a must for this.
</STRONG></P>
<P>
Sorry to disappoint you, but last time I checked there was no DRI driver
for the Riva 128. It's among the earliest nVidia chips, and nVidia's own
binary-only driver only supports TNT or later (two models newer). There
was a partly accelerated Mesa-based GLX implementation for XFree86 3
that supported it, however, called Utah-GLX. You may be able to run
that, but you'd obviously lose out on all other new features of XFree86
4.
</P>

<!-- end 10 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.11"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">xcdroast post cdrom mount problem</FONT></H3>
Fri, 10 Jan 2003 17:32:51 -0500
<BR> (<a href="mailto:linux-questions-only@ssc.com?cc=bbertsch@surfside.net&cc=&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2311"></a>)
<BR>Question by Brian (bbertsch from surfside.net)

<P><STRONG>
hello,
i'm a recovering os/2 user.  i used it today, and i may have to
tomorrow... but i can stop any time i  want to.. but my modem....
</STRONG></P>
<P><STRONG>
Anyway, after i use xcdroast, (which i am getting used to, under RH8-<A HREF="http://www.kde.org/">KDE</A>)
i am unable to check the cdrom just  made because the cdrom will not
mount.  (ide double cheapo brand 48x, works great).  i have to use  the
newly-made cd on my os/2 machine to check it.  my friends laugh at me.
</STRONG></P>
<P><STRONG>
thanks, brian
</STRONG></P>
<BLOCKQUOTE>
[JimD] 
You probably need to change <TT>/dev/cdrom</TT> to be a symlink to <TT>/dev/scd0</TT> or
something like that.
</BLOCKQUOTE>
<BLOCKQUOTE>
Linux normally handles your ATAPI CD-R drive via a SCSI emulation
layer.  Once this layer is active (possibly via a loadable module)
then all access to the CD has to go through the SCSI device nodes
(<TT>/dev/sg*</TT> for writing, and <TT>/dev/scd0</TT> for mounting CDs).
</BLOCKQUOTE>
<BLOCKQUOTE>
Try that.  Try this command first:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
mount -t iso9660 -o ro /dev/scd0 /mnt/cdrom
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... from a root shell prompt.
</BLOCKQUOTE>
<BLOCKQUOTE>
[John] 
Greetings from another former OS/2 user - although I used it for about 2
yrs or so, and switched to Linux.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, have you read CD's made from that cooker before?  Could be a
hardware issue.  Some of those really cheap devices lack some features.
But chances of that would seem a bit slim if it's a 48X drive, cuz those
compatibility problems are usually more common with the older drives.  But
I wouldn't rule it out as a possibility.
</BLOCKQUOTE>

<!-- end 11 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.12"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">iptables: What They Are and What They Do</FONT></H3>
Tue, 7 Jan 2003 04:18:33 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=collin_sq2003@yahoo.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2312">the <em>LG</em> Answer Guy</a>)
<BR>Question by peter collins (collin_sq2003 from yahoo.com)

<P><STRONG>
could you please explain to me what iptables are and what they do
</STRONG></P>
<P>
IPTables are tables (lists) of packet filtering rules in the Linux
kernel.  They are added (passed into the kernel's address space)
and manipulated using a command named: 'iptables' and they are
interpreted by various kernel modules written to the "netfilter"
APIs (primarily by Paul "Rusty" Russell).
</P>
<P>
Each rule is a pattern matching some sorts of network traffic
based on many criteria (IP source or destination addresses,
TCP or UDP source and destination ports, ICMP type, IP or other
options (flags), connection status (correlated from other, previous
packets), even MAC addresses, which interface and direction they're
coming from or destined to, which local processes are generating
them, etc.).  Part of each rule is a "disposition" like: DROP, REJECT,
ACCEPT, "jump" to another ruleset (table) etc.
</P>
<P>
The ability to conditionally process different packets in various ways,
and even to conditionally "call" on some rulesets, makes iptables into
a very specialized programming language.  IPChains was somewhat
different, simpler packet filtering language (also by Rusty), and
ipfwadm was a much simpler packet filtering system back in the 2.0
kernel days.
</P>
<P>
It looks like the 2.6 kernel, probably due out sometime this year, will
be the first one since 1.3 that hasn't had a major overhaul in the
packet filtering language.  IP Tables was released with 2.4 and has
only undergone minor bug fixes and refinement since then.
</P>
<P>
Note that most of the packet filtering rules relate to whether to
allow a packet through the system, to DROP it (with no notice)
or REJECT it (providing an ICMP or error back to its sender, as
appropriate), MASQUERADE or TRANSLATE it (change its apparent source
address and port (usually setting up some local state to dynamically
capture and re-write any response traffic related to it), REDIRECT it
(change its destination address and/or port), change its "ToS"  (type
of service) bits.  It's also possible to attach an FWMARK to a packet
which can be used by some other parts of the Linux TCP/IP subsystem.
</P>
<P>
What IPTables is NOT:
</P>
<P><BLOCKQuote>
There is another subsystem, similarly complex and seemingly related
--- but distinct from netfilter (the kernel code that support IP
Tables).  This is the "policy routing" code --- which is controlled
with the tersely named 'ip' command (the core of the iproute2 package).
</BLOCKQuote></P>
<P>
Policy routing is different that packet filtering.  Where packet
filters is about whether the packets go through, and whether some parts
of a packet are re-written, policy routing is purely about <EM>how</EM> they
are sent towards their destination.  Under normal routing every
outbound and forwarded packet is sent to its next hop based exclusively
on its destination address.  Under policy routing it's possible to send
some traffic through one router based on its source address, port or
protocol characteristic, etc.  This is different than the IP tables
"REDIRECT" because this doesn't change the packet --- it just sends it
to a different router based on the policy rules.
</P>
<P>
The two subsystems can interact, however.  For example policy routing
does include options to match on the ToS or FWMARK that might be attached
to a packet by the iptables rules.  (These FWMARKs are just identifiers
that are kept in the kernel's internal data structure about the packet
--- they never leave the system and can't go over the wire with the
packet.  ToS are only a couple of bits in the header, hints that
traditionally distinguish between "expedited" (telnet) and "buld" (ftp)
traffic).
</P>
<P>
The iproute2 package and the 'ip' command replace the ifconfig command
and provide considerable control over interfaces.   It also allows one
to set "queueing disciplines" to interfaces which determine which
packets get to "go first" when there are more than one of them waiting
to be sent over given interface.
</P>
<P>
There is alot more I could tell you about Linux routing and network
support.  For example none of this relates to dynamic routing table
management.  There are user space programs like routed, gated, and
various GNU Zebra modules, that can listening to various dynamic
routing protocols such as RIP, RIPv2, OSPF, BGP, etc. to automatically
add and remove entries to the kernel's routing tables.  Some of these
might be able to also dynamically set <EM>policies</EM> as they do so.
There is also a Linux compile time option called "Equal Cost
Multi-path" which is not part of policy routing.  Normally if you added
two static routes of "equal cost" than the first one (of the lowest
cost) would always be used, unless the system was getting "router
unavailable" ICMP messages from somewhere on the LAN.  However, with
Equal Cost Multipath the system will distribute the load among
such routes.  This can be used to balance the outbound traffic from a
very busy system (such as a popular web server or busy mail gateway) among
multiple routers (connected to multiple ISPs over multiple T1s or whatever).
</P>
<P>
(This is similar to a trick with policy routing --- assigning a couple
of IP "aliases" --- different IP addresses --- to one interface; one
from one ISP, another from a different one, and using policy routing
to ensure that all response/outbound packets <EM>from</EM> one of these sources
go through the appropriate router.  DNS round robin will balance the
incoming load, and policy routing will balance the response load.
Equal Cost Multipath will balance traffic <EM>initiated</EM> from that host).
</P>
<P>
Again, all of these last paragraphs are NOT IP tables.  I'm just trying
to give you a flavor of other networking stuff in Linux apart from it,
and to let you know that it, if you don't find what you need in the
iptables documentation, it might be somewhere else.
</P>
<P>
To learn more about Netfilter and IP Tables, please read though the
appropriate HOWTOs:
</P>
<P><BLOCKQuote>
<A HREF="http://www.tldp.org/LDP/nag2/x-087-2-firewall.future.html"
	>http://www.tldp.org/LDP/nag2/x-087-2-firewall.future.html</A>
<A HREF="http://www.netfilter.org"
	>http://www.netfilter.org</A>
</BLOCKQuote></P>
<!-- sig -->
<!-- sig -->

<!-- end 12 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.13"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Code folding in Vim</FONT></H3>
12 Jan 2003 23:53:53 +0530
<BR>Ashwin N (<a href="mailto:linux-questions-only@ssc.com?cc=ashwin_n@gmx.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2313">ashwin_n from gmx.net</a>)


<P>
Vim versions 6.0 and later support a new feature called Code Folding.
Using code folding a block of code can be "folded" up into a single
line, thus making the overall code easier to grasp.
</P>
<P>
The Vim commands to use code folding are quite simple.
</P>
<P>
To create a fold just position the cursor at the start of the block of
code and type :
zfap
</P>
<P>
To open a fold :
zo
</P>
<P>
To close a fold :
zc
</P>
<P>
To open all the folds :
zr
</P>
<P>
To close all the folds :
zm
</P>
<P>
For more commands and information on code folding in Vim query the
inbuilt help feature of Vim :
:help folding
</P>
<BLOCKQUOTE>
[John Karns] 
You're quite right. Folding is particularly useful for
long sections of code that contain loops, etc. I use
it extensively in this context.
</BLOCKQUOTE>
<BLOCKQUOTE>
Other uses include long paragraphs of prose.
</BLOCKQUOTE>
<BLOCKQUOTE>
But make sure you are in command mode!  If you are in text
entry mode, just typing in "zfap" would literally embed that
string into your text!
</BLOCKQUOTE>

<blockquote><font color="#000066">If you're in text entry mode, press Escape to get back into
command mode.
</font></blockquote>
<blockquote><font color="#000066">Vi has two command modes and a text entry mode.  When you come
in you are at ordinary command mode.  When you type a colon
(such as what precedes the word "help" above) then you end up
with a small colon prompt.  The above commands are NOT colon
mode commands, except for help.  But you do need your cursor
at the right location.
</font></blockquote>
<blockquote><font color="#000066">The colon prompt is also called "ex mode" by old hands at vi,
but I'm not entirely sure that all the commands that use it
are really old commands at all.  Some are surely long words
allowing you to access some enhanced features, too, because
there are only so many letters in the alphabet.
</font></blockquote>
<blockquote><font color="#000066">To get out of the help mode you may need to type :q to quit
the extra window it created.  Your original textfile is still
around, don't worry.
 -- Heather</font></blockquote>

<!-- end 13 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.14"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Debian "Woody" boot error</FONT></H3>
Tue, 21 Jan 2003 16:30:32 -0600
<BR>Robos (<a href="mailto:linux-questions-only@ssc.com?cc=rich@gandalf.ws&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2314">the <em>LG</em> Answer Gang</a>)
<BR>Question by Rich Price (rich from gandalf.ws)

<P><STRONG>
After installing the Woody release of <A HREF="http://www.debian.org/">Debian</A> using the idepci kernel I
noticed the following boot message
</STRONG></P>

<pre><strong>modprobe: Can't locate module char-major-10-135
</strong></pre>
<P><STRONG>
Some Google searching led me to the following factoid:
</STRONG></P>
<P><STRONG><BLOCKQuote>
"char-major-10-135" refers to the character device, major 10, minor 135,
</BLOCKQuote></STRONG></P>
<P><STRONG>
which is <TT>/dev/rtc.</TT>
It provides access to the BIOS clock, or RTC, the Real Time Clock.
</STRONG></P>
<BLOCKQUOTE>
[Robos] 
OH MY GOSH! REINSTALL!
(Just kidding)
</BLOCKQUOTE>

<blockquote><font color="#000066">This doesn't actually mean that your computer has no sense of time at
all;  it just means you won't be able to access the additional precision
it has available, without extra code in the kernel.  If you have SMP,
the kernel docs warn that it's important to compile this in.  Otherwise,
very few things actually care.
</font></blockquote>
<blockquote><font color="#000066">But in a new enough kernel, with devfs support, any app which is
curious about it (that is, would use the extra support if you have it,
but ignore it if you don't) will provoke a complaint when the userland
devfsd attempts to autoload the module.  You can tell it to ignore that
stuff, detailed in devfsd's man page.
 -- Heather</font></blockquote>
<P><STRONG>
So, fine, I want it.
</STRONG></P>
<BLOCKQUOTE>
[Robos] 
Hmm, ok
</BLOCKQUOTE>
<P><STRONG>
I looked around in the distro CDs, but I couldn't find the char-major-10-135
module.
No luck at the Debian site either.  Where can I find a copy of this module
compiled for the
Debian Woody idepci kernel?
</STRONG></P>
<BLOCKQUOTE>
[Robos] 
Actually it has to be compiled in the kernel to be either hard integrated or
to be loadable as a module. It <EM>seems</EM> as if they (the debian kernel package
maintainer) did neither. So, either you bake your own kernel and tick the
appropriate field in make xconfig or you need to look (grep) through some
configs of kernels (packaged ones) to find one which has rtc true oder m.
BTW, I have this message too on all my machines with hand made kernels and
it didn't bother me a thing till now...
</BLOCKQUOTE>
<BLOCKQUOTE>
[Iron] 
char-major-10-135 is a generic name; the module itself won't be called that.
Take a look in <TT>/etc/modules.conf</TT> .  The "alias" lines map the generic name to
a specific module that provides it, for instance:
</BLOCKQUOTE>

<blockquote><pre>alias char-major-10-175 agpgart
</pre></blockquote>
<BLOCKQUOTE>
In this case, some program or daemon is trying to access the real time clock.
You can also create your own aliases; e.g., I name my Ethernet cards according
to their interfaces:
</BLOCKQUOTE>

<blockquote><pre>alias eth0 3c59x
alias eth1 eepro100
</pre></blockquote>
<BLOCKQUOTE>
So when my network initialization script does:
</BLOCKQUOTE>

<blockquote><pre>modprobe eth0
modprobe eth1
</pre></blockquote>
<BLOCKQUOTE>
I know eth0 will connect to the 3C905 card (DSL) and eth1 will connect to the
EE PRO card (LAN).  And if I have to change cards later, I can just change the
alias lines and leave everything else along.  (The only thing I can't do is
use two cards of the same brand, because then I would have no control over their
initialization order except by seeing which PCI slot has the lowest base
address: "cat <TT>/proc/ioports</TT>".  If eth0 and eth1 get reversed, the network
won't work because packets will get routed to the wrong network.)
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, the easiest way to "fix" your problem is to add an alias:
</BLOCKQUOTE>

<blockquote><pre>alias char-major-10-175 off
</pre></blockquote>
<BLOCKQUOTE>
That tells modprobe to shut up because there is no module for that service.
So whatever is asking for that module will abort or do without.  Whether that's
a problem or not depends on what the program is trying to do and whether you
need it.  I have never run into problems aliasing char-major-*-* modules off.
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course, the "correct" solution is to find out what's using the module and
disable it if you don't need it.
</BLOCKQUOTE>
<BLOCKQUOTE>
In my Linux 2.4.17 source, "make menuconfig", "character devices",
"Enhanced Real Time Clock support", "Help" (press Help while the cursor is
on the RTC line) says the module file is "rtc.o".  You can also guess that from
the config option name at the top: CONFIG_RTC.  That's the file you want from
your distribution disk.  On Debian it would be in a kernel modules package.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note that Debian has a configurator for <TT>/etc/modules.conf.</TT>  Instead of editing
that file directly, edit <TT>/etc/modutils/aliases</TT> and then run "update-modules".
See "man 8 update-modules".
</BLOCKQUOTE>

<!-- end 14 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Proxying with MAC address</FONT></H3>
Sun, 12 Jan 2003 05:00:20 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=gansh@rediffmail.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2315">the <em>LG</em> Answer Guy</a>)
<BR>Question by Ganesh M (gansh from rediffmail.com)

<P><STRONG>
Thanks to Karl-Heinz Herrmann for bearing with me, just one little
<BR>question please.
</STRONG></P>
<P><STRONG>
Is it possible to restrict internet access by private LAN PCs
taking into account their MAC address instead of the IP address
by any means, i.e., Masquerading/Proxying etc. Can masquerading
and proxying co-exist, and if so, what is the advantage?
</STRONG></P>
<P><STRONG>
Thanks
<BR>M Ganesh
</STRONG></P>
<P>
It should be possible (though <EM>very</EM> cumbersome) to configure your
networks so that only registered MAC addresses are routed from one
internal network to another (including via the border router to the
Internet).
</P>
<P>
Under Linux you could write scripts to do this using the MAC Address
Match option/module in the Linux kernel configuration (*) (named:
CONFIG_IP_NF_MATCH_MAC in the .config file).
</P>

<blockquote><em><font color="#000033"><br>   *(Networking Options --&gt; Netfilter Configuration --&gt; IP Tables)
</font></em></blockquote>
<P>
However, it's probably an ill-advised strategy.  Many people try
to limit this by setting up their DHCP servers with known MAC addresses
and refusing to give out IP addresses to unknown systems.  They then
might couple this with monitoring using the 'arpwatch' package to
detect new ARP (MAC/IP address combinations) and with 'snort' to
warn them of other suspicious network activity.
</P>
<P>
As for co-existence of IP Masquerading and applications layer proxying.
Yes they can co-exist --- and are even sensible in some cases.  In fact
it's common to use something <EM>like</EM> IP Masquerading with the Squid caching
web proxy --- in its "transparent proxy" configuration.
</P>
<P>
In general you might use proxies for those protocols that support it,
and for inbound connections; while letting systems fall back on IP
masquerading other work (subject to your packet filtering, of course).
</P>
<P>
The advantages of application proxy systems are largely in three
dimensions:  They can be quite simple, and run in user space often as a
non-privileged process (security and simplicity); they can reflect
higher level policies because they have access to the applications and
sessions layers of the protocol that is being proxied (flexibility and
control), they may be able to provide better performance (performance,
especially via caching).
</P>
<P>
However, any particular proxy might not provide real advantages in all
(nor even ANY) of these areas.  In particular the Delegate proxy system
seems to be riddled with buffer overflows, for example.  Squid is a
nice caching proxy for web and some other services --- and it has some
security and policy management features and optional modules.  However,
Squid configuration and administration can be quite complicated.  It's
far too easy to inadvertantly make your Squid system into a free
anonymizing proxy for the whole Internet, or to make it into an
unintentional <EM>inbound</EM> proxy to your own intranet systems.
</P>
<P>
While a proxy <EM>might</EM> have access to the application/session layer data
(in the payloads of the IP packets) --- it might not have a reasonable
means for expressing your policies regarding acceptable use of these
protocols.
</P>
<P>
Also there are always those new protocols for which no proxies have
been written.  There will frequently be considerable demand by your
users and their management to provide access to the latest and greatest
new toys on the Internet (Pointcast was an historic example, Internet
radio is, perhaps, a more recent one).
</P>
<P>
These issues are very complex, and I can't do them justice at 5am after
staying up all night 
<IMG SRC="../gx/dennis/smily.gif" ALT=";)" 
		height="24" width="20" align="middle">
</P>

<!-- end 15 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<P> <A NAME="tips.16"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">fwd: Re: [TAG] wrestling with postfix...</FONT></H3>
Sun, 19 Jan 2003 09:01:44 -0800
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=rnegut@yahoo.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2316">the <em>LG</em> Answer Gang</a>)
<BR>Question by Radu Negut (rnegut from yahoo.com)

<P><STRONG>
Hi!
After going twice through the postfix documentation, I
still couldn't figure it out if it is possible to
configure mail for groups (e.g.
<A HREF="mailto:sales_managers@domain.com"
	>sales_managers@domain.com</A>) otherwise besides aliasing
all group members to that address in
<TT>/etc/postfix/aliases.</TT> Does postfix reread the aliases
as well if 'postfix reload' is issued or only the .cf
file? Does 'service postfix restart' reset all
mailques, resulting in dropped/lost mail? I've looked
</STRONG></P>
<P>
For alias lists, add stuff to <TT>/etc/aliases</TT> then run
</P>
<P><CODE>
postalias /etc/aliases
</CODE></P>
<P>
If you don't care whether the new aliases are effective instantly,
you're done.  Very shortly Postfix will notice
the aliases file is updated and will reload it.
</P>
<P>
You may keep aliases in additional files.  See the
</P>
<P>
alias_maps =
</P>
<P>
parameter in main.cf.  You can add as many alias files as you
like.
</P>
<P>
For bigger lists, or frequently changing ones, investigate
mailing list software.  I use Mailman or majordomo myself.
See the URL below.
</P>
<P><STRONG>
around but couldn't find if postfix can be configured
to use accounts other than from <TT>/etc/passwd</TT> (and I'm
not talking about aliases). What I mean is normal mail
spools, but for users that get specified in a separate
file and who do not have any permissions on the system
whatsoever.
</STRONG></P>
<P>
Briefly, you can't do normal UNIX mail delivery except to users
from <TT>/etc/passwd.</TT>  However you <EM>can</EM> do POP3/IMAP delivery
to a software that maintains its own list of users.  You're looking
for something like Cyrus.  You'll find it under the POP3/IMAP servers
section of
</P>
<P>
<A HREF="http://www.postfix.org/addon.html"
	>http://www.postfix.org/addon.html</A>
</P>
<P>
Take the time to browse the other pages of the postfix.org site.
</P>
<P>
--
Dan Wilder
</P>
<!-- sig -->

<!-- end 16 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>This page edited and maintained by the Editors of <I>Linux Gazette</I><br>HTML script maintained by <A HREF="mailto:star@starshine.org">Heather Stern</a> of Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="http://www.linuxgazette.com/copying.html">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 87 of <i>Linux Gazette</i>, February 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>



<TABLE width="100%" BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD>


<center>
        <img src="../gx/dennis/qbubble.gif" alt="(?)"                           
	                border="0" align="left">
<A NAME="answer"><BIG><BIG><STRONG><FONT COLOR="maroon"
	>The Answer Gang</FONT></STRONG></BIG></BIG></a>
	<img src="../gx/dennis/bbubble.gif" alt="(!)"                           
	                border="0" align="right"><BR>
<STRONG>By Jim Dennis, Ben Okopnik, Dan Wilder, Breen, Chris, and...
        (<a href="../tag/bios.html">meet the Gang</a>) ...
	        the Editors of <i>Linux Gazette</i>...
		        and You! 
</STRONG></BIG> </TD></TR>
</TABLE>
<P>

<!-- END header -->

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

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

<DL>
<!-- index_text begins -->
<dt><A HREF="#tag.1"
	><img src="../gx/dennis/bbub.gif" height="28" width="50"
	  alt="(!)" border="0"
	><strong>LILO problem whith dual linux boot on seperate drives</strong></a>
<dt><A HREF="#tag.2"
	><img src="../gx/dennis/bbub.gif" height="28" width="50"
	  alt="(!)" border="0"
	><strong>filter out spam and viruses</strong></a>
<dt><A HREF="#tag.3"
	><img src="../gx/dennis/bbub.gif" height="28" width="50"
	  alt="(!)" border="0"
	><strong>The One Remaining (non-Depracated) Use for rsh</strong></a>
<!-- index_text ends -->
</DL>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag/greeting"><HR WIDTH="75%" ALIGN="center"></A>
<H3 align="left"><img src="../gx/dennis/hbubble.gif" 
	height="50" width="60" alt="(&para;) " border="0"
	>Greetings from Heather Stern</H3>
<!-- begin hgreeting -->
<P> Greetings, everyone.  It's another day, another penguin over here at
The Answer Gang.   I'm sorry there are only three messages this time but
I think you'll find them juicy.

<P> Statistics - there were about 460 messages - and almost none of that was
spam thanks to Dan Wilder's hard work keeping the list on a leash.  I'd 
say the most common reason to not get an answer or merely get grumped at
instead of seeing a useful answer, would be to combine the twin errors
of using HTML based mail, and not telling us what few things you've
looked up first.  We can do much better at translating technese to
English than we can do at translating confused-fuzziness to a technical
question.

<P> You folks had a gazillion good tips out there and I'm digging myself out
from under them right now.  [Imagine:  a computer workroom filled with 
little grey envelopes filled with pennies all gabbing about little Linux
tidbits.  It's quite a chatterbox.]

<P> But that's hardly fair.  The real reason I'm running late and a few
pennies short is that I've been working really hard on the upcoming
LNX-BBC.  It's gonna be this year's membership card for the 
<A HREF="http://www.fsf.org/">Free Software Foundation</A>.  I mean, if you're
not a member then perhaps you should be anyway... but this is a definite plus.
It's still a toy for experts though.  More on cool toys for "the rest of us" in
upcoming months.  There are lots and lots of good projects out there.  

<BLOCKQUOTE><EM>
	[It wasn't all Heather's fault.  Our FTP server played a game of
"let's not but pretend we did", accepting Heather's Answer Gang upload but not
storing it.  Bad FTP daemon, bad!  It also has been dying the past few days,
which Dan has been combating via upgrades and logfile analysis.  At one point
logrotate was dying and taking the daemon down with it.  -Iron.]
</EM></BLOCKQUOTE>

<P> Have fun!
<!-- end hgreeting -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 87 of <i>Linux Gazette</i>, February 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->

<SMALL><CENTER><H6 ALIGN="center">HTML script maintained by
        <A HREF="mailto:star@starshine.org">Heather Stern</a> of
        Starshine Technical Services,
       <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6></SMALL></CENTER>
<HR>

<P>
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.1"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif" 
	height="50" width="60" alt="(!) " border="0"
	>LILO problem whith dual linux boot on seperate drives</H3>


<p><strong>From Rich Price
</strong></p> 
<p align="right"><strong>Answered By Matthias Posseldt, Jim Dennis, Mike "Iron" Orr, John Karns, Heather Stern, Benjamin A. Okopnik 
<p></strong></p>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I recently bought a new IDE disk drive and installed it as <TT>/dev/hdb</TT> in my
server.
While leaving my current [<A HREF="http://www.slackware.org/">Slackware</A>] distribution on <TT>/dev/hda</TT>, I wish to
install the <A HREF="http://www.debian.org/">Debian</A> distribution on <TT>/dev/hdb.</TT>
</STRONG></P>
<P><STRONG>
After completing the basic Debian install, I edited the lilo.conf file to
include a second image. The original file was:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/rich-price.slack.lilo-conf.txt">rich-price.slack.lilo-conf.txt</a></tt></p>
<P><STRONG>
The newly modified file is:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/rich-price.slack-debian.lilo-conf.txt">rich-price.slack-debian.lilo-conf.txt</a></tt></p>
<P><STRONG>
when I tested this config file i got:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/rich-price.slack-debian.lilo-complains.txt">rich-price.slack-debian.lilo-complains.txt</a></tt></p>
<P><STRONG>
<TT>/boot/vmlinuz-2.2.20-idepci</TT> does exist on <TT>/dev/hdb1</TT> but not of course on
/dev/hda1.
Is this the problem?  If so, how do I access an image on a different hard
drive?
</STRONG></P>
<P><STRONG>
I downloaded the "LILO User's Guide" and read about the alternate image
format:
</STRONG></P>

<pre><strong>   image=/dev/hdb1
      range=sss-eee
</strong></pre>
<P><STRONG>
where sss-eee is the starting and ending sector range of the image, but I
don't know
how to find out what to use for sss-eee.
</STRONG></P>
<P><STRONG>
Rich Price
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Matthias] 
Just mount the corresponding partition and use this path then, e.g.
</blockQuote>

<blockquote><pre>image = /mnt/newdebianroot/boot/vmlinuz-2.2.20-idepci
root = /dev/hdb1
label = Debian
</pre></blockquote>
<blockQuote>
A different option is to separate boot and root partitions and mount the
<TT>/boot</TT> partition in both Slackware and Debian while also keeping
<TT>/etc/lilo.conf</TT> in sync, so that you can easily use the
<TT>/boot/vmlinuz-debian-2.a.b</TT> and <TT>/boot/vmlinuz-slackware.2.x.y</TT> kernel images
and use the <TT>/boot</TT> path. An easy way would be to symlink <TT>/etc/lilo.conf</TT> to
<TT>/boot/lilo.conf</TT> in both installations and you can happily run lilo from
Debian and Slackware.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd personally avoid the esoterica of any "alternate image format"
(if possible) and simply put the desired kernel and any required
initrd (compressed initial RAMdisk) images unto the <TT>/boot</TT> partition
(or into the <TT>/boot</TT> directory of any rootfilesystem) back on <TT>/dev/hda.</TT>
</blockQuote>
<blockQuote>
There is no problem sharing one <TT>/boot</TT> directory among multiple
Linux distributions --- and it's the easiest way to do it.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Thanks to both of you for your answers.
</STRONG></P>
<P><STRONG>
I have sidesteped the problem for now by booting off of a floppy.
But I think Jim's suggestion will make a better long term solution.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron] 
Jim's method is the easiest and most convenient.  However, there's no reason
the other kernel has to be in <TT>/boot</TT> as long as it's mounted somewhere when
"lilo" is run.  Older Linux distributions used to put the kernel in <TT>/</TT> by
default.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I am not a programmer [any more] but I think that an enhansement
to LILO which would allow the use of different file systems for
different boot images would be good.  Something like this:
</STRONG></P>

<pre><strong>image = /boot/vmlinuz-2.2.20-idepci
root = /dev/hdb1
imagefs=/dev/hdb1
label = Debian
</strong></pre>
<P><STRONG>
Where imagefs is a new parameter used to specify the file system
that contains the boot image file.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Jim] 
Unfortunately this suggestion exhibits a fundamental misunderstanding
of how LILO works.  The "image" files are access as regular files,
and thus they must reside on some locally mounted filesystem when you
run <TT>/sbin/lilo.</TT>  <TT>/sbin/lilo</TT> then issues ioctl()s to get the low-level
block address information about where the image file's parts are
located.  Those raw device/block addresses are written into the map
file (usually found in <TT>/boot</TT>).  The address of the map file is written
into the boot block (usually in the MBR of the hard drive).
</blockQuote>
<blockQuote>
Your hypothetical imagefs= would require that <TT>/sbin/lilo</TT> either
incorporate all the code to directly access the device/partition as
a filesystem (which is infeasible for a large number of filesystem and
is just bad engineering --- code duplication for even a single type),
or it would have to do something like: make a temporary mount point,
mount the imagefs, use this temp mount as a relative chroot
point?, then proceed as before.  It's VASTLY easier for you to
mount the fs up yourself and simply manually refer the appropriate
entries in your <TT>/etc/lilo.conf</TT> to the kernel image (and initrd images,
etc) before running <TT>/sbin/lilo.</TT>
</blockQuote>
<blockQuote>
In my MANY discussions about LILO I find it convenient to distinguish
between LILO (the whole package) and <TT>/sbin/lilo</TT> (the utility that reads
the <TT>/etc/lilo</TT> file and various command line options and produces/writes
a map file and a bootloader (into the MBR, unto a floppy or into a
filesystem superblock or "logical boot record).
</blockQuote>
<blockQuote>
Run strace on <TT>/sbin/lilo</TT> some time and you may find enlightenment.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [John] 
Yes, Linux is nirvana!  :^)
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
I've found that running "strace" <em> _often</em> precedes enlightenment. Also,
like reading the dictionary (who the heck can stop at just one entry?),
it's usually enlightenment on topics far beyond the original one.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron] 
What would the information be useful for?  "lilo" uses the image= path to
determine the kernel's physical location, the boostrapper uses the physical
location, and at no time is <TT>/boot</TT> required to be mounted (except when running
"lilo").
</blockQuote>
<blockQuote>
However, a few programs use <TT>/boot/System.map</TT> (or <TT>/boot/System.map-VERSION</TT>), and
these may behave funny if it's not accessible or is out of sync with the
running kernel.  Currently I see that klogd (the kernel logging daemon) has it
open while it's running.  But stopping klogd, unmounting <TT>/boot</TT> and restarting
klogd does not cause any errors, although it does generate a log message of:
</blockQuote>

<blockquote><pre>Jan 10 14:55:28 rock kernel: Cannot find map file.
Jan 10 14:55:28 rock kernel: No module symbols loaded.
</pre></blockquote>
<blockQuote>
"man klogd" says it uses System.map to translate the numeric traceback of a
kernel error to a list of functions that were active at the time, which makes
it easier for kernel developers to track down what caused the problem.
</blockQuote>
<blockQuote>
Dan says modprobe also uses System.map.  "strings <TT>/sbin/modprobe</TT> | grep
System.map" shows that word exists in the code, although the manpage doesn't
mention it.  So you may need <TT>/boot</TT> mounted when loading modules.
</blockQuote>
<blockQuote>
Is there anything else that likes to have System.map around?
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Ben] 
Oddly enough, <EM>Netscape</EM>. I remember doing some complicated messing
around with multiple kernels, way back when, where I'd hosed System.map
in some way or another. It didn't seem to affect too many things, but
the annoying error message I got every time I fired up Netscape finally
got me to straighten it all out. I was a young Linux cub then... 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [John] 
For a time I used to unmount the <TT>/boot</TT> partition in the init scripts to
avoid risking corruption of the ext2fs there during normal operation.
Then I noticed the above errors (didn't seem to affect loading modules
though), and switched to remounting as ro instead, which rid me of the
error, and avoids the problem of having it mounted rw.  Alternatively I
suppose that one might be able to change the fstab entry to mount it ro.
Not sure if there is a requirement to have it rw in the early boot
process.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron] 
I have had <TT>/boot</TT> mounted read-only for years and have had no problem.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather] 
On my multi-distro setup, I also mount <TT>/boot</TT> read-only;  depmod tries to
run during every boot, and complains that it cannot write.  As long as
I deliberately run depmod while my <TT>/boot</TT> is read-write whenever I'm
adding modules or new kernels, then this is an ignorable warning because
I already did that.  When running depmod by hand on a kernel which you
do not yet have booted, you definitely need a copy of its System.map on
hand, for use with the -F parameter.  If I fail to do this, the distro
that wants this is a very unhappy camper, because with no depmod
information at all, it cannot load any modules.
</blockQuote>
<blockQuote>
I occasionally build monolithic kernels deliberately, but that's barely
viable with today's huge list of kernel features.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Thanks, Jim.
</STRONG></P>
<P><STRONG>
This information makes LILO much more understandable to me.
It enables me to see why my suggestion doesn't make any sense.
It also makes the light bulb go on about Matthias's original answer
which I admit I didn't understand until now.  This is great!
I now have two ways to solve my problem and enough understanding
about what I am doing to finally be dangerous ;-}&gt;
</STRONG></P>
<P><STRONG>
I think that adding something similar to your comments to the LILO
User's Guide would be helpful to part time LINUX hackers like me.
Perhaps in section 3.3.1 a second paragraph could be added saying:
</STRONG></P>
<P><STRONG><BLOCKQuote>
"The image file is accessed as a regular file,  and thus it must reside
on a locally mounted filesystem at the time that <TT>/sbin/lilo</TT> is run.
</BLOCKQuote></STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
...  kernel and initrd images files are accessed by <TT>/sbin/lilo</TT> ...
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
/sbin/lilo
will then issue ioctl()s to get the low-level  block address information
which shows where the image file's parts are located in the file system.
This file system does not have to be on the same physical drive as the
root file system."
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
... but must be accessible to the bootloader code (generally via BIOS functions).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Did I get it right?  Do you think I should suggest this to the maintainers?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I've touched it up a bit --- their maintainers would, undoubtedly
tweak it more to their likely if they choose to incorporate it.
</blockQuote>
<blockQuote>
Please feel free to send this to John Coffman and to the maintainers of
the appropriate HOWTOs (as referenced in my earlier post).
</blockQuote>
<blockQuote>
I'd also <EM>highly</EM> recommend pointing them at the years of Linuz Gazette
Answer Guy/Gang material on this topic --- so they can understand how
frequently these questions come up and glean some ideas for how we
people in the "support trenches" have been trying to dispel the
confusion that plagues so many LILO users.  (Did I mix too many
metaphors there?)
</blockQuote>
<blockQuote>
In particular if they explain LILO as analogous to programming:
<TT>/etc/lilo.conf</TT> is the "program source", <TT>/sbin/lilo</TT> is the compiler and
the bootloader and map files are "objects" --- then a large number of
people will "get it."  Even people with the barest modicum of
(compiler) programming experience understand why changing the source
code doesn't change the program until it's recompiled.
</blockQuote>

<!-- end 1 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.2"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 2 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif" 
	height="50" width="60" alt="(!) " border="0"
	>filter out spam and viruses</H3>


<p><strong>From Jonathan Becerra
</strong></p> 
<p align="right"><strong>Answered By Faber Fedor, Neil Youngman, Kapil Hari Paranjape, Heather Stern 
<p></strong></p>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I'm very new to Linux but like what I see
</STRONG></P>
<P><STRONG>
The object here is to install a software that will filter all my e-mails and
keep out viruses
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Faber] 
Look into Amavis (www.amavis.org) and your favorite anti-virus software
(Sophos, McAffee, etc.). If you're using Postfix as your MTA, drop me a
line and I can help you get the three of them working.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
and catch re-occurring spam.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Faber] 
Check out Spam Assassin (www.spamassassin.org).  It rocks!
</blockQuote>

<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather] Since the list which all Answer Gang members are on uses SpamAssassin as one
among several defenses, I think yes - it does 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> but it is not infallible.
With any mail filtering answers I encourage you to take a look at its
principles, and decide if you like them, rather than just take someone
else's word on what is or isn't spam.
</blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Neil] 
LWN seem to rate bogofilter, see <A HREF="http://lwn.net/Articles/9186"
	>http://lwn.net/Articles/9186</A>. I haven't
used it myself.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
I currently use "bogofilter" and am very happy with it. There are also
alternatives such as "spamoracle" and "spamprobe". All these three
programs implement Paul Graham's suggestions in "A Plan for Spam".
</blockQuote>
<blockQuote>
As far as I can make out "spamassasin" is a much more general tool that
can easily incorporate the measurements used by Paul Graham.
</blockQuote>
<blockQuote>
The neatness of Paul Graham's approach is that it is entirely
"Bayesian" --- spam mails self-select themselves once we have a
sufficiently large database of spam and non-spam messages. Moreover,
this division is entirely in the hands of the end-user.
</blockQuote>
<blockQuote>
On the other hand since this measurement is made <EM>after</EM> the mail enters
the system it is not very useful if you want to reduce bandwidth
consumption.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I have 2 NIC cards, etho1 and
etho2. Both were picked up by my install and both work, I can get out to the
Internet with either one. I need help configuring etho1 to be the incoming
route for my e-mails which my software will then pick up and process and
then I want etho2 to send it out to my users.
</STRONG></P>
<P><STRONG>
I have been all over the Internet and in the book stores, I even had to
break down and buy a Linux book for dummies which was no help at all.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
I think what you need is to take a hard look at Firewall-HOWTO.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Faber] 
(at <A HREF="http://www.tldp.org"
	>http://www.tldp.org</A>, in case you didn't know).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Sound possible?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Faber] 
With Linux, almost anything is possible.
</blockQuote>

<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather] Though it may take a while to finish coding... no wait, that's "the
impossible takes a little longer" 
<IMG SRC="../gx/dennis/smily.gif" ALT=":D" 
		height="24" width="20" align="middle">
</blockquote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I would be so appreciative and so would my head (because then I can quit
banging it against my desk) for any and all help you could provide.
</STRONG></P>

<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Heather] On behalf of the Gang, we hope you heal up soon!  You're following good
principles;  make all emails have to follow one path into your site,
then place some guardians upon that path to nail the miscreants as they
come through.
</blockquote>
<blockquote>Tune up your firewall to only show services to the outside world which
you really provide, and that needed for your inside people to get to
outside services they use (generally, using IP masquerading will make
this automatic and nearly invisible).  If you've got specific hosts
pestering you with spam, get your MTA to blow them off with a "551
too much spam, site blocked" so your mailbox guardians don't have to
waste CPU time on those bozos.  Best of luck in the battle against spam.
</blockquote>

<!-- end 2 -->
<!--     .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.     -->
<A NAME="tag.3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif" 
	height="50" width="60" alt="(!) " border="0"
	>The One Remaining (non-Depracated) Use for rsh</H3>


<p><strong>From Dave Falloon
</strong></p> 
<p align="right"><strong>Answered By Jim Dennis, Mike "Iron" Orr, Kapil Hari Paranjape 
<p></strong></p>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Hi Answer Guy,
</STRONG></P>
<P><STRONG>
I have a 32 node cluster running <A HREF="http://www.debian.org/">Debian</A> 3.0 (Woody).  The primary way we
use these machines is in a batch type submission, kind of a fire an forget
thing, via rsh "&lt;command&gt;".
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
These days the knee jerk response would be: "Don't run rsh; use ssh
instead."
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Agreed, the reason for rsh is that this little cluster is all by itself,
accessed through a "choke host" that is pretty well locked down, only a
handful of users can access it on the external interface.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
However, compute clusters, on an isolated network segment, (perhaps
with one or more multi-homed ssh accessible cluster controller nodes)
are still a reasonable place for the insecure r* tools (rsh, rlogin,
rcp).  (rsync might still be preferable to rcp for some workloads and
filesets).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I crippled PAM a little to allow this ( changed
one line to be sufficient).  This cluster is not a super critical farm so if
things go haywire its not a big deal but it would be nice to figure out why
sometimes you can't connect to the nodes, here is the output from one such
attempt:
</STRONG></P>

<pre><strong>(503)[dave@snavely] ~$ rsh ginzu
Last login: Thu Jan 16 16:37:22 2003 from snavely on pts/1
Linux ginzu 2.4.18 #1 SMP Fri Aug 2 11:20:55 EDT 2002 i686 unknown
rlogin: connection closed.
(504)[dave@snavely] ~$
</strong></pre>
<P><STRONG>
This happened once then when I repeated the command it succeeded, with no
error.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
One possible reason for the problem is the assignment of a free pty.
</blockQuote>
<blockQuote>
1. You may be running out of pty's if many processes unnecessarily
open them.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
This is a definate possibility, and I am recompiling a kernel as we speak to
up this limit to 2048.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
2. Your tweaking of rsh and PAM was not sufficient to give rsh
permission to open a pty.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Would this produce an intermitten connection drop or would it prevent any
connection at all?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
This would also explain the unable to get TTY name error.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
So how does the chain of events happen?  Is this correct; I rsh to a machine
it, pam looks over its rules and see that it is crippled and should allow
this connection with no passwd, passes this on to login which then tries to
assigned a pty but the pty's are all currently used, then it tries to assign
a TTY because there are no ptys, and in my logs I get the can't get TTY name
error?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Kapil] 
No, there is no separate "TTY" assignment. The "pty/tty" pair is what is
assigned for interactive communication.
</blockQuote>
<blockQuote>
Let's see if we can track the sequence of events (the Gang please post
corrections, I am sure I'll go wrong somewhere!):
</blockQuote>
<blockQuote><BLOCKQuote>
Client "rsh" request is usually handled on the server by "inetd" which
then passes this request to "tcpd" which then passes the request to
"rshd".
</BLOCKQuote></blockQuote>
<blockQuote>
O. However, tcpd may refuse the connection if its host_access rules do
not allow the connection. This refusal could be intermittent depending
on whether the name service system is responding (NIS/DNS whatever).
(This possibility has already been mentioned on the list in greater
detail).
</blockQuote>
<blockQuote>
At this point, I looked up the Sun Solaris man page for rshd (none
of the Linux machines here has "rsh" installed!). The following steps
are carried out and failure leads to closing the connection.
</blockQuote>
<blockQuote>
A. The server tries to create the necessary sockets for a connection.
</blockQuote>
<blockQuote>
B. The server checks the client's address which <EM>must</EM> be resolvable
via the name service switch specification (default NIS+/etc/hosts).
</blockQuote>
<blockQuote>
C. The server checks the server user name which <EM>must</EM> be verifiable
via the name service switch specification (default NIS+/etc/passwd).
</blockQuote>
<blockQuote>
D. The server checks via PAM that the either (the client is in <TT>/etc/hosts.equiv</TT>
</blockQuote>
<blockQuote>
and the client user name is the same as the server user name) or
the client username is in .rhosts.
</blockQuote>
<blockQuote>
E. The server tries to acquire the necessary pty/tty's and connects them
to the sockets and the server user's shell (which must exist).
</blockQuote>
<blockQuote>
I am a bit confused about the use of PAM but I think it is also used
in steps C and E through the "account" and "session" entries. The
"auth" entry for PAM is used in "D".
</blockQuote>
<blockQuote>
So it seems like O,A-E need to be checked on your system. My own
earlier suggestion was only about E but the failure could be
elsewhere.
</blockQuote>
<blockQuote>
Temporary failure of the NIS server to respond could affect B and C;
it could even affect E as the "passwd" entry is required to find the
user's shell. Thus, in such situations it is a good idea to run the
name service caching daemon.
</blockQuote>
<blockQuote>
If NFS is used for home directories then temporary failure of the NFS
server to respond could affect D as well.
</blockQuote>
<blockQuote>
Hope this helps,
</blockQuote>
<blockQuote>
Kapil.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
So it was a transient (or is an intermittent) problem.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Yup
</STRONG></P>
<P><STRONG>
I have adjusted the <TT>/etc/inet.conf</TT> by adding the .500 to the rsh line
nowait:
</STRONG></P>

<pre><strong>shell           stream  tcp     nowait.500      root    /usr/sbin/tcpd /usr/sbin/in.rshd
</strong></pre>
<P><STRONG>
in order for these machines to allow more jobs to be run at a time.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
This adjusts inetd's tolerance/threshold to frequent connections
on a given service.   It simply means that inetd won't throttle back
the connections as readily --- it will try to service them even if
they are coming in fast and furious.  In this case it will allow up to
500 attempted rsh connections per minute (about 8 per second).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
That really doesn't adjust anything about the number of concurrent
jobs that a machine can run --- just the number of times that the
inetd process will accept connections on a give port before treating
it as a DoS (denial of service) attack or networking error, and
throttling the connections.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I adjusted this because we ran into lots of problems with inet dropping
connections, I just wanted to make sure that it behaved like it was supposed
to, ie you didn't know of some immediately relevant bug in this line
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
In your example this is clearly NOT the problem.  It made the
connection and then disconnected you.  Thus it wasn't inetd refusing
the connection, but the shell process exiting (or being killed by the
kernel).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron] 
Just to clarify, I think Jim is saying that it's not inetd or tcpd refusing
you, because otherwise rlogin wouldn't have started at all, and it (rlogin)
ouldn't have been able to print the "last login:" and kernel version lines.
</blockQuote>
<blockQuote>
By the way, when tcpd doesn't like me, it waits a couple seconds (usually
doing reverse DNS lookup), and then I see "Connection closed by foreign host"
with no other messages.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
One possibility is that we have everyone's home drive on NFS and if the NFS
was slow to respond that may cause rlogin to find no home directory and
refuse the connection.  Is that a realistic possibility?
</STRONG></P>
<P><STRONG>
One interesting turn of events is the message you get in auth.log :
</STRONG></P>
<P><STRONG><BLOCKQuote>
Jan 20 15:41:31 ginzu PAM_unix[31073]: (login) session opened for user dave
by (uid=0)
Jan 20 15:41:31 ginzu login[31073]: unable to determine TTY name, got
/dev/tty6
</BLOCKQuote></STRONG></P>
<P><STRONG>
These machines have no video cards/keyboards/otherinput, really they are
processor/harddrive/ram/NIC and thats all so it would make sense to comment
out the getty lines in inittab for these boxes ... correct?
</STRONG></P>
<P><STRONG>
That would at the very least stop the auth.log and daemon.log spamming, I
think
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [Iron] 
If inetd is not listening to the port at all and no other daemon is, you'll
get an immediate "Connection refused" error.  This is confusing because it
doesn't mean it doesn't like you, it means there's nobody there to answer the
door.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd run vmstat processes on the affected nodes (or all of them) for
a day or two --- redirect their output to local files or over the
network (depending one which will have the least impact on your
desired workload) and then write some scripts to analyze and/or graph
them.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I have started collecting info on these machines.
</STRONG></P>
<P><STRONG>
Can you think of why these machines behave like this?  Could it be a load
average problem, maybe its network related, is it a setup problem?  Any
ideas would be appreciated
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
It's not likely to be a networking or setup issue.  Your networking
seems to work.  Things seem to be configured properly for moderate
workloads, so we have to find out which host resources are under the
most pressure.  So it's probably a loading problem.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Its not a loading issue the system is pretty good at evening out load across
the pool of machines
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
(Note I did NOT say "load average" problem.  "load average" is simply
a measure of the average number of processes that were in a runnable
(non-blocked) state during each context switch over the last minute,
and five and fifteen minutes.  A high load average should NOT result
in processes dying as you've described --- but often indicates a
different resource loading issue.  Sorry to split hairs on that point
but this is a case were understanding that distinction is important).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
These machines can get a little bagged at times but the login failure
happens regardless of the load of a given host.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
As always you should be checking your system logs.  Hopefully there'll
be messages therein that will tell you if the kernel killed your
process and why.  Otherwise you can always write an "strace" wrapper
around these executables.  It will kill your performance, but, if you
can reproduce the problem you'll be able to see what the process died.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
After a look in the logs ( I can't believe I didn't do this earlier ), I
found a lot of messages about getty trying to use <TT>/dev/tty*</TT>, no such device,
which makes sense considering they have no input/output hardware like
video/keyboard, etc.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
Some tweaks to the setup might help.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
There are basically four resources we're concerned about here:
memory, CPU, process table, and file descriptor table (space and
contention).  (I'm not concerned about I/O contention in this case
since that usually causes processes to block --- performance to
go very slowly.  It doesn't generally result in processes dying like
you've described here).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
vmstat's output will tell you more.  You can probably make some guesses
based on your workload profile.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
If you're running many small jobs spawning from one (or a small number
of) dispatcher processes (on each node) you might be bumping into
rlimit/ulimit issues.  Read the man page for your shell's ulimit
built-in command, and the ulimit(3) man page for more details on that.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Ulimits have been adjusted already we ran into file descriptor limits before
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
If you're running a few large jobs than its more likely to be a memory
pressure problem --- though we'd expect you'd run into paging/thrashing
issues first.  There are cases where you can run out of memory without
doing any signficant paging/swapping (where the memory usage is on
non-swappable kernel memory rather than normal process memory).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
By the way, you might want to eliminate tcpd from your configuration
(remove the references to <TT>/usr/sbin/tcpd</TT> from your inetd.conf file).
This will save you an extra fork()/exec() and a number of file access
operations on each new job dispatched.  (The use of rsh already assumed
you've physically isolated this network segment with very restrictive
packet filters and anti-spoofing --- so TCP Wrappers is not useful
in your case and is only costing you some capacity, albeit small).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
You might even eliminate rsh/rlogin and go with the even simpler
rexec command!
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Some times people will run an interactive job on this cluster, so rsh/rlogin
is still nice to have.  We have no real policy about what can or cannot be
run on these machines, like I had said it is more of a playground for our
researchers, than a critical cluster.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
It goes without saying that you may wish to eliminate, renice, or
reconfigure any daemons you're running on these nodes.  For example,
you can almost certainly eliminate cron and atd from the nodes (since
your goal is to dispatch the jobs from one or a few central
cluster control nodes.  <EM>They</EM> could run a small number of cron/atd
processes and dispatch jobs across the cluster as appropriate.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
True, but really it doesn't seem related, I can't see an interaction between
login and cron that would drop your connection.  Although it is nice to cut
down bloat where you can.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
The klogd/syslogd daemons are worth extra consideration.  I'd
strongly consider running syslog under 'nice' and giving it lowest
possible priority.  I'd also consider tweaking the syslog.conf to
remove the leading "-" (dashes) from any local log file names
(so that they will be written asynchronously rather than with
 <TT>fsync()</TT> calls after every write to the logs).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd even consider eliminating all local files from these configurations
and having these nodes do all their logging over the net (which being
UDP based, might result in some lossage of log messages).  However,
that depends heavily on your workload and network topology and
capacity.  Basically you might have bandwidth to burn (Gig ethernet,
for example) and this might be a reasonable tradeoff.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
We are on a switched full duplex 100 base TX, network.  The logs on the
switches report that in the last 3 months we have only went above 80% of the
switches bandwith once, so I think we have enough bandwidth to support logs
over the net.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd also consider setting the login shell for these job handling
accounts to ash (or the simplest, smallest shell that can successfully
process your jobs).  bash, particularly with version 2.x is a pretty
"resourceful" (read "bloated") program which may not be necessary
unless you're doing some fairly complex shell scripting.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
A possibility, but as I had said some of our researchers will run an
interactive job so they want a full shell.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
Also in your shell/jobs you might want to make some strategic use of
the exec built-in command.  Basically in any case where the shell
or subshell doesn't have a command subsequent to one of your external
binaries --- exec the binary.  This saves a <TT> fork()</TT> system call, and
means that the shell processes are NOT taking up memory, file descriptors,
and entries in the process table just waiting for other executables to
exit.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd also eliminate PAM and look for the older r* and login suite.
The traditional <TT>/bin/login</TT> program does an exec*() system call to
run your shell.  The PAM based suite performs a <TT> fork()</TT> and then an
 <TT>exec()</TT> --- and the <TT>/bin/login</TT> program remains in order to perform
post logout cleanup.  It is quite likely that you are not interested
in these more advanced features provided by PAM's approach.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
PAM is overkill but I don't think it is the culprit.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
Incidentally, another point to consider is your local filesystems.
You may want to mount as many of them as possible in "read-only" mode
and all of them with the noatime option.  Both of these tweaks can
considerably reduce the amount of work the system is doing to maintain
your filesystem consistency and the (rarely used) access time stamps.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
You may also want to consider using the older ext2 filesystem rather
than any of the journaling filesystem choices.  This depends on your
data integrity requirements, of course, but the journaling done by
ext3, reiserfs, XFS and others does come at a significant cost.
</blockQuote>
<blockQuote>
(Note: In some other cases, where intensive use of local filesystems
is part of the workload, XFS or reiserfs might be VASTLY better than
ext2 --- for various complicated reasons).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Reiser is working fine on these nodes.  I have found a significant
improvement over ext2 for the majority of tasks run on these boxes.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
Depending on your application, you might even want to consider
recompiling it using older, simpler versions of libc/libm (since
many of the advanced features of GNU glibc 2.x may be useless
for your computations).  Of course if the application is multi-threaded
then you may needs glibc 2.x' re-entrancy.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Not really possible, in a lot of cases we are running some third party
commercial software which is very closed source.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
It's possible that you need to do some kernel tuning.  This might
involve writing some magic values into the sysctl nodes under
<TT>/proc/sys</TT> (or running the systune or Linux powertweak utilities).
It might also involve rebuilding your kernel, possibly with a few
static variables changed or a few scalability patches applied.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
(In this case, "scalability" is a loaded term --- since it means
much different things to differing workloads).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I think the real problem is that we are having a bad interaction with some
piece of software and rlogin/login/getty?/init or something and that causes
the connection to be dropped.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
You can find numerous hints about Linux kernel performance
tweaking using Google! <A HREF="http://www.google.com/linux"
	>http://www.google.com/linux</A>
</blockQuote>
<blockQuote>
Here's a few links:
</blockQuote>
<blockQuote><DL><DT>
The C10K problem
<DD><A HREF="http://www.kegel.com/c10k.html"
	>http://www.kegel.com/c10k.html</A>
</DL></blockQuote>
<blockQuote>
Written and maintained by Dan Kegel, originally in response
to the infamous "Mindcraft" fiasco wherein Microsoft paid an
"independent" lab to prove that MS Windows was "faster" or
"more scalable" than Linux.
</blockQuote>
<blockQuote>
Dan is/was one of the advocates for improving the Linux kernel
in a number of key areas regardless of if Mindcraft's
credibility.
</blockQuote>
<blockQuote>
CITI: Projects: Linux scalability - University of Michigan
</blockQuote>
<blockQuote>
<A HREF="http://www.citi.umich.edu/projects/linux-scalability"
	>http://www.citi.umich.edu/projects/linux-scalability</A>
Run by Peter Honeyman (a legendary UNIX programmer).
</blockQuote>
<blockQuote><DL><DT>
SGI - Developer Central Open Source: Scalability Project
<DD><A HREF="http://oss.sgi.com/projects/linux-scalability"
	>http://oss.sgi.com/projects/linux-scalability</A>
</DL></blockQuote>
<blockQuote><DL><DT>
IBM developerWorks: Linux: Linux Kernel Performance &amp; Scalability
<DD><A HREF="http://www-106.ibm.com/developerworks/linux/library/l-kperf"
	>http://www-106.ibm.com/developerworks/linux/library/l-kperf</A>
</DL></blockQuote>
<blockQuote>
The problem with all of these links is that they are not focused on
the set of requirements specific to your needs.  They are more
concerned with webserver, database, SMP, and single-server scalability
rather than Beowulf style cluster performance.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
Of course you could read the information at <A HREF="http://www.beowulf.org"
	>http://www.beowulf.org</A>
Strictly speaking it doesn't sound like you're really running a Beowulf
cluster --- you're dispatching jobs via rsh rather than distributing
computation load using MPI, PVM or similar libraries.  However some of
the same configuration suggestions and performance observations might
still apply.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Most of the tweaking described has already been implemented
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
In general there isn't any silver bullet to increasing the capacity
of your cluster.  You have to find out which resources are being
hit hardest (the bottlenecks), review what is using those resources,
find ways to eliminate as much of that utilization as possible
(removing tcpd, using a simpler/smaller shell, running terminal
processes via exec, changing to a non-journaling filesystem,
eliminating unneeded daemons) and try various tradeoffs that shift
the utilization of a constrained resource (local filesystem I/O vs.
pushing things out to the network, memory/cache and indexed data
structures vs CPU and linear searches).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Capacity is not the objective, I would say reliability ( not necessarily
100%, but better than 50%, for sure 
<IMG SRC="../gx/dennis/smily.gif" ALT=":)" 
		height="24" width="20" align="middle"> is more my goal.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
That's really all there is to performance tuning.  Finding what's
using which resources.  Finding what you can "not" do.  Finding ways
to tradeoff one form of resource consumption with another.  Of course
the black magic is in the details (especially when it comes to
poking new values into nodes under <TT>/proc/sys/vm/</TT> --- read the
Documentation/sysctl* text files in your Linux kernel sources for some
hints about <EM>that</EM>)!
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Perhaps a more detailed view of the cluster will give you more to work on.
There are really 34 machines to this cluster, one choke node that stands
between the outside world and the inside nodes.  32 machines (identical
hardware), dual Pentium 3 550 MHz's, 256 megs SDRAM (133MHz), single Maxtor
12 GB hardrive (7200 RPM ATA 66), 3com 3c590 ethernet card, identical
kernel's across the board, 2.4.18, SMP.  One single sun machine, that
serves, NIS, NFS, and DNS, and home brewed batch server ( keeps track of
jobs and hosts loads and assigns jobs to hosts via rsh ).  After searching
some more websites I found that some people have a problem with the
services.byname map in NIS.  Could that be an issue here? I have adjusted
the inittab by commenting out the lines:
</STRONG></P>

<pre><strong>#  &lt;id&gt;:&lt;runlevels&gt;:&lt;action&gt;:&lt;process&gt;
#1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
</strong></pre>
<P><STRONG>
Because these machines have no video/input.
</STRONG></P>
<P><STRONG>
Thanks for all your help so far.  I hope all this new info helps you get a
better idea of whats going on.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
You could build a new kernel, setting CONFIG_UNIX98_PTY_COUNT=2048
(apparently their maximal value).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
Running a compile with this right now, thanks
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd also try to eliminate NIS from these systems.  I'd look at using
rsync to replicate the various <TT>/etc</TT> configuration files across the
cluster (passwd, group, hosts, services, et al).  Failing that make
sure that you have the nscd (NIS name services cache daemon) properly
configured on the client nodes.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I have been waffling on moving this farm over to Cfengine and losing NIS for
about three months, I think I am going to get started on that right away.
Have you guys used cfengine, or do you have any suggestions for config
management tools?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd also try to eliminate NFS, or at least try to minimize it's use
especially for home directories.  I'd also eliminate the automounting
if at all possible.  This requires that the users work a little
smarter, manually transferring their data/input files down to the
proper nodes, and pulling the results back therefrom.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I have suggested this, but the tools (third party, very badly designed) some
of the research guys use need to write to the home drive, and in order to
take advantage of more than one node that would suggest that the home drive
be in two places at once (NFS, SMB or whatever).  The way it works is that
one node will modify a model file, another will immediately pick up the
change and adjust what it is doing and modify the file more until the proper
mathematical model for a given project is found.  Then they use that model
to figure out a whole range of useful information, at least thats how its
supposed to work.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
If that's not feasible, at least configure these systems so that the
home directories are not automounted, replicate the basic suite of
"dot files" out to them and have a lower mount point provide the shared
data.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I don't think I can.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
I'd also be quite wary of configuring the systems to allow NFS crossing
the isolated segment and out into filers on your network.  This sounds
like a supremely bad idea allowing anyone with local root access on any
node on the outer network to impersonate any users, dropping files into
their directories which will be executed/sourced by shell session in
the inner network.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
NFS traffic never leaves the clusters subnet, think of it as a hole in my
network covered by one node that runs ssh with 6 local accounts.  Once you
log in to that firewall node you need to then rsh or ssh out the other
interface to either a node in the cluster or the old sun machine serving
NIS/NFS.  All traffic on the local subnet stays on the local subnet.  Once a
researcher has a proper model defined they have to rcp/scp that file to the
firewall machine, and then scp (rsync over ssh, or whatever) it to their
destination (rcp is not enabled outside of my protected subnet).
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> [JimD] 
However, I think you're getting closer to the real heard of the problem
by looking into Kapil's suggestion regarding your PTY availability.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	> 
I'll know shortly, thanks everyone you guys rock!
</STRONG></P>
<P><STRONG>
Dave
</STRONG></P>

<!-- end 3 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 87 of <i>Linux Gazette</i>, February 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->

<SMALL><CENTER><H6 ALIGN="center">HTML script maintained by
        <A HREF="mailto:star@starshine.org">Heather Stern</a> of
        Starshine Technical Services,
       <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6></SMALL></CENTER>
<HR>

<table border="1"><tbody><tr><td width="200">
<a href="http://www.linuxgazette.com/">
<img alt="LINUX GAZETTE" src="../gx/2002/lglogo_200x41.png" width="200" height="41" border="0"></a> 
<br clear="all">
<small>...<i>making Linux just a little more fun!</i></small>
</td><td width="380">



<center>
<BIG><BIG><STRONG><FONT
COLOR="maroon">News Bytes</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="http://www.linuxgazette.com/authors/conry.html">Michael Conry</A></STRONG></BIG>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



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

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


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


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

</p><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">
February 2002 <i>Linux Journal</i>
</font>
</h3>

<img alt="[issue 106 cover image]" src="misc/bytes/lj-cover106.png" width="200" height="268" align="left" hspace="20">

The February issue of <a href="http://www.linuxjournal.com/"><i>Linux
Journal</i></a> is on newsstands now.
This issue focuses on enterprise computing.  Click 
<a href="http://www.linuxjournal.com/modules.php?op=modload&amp;name=NS-lj-issues/issue106&amp;file=index">here</a>
to view the table of contents, or 
<a href="http://www.linuxjournal.com/subscribe/">here</a> 
to subscribe.

<p>
<font color="green">All articles older than three months are available for
public reading at 
<a href="http://www.linuxjournal.com/magazine.php">http://www.linuxjournal.com/magazine.php</a></font>.  
Recent articles are available on-line for subscribers only at 
<a href="http://interactive.linuxjournal.com/">http://interactive.linuxjournal.com/</a>.  


<BR CLEAR="all">
<!-- =================================================================== -->

<a name="leg"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Legislation and More Legislation</font></H3></center>

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">You win some...
</FONT>
</H3> 
<P>
Jon Johansen,
a Norwegian programmer who has been 
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/Johansen_DeCSS_case/20021206_eff_pr.html">facing criminal charges</a>
as a result of his involvement in the creation of the DeCSS computer code
for playing CSS encoded DVDs, has been 
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/Johansen_DeCSS_case/20030107_eff_pr.html">acquitted on all counts</a>.
Jon was charged under a law that relates to breaking into other people's
property, a law usually invoked in cases where attackers have attempted to
break into another party's computer system.  The law had never before been
applied to prosecute a defendant for breaking into his own property, and in
this case the Norwegian court ruled against the prosecutor on all charges,
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=466519">
citing Norwegian law protecting a consumer's rights to use his own
property</a>.  An English
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/Johansen_DeCSS_case/20030109_johansen_decision.html">translation of the judgement</a> has been made online by 
<a href="http://www.eff.org/">EFF</a>.
<P>
The war is not over yet, however, and Norwegian prosecutors are set to
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/Johansen_DeCSS_case/20030120_eff_pr.php">appeal the verdict</a>.
If the request for an appeal is granted, the case will be heard again
before the Norwegian appeal courts.
Film industry lawyer, Charles Sims, 
<a href="http://www.reuters.com/newsArticle.jhtml?type=topNews&storyID=2006339">
was keen to assert</a> that a US resident would have been breaking the law
if they did what Jon Johansen did.


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

<P>
The United States Supreme Court
<a href="http://cyberlaw.stanford.edu/lessig/blog/archives/01-618o.pdf">
has ruled to support</a>
the 20 year extension of copyright terms that was granted two years ago.
The balance of opinion went 7-2, with dissenting opinions coming from
Justices
<a href="http://www.copyright.gov/docs/eldredd.pdf">
Stevens</a>
and
<a href="http://www.copyright.gov/docs/eldredd1.pdf">
Breyer</a>.
<P>
The constitutional challenge began when Eric Eldred, who
<a href="http://209.11.144.65/eldritchpress/">
distributes public-domain books online</a>,
found that he would have to 
<a href="http://www.nashuatelegraph.com/Main.asp?SectionID=25&SubSectionID=377&ArticleID=71766">remove some of these works</a>
as their copyrights had been reactivated by an extension granted by the US
Congress.
There is a large amount of information on the case available at
<a href="http://eldred.cc/">
eldred.cc</a>.  Lisa Rein has also compiled a
<a href="http://www.onlisareinsradar.com/archives/eldred_vs_ashcroft/">
selection of reports and resources</a>
related to the case.
<P>
The issue at stake in the Eldred case was whether it was constitutional for
Congress to extend copyrights in this way.  There are compelling arguments
on both sides of this argument (with some more compelling if you own
billions of dollars in copyrighted works and want your business to be
subsidised by the public), but the court has ruled that
Congress had (and has) the right to make this extension.  This does not
mean that the all is lost.  Governments in democratic countries are
supposed to be responsive to the desires of citizens,
and to act accordingly.  Thus, it is important for citizens to make their
opinions on these issues apparent to their elected representatives.  Simply
because a government <em>can</em> pass a law, does not mean that they
<em>will</em> pass the law, especially if they can expect to pay a steep
price at the ballot box next election time.
<P>
This is particularly relevant to European readers.  European copyrights
last for 50 years.  What makes this significant is that about 50 years ago
was the beginning of the modern era music recording, so from now on, a
steady stream of high quality recordings by still-popular artists will be
entering the public domain.  Industry bodies are 
<a href="http://www.nytimes.com/2003/01/02/international/02CND_COPY.html">
lobbying to have the terms of copyrights extended</a>
and are bandying words like piracy around to cloud the waters.
As 
<a href="http://www.tompaine.com/feature.cfm/ID/7048">
pointed out</a>
by Dean Baker, extending copyrights retrospectively on works does nothing
to encourage creativity or 
<a href="http://librenix.com/?inode=2747">
"To promote the Progress of Science and useful Arts"</a>.  Instead, it
"<a href="http://www.tompaine.com/feature.cfm/ID/7048">
raises costs to consumers and leads to increased economic
inefficiency</a>".  This straight-forward truth will not stop industry
monopolists and their quislings from attempting to steal the labour of
humanity from the public commons, and then 
<a href="http://story.news.yahoo.com/news?tmpl=story2&u=/nm/20030116/media_nm/industry_copyright_dc">
telling us it was all for our own good</a>.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">DMCA
</FONT>
</H3> 
<P>
Your monthly serving of DMCA madness this time involves garage doors.  It
would appear that at least one firm believes that
<a href="http://yro.slashdot.org/article.pl?sid=03/01/16/1311232&mode=nested&tid=99">
making universal garage door remotes</a> is a breach of the DMCA and is
prepared to spend some legal money on the idea.  That wasn't enough?  Well,
here's a second helping:
<a href="http://www.lexmark.com">Lexmark</a> is 
<a href="http://www.theregister.co.uk/content/7/28811.html">
invoking the DMCA</a>
in an attempt to hobble the printer cartridge remanufacturing industry.
Edward Felten has 
<a href="http://www.freedom-to-tinker.com/archives/000248.html">
concisely explained</a>
that a major issue here is the whole principle of interoperability.
Interestingly, the European Parliament has 
<a href="http://www.geek.com/news/geeknews/2002Dec/gee20021223017885.htm">
voted in a new law</a>
banning such "smart" printer cartridges as they make recycling more
difficult and expensive.  Bruce Schneier 
<a href="http://www.counterpane.com/crypto-gram-0301.html">
predicts a trade war</a>, but even if it does not come to that, it will be
interesting to see where the story goes.  Also highlighted by Bruce, and
worth reading, is the EFF's guide 
<a href="http://www.eff.org/IP/DMCA/20030102_dmca_unintended_consequences.html">
Unintended Consequences: Four Years under the DMCA</a>.

<a name="links"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Linux Links</font></H3></center>
<P>
Linux Magazine article on
<a href="http://www.linux-mag.com/2002-10/jfs_01.html">
journaling filesystems</a>.
<P>
Linux Planet article discussing
<a href="http://www.linuxplanet.com/linuxplanet/tutorials/211/1/">
basic Linux network security</a>.
<P>
Some links highlighted by
<a href="http://www.linuxtoday.com/">
Linux Today</a>:
<ul>
<li>
    <a href="http://www.newsfactor.com/perl/story/20432.html">
    How secure is secure shell?</a>
</li>
<li>
    Wired on
    <a href="http://www.wired.com/news/infostructure/0,1377,57306,00.html">
    a penguin shaped future</a>.
</li>
<li>
    DistroWatch has a 
    <a href="http://www.distrowatch.com/cd.php">
    list of Linux-on-CD projects</a>.
</li>
<li>
    Fortune asks
    "<a href="http://www.fortune.com/fortune/technology/articles/0,15114,409836,00.html">
    How do you stop an army of penguins?</a>"
</li>
<li>
    Linux Orbit
    <a href="http://www.linuxorbit.com/modules.php?op=modload&name=Reviews&file=index&req=showcontent&id=27">
    Gnu/Linux media player</a> round-up.
</li>
</ul>
<P>
<a href="http://www.jobmart.com/Linux/Resumes/index.html">
Linux Job Market</a>.
<P>
Lawrence Lessig discusses whether 
<a href="http://www.redherring.com/insider/2003/01/copycats011003.html">
derivative works are always a bad thing</a>
for the owners of the original work.  Japanese experience indicates they
may be beneficial.
<P>
The Register has 
<a href="http://www.theregister.co.uk/content/4/29002.html">a report</a>
on businesses gathering to fight Hollings' copy controls
<P>
Some links from NewsForge:
<ul> 
<li> 
    Article on the 
    <a href="http://newsforge.com/article.pl?sid=03/01/20/1432234&mode=thread&tid=23">
    use of Linux by electricity companies</a>
</li>
<li> 
    <a href="http://newsforge.com/newsforge/03/01/07/2134248.shtml?tid=46">
    Training is available</a> for new commercial Security-Enhanced Linux
</li>
<li>
    Workspot Linux:
    <a href="http://newsforge.com/article.pl?sid=03/01/22/1733244&mode=thread&tid=23">
    instant and portable "magic"</a>.
</li>
</ul>
<P>
<a href="http://www.virtualsky.net/daves">
Dave's Desktop</a>
is one Linux user's quest to share information on some of the helpful apps
for Linux he has come across recently.
<P>
Howard Wen at O'Reilly is on a quest to find good Linux games.
On the way, he 
<a href="http://www.onlamp.com/pub/a/onlamp/2003/01/02/falconseye.html">
found Falcon's Eye</a>
and 
<a href="http://linux.oreillynet.com/pub/a/linux/2003/01/16/jaakko.html">
talked to the game's creator</a>
<P>
Linux Server Hacks:
<a href="http://www.oreilly.com/catalog/linuxsvrhack/chapter/index.html">
Backups</a>
<P>
Both 
<a href="http://www.linuxjournal.com/article.php?sid=6562">
Linux Journal</a>
and
<a href="http://www.desktoplinux.com/articles/AT8221013471.html">
DesktopLinux</a>
have dealt with Linux's relevance to senior citizens.
<P>
Some links from <a href="http://lwn.net/">Linux Weekly News</a>:
<ul>
<li>
    <a href="http://lwn.net/Articles/16858/">
    LWN 2002 Linux Timeline</a>
</li>
<li>
    <a href="http://lwn.net/Articles/18472/">
    LWN Five-Year Timeline</a>
</li>
<li>
    Linux is
    <a href="http://techupdate.zdnet.com/techupdate/stories/main/0,14179,2908199,00.html">
    gaining market share</a> in government offices around the world.
</li>
<li>
    A <a href="http://lwn.net/Articles/19535/">list of Linux-related
    books</a> that are published under open source licenses.
</li>
</ul>
<P>
<a href="http://www.linux.org.tw/CLDP/NEW/">
The Chinese Linux Documentation Project</a> (CLDP) has included LDP's and
Gnu's documents, translated them into Chinese.  It also involve the Linux Gazette.

<P>
Some links from <a href="http://slashdot.org/">Slashdot</a>:
<ul>
<li>
    Using a 
    <a href="http://slashdot.org/articles/03/01/01/2151236.shtml?tid7">
    manual typewriter on a computer</a> as an aid for an RSI sufferer
</li>
<li>
    <a href="http://www.opensource.org/halloween/halloween8.php">
    Halloween 8</a> 
    A Microsoft memo inspired by the threat of governments turning to Linux.
</li>
<li>
    <a href="http://shirky.com/writings/zapmail.html">
    Customer-owned broadband infrastructure</a>.
</li>
<li>
    Robot brain surgeon
    <a href="http://www.smh.com.au/articles/2003/01/15/1042520673704.html">
    runs Linux</a>.  I feel safer already!
</li>
<li>
    <a href="http://speed.vpizza.org/~jmeehan/balloon/">
    A Linux weather balloon</a>
</li>
</ul>
<P>
<a href="http://www.wikipedia.org/">
Wikipedia</a>, the free, contributor-maintained on-line encyclopedia,
has 
<a href="http://www.wikipedia.org/wiki/Wikipedia%3A2003_Press_Release">
reached its second birthday and 100,000 articles</a>.


<a name="conferences"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Upcoming conferences and events</font></H3></center>

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

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


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

<tr><td valign=top>
        <b>O'Reilly Bioinformatics Technology Conference</b><BR>
        <td valign=top>February 3-6, 2003<BR>San Diego, CA<BR>
        <a href="http://conferences.oreilly.com/" target="_blank">
        http://conferences.oreilly.com/</A><BR>

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

<tr><td valign=top>
        <b>Desktop Linux Summit</b><BR>
        <td valign=top>February 20-21, 2003<BR>San Diego, CA<BR>
        <a href="http://www.desktoplinux.com/summit/" target="_blank">
        http://www.desktoplinux.com/summit/</A><BR>

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

<tr><td valign=top>
        <b>Game Developers Conference</b><BR>
        <td valign=top>March 4-8, 2003<BR>San Jose, CA<BR>
        <a href="http://www.gdconf.com/" target="_blank">
        http://www.gdconf.com/</A><BR>

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

<tr><td valign=top>
        <b>SXSW</b><BR>
        <td valign=top>March 7-11, 2003<BR>Austin, TX<BR>
        <a href="http://www.sxsw.com/interactive" target="_blank">
        http://www.sxsw.com/interactive</A><BR>

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

<tr><td valign=top>
        <b>CeBIT</b><BR>
        <td valign=top>March 12-19, 2003<BR>Hannover, Germany<BR>
        <a href="http://www.cebit.de/" target="_blank">
        http://www.cebit.de/</A><BR>

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

<tr><td valign=top>
        <b>Software Development Conference & Expo</b><BR>
        <td valign=top>March 24-28, 2003<BR>Santa Clara, CA<BR>
        <a href="http://www.sdexpo.com/" target="_blank">
        http://www.sdexpo.com/</A><BR>

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

<tr><td valign=top>
        <b>Linux Clusters Institute (LCI) Workshop</b><BR>
        <td valign=top>March 24-28, 2003<BR>Urbana-Champaign, IL<BR>
        <a href="http://www.linuxclustersinstitute.org/" target="_blank">
        http://www.linuxclustersinstitute.org/</A><BR>

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


<tr><td valign=top>
        <b>4th USENIX Symposium on Internet Technologies and Systems</b><BR>
        <td valign=top>March 26-28, 2003<BR>Seattle, WA<BR>
        <a href="http://www.usenix.org/events/" target="_blank">
        http://www.usenix.org/events/</A><BR>

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

<tr><td valign=top>
        <b>PyCon DC 2003</b><BR>
        <td valign=top>March 26-28, 2003<BR>Washington, DC<BR>
        <a href="http://www.python.org/pycon/" target="_blank">
        http://www.python.org/pycon/</A><BR>

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

<tr><td valign=top>
        <b>Linux on Wall Street Show & Conference</b><BR>
        <td valign=top>April 7, 2003<BR>New York, NY<BR>
        <a href="http://www.linuxonwallstreet.com" target="_blank">
        http://www.linuxonwallstreet.com</A><BR>

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

<tr><td valign=top>
        <b>AIIM</b><BR>
        <td valign=top>April 7-9, 2003<BR>New York, NY<BR>
        <a href="http://www.advanstar.com/" target="_blank">
        http://www.advanstar.com/</A><BR>

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

<tr><td valign=top>
        <b>FOSE</b><BR>
        <td valign=top>April 8-10, 2003<BR>Washington, DC<BR>
        <a href="http://www.fose.com/" target="_blank">
        http://www.fose.com/</A><BR>

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

<tr><td valign=top>
        <b>LinuxFest Northwest 2003</b><BR>
        <td valign=top>April 26, 2003<BR>Bellingham, WA<BR>
        <a href="http://www.linuxnorthwest.org/" target="_blank">
        http://www.linuxnorthwest.org/</A><BR>

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

<tr><td valign=top>
        <b>Real World Linux Conference and Expo</b><BR>
        <td valign=top>April 28-30, 2003<BR>Toronto, Ontario<BR>
        <a href="http://www.realworldlinux.com/" target="_blank">
        http://www.realworldlinux.com</A><BR>


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

<tr><td valign=top>
        <b>USENIX First International Conference on Mobile Systems, 
	Applications, and Services (MobiSys)</b><BR>
        <td valign=top>May 5-8, 2003<BR>San Francisco, CA<BR>
        <a href="http://www.usenix.org/events/" target="_blank">
        http://www.usenix.org/events/</A><BR>

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

<tr><td valign=top>
        <b>USENIX Annual Technical Conference</b><BR>
        <td valign=top>June 9-14, 2003<BR>San Antonio, TX<BR>
        <a href="http://www.usenix.org/events/" target="_blank">
        http://www.usenix.org/events/</A><BR>

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

<tr><td valign=top>
        <b>CeBIT America</b><BR>
        <td valign=top>June 18-20, 2003<BR>New York, NY<BR>
        <a href="http://www.cebit-america.com/" target="_blank">
        http://www.cebit-america.com/</A><BR>

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

<tr><td valign=top>
        <b>The Fourth International Conference on Linux Clusters:
	the Linux HPC Revolution 2003</b><BR>
        <td valign=top>June 18-20, 2003<BR>Las Vegas, NV<BR>
        <a href="http://www.linuxclustersinstitute.org/Linux-HPC-Revolution" 
	target="_blank">
        http://www.linuxclustersinstitute.org/Linux-HPC-Revolution</A><BR>


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

<tr><td valign=top>
        <b>O'Reilly Open Source Convention</b><BR>
        <td valign=top>July 7-11, 2003<BR>Portland, OR<BR>
        <a href="http://conferences.oreilly.com/" target="_blank">
        http://conferences.oreilly.com/</A><BR>

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

<tr><td valign=top>
        <b>12th USENIX Security Symposium</b><BR>
        <td valign=top>August 4-8, 2003<BR>Washington, DC<BR>
        <a href="http://www.usenix.org/events/" target="_blank">
        http://www.usenix.org/events/</A><BR>

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

<tr><td valign=top>
        <b>LinuxWorld Conference & Expo</b><BR>
        <td valign=top>August 5-7, 2003<BR>San Francisco, CA<BR>
        <a href="http://www.linuxworldexpo.com" target="_blank">
        http://www.linuxworldexpo.com</A><BR>

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

<tr><td valign=top>
        <b>Linux Lunacy</b><BR><i>Brought to you by Linux Journal and
	Geek Cruises!</i><br>
        <td valign=top>September 13-20, 2003<BR>Alaska's Inside Passage<BR>
        <a href="http://www.geekcruises.com/home/ll3_home.html" target="_blank">
        http://www.geekcruises.com/home/ll3_home.html</A><BR>

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

<tr><td valign=top>
        <b>Software Development Conference & Expo</b><BR>
        <td valign=top>September 15-19, 2003<BR>Boston, MA<BR>
        <a href="http://www.sdexpo.com" target="_blank">
        http://www.sdexpo.com</A><BR>

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

<tr><td valign=top>
        <b>PC Expo</b><BR>
        <td valign=top>September 16-18, 2003<BR>New York, NY<BR>
        <a href="http://www.http://www.techxny.com/pcexpo_techxny.cfm"
target="_blank">
        http://www.techxny.com/pcexpo_techxny.cfm</A><BR>

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

<tr><td valign=top>
        <b>COMDEX Canada</b><BR>
        <td valign=top>September 16-18, 2003<BR>Toronto, Ontario<BR>
        <a href="http://www.comdex.com/canada/" target="_blank">
        http://www.comdex.com/canada/</A><BR>

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

<tr><td valign=top>
        <b>LISA (17th USENIX Systems Administration Conference)</b><BR>
        <td valign=top>October 26-30, 2003<BR>San Diego, CA<BR>
        <a href="http://www.usenix.org/events/lisa03/" target="_blank">
        http://www.usenix.org/events/lisa03/</A><BR>

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

<tr><td valign=top>
        <b>HiverCon 2003</b><BR>
        <td valign=top>November 6-7, 2003<BR>Dublin, Ireland<BR>
        <a href="http://www.hivercon.com/" target="_blank">
        http://www.hivercon.com/</A><BR>

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

<tr><td valign=top>
        <b>COMDEX Fall</b><BR>
        <td valign=top>November 17-21, 2003<BR>Las Vegas, NV<BR>
        <a href="http://www.comdex.com/fall2003/" target="_blank">
        http://www.comdex.com/fall2003/</A><BR>

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

</table>

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

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">MEN Micro's New M-Modules
</FONT>
</H3> 

<P>
Two new digital input M-Modules from
<a href="http://www.men.de/">
MEN Micro</a> have been released.  They have been designed to
meet tough environmental and safety specifications and were developed
specifically for railway
applications, but they can be  deployed in a broad range of
industrial systems where shock, vibration, temperature and harsh
environments are a concern.
<P>
The M-Modules, which are designated M31 and M32, each provide 16 binary
channels to a control platform. Because they conform to the ANSI-approved
M-Module standard, they can be installed in a number of standard bus-based
systems, including CompactPCI, PXI, VMEbus and PCI, or they can be used in
small busless systems. 
<P>
Software drivers for the M31 and M32 are available for Windows, Linux,
VxWorks, QNX, RTX and OS-9. 

<a name="distro"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Distro News</font></H3></center>
<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Ark
</FONT>
</H3> 
<P>
<a href="http://www.arklinux.org/">
Ark Linux</a> is a 
<a href="http://www.ofb.biz/modules.php?name=News&file=article&sid=191">
new distribution</a>, led by former Red Hat employee Bernhard
Rosenkraenzer.  It is based on Red Hat 7.3/8.0, and free alpha
<a href="http://www.arklinux.org/download.php">
downloads</a>
are available.


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Debian
</FONT>
</H3> 
<P>
Debian Weekly News
<a href="http://www.debian.org/News/weekly/2002/51/">
reported</a> the 
<a href="http://lists.debian.org/debian-cd-0212/msg00177.html">
announcement</a>
by Steve McIntyre that he
has created a set of update CD images that contain new and updated
packages from 3.0r1. 
<P> 
<hr width="20%" noshade>
<P>
Also
<a href="http://www.debian.org/News/weekly/2003/01/">
from Debian Weekly News</a> is a report on
the availability of an
<a href="http://polydistortion.net/urls/new-debian-packages.rss">
RSS feed of new Debian packages</a>.
<P> 
<hr width="20%" noshade>
<P>
Bdale Garbee, current Debian project leader,
<a href="http://www.theage.com.au/articles/2003/01/08/1041989994382.html">
has been interviewed</a> by Australian newspaper The Age.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Eagle
</FONT>
</H3> 
<P>
<a href="http://www.geocities.com/eaglelinux">
Eagle Linux</a>
is a how-to based Linux distribution offering full open source
documentation assisting users in creating personal embedded, floppy, and CD
based bootable distributions.


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Gentoo
</FONT>
</H3> 
<P>
<a href="http://www.gentoo.org">
Gentoo Linux</a>
has announced the second release candidate for the upcoming 1.4 version of
Gentoo Linux.  New in 1.4_rc2 is the Gentoo Reference Platform: a suite of
binary tarballs that allow for faster initial
<a href="http://www.gentoo.org/doc/en/gentoo-x86-install.xml">
installation</a>.  Currently X, GNOME, KDE, Mozilla, and OpenOffice,org are
available as binary installations for x86 architectures and ppc
architectures with others to follow.

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Mandrake
</FONT>
</H3> 
<P>
Mandrake 9.0 has been reviewed recently
<a href="http://www.theregister.co.uk/content/4/28776.html">
by The Register/NewsForge</a>
and
<a href="http://www.ofb.biz/modules.php?name=News&file=article&sid=189">
by Open for Business</a>.
<P>
<hr width="20%" noshade>
<P>
It has been widely reported in the past month that Mandrake is currently
experiencing acute financial problems.  This has lead company management to
apply for 
<a href="http://www.theregister.co.uk/content/4/28895.html">
Chapter-11 style protection</a>.  The purpose of this is to give the
company some respite to allow it to reorganise its finances without
pressure from creditors.
The French courts have 
<a href="http://www.mandrakesoft.com/company/press/briefs?n=/mandrakesoft/news/2406">
approved the plan</a> and hopefully the company will
in a better position to make positive progress after this period.

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

<P>
<a href="http://www.sco.com">
The SCO Group</a>
have announced plans to work with
<a href="http://www.wincor-nixdorf.com/usa">
Wincor Nixdorf</a>
to provide Linux-based
retail point-of-sale (POS) solutions to retailers in North America. This
relationship gives retail customers an economical, reliable choice by
combining the functionality and flexibility of Wincor Nixdorf hardware with
the stability and reliability of SCO operating systems.
The joint retail solutions will rely on Wincor Nixdorf's BEETLE POS family and
SCO's Linux POS solution, SmallFoot.


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

<P>
<a href="http://www.suse.de/en/">
SuSE Linux</a>
has annnounced the availability of a desktop Linux product that gives users
the full functionality of the Microsoft Office suite of applications.  SuSE
Linux Office Desktop, available from January 21, is intended for small
companies looking for an easy, preconfigured desktop -- as well as for
personal users with little or no Linux experience.


<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">UnitedLinux
</FONT>
</H3> 
<P> 
<a href="http://www.unitedlinux.com">
UnitedLinux</a>
has announced 
plans to integrate the full 
<a href="http://www.osdl.org">
OSDL</a> Carrier Grade Linux (CGL) 1.1 
feature set for UnitedLinux 1.0, delivering  
enhanced abilities to develop and deploy carrier-grade 
applications in a standardized Linux environment.
<P>
Developed by UnitedLinux integration partner SuSE Linux with HP, 
IBM and Intel, the features -- targeted initially for use on 
Intel-based hardware platforms -- enable telecommunications 
providers to develop and deploy new products and services on 
standards-based, modular communications platforms.
<P>
<hr width="20%" noshade>
<P>
<a href="http://www.lpi.org">
LPI</a>
a professional certification program for 
the Linux community, and
<a href="http://www.unitedlinux.com">
UnitedLinux LLC</a>
have signed a 
cooperative agreement to market a UnitedLinux professional 
certification program.


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

<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">KDE
</FONT>
</H3> 
<P>
KDE 3.1 has
<a href="http://www.kde.org/announcements/announce-3.1.html">
been released</a>.
<P>
<P> <hr> <P> 
<!-- =================================================================== -->
<H3><IMG ALT=" "   SRC="../gx/bolt.gif">
<FONT COLOR="green">Understanding the Linux Kernel, 2nd Edition
</FONT>
</H3> 
<P> 
O'Reilly & Associates has released a new edition of 
<em>
<a href="http://www.oreilly.com/catalog/linuxkernel2/?CMP=EM13459">
Understanding the Linux Kernel</a>
</em>
which has been updated to cover version
2.4 of the kernel. 2.4 differs significantly from version 2.2: 
the virtual memory system is new, support 
for multiprocessor systems is improved, and whole 
new classes of hardware devices have been added. 


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


<P>
<a href="http://www.aquafold.com/">
AquaFold</a>
has announced the
release of Aqua Data Studio 1.5, a free database tool supporting all major
database platforms, including Oracle 8i/9i, DB2 7.2/8.1, Microsoft SQL
Server 2000/7.0, Sybase ASE 12.5, MySQL, PostgreSQL and generic JDBC
drivers.  Aqua Data Studio also supports all major Operating Systems
designed to run Sun Microsystem's Java Platform such as Microsoft Windows,
Linux, OSX and Solaris.
Aqua Data Studio is designed to speed up the
development of database and application developers by providing them with an
elegant and consistent interface to all databases on all platforms.
<a href="http://www.aquafold.com/downloads.html">
Free downloads</a>
and 
<a href="http://www.aquafold.com/screenshots.html">
screenshots</a>
of Aqua Data Studio are available online.


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

<P>
<a href="http://www.openmfg.com">
OpenMFG</a> is
a company
using open source software to bring enterprise resource planning (ERP)
applications to small manufacturers, has welcomed the first ten members of
the Open Partners Program. 

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



<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>

Copyright &copy; 2003, Michael Conry.
Copying license 
<A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 87 of <i>Linux Gazette</i>, February
2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>



<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Ultimate Editor</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/bint.html">Stephen Bint</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<P><CENTER><B><I>Somewhere, out there, is a C++ programmer whom destiny has
chosen to be our liberator.</I></B></CENTER>


<H3>The Ultimate Editor's Time Has Come</H3>

<P>How can it be that Windows users are spoiled for choice of excellent
text editors, while not one decent one exists for the Linux console?
Linux is a better OS, supported by better programmers who are dedicated
to producing better tools for eachother's benefit. The text editor is
the programmer's most important and frequently used tool. Yet Linux
console editors are rubbish. How can this be? 

<P>Those of us who migrate from windows to Linux expect a text editor,
at the very least, to allow selection of text with the mouse and to have
mouse-sensitive menus and dialogs. Of all the editors only mcedit, the
editor built in to the Midnight Commander disk navigator, has these
features. The rest have no dialogs and either no mouse interface or a
very limited, stupid one.

<P>Yet even mcedit has a fatal flaw. If there is anything about its
behaviour you don't like, or a function it lacks which you would like to
add, you will find that reverse-engineering the source to solve that
problem is more difficult than writing your own text editor from
scratch. Unfortunately mcedit is quite basic, so it really needs added
functionality and there is no easy way to add it.

<P><I>What is the point of Open Source being open, if it is so complicated
and poorly documented as to be impenetrable to anyone but the author?</I>

<P>Let's face it, we are all the same. We love writing code and hate
writing docs. Writing slick algorithms is fun but explaining how they
work to newbies is a bore. Yet if someone were to take the trouble to
write an editor with maintenace in mind and build in a simple way to add
C++ functions to menus, it might be the last editor ever written. No one
would bother to write a text editor if one existed, whose behaviour was
easy to change and to which any function could be added.


<H3>Blasphemy</H3>

<P>Stallmanist Fundamentalists may say at this point, emacs is
extensible. So it is, but you need to learn a second language to extend
it. Besides that, the basic editor has a crude and confusing user
interface which cannot be improved by adding lisp modules. 

<P>Some of us who aspire to use Linux are ordinary people, not software
supermen. It is cruel and unnecessary to tell someone struggling to
learn their first language, that they must simultaneously learn a second
language in order to make their editor work they way they want it to.

<P>It will never do. Emacs isn't a tool. It's an intelligence test. It
is time stupid people fought back against the elitists who are so
clever, they find learning emacs a breeze. Notice that you do not have
to learn how to use mcedit. It does what you expect so there is nothing
to learn.

<P>The Ultimate Editor would be what emacs should have been: an
extensible editor with an intuitive mouse-and-menu interface. 
<EM>[Editor's note: emacs was born before mice and pulldown
menus were invented.]</EM>  Instead of
complicating the picture with a second language, the extensions would be
written in C++. It would come with a programmer's guide, explaining how
to install your own menu commands and also describing the anatomy of the
source so that you can easily locate the module you are after if you
want to change something about its basic behaviour. It would be a
do-it-yourself editor kit.


<H3>O, Beautiful Tool</H3>

<P>If the Ultimate Editor existed, this is what it would be like. You
would download it and build it and find it has the basic functionality
of mcedit. It would have mouse selection, mouse-sensitive menus and a
file open dialog box that allows you to navigate the disk by
double-clicking on directories.

<P>It would have few functions: File Open, File Save, File Save As,
Exit, Cut, Copy, Paste, Delete and Help. At first there would be no
search function, but the README would explain that the source file for
the search function is included and would give simple instructions for
how to add it. The lines to be added to the source would already be
there, but commented out, to make it easy to add the search function.

<P>To add the search function you would have to:

<P>1. Move its source file to the editor's src directory

<P>2. Declare the function at the top of main.cc like this:

<PRE>   int show_search_dlg();</PRE>

<P>3. Add a line to main() (actually uncomment a line) like this:

<PRE>   ed.add_menu_cmd( show_search_dlg, "Search", "Edit", F2_key, SHIFT_PRESSED );</PRE>

<P>...which installs a command labelled "Search" on the "Edit" menu,
which can be activated directly by pressing Shift-F2. 

<P>4. In the Makefile, add (uncomment) a compile rule for the source
file and add its name to the list of objects to be linked.

<P>5. Run Make and find that the search function is now on the menu.

<P>Having followed this procedure, even a complete newbie will know how
to write their own menu functions. The editor will be a global variable,
(C++ object) accessible in any source file the user writes, through its
header file. Its member functions will report the states of all its
internal variables, such as cursor position and area selected. The text
array containing the file being edited will be accessible as a member
variable, so that the file can be scanned and modified within the user
function.


<H3>Living Colour</H3>

<P>Usually, the logic of colourization is imposed on users. Some editors
offer a dialog to change the colours and to add keywords, but the logic
is dictated by the author.

<P>The Ultimate Editor will offer an easy way for users to write their
own colourization routines. Apart from enabling people to colourize rare
and eccentric languages, this feature will unlock the hidden potential
of colourization.

<P>Think how many ways you could choose to colour source and what an aid
to reverse engineering it could be. Depending on your purpose, you might
want to colour identifiers according to which header file they are
declared in, or whether they are automatic or allocated, or use colours
to indicate their scope. You might choose to have several colouring
schemes installed and switch between them with hot keys.

<P>To make colourizing simple, the Ultimate Editor will store its files
in file arrays which contain two arrays of strings - one for the text
and another for the colours. The file array will keep the sizes of the
strings in these arrays synchronized so that, for every character stored
in the text array, there is always a byte representing its colour at the
same co-ordinates in the colour array.

<P>The editor will always draw on the colour array when it refreshes, so
all the programmer has to do in order to colour a character at certain
co-ordinates, is change the value in the colour array at those same
co-ordinates and refresh the display. 


<H3>Ninety Percent Widgets</H3>

<P>From the user's point of view, dialog boxes appear to be a small part
of a text editor. From the programmer's perspective, it is the other way
round. The editable fields which appear in dialogs are fully functional
editing windows with a couple of features disabled. So to write the
Ultimate Editor is really to write the Ultimate Widget Library.

<P>A well-written widget library with good docs is more than an
accessory to an extensible editor. If users become familiar with the
library in order to improve the editor, they can use it to produce
configuration dialogs which assist non-experts in configuring other
software, by asking simple questions and writing out their wishes in a
config file. 

<P>Linuxconf is a very important configuration tool, but it is fading
like a dead language because it is hard to use. Because it is hard to
use, it is hard to get enthusiastic about improving it. Users and
programmers both drift instead towards other, distribution-specific
configuration programs. If linuxconf was rewritten to show
mouse-sensitive dialogs that behave like proper dialogs (like X-windows
dialogs), it might grow to include modules to enable clueless newbies to
configure any popular package.

<P>Do you not agree, that the main obstacle to the popularity of Linux,
is esotericism? I mean, no-one bothers to write software for newbies
because only software experts ever use Linux. The growth of Linux is
being prevented by an elitist Catch-22. If idiot-friendly configuration
programs were not important to the popularity of an OS, would Microsoft
have lavished so much time and money on them?

<P>Rewriting linuxconf with a simple but modern widget library would be
the first step to making what it should be - a project that never ends.
It should be continually growing as more modules are added, until it
becomes the one-stop-shop through which all Linux software can be
configured by children.


<H3>A Little Help</H3>

<P>I want this challenge to be open to anyone who knows C++. Because
interfacing with the mouse, keyboard and colour-text screen under Linux
is a low-level nightmare, I have produced an interface library which
makes it as simple under Linux as it is under DOS. I recommend it over
Slang for the purpose of writing an editor for several reasons.

<P>First, the Slang source (including docs and demo programs) zipped is
740k, whereas my library's source zips to 42k. Second, Slang does not
report mouse movement, so a Slang program cannot drag-select with the
mouse. Third, the colouring system in Slang is complicated, but mine
represents the screen as an EGA-style buffer of character/colour byte
pairs. 

<P>I wrote my library after an attempt to use Slang myself drove me to
the conclusion that its all-platform capability generated an
unacceptable overhead and took less than full advantage of the potential
of the Linux console. I don't doubt that the author of Slang is a better
programmer than me, but I have produced a library specifically to serve
programmers who want to produce the first adequate editor for the Linux
console.

<P>You can download it here: <A href="http://members.lycos.co.uk/ctio/">http://members.lycos.co.uk/ctio/</A>

<P>And now that interfacing with the console is as simple under Linux as
it ever was under DOS, the obstacle to Linux editors having the same
basic features as DOS editors has been removed. Now anyone who knows C++
can do something great. To produce the editor and widget library I have
described might change the course of the history of free software, by
rolling out a red carpet to entry-level programmers. 


<H3>Invent the Wheel</H3>

<P>I am constantly being told that there is no need to reinvent the
wheel. A ship could sail the Atlantic, powered only by my sighs. Let me
assure you, I will march up and down the High Street blowing a trumpet
and proclaiming at the top of my voice, "NO NEED TO REINVENT THE WHEEL!"
on the day that someone actually produces a ROUND WHEEL.

<P>In theory, any Open Source editor can be hacked and made perfect, but
we are still waiting for a mouse-aware console editor which can be
hacked and improved by programmers with I.Q.s under 170. Without
adequate documentation, Open Source is a Closed Book to ordinary
mortals.


<H3>Destiny</H3>

<P>What are you, C++ programmer? Someone with the power to build
abstract machines, an inventor that has transcended the limitations of
the material world that crushed the dreams of human inventors of every
generation before this? The citizens of the beautiful city of Free
Software scrape along on square wheels and you could solve their
problem.

<P>If you are sitting on your flabby backside thinking, "Nyaahh. It's
not for me", then who is it for? Not me, I'm homeless. I have had access
to a computer long enough to write the interface library, but now I am
living in a tent and the closest I get to a computer is occasional
internet access at a day centre for the unemployed. That is why it can't
be me. Why can't it be you?

<P>It might be your destiny to be the author of that Ultimate Editor,
the last editor ever written. Perhaps no more than a month after the
importance of free software has been recognised and Stallman's face is
carved on Mount Rushmore, they may have to blow it off with dynamite and
carve yours on there instead.

<H2>Reference</H2>

<P><STRONG><A href="http://www.s-lang.org/">Slang</A></STRONG>, by John
E. Davis. Slang appears to have eclipsed curses, as the
keyboard/mouse/colour text interface library most programmers would
recommend. If you are dead clever, you might find a way to use the
subset of Slang purely concerned with the console interface, which is
part of the <A href="http://www.ibiblio.org/mc/">Midnight Commander</A>
source. It is smaller and allows text selection at the Linux console, while
still offering limited functionality on less capable terminals, even
telnet windows!

<P><STRONG><A href="http://members.lycos.co.uk/ctio/">CTIO</A></STRONG>,
by Stephen Bint. By far the simplest and best console interface library
I have ever written. Only works at the Linux console and DOS, not in
rxvt/xterm nor telnet windows (but it's only 42k). Read about my struggle
to write it <A href="http://www.linuxgazette.com/issue86/bint.html">
here.</A>

<P><STRONG><A href="http://www.gnu.org/software/emacs/emacs.html">emacs</A></STRONG>,
by Richard Stallman. A millstone in the history of free software.






<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Stephen is a homeless Englishman who lives in a tent in the woods. He eats out
of bins and smokes cigarette butts he finds on the road. Though he once worked
for a short time as a C programmer, he prefers to describe himself as a "keen
amateur".
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Stephen Bint.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">HelpDex</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/collinge.html">Shane Collinge</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->













<EM>These cartoons are scaled down to minimize horizontal scrolling.
	To see a panel in all its clarity, click on it.</EM>


<P>

<A HREF="misc/collinge/cheatcodes.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/cheatcodes.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/collinge/379sims.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/379sims.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/collinge/381atmcode.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/381atmcode.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/collinge/382doohickey.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/382doohickey.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/collinge/383hashleft.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/383hashleft.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/collinge/380eminem.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/380eminem.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">



<P> Recent HelpDex cartoons are at Shane's web site,
<A HREF="http://www.shanecollinge.com/">www.shanecollinge.com</A>, on
the <A HREF="http://www.shanecollinge.com/Linux/">Linux</A> page.












<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Part computer programmer, part cartoonist, part Mars Bar. At night, he runs
around in a pair of colorful tights fighting criminals. During the day... well,
he just runs around.  He eats when he's hungry and sleeps when he's sleepy.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Shane Collinge.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Ecol</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/malonda.html">Javier Malonda</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->























These cartoons were made for es.comp.os.linux (ECOL), the Spanish USENET
newsgroup for Linux.  The strips are drawn in Spanish and then translated to
English by the author.  Text commentary on this page is by LG Editor Iron.
Your browser has shrunk the images to conform to the horizontal size limit for
LG articles.  For better picture quality, click on each cartoon to see it full
size.

<P> 
<A HREF="misc/ecol/ecol-93-e.png"><IMG SRC="misc/ecol/ecol-93-e.png" WIDTH="600" HEIGHT="240"></A>
<P>
<A HREF="misc/ecol/ecol-93.png"><IMG SRC="misc/ecol/ecol-93.png" WIDTH="600" HEIGHT="240"></A>


<!-- HR NOSHADE --> <!-- ****************************************************** -->

<HR NOSHADE> <!-- ****************************************************** -->

All Ecol cartoons are at
<A HREF="http://tira.escomposlinux.org/">tira.escomposlinux.org</A> (Spanish) and
<A HREF="http://comic.escomposlinux.org/">comic.escomposlinux.org</A> (English).

<P> <SMALL>These cartoons are copyright Javier Malonda.  They may be copied, linked
or distributed by any means.  However, you may not distribute modifications.  If 
you link to a cartoon, please <A
HREF="mailto:jmr@escomposlinux.org">notify</A> Javier.
</SMALL>














<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<!-- P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all" -->
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Javier Malonda.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Quick-Start Networking</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/howell.html">Edgar Howell</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<HTML>
<BODY>
<H1>
Quick-Start Networking
</H1>



<H2>
Contents
</H2>

Introduction
<BR>1. Ethernet
<BR>2. Ssh
<BR>3. Screen
<BR>4. File Transfer
<BR>5. Nfs
<BR>6. Samba
<BR>7. PCMCIA
<BR>8. Further Reading
<BR>9. A Future without Windows?

<H2>
Introduction
</H2>

<P>
Over the holidays I finally had a block of time large enough to
work on a network at home.  But getting started is always my
biggest problem and it took a while to understand what had to be
done on which machine.  In retrospect it was quite easy to get
started.

<P>
This article is essentially little more than my notes, taken
during the experience, less false starts.  To the best of my
knowledge it documents what I had to do and will be my reference
if the need arises to repeat any of this.

<P>
To avoid inflating this unnecessarily and because I'm really just
an experienced newbie, almost nothing is explained.  There are
references to some relevant articles but I assume you know how to
find the standard documentation.

<P>
To my mind there is no reason for anyone with two or more computers
not to have them networked.  My first step was with an Ethernet
card for the PC, a cross-over cable, and a PCMCIA Ethernet card,
all for 87.50 euro.  Once that was working, another PCMCIA card
(should have known by the price that it was Windows-only), 8-port
switch and 3 3-meter cables cost 67.50 euro.  Roughly $160 wasn't
bad.  And it shouldn't cost much more than $25 to connect 2 PCs
point-to-point.

<P>
The current status of this home office network is as follows:
<LI> Toshiba 486 500MB/24MB, SuSE 8.0 (kernel 2.4.18-4GB) without X
<LI> PC Pentium 166 2x4GB/32MB, SuSE 6.3 (kernel 2.2.13)
<LI> Toshiba AMD 4GB/64MB, SuSE 8.0 (kernel 2.4.18-4GB) or Windows 98

<P>
By the way, the asymmetry in the following is not due to anything
inherent in networking or the different Linux kernels.  Rather,
the 486 will one day be my portal to the Internet.  It shouldn't
be able to do much of anything other than responding to someone
it knows.  On the other hand the other two should have no
restrictions.

<P>
Other than that, be careful: this is merely intended to get up and
running as quickly as possible.  Everything else has been pretty
much ignored.  Consider this just a small but important first step.
Your next step has to be the relevant documentation because this is
quite superficial!

<H2>
1. Quick-Start - Ethernet
</H2>

<P>
Other than a PCMCIA problem (see below), installing and configuring
Ethernet is rather straight-forward.  To keep things simple I
started out with a cross-over cable, i.e. point-to-point, and
moved on to a switch only after everything else was known to work.

<P>
Rather than having each machine connect to the network at boot,
there are scripts in /root to run when it is time to connect.
Here are the relevant scripts and files from two of the machines
(less comments and stuff not relevant here):

<P>
Toshiba 486

<PRE>
     /etc/hosts:       127.0.0.1      localhost
                       192.168.0.99   Toshiba486.Lohgo  Lohgo486
                       192.168.0.100  ToshibaAMD.Lohgo  LohgoAMD
                       192.168.0.101  PC.Lohgo          LohgoPC

     /etc/hosts.allow: sshd: 192.168.0.100, 192.168.0.101

     /root/eth-up:     #!/bin/bash
                       /sbin/ifconfig eth0 192.168.0.99 \
                                      broadcast 192.168.0.255 \
                                      netmask 255.255.255.0 up
</PRE>
<P>
Pentium 166

<PRE>
     /etc/hosts:       127.0.0.1      localhost         PC
                       192.168.0.99   Toshiba486.Lohgo  Lohgo486
                       192.168.0.100  ToshibaAMD.Lohgo  LohgoAMD
                       192.168.0.101  PC.Lohgo          LohgoPC

     /etc/hosts.allow: sshd:      192.168.0.100
                       portmap:   192.168.0.100
                       lockd:     192.168.0.100
                       rquotad:   192.168.0.100
                       mountd:    192.168.0.100
                       statd:     192.168.0.100

     /root/eth-up:     #!/bin/bash
                       /sbin/insmod rtl8139
                       /sbin/ifconfig eth0 192.168.0.101 \
                                      broadcast 192.168.0.255 \
                                      netmask 255.255.255.0 up
</PRE>

<P>
The following are the same on all 3 machines:

<PRE>
     /etc/hosts.deny:  ALL : ALL

     /root/eth-down:   #!/bin/bash
                       /sbin/ifconfig eth0 down

     /root/eth-stat:   #!/bin/bash
                       /sbin/ifconfig eth0; /bin/netstat -r
</PRE>

<P>
The extra entries for the P166 in /etc/hosts.allow are to support
nfs.  And insmod in /root/eth-up is due to the Ethernet card in
the PC vs PCMCIA on the notebooks.

<P>
Be aware that SuSE at installation has an option to "re-organize"
/etc/hosts that defaults to CHECK_ETC_HOSTS=yes in /etc/rc.config.
My suspicion is that this is what can cause the 192-IP-address to
be replaced by a 127-address for the host itself in /etc/hosts on
reboot.  I don't reboot often enough to feel like checking this
out.  But if you get an inexplicable inability to access the
network, do verify the contents of this file.

<H2>
2. Quick-Start - Ssh
</H2>

<P>
Without a doubt this is the most complex of the Linux facilities
described here but is the key to a couple of things that are
extremely useful and it certainly should be set up, for both
convenience and security.

<P>
Prerequisites/definitions:
<LI> "local" is the machine whose keyboard you want to use
<LI> "remote" is the machine whose keyboard you don't want to use
<LI> "&lt;user&gt;" has been set up on both machines
<LI> "&lt;host&gt;" is the 3rd column of the entry for the "remote" host
  in /etc/hosts on the "local" machine
<LI> the entries in /etc/hosts.allow and /etc/hosts.deny on the
  "remote" machine permit use of sshd from the "local" machine
<LI> use of the mount command does mean playing disk-jockey between
  the two machines as appropriate.
<LI> the following is based on SuSE 6.3 (2.2.13) and 8.0 (2.4.18-4GB)

<P>
This is what you have to do if you don't bother to set ssh up:

<PRE>
Remote        Local          Comment

              &lt;logon as user also known to remote host&gt;
              ssh &lt;host&gt;
                             warning:... SOMETHING NASTY
              yes            accept it
              &lt;password&gt;
</PRE>

<P>
This is setup:

<PRE>
Remote        Local          Comment

              &lt;logon as user also known to remote host&gt;
              /usr/bin/ssh-keygen
                             accept default: .ssh/identity
                             no passphrase
              mount /floppy
              cp .ssh/identity.pub /floppy/
              umount /floppy

logon as &lt;the same user&gt;
mkdir .ssh                   if necessary
mount /floppy
cp /floppy/identity.pub .ssh/authorized_keys
cp /etc/ssh/ssh_host_key.pub /floppy/known_hosts
umount /floppy

              mount /floppy
              cp /floppy/known_hosts .ssh/
              umount /floppy
              vi .ssh/known_hosts
                             add &lt;host&gt; at start of line and
                             remove root@&lt;host&gt; at end
</PRE>

<P>
And this is what you have to do to logon after setting things up:

<PRE>
Remote        Local          Comment

              &lt;logon as user also known to remote host&gt;
              ssh &lt;host&gt;
</PRE>

<P>
Note that the host key is generated as part of system installation
(with SuSE anyhow).  And there can be differences in directory
structure (SuSE's kernel 2.2 didn't have 'ssh' under 'etc').
Also note that this is just intended to get someone unfamiliar
with ssh up and running.  Do not blindly follow these steps if you
have used ssh before!  In particular most 'cp's certainly ought to
be 'cat ... &gt;&gt;'.  In the office at home I don't want a passphrase
to begin work on a different machine, but you might.

<H2>
3. Quick-Start - Screen
</H2>

<P>
Although it has been mentioned in Linux Gazette several times and
I actually did play with it briefly, the need for screen wasn't
at all obvious to me.  Given 6+ vt's and X running on at least
two others with unlimited windows under whatever window manager
one has running, it seemed just another level of complexity.

<P>
The need became obvious as the network at home began taking shape.
The rationale behind screen boils down to this: if you start
sessions on remote machines under screen, they remain available
to you as long as the remote machine isn't shut down -- independent
of what happens on the communication link or your local machine.
Like one of my PCMCIA Ethernet cards only works under Windows and
I can thus only connect one of the notebooks to the PC at a time,
if the AMD is also running Linux, as it usually is -- but no need
to shut the 486 down, just eject the card, pop it into the AMD and
screen keeps sessions active on the 486 for later access.

<P>
To start screen:

<PRE>
    screen -R   restart session if available, otherwise start one
</PRE>

<P>
Within screen (not at all apparent, it hides well) use Ctrl-a
followed by:

<PRE>
    ?   help
    w   show list of windows
    n   switch to next window
    c   create new window
    d   disconnect
    A   assign title to window
</PRE>

<H2>
4. Quick-Start - File Transfer
</H2>

<P>
If you are using ssh, you can get rid of rsh -- and telnet and
ftp as well for that matter.  Here are a couple of alternatives
that to me are more convenient than the lot.

<P>
Netcat is a nifty little tool, analogous to cat.  You start it to
receive a file on one machine

<PRE>
    netcat -vv -l -p &lt;port&gt; &gt; &lt;file&gt;
</PRE>

<P>
and then tell the other machine what to send

<PRE>
    netcat -vv -w 10 &lt;host&gt; &lt;port&gt; &lt; &lt;file&gt;
or
    tar -czvf - &lt;directory&gt; | netcat -vv -w 10 &lt;host&gt; &lt;port&gt;
</PRE>

<P>
Use netstat and /etc/services to find an available port.  The
option "-w 10" tells the sender to terminate the connection after
10 seconds of inactivity and the option "-vv" lets you verify
that the correct number of bytes was sent and received.

<P>
While netcat holds promise for scripts to backup to a different
machine as the network at home gradually takes shape, Midnight
Commander has amazing facilities for the things one simply has to
do by hand.

<P>
If ssh has been set up properly, the following entered in the
command line makes mc's active panel point to the same user on
the "other" machine -- yes, "#sh" not "#ssh", unfortunately

<PRE>
    cd /#sh:&lt;host&gt;
</PRE>

<P>
And if the other side has anonymous ftp running, the following should be
fairly self-explanatory

<PRE>
    cd /#ftp:www.tldp.org/
</PRE>

<H2>
5. Quick-Start - NFS
</H2>

<P>
I played around with nfs and it works but unfortunately my notes
are non-existant (basically just check-marks in the printout of
the HOWTO).  As I recall, besides installing the relevant package
on client and server all that was needed was to edit /etc/exports
on the PC (server) as follows:

<PRE>
/home	192.168.0.100(rw,root_squash,sync,insecure)
/tmp	192.168.0.100(rw,root_squash,sync,insecure)
</PRE>

See also /etc/hosts.allow under 1. Ethernet, above.

<P>
At installation SuSE has a number of options to be selected, many
(all?) of which wind up in /etc/rc.config.  Here is an excerpt of
those relevant to nfs:

<PRE>
START_PORTMAP="yes"
NFS_SERVER="yes"
USE_KERNEL_NFSD="yes"
USE_KERNEL_NFSD_NUMBER="4"
NFS_SERVER_UGID="no"
REEXPORT_NFS="no"
</PRE>

<P>
On the AMD (client) I added the following to /etc/fstab:

<PRE>
192.168.0.101:/home	/Rhome	nfs	noauto,users,sync 0 0
192.168.0.101:/tmp	/Rtmp	nfs	noauto,users,sync 0 0
</PRE>

<P>
At that point the mount command works with /Rhome etc. just as
well as /floppy or any other entry in fstab.  One minor annoyance
is that user ID's must be the same on all machines using nfs.
This was not a problem for me because, when installing Linux, I
create the few users in the same order.

<H2>
6. Quick-Start - Samba
</H2>

<P>
Given the difficulty of keeping track of what one is doing under
Windows, particularly with false starts and things that turn out
to be wrong or simply irrelevant, this needs to be taken with a
large grain of salt.  It assumes that the driver for the PCMCIA
card has been installed, if relevant.  And if the terminology is
slightly obscure, that is due to my translating from the German
versions of Windows.

<P>
The following is what was necessary to enable logon to the PC
from the AMD under Samba, i.e. from Windows 98 to Linux 2.2.13
(SuSE 6.3).  With appropriate adjustments the same steps worked
in the other direction, i.e. from Windows 95 to Linux 2.4.18-4GB
(SuSE 8.0).  But note these differences:
<LI>encrypt passwords:  98: yes; 95: no
<LI>path to smb.conf:  2.4: /etc/samba; 2.2: /etc
<LI>path to smbpasswd: 2.4: /etc/samba; 2.2: /etc
<LI>path to netlogon:  2.4: /usr/local/samba; 2.2: /var/lib/samba

<PRE>
Part 1 - Linux
                             edit /etc/smb.conf
[global]
   workgroup = Lohgo
   encrypt passwords = yes
   smb passwd file = /etc/smbpasswd
   password level = 8
   username level = 8
   socket options = TCP_NODELAY
   domain logons = yes
   domain master = yes
   os level = 65
   preferred master = yes
   wins proxy = no
   wins support = yes
   hosts allow = 192.168.0.100 127.
[homes]
   comment = Home Directories
   read only = no
   browseable = no
[netlogon]
   comment = Network Logon Service
   path = /usr/local/samba/netlogon
   public = no
   writeable = no
   browseable = no
[profiles]
   path = /home/%U/profile
   guest ok = yes
   browseable = no
                             confirm validity, should show no errors
testparm | less
                             create user w/password
smbpasswd -a web
                             verify user enabled
smbpasswd -e web
                             start Samba
smbd -D
nmbd -D
                             at this point from the client -- under
                             Linux, not Windows -- the following
                             should give a meaningful response
smbclient -L LohgoPC
                             and the following should give you
                             ftp-like access
smbclient //LohgoPC/web
</PRE>


<PRE>
Part 2 - Windows98

control panel | network | configuration
  add | client for microsoft network
  properties
    Windows NT-domain: Lohgo
    quick logon
  add | protocol | microsoft | tcp/ip
  properties | set IP-address
    IP-address:     192.168.000.100
    Subnet address: 255.255.255.000
  primary network logon: client for Microsoft network
control panel | network | identification
  computer name: LohgoAMD
  workgroup:     Lohgo
  description:   ToshibaAMD.Lohgo
control panel | passwords | user profiles
  users can customize: both
reboot
                             if using PCMCIA the following puts
                             a symbol on the task bar with which
                             the PCMCIA card can be removed
&lt;insert PCMCIA Ethernet card and wait for lights to settle down&gt;
                             the following works ONLY after TCP/IP
                             has been set up, shows configuration
start | run | winipcfg
                             test connection from within a dos-box
ping -n 5 192.100.0.101
                             edit c:\windows\hosts.sam
127.0.0.1       localhost
192.168.0.101   lohgopc
                             edit c:\windows\lmhosts.sam
192.168.0.101   lohgopc
</PRE>

<P>
At this point after booting, Windows will ask you to logon, which
you can either do with a user known to Samba or cancel to use
Windows without the network as before.  Now, however, the pop-up
window opened by Ctrl-Esc includes near the bottom a line to
logoff that afterwards provides the same logon prompt as booting.
And the entries in the task bar -- in the home directory, anyhow
-- tell you who and where you are, as in

<P>
"Explorer - &lt;user&gt; at &lt;host&gt;"

<P>
where "&lt;host&gt;" is the 3rd column of the entry for the Linux
machine in /etc/hosts on the Linux machine.

<P>
Symbolic links work quite nicely.  The following executed within
the home directory of some user makes a directory -- even on a
different partition -- on the Linux machine available to that
user on the Windows machine:

<P>
ln -s /dos/f/pictures pictures

<P>
Due to a shortage of resources on the PC and the fact that I have
no real use for Windows anyhow, I use the following scripts to
start and stop the Samba daemons on the PC as needed:

<PRE>
/root/samba-up:     #!/bin/bash
                    /usr/sbin/smbd    -d3    -l /tmp/sbd.log
                    /usr/sbin/nmbd -D -d0 -o -l /tmp/sbd.log

/root/samba-down:   #!/bin/bash
                    kill -s SIGTERM $(ps aux | grep mbd \
                        | grep -v grep | awk '{print $2}')
</PRE>

Once you have this working, it won't take you 5 minutes to set up
a network printer.

Uncomment (or add) the following to smb.conf:

<PRE>
[printers]
   comment = All Printers
   browseable = no
   printable = yes
   public = no
   read only = yes
   create mode = 0700
   directory = /tmp
</PRE>

And then spend some time with the archaic data entry system on the
Windows machine:

<PRE>
control panel | printer | new printer
  network printer | search
    network environment | Pc
      hpdj-a4-raw
    manufacturer: HP
    printer:      HP OfficeJet
</PRE>

Shut down and re-start Samba and you're in business.

<H2>
7. Quick-Start - PCMCIA
</H2>

<P>
To be honest I have no idea whether this is generally applicable
or is specific to SuSE (8.0).  And it was only the 2.4 kernel
that had problems with PCMCIA, not 2.2 strangely enough.  Also,
it has nothing to do with networking per se.  But if you're going
to connect a notebook to your network, you'll probably have to
confront the alphabet monster.  And a PCMCIA Ethernet card makes
a delightful docking station.

<P>
Omitting many details, I initially failed to note an inconsistency
with references to irq 5 and 10 that later led to tons of error
messages.  But this was due to having inserted the PCMCIA card
before starting the installation of Linux.

<P>
In my case at least, by not inserting the PCMCIA card before
starting installation, there was a reference to only one irq which
led to my doing the following.

<P>
After initial boot in /etc/sysconfig/pcmcia add
<PRE>
	PCMCIA_PCIC="i82365"
	PCMCIA_PCIC_OPTS="irq_list=10"
</PRE>
and then run /sbin/SuSEconfig and reboot.

<P>
However, installing the PCMCIA software before doing this causes
the notebook to hang irrevocably on boot.  The only way to boot
is by giving LILO the parameter NOPCMCIA=yes.  Instead, I installed
the PCMCIA software after SuSEconfig and before reboot.

<P>
After that, inserting the PCMCIA card produces a couple of beeps
and it works as advertised.  Since this is my first personal
experience with Ethernet, I can't comment on alternatives but the
D-Link DFE-650TXD PCMCIA Ethernet card works well, Linux-to-Linux
anyhow (a couple of hours sending stuff over the network before
risking the wretched "Recovery CD-Rom" to make Windows 98 work
again) and has lots of LEDs to let you know what is going on.

<P>
Here is the output from /sbin/cardctl config and ident.

<P>
CONFIG:

<PRE>
Socket 0:
  not configured
Socket 1:
  Vcc 5.0V  Vpp1 0.0V  Vpp2 0.0V
  interface type is "memory and I/O"
  irq 10 [exclusive] [level]
  function 0:
    config base 0x0400
      option 0x60 status 0x00 copy 0x00
    io 0x0300-0x031f [auto]
</PRE>

<P>
IDENT:

<PRE>
Socket 0:
  no product info available
Socket 1:
  product info: "D-Link", "DFE-650TXD", "Fast Ethernet", "Rev. A1"
  manfid: 0x0149, 0x0230
  function: 6 (network)
</PRE>

<H2>
8. Further Reading
</H2>


<P>
See also the following articles in the issue of Linux Gazette
indicated:

<BR>36: <EM>Introducing Samba</EM>
    by John Blair
<BR>39: <EM>Expanding Your Home Network</EM>
    by J.C. Pollman
<BR>44: <EM>DNS for the Home Network</EM>
    by J.C. Pollman and Bill Mote
<BR>47: <EM>Backup for the Home Network</EM>
    by J.C. Pollman and Bill Mote
<BR>48: <EM>SAMBA, Win95, NT and HP Jetdirect</EM>
    by Eugene Blanchard
<BR>50: <EM>Sharing your Home</EM>
    by J.C. Pollman and Bill Mote
<BR>57: <EM>Making a Simple Linux Network Including Windows 9x</EM>
    by Juraj Sipos
<BR>61: <EM>Using ssh</EM>
    by Matteo Dell'Omodarme
<BR>64: <EM>ssh suite: sftp, scp and ssh-agent</EM>
    by Matteo Dell'Omodarme
<BR>67: <EM>Using ssh-agent for SSH1 and OpenSSH</EM>
    by Jose Nazario
<BR>74: <EM>Play with the Lovely Netcat</EM>
    by zhaoway

<P>
The Linux Gazette Answer Gang Knowledge Base under Network
Configuration has numerous relevant tidbits among which
<EM>Routing and Subnetting 101</EM> is mandatory reading.

<P>
And the Linux Focus Index by Subject under System Administration
has several articles well worth looking at, e.g.:

<BR><EM>Replacing a Windows/NT/2000 server using Linux and Samba</EM>
    by Sebastian Sasias
<BR><EM>Through the Tunnel</EM>
    by Georges Tarbouriech
<BR><EM>Samba Configuration</EM>
    by Eric Seigne
<BR><EM>Network File System (NFS)</EM>
    by Frederic Raynal
<BR><EM>Home Networking, glossary and overview</EM>
    by Guido Socher

<H2>
9. A Future without Windows?
</H2>


<P>
Coming from pre-TRS-80 days, I've used DOS, various versions of
Windows, at least 3 releases of OS/2, Coherent, and now 5 releases
of SuSE Linux over at least 5 years.  I am convinced that anyone
in a position to "compare and contrast" would agree that at best
Windows is unstable junk.  One of my goals for quite some time
had been to gain complete independence from Windows.

<P>
But consider: our ISDN phone system has an RS-232 connector with
which it can be programmed via -- yeah, you got it.  One of the
printers is USB for the notebook and guess whose drivers are
available.  Our digital camera uses smart media and the USB smart
media reader...  Oh, well, you get the picture.

<P>
I've only had Samba working for a week and actually hadn't even
intended to check it out but everything else worked so well that
it seemed worth a try.  And it's so slick that I question whether
it would really be worth my effort to try to find replacement drivers
for this legacy stuff.  How many hours, how many experiments, what
guarantee of success?  Doesn't it make more sense to boot the
notebook under the "silly system" (I hope Monty Python put that
under GPL) and use the Samba connection to the rest of the network?
At least until the last Windows-legacy device eats it.




<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Edgar is a consultant in the Cologne/Bonn area in Germany.
His day job involves helping a customer with payroll, maintaining
ancient IBM Assembler programs, some occasional COBOL, and
otherwise using QMF, PL/1 and DB/2 under MVS.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Edgar Howell.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">A Keep-Alive Program You Can Run Anywhere</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/jenkins.graham.html">Graham Jenkins</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<h2>The Poodle and the Labrador</h2>

<p>You are halfway through typing a new program into a remote machine connected
over a dial-up line, and you get
called to intervene in a fight between your partner's miniature poodle
and the neighbour's ugly yellow Labrador.
When you get back, your connection has timed-out.</p>

<p>Is this something that has happened to you?
Or perhaps you had to
drag your kids away from a particularly offensive episode of Jerry Springer,
then found you had to stick around to make sure they didn't come back?</p>

<h2>The Blonde Solution</h2>

<p>The traditional procedure for maintaining activity on your line during
an interruption of the type outlined above was to use a 'fortune' program
in a small loop so that a random saying got written to your screen
every half-minute. This could present some real problems if a person with
fair hair looked at your screen and saw something like:</p>
<pre>
 Q:  How do you make a blonde's eyes light up?
 A:  Shine a flashlight in her ear.
</pre>
<p>You could of course used a '-i' or equivalent parameter restricting 'fortune'
to generating inoffensive material like:</p>
<pre>
  Computing Definition
  Chaining - A method of attaching programmers to desk, to speed up output.
</pre>
<p>The more recent incarnations of the 'fortune' program offer their users
a more specific set of options. You can chose between offending 
those who are Irish, gay or intellectually retarded!</p>

<h2>For The Terminally-Challenged</h2>

<p>If you are just using a browser to read your Hotmail messages, you probably
won't want to open a terminal window just so you can run a 'fortune'
program. If you are using an X11-compliant window-manager, you could start a
clock program with something like:</p>
<pre> xclock -digital -update 1 &</pre>
<p>But that's not going to work on your your vintage Windows 95 machine unless
you also happen to be running something like PC-Xware.</p>
<p>The 'KeepAlive.java' program listed here is designed to work anywhere.
It's written in Java 1.1 so that even the 'jview' virtual machine
on your basic Microsoft machine can handle it. It doesn't rely on finding
a 'fortune', 'xclock' or other program on a remote machine. And you don't
have to change anything when you connect via a different ISP.</p> 

<h2>Finding A Partner</h2>

<p>But you have to send traffic somewhere, right? So how do you find a partner
machine which will receive your traffic? If we were writing this program as
a shell script, we might work out where our gateway was, and ping it at
appropriate intervals. That's not so easy to do in a Java program which might
run on any number of platforms. And in any case, it would be nice if we could
send traffic somewhere beyond the gateway machine.</p>

<p>In almost every sort of networking arrangement, the participating machines
have knowledge of one or more nameserver addresses. So what we can do from
our Java program is make periodic requests to those nameservers.
We need to ensure that any hosts whose addresses we request cannot be found
locally in a hosts table. And we need to also ensure that the answers to
our nameserver requests are not cached locally. If you take a look now at
the program, you will see that the names of the hosts whose addresses
we are requesting are generated by
examining the clock-time in milliseconds at the time of each request.
This results in names like A1040689223909, A1040689229448, etc.</p>

<p>That's really all we need to do. But it's nice to be able to see something
happening. So our program defines a 'MessageFrame' class which displays two
colored buttons in a GUI window. The colors of these are changed at each
iteration. We also set the title on the GUI window, and change it at each
iteration - so we can still see something happening when the window is
minimized. And we set up a listener to detect 'window closing' events and
perform a graceful shutdown.</p>

<h2>Getting It Together</h2>

<p>Here's the
<a href="misc/jenkins/KeepAlive.java.txt">program</a>.
You need to compile it with a command like:
<pre> javac KeepAlive.java</pre>
This will generate three 'class' files which contain code which can be executed
on a java virtual machine. So you can copy those class files to a directory
on another machine, then execute it with a command like:
<pre> java KeepAlive</pre>
To use the Microsoft virtual machine on a Windows box, use:
<pre> java KeepAlive</pre>
</p> 
<pre>
/* @(#) KeepAlive.java  Trivial keep-alive program. Tries at 5-second intervals
 *                      to find addresses for hosts with generated names. This
 *                      ensures that messages are sent to nameserver(s).
 *                      Copyright (c) 2002 Graham Jenkins &lt;grahjenk@au1.ibm.com&gt;
 *                      All rights reserved. Version 1.06, August 15, 2002.
 */
import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Date;
public class KeepAlive {
  public static void main(String[] args) {
    MessageFrame f=new MessageFrame();  // Change button colours each iteration.
    int flag=0;                         // Also switch frame-title so we can see
    while ( true ) {                    // activity whilst iconified.
      f.statusMess(Color.red,Color.red); f.setTitle("==X==");
      try {InetAddress addr=InetAddress.getByName("A"+(new Date()).getTime());}
      catch (UnknownHostException ioe) {}
      if(flag==0) {f.statusMess(Color.yellow,Color.green); f.setTitle("1.06");}
      else {f.statusMess(Color.green,Color.yellow); f.setTitle("KeepAlive");}
      flag=1-flag;
      try {Thread.sleep(5000L);} catch (InterruptedException e) {}
    }
  }
}

class MessageFrame extends Frame implements ActionListener {
  private Button b1, b2;                // Displays two coloured buttons.
  public MessageFrame() {
    Panel p=new Panel(); p.setLayout(new FlowLayout());
    b1=new Button() ; b2=new Button(); p.add(b1); p.add(b2);
    this.add("South",p); this.setSize(150,50); this.show();
    this.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) { System.exit(0); }
    });
  }
  public void statusMess(Color left, Color right) {
    b1.setBackground(left); b2.setBackground(right);
  }
  public void actionPerformed(ActionEvent e) {}
}
</pre>
<p>If you have Java 1.1 or later, and no requirement to use the Microsoft
virtual machine,
you can assemble the class files into a single 'jar' file, then execute it
using the '-jar' option thus:
<pre>
  echo "Main-Class: KeepAlive\015" &gt;/tmp/MyManifest
  jar cmf /tmp/MyManifest /tmp/KeepAlive.jar *.class
  
  java -jar /tmp/KeepAlive.jar
</pre>

<h2>If You Don't Have It</h2>

<p>If your machine doesn't have Java, you can get it from
<a href="http://java.sun.com/j2se/downloads.html">Sun MicroSystems</a>.

And if you need to know more about network programming with Java, you
could take a look at <a href="http://www.davidreilly.com/jnpbook">"Java Network
Programming and Distributed Computing" by David Reilly and Michael Reilly</a>.
</p>





<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Graham is a Unix Specialist at IBM Global Services, Australia. He lives
in Melbourne and has
built and managed many flavors of proprietary and open systems on several
hardware platforms.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Graham Jenkins.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Linux-Based Voice Recognition</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/lodato.html">Janine M Lodato</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->





<P>  Let's look at Linux-based voice recognition software from the perspective of China.
It would behoove Linux computer makers anyway to begin manufacturing their
computers in China, because China offers a low-cost method of manufacturing and
provides them with a large market for their hardware which can also be exported
to other important markets around the world.  

<P>  Linux  computers have the capacity to accommodate voice recognition
systems, such as IBM ViaVoice.  This is especially advantageous to Chinese
speakers because both Mandarin and Cantonese are very complex in the written
form, so documents could be more easily produced through voice recognition
software running on a Linux platform.  Using a keyboard is next to impossible
for Chinese languages because so many characters are involved in typing a
document.    

<P>  Other languages will also benefit from using voice recognition software 
for purposes of speed.  Hands-busy, eyes-busy professionals can benefit 
greatly from voice recognition so they don't have to use a mouse and keyboard 
to document their findings.  Voice-activated, easily-used telephone systems 
will benefit all walks of life.  Anyone driving a car will find voice 
recognition a much more effective way of manipulating a vehicle and 
communicating from the vehicle.    
<P>  The health-care market alone may justify the Linux based voice 
recognition project. Health-care services are the largest expense of the 
Group of Ten nations, and it is the fastest growing sector as well. 
Health-care workers would benefit from using their voices to document 
describing the treatments of patients.  Voice recognition allows them a 
hands-free environment in which to analyze, treat and write about particular 
cases easily and quickly.  
<P>  Electronically connected medical devices via  wireless
LAN can benefit:
<UL>
<LI> ...Hospital administration staff
	<UL>
	<LI> Improve the usage efficiency of resources
	<LI> Achieve standardized, quality patient management
	<LI> Dramatically reduce data recording (transcription) errors
	<LI> Lower costs
	<LI> Make any room a telemetry room on demand (that is, do laboratory
measurements in any room regardless of where the central equipment is located)
</UL>
<LI> ...Medical staff
	<UL>
	<LI> Be empowered with a 24/7 complete set of vital-sign data
	<LI> Have more time for hands-on care
	<LI> See changes in patient status immediately to enable quicker responses
	</UL>
</UL>


<P> In this life sciences field, the simplicity, reliability and low cost of 
Linux for servers, tablets, embedded devices and desktops is paramount.  
Only about 10% of the documents in the health-care field in the USA are 
produced electronically due to the cumbersome and unreliable nature of the 
Windows environment. 30% of the cost of health-care is a direct result of 
manual creation of the documents and many of the malpractice cases are also 
due to the imprecision of transcriptions of manually scribbled medical 
records and directives, as anybody who looks at a prescription can attest.   

<P>   Obviously, the market for these new technologies exists. What remains 
is for a hungry company with aggressive sales people to tap into that market. 
 Once those sales people get the technology distributed, the needs of many 
will be met and a new mass market will open up that Microsoft isn't filling: 
assistive technology (AT).  Actually, the field already exists but needs to 
be expanded to include both physically disabled and functionally disabled.
<P>  Yes, voice recognition offers great promise for the future.  However, it 
isn't perfect and needs to be improved.  One improvement could use lip 
reading to bolster its accuracy.
 Still another is multi-tonal voice input. Another is directional 
microphones.  Every generation of voice recognition software will improve as 
the hardware for Linux gets bigger and stronger.    










<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Janine M Lodato.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Perl One-Liner of the Month: The Adventure of the Arbitrary Archives</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/okopnik.html">Ben Okopnik</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<p>Spring was in full bloom, and Woomert Foonly was enjoying another perfect
day. It had featured a trivially easy configuration of a 1,000-node Linux
cluster, and had been brought to an acme by lunching on Moroccan
<i>b'stila</i>
with just a touch of <i>ras el hanout</i> curry and a fruited <i>couscous</i>
on the side, complemented by a dessert of sweet rice with cinnamon. All
was at peace... until Frink Ooblick burst in, supporting - almost carrying
- a man who seemed to be in the last extremity of shock. Frink helped him
to the couch, then dropped into the easy chair, clearly exhausted by his
effort.
<p>&nbsp;-- "Woomert, it's simply scandalous. This is Resolv Dot Conf, a humble...
erm, well, a sysadmin, anyway. Recently, he was cruelly forced to install
some kind of a legacy OS on his manager's computer - can you imagine? -
and now, he's being asked to do something that sounds nearly impossible,
although I could only get scant details. He had heard of your reputation
(who hasn't, these days?), and was coming to see if you could help him,
but collapsed in the street just outside your door due to the residual
shock and a severe Jolt Cola deficiency. As to the problem... well, I'll
let him tell you."
<p>Woomert had been tending to their guest while listening, with the result
that the latter now looked almost normal. Indeed, Woomert's "sysadmin-grade
coffee" was well-known among the <i>cognoscenti</i> for its restorative
powers, although the exact recipe (it was thought to have Espresso Alexander
and coffee ice cream somewhere in its ancestry, but the various theories
diverged widely after that point) remained a deep secret.
<p>Now, though, the famous detective's eyes sharpened to that look of concentration
he habitually wore while working.
<p>&nbsp;-- "Please state your problem clearly and concisely."
<p>The quickly recovering sysadmin shook his head mournfully.
<p>&nbsp;-- "Well, Mr. Foonly... you see, what I have is a script that processes
the data submitted to us by our satellite offices. The thing is, it all
comes in various forms: we're a health insurance data processor, and every
company's format is different. Not only that, but the way everyone submits
the data is different: some just send us a plain data file, others use
'gzip', or 'compress', or 'bzip', or 'rar', or even 'tar' <i>and</i>
'compress' (or 'gzip'), and others - fortunately, all of those are just
plain data - hand us a live data stream out of their proprietary
applications. Our programmers handled the various format conversions as
soon as they got the specs, but this arbitrary compression problem was left
up to me, and it's got me up a tree!"
<p>He stopped to take a deep breath and another gulp of Woomert's coffee,
which seemed to revive him further, although he still sat hunched over,
his forehead resting on his hand.
<p>"Anyway, at this point, making it all work still requires human intervention;
we've got two people doing nothing but sorting and decompressing the files,
all day long. If it wasn't for that, the whole system could be completely
automated... and of course, management keeps at me: 'Why isn't it fixed
yet? Aren't you computer people supposed to...' and so on."
<p>When he finally sat up and looked at Woomert, his jaw was firmly set.
He was a man clearly resigned to his fate, no matter how horrible.
<p>"Be honest with me, Mr. Foonly. Is there a possibility of a solution,
or am I finished? I know The Mantra <a href="#1">[1]</a>, of course, but
I'd like to go on if possible; my users need me, and I know of The Dark
Powers that slaver to descend upon their innocent souls without a sysadmin
to protect them."
<p>Woomert nodded, recognizing the weary old warrior's words as completely
true; he, too, had encountered and battled The Dark Ones, creatures that
would completely unhinge the minds of the users if they were freed for
even a moment, and knew of the valiant SysAdmin's Guild 
(<a href="http://sage.org">http://sage.org</a>) which had sworn
to protect the innocent (even though it was often protection
from themselves, via the application of the mystic and holy LART <a href="#2">[2]</a>).
<p>&nbsp;-- "Resolv, I'm very happy to say that there is indeed a solution to
the problem. I'm sure that you've done your research on the available tools,
and have heard of '<tt>atool</tt>', an archive manager by Oskar Liljeblad..."
<p>At Resolv's nod, he went on.
<p>"All right; then you also know that it will handle all of the above
archive formats and more. Despite the fact that it's written in Perl, we're
not going to use any of its code in your script - that would be a wasteful
duplication of effort. Instead, we're simply going to use '<tt>acat'</tt>,
one of <tt>'atool'</tt>s utilities, as an external filter - a conditional
one. All we have to do is insert it right at the beginning of your script,
like so:
<pre>
<hr WIDTH="100%">#!/usr/bin/perl -w
# Created by Resolv Dot Conf on Pungenday, Chaos 43, 3166 YOLD

<b>@ARGV = map { /\.(gz|tgz|zip|bz2|rar|Z)$/ ? "acat $_ '*' 2>/dev/null|" : $_ } @ARGV;

</b># Rest of script follows</pre>

<pre>...

<hr WIDTH="100%"></pre>
"Perl will take care of the appropriate magic - and that will take care
of the problem."
<p>The sysadmin was on his feet in a moment, fervently shaking Woomert's
hand.
<p>&nbsp;-- "Mr. Foonly, I don't know how to thank you. You've saved... well,
I won't speak of that, but I want you to know that you've always got a
friend wherever I happen to be. Wait until they see <i>this</i>!... Uh,
just to make sure I understand - what <b>is</b> it? How does it work?"
<p>Woomert glanced over at Frink, who also seemed to be on the edge of
his seat, eager for the explanation.
<p>&nbsp;-- "What do you think, Frink - can you handle this one? I've only used
one function and one operator; the rest of it happened automagically, simply
because of the way that Perl deals with files on the command line."
<p>Frink turned a little pink, and chewed his thumb as he always did when
he was nervous.
<p>&nbsp;-- "Well, Woomert... I know you told me to study the 'map' function,
but it was pretty deep; I got lost early on, and then there was this new
movie out..."
<p>Woomert smiled and shook his head.
<p>&nbsp;-- "All right, then. 'map', as per the info from '<tt>perldoc -f map</tt>',
evaluates the specified expression or block of expressions for each element
of a list - sort of like a 'for' loop, but much shorter and more convenient
in many cases. I also used the ternary conditional operator ('<tt>?:</tt>')
which works somewhat like an "if-then-else" construct:
<pre>
<hr WIDTH="100%"># Ternary conditional op - sets $a to 5 if $b is true, to 10 otherwise
$a = $b ? 5 : 10;

# "if-then-else" construct - same action
if ( $b ){
        $a = 5;
}
else {
        $a = 10;
}
<hr WIDTH="100%"></pre>
"Both of the above do the same thing, but again, the first method is shorter
and often more convenient. Examining the script one step at a time, what
I have done is test each of the elements in @ARGV, which initially contains
everything on the command line that follows the script name, against the
following regular expression:
<p><tt>/\.(gz|tgz|zip|bz2|rar|Z)$/</tt>
<p>This will match any filename that ends in a period (a literal dot) followed
by any of the specified extensions.
<p>Now, if the filename <i>doesn't</i> match the regex, the ternary
operator returns the part after the colon, '<tt>$_</tt>' - which simply
contains the original filename. Perl then processes the filename as it
normally does the ones contained in @ARGV: it opens a filehandle to that
file and makes its contents available within the script. In fact, there
are a number of ways to access the data once that's done; read up on the
diamond operator ('<tt>&lt;&gt;</tt>') , the STDIN filehandle, and the ARGV
filehandle (note the similarity <i>and</i> the difference, Frink!) for
information on some of the many available methods of doing file I/O in
Perl."
<p>"On the other hand, if the current element <i>does</i> match, the ternary
operator will return the code before the colon, in this case<b></b>
<p><tt>"acat $_ '*' 2&gt;/dev/null|"</tt>
<p>Perl will then execute the above command for the current filename. The
syntax may seem a little odd, but it's what '<tt>acat</tt>' (or, more to
the point, the archive utilities that it uses) requires to process the
files and ignore the error messages. Note that the command ends in '|',
the pipe symbol; what happens here is much like doing a pipe within the
shell. The command will be executed, the output will be placed in a memory
buffer, and the contents of that buffer will become available on the filehandle
that Perl would normally have opened for that file - presto, pure magic!
<a href="#3">[3]</a>"
<p>"So, to break it all out in long form, here's what I did:
<pre>
<hr WIDTH="100%">@ARGV = 
        map {                                       # Use the BLOCK syntax of 'map'
                if ( /\.(gz|tgz|zip|bz2|rar|Z)$/ ){     # Look for archive extensions
                        "acat $_ '*' 2&gt;/dev/null|"; # Uncompress/pipe out the contents
                }
                else {
                        $_;                         # Otherwise, return original name
                }
        } @ARGV;                                    # This is the list to "walk" over

<hr WIDTH="100%"></pre>
"Perl handles it from that point on. Once you pass it something useful
on the command line or standard input, it knows just what to do. In fact,"
he glanced sternly over at Frink,  who once again looked abashed,
"studying '<tt>perldoc perlopentut</tt>' is something I recommend to anyone
who wants to understand how Perl does I/O. This includes files, pipes,
forking child processes, building filters, dealing with binary files, duplicating
file handles, the single-argument version of 'open', and many other things.
In some ways, this could be called the most important document that comes
with Perl. Taking a look at '<tt>perldoc perlipc</tt>' as a follow-up would
be a good idea as well - it deals with a number of related issues, including
opening safe (low privilege) pipes to possibly insecure processes, something
that can become very important in a hurry."
<p>&nbsp;-- "Now, Resolv, I believe that you have a bright new future stretching
out ahead of you; your problem will be solved, your management will be
pleased, and your users will remain safe from Those Outside The Pale. If
you would care to join us in a little celebration, I've just finished boiling
a Spotted Dog, and - oh. Where did he go?... It's a very fine English pudding
with currants, after all. Well, I suppose he wanted to implement that change
as soon as possible..."
<hr WIDTH="100%">
<H3>Footnotes</H3>
<p><a NAME="1"></a>[1] "Down, Not Across." For those who need additional
clues on the grim meaning of The Sysadmin Mantra, search the archives of
<b>alt.sysadmin.recovery</b>
at <a href="http://groups.google.com">&lt;http://groups.google.com&gt;</a>,
and all will become clear. If it does not, then you weren't meant to know.
:)
<p><a NAME="2"></a>[2] From The Jargon File:
<pre>  Luser Attitude Readjustment Tool. ... The LART classic is a 2x4 or
  other large billet of wood usable as a club, to be applied upside the
  head of spammers and other people who cause sysadmins more grief than
  just naturally goes with the job. Perennial debates rage on
  alt.sysadmin.recovery over what constitutes the truly effective LART;
  knobkerries, semiautomatic weapons, flamethrowers, and tactical nukes
  all have their partisans. Compare {clue-by-four}.</pre>

<p><br><a NAME="3"></a>[3] See "perldoc perlopentut" for a tutorial on
opening files, the 'magic' in @ARGV, and even "Dispelling the Dweomer"
for those who have seen too much magic already. :)




<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<P> Ben is a Contributing Editor for Linux Gazette and a member of
The Answer Gang.

<!-- *** BEGIN bio *** -->
<P>
<IMG ALT="picture" SRC="../../gx/2002/tagbio/ben-okopnik.jpg" WIDTH="199"
   HEIGHT="200" ALIGN="left"  HSPACE="10" VSPACE="10">
<em>
Ben was born in Moscow, Russia in 1962. He became interested in
electricity at age six--promptly demonstrating it by sticking a fork into
a socket and starting a fire--and has been falling down technological mineshafts
ever since. He has been working with computers since the Elder Days, when
they had to be built by soldering parts onto printed circuit boards and
programs had to fit into 4k of memory.  He would gladly pay good money to any
psychologist who can cure him of the resulting nightmares.

<p>Ben's subsequent experiences include creating software in nearly a dozen
languages, network and database maintenance during the approach of a hurricane,
and writing articles for publications ranging from sailing magazines to
technological journals. Having recently completed a seven-year
Atlantic/Caribbean cruise under sail, he is currently docked in Baltimore, MD,
where he works as a technical instructor for Sun Microsystems.

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

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Ben Okopnik.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Fun with Simputer and Embedded Linux</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/pramode.html">Pramode C.E</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<html>
<head><title>Fun with Simputer and Embedded Linux</title></head>

<h1>Fun with Simputer and Embedded Linux</h1>

The Simputer is a StrongArm CPU based handheld device running
Linux. Originally developed by professors at the Indian
Institute of Science, Bangalore, the device has a social
objective of bringing computing and connectivity within
the reach of rural communities. This articles provides a
tutorial introduction to programming the Simputer (and similar
ARM based handheld devices - there are lots of them in the
market). The reader is expected to have some experience
programming on Linux. Disclaimer: I try to describe things
which I had done on my Simputer without any problem - if
following my instructions leads to your handheld going up
in smoke - I should not be held responsible!

<h2>Hardware/Software</h2>

<p>
The device is powered by an Intel StrongArm (SA-1110) CPU.
The flash memory size is either 32Mb or 16Mb and RAM is
64Mb or 32Mb. The peripheral features include:

<p>
<ol>
<li> USB master as well as slave ports.
<li> Standard serial port.
<li> Infra Red communication port.
<li> Smart card reader
</ol>

<p>
Some of these features are enabled by using a `docking cradle'
provided with the base unit. Power can be provided either
by rechargeable batteries or external AC mains.

<p>
Simputer is powered by GNU/Linux - kernel version 2.4.18
(with a few patches) works fine. The unit comes bundled
with binaries for the X-Window system and a few simple utility
programs. More details can be obtained from the project
home page at <a href="http://www.simputer.org">www.simputer.org</a>.

<h2> Powering up </h2>

<p>
There is nothing much to it, other than pressing the `power
button'. You will see a small tux picture coming up and
within a few seconds, you will have X up and running . The
LCD screen is touch sensitive and you can use a small `stylus'
(geeks use finger nails!) to select applications and move
through the graphical interface. If you want to have keyboard
input, be prepared for some agonizing manipulations using
the stylus and a `soft keyboard' which is nothing but a
GUI program from which you can select single alphabets and
other symbols.

<h2> Waiting for bash </h2>

<p>
GUI's are for kids. You are not satisfied till you see the
trusted old bash prompt. Well, you don't have to try a lot.
The Simputer has a serial port - attach the provided serial
cable to it - the other end goes to a free port on your
host Linux PC (in my case, /dev/ttyS1).
Now fire up a communication program (I use `minicom') -
you have to first configure the program so that it uses
/dev/ttyS1 with communication speed set to 115200 (that's
what the Simputer manual says - if you are using a similar
handheld, this need not be the same) and 8N1 format, hardware
and software flow controls disabled. Doing this with minicom
is very simple - invoke it as:
<p>
minicom -m -s
<p>
Once configuration is over - just type:
<p>
minicom -m
<p>
and be ready for the surprise. You will immediately see a
login prompt. You should be able to type in a user name/password
and log on. You should be able to run simple commands like
`ls', `ps' etc - you may even be able to use `vi' .

<p>
If you are not familiar with running communication programs
on Linux, you may be wondering what really happened. Nothing
much - it's standard Unix magic. A program sits on the Simputer
watching the serial port (the Simputer serial port, called
ttySA0) - when you run minicom on the Linux PC, you establish
a connection with that program, which sends you a login
prompt over the line, reads in your response, authenticates
you and spawns a shell with which you can interact over
the line.

<p>
Once minicom initializes the serial port on the PC end, you
can `script' your interactions with the Simputer. You are
exploiting the idea that the program running on the Simputer
is watching for data over the serial line - the program
does not care whether the data comes from minicom itself
or a script. You can try out the following experiment:

<p>
<ol>
<li> Open two consoles (on the Linux PC)
<li> Run minicom on one console, log on to the simputer
<li> On the other console, type `echo ls &gt; /dev/ttyS1'
<li> Come to the first console - you will see that the command
  `ls' has executed on the Simputer.
</ol>

<h2> Setting up USB Networking </h2>

<p>
The Simputer comes with a USB slave port. You can establish
a TCP/IP link between your Linux PC and the Simputer via
this USB interface. Here are the steps you should take:

<p>
<ol>
<li> Make sure you have a recent Linux distribution - Red Hat
  7.3 is good enough.

<li> Plug one end of the USB cable onto the USB slave slot in
  the Simputer, then boot the Simputer.

<li> Boot your Linux PC. DO NOT connect the other end of the
  USB cable to your PC now. Log in as root on the PC.

<li> Run the command `insmod usbnet' to load a kernel module
  which enables USB networking on the Linux PC. Verify that
  the module has been loaded by running `lsmod'.

<li> Now plug the other end of the USB cable onto a free USB
  slot of the Linux PC. The USB subsystem in the Linux kernel
  should be able to register a device attach. On my Linux
  PC, immediately after plugging in the USB cable, I get
  the following kernel messages (which can be seen by running
  the command `dmesg'):
</ol>

<pre>
usb.c: registered new driver usbnet
hub.c: USB new device connect on bus1/1, assigned device
number 3
usb.c: ignoring set_interface for dev 3, iface 0, alt 0
usb0: register usbnet 001/003, Linux Device
</pre>

<p>
After you have reached this far, you have to run a few more
commands:

<p>
<ol>
<li> Run `ifconfig usb0 192.9.200.1' - this will assign an IP
  address to the USB interface on the Linux PC.

<li> Using `minicom' and the supplied serial cable, log on to
  the Simputer as root. Then run the command `ifconfig usbf
  192.9.200.2' on the Simputer.

<li> Try `ping 192.9.200.2' on the Linux PC. If you see ping
  packets running to and fro, congrats. You have successfully
  set up a TCP/IP link!
</ol>

You can now telnet/ftp to the Simputer through this TCP/IP
link.

<h2> Hello, Simputer </h2>

<p>
It's now time to start real work. Your C compiler (gcc) normally
generates `native' code, ie, code which runs on the microprocessor
on which gcc itself runs - most often, an Intel (or clone)
CPU. If you wish your program to run on the Simputer (which
is based on the StrongArm microprocessor), the machine code
generated by gcc should be understandable to the StrongArm
CPU - your `gcc' should be a cross compiler. If you download
the gcc source code (preferably 2.95.2) together with `binutils',
you should be able to configure and compile it in such a
way that you get a cross compiler (which could be invoked
like, say, arm-linux-gcc). This might be a bit tricky if
you are doing it for the first time - your handheld vendor
should supply you with a CD which contains the required
tools in a precompiled form - it is recommended that you
use it (but if you are seriously into embedded development,
you should try downloading the tools and building them yourselves).

<p>
Assuming that you have arm-linux-gcc up and running, you
can write a simple `Hello, Simputer' program, compile it
into an `a.out', ftp it onto the Simputer and execute it
(it would be good to have one console on your Linux PC running
ftp and another one running telnet - as soon as you compile
the code, you can upload it and run it from the telnet console
- note that you may have to give execute permission to the
ftp'd code by doing `chmod u+x a.out' on the Simputer).

<h2> A note on the Arm Linux kernel </h2>

<p>
The Linux kernel is highly portable - all machine dependencies
are isolated in directories under the `arch' subdirectory
(which is directly under the root of the kernel source tree,
say, /usr/src/linux). You will find a directory called `arm'
under `arch'. It is this directory which contains ARM CPU
specific code for the Linux kernel.

<p>
The Linux ARM port was initiated by Russell King. The ARM
architecture is very popular in the embedded world and there
are a LOT of different machines with fantastic names like
Itsy, Assabet, Lart, Shannon etc all of which use the StrongArm
CPU (there also seem to be other kinds of ARM CPU's - now
that makes up a really heady mix). There are minor differences
in the architecture of these machines which makes it necessary
to perform `machine specific tweaks' to get the kernel working
on each one of them. The tweaks for most machines are available
in the standard kernel itself, and you only have to choose
the actual machine type during the kernel configuration
phase to get everything in order. But to make things a bit
confusing with the Simputer, it seems that the tweaks for
the initial Simputer specification have got into the ARM
kernel code - but the vendors who are actually manufacturing
and marketing the device seem to be building according to
a modified specification - and the patches required for
making the ARM kernel run on these modified configurations
is not yet integrated into the main kernel tree. But that
is not really a problem, because your vendor will supply
you with the patches - and they might soon get into the
official kernel.

<h2> Getting and building the kernel source </h2>

<p>
You can download the 2.4.18 kernel source from the nearest
Linux kernel ftp mirror. You will need the file `patch-2.4.18-rmk4'
(which can be obtained from the ARM Linux FTP site ftp.arm.linux.org.uk).
You might also need a vendor supplied patch, say, `patch-2.4.18-rmk4-vendorstring'.
Assume that all these files are copied to the /usr/local/src
directory.

<p>
<ol>
<li> First, untar the main kernel distribution by running `tar
  xvfz kernel-2.4.18.tar.gz'

<li> You will get a directory called `linux'. Change over to
  that directory and run `patch -p1 &lt; ../patch-2.4.18-rmk4'. 

<li> Now apply the vendor supplied patch. 
Run `patch -p1  &lt; ../patch-2.4.18-rmk4-vendorstring'.
</ol>

<p>
Now, your kernel is ready to be configured and built. Before
that, you have to examine the top level Makefile (under
/usr/local/src/linux) and make two changes - there will
be a line of the form:
<p>
ARCH := &lt;lots-of-stuff&gt;
<p>
near the top. Change it to
<p>
ARCH := arm
<p>
You need to make one more change. You observe that the Makefile
defines:

<p>
<pre>
AS = ($CROSS_COMPILE)as
LD = ($CROSS_COMPILE)ld
CC = ($CROSS_COMPILE)gcc
</pre>

<p>
You note that the symbol CROSS_COMPILE is equated with the
empty string. During normal compilation, this will result
in AS getting defined to `as', CC getting defined to `gcc'
and so on which is what we want. But when we are cross compiling,
we use arm-linux-gcc, arm-linux-ld, arm-linux-as etc. So
you have to equate CROSS_COMPILE with the string arm-linux-,
ie, in the Makefile, you have to enter:
<p>
CROSS_COMPILE = arm-linux-
<p>

<p>
Once these changes are incorporated into the Makefile, you
can start configuring the kernel by running `make menuconfig'
(note that it is possible to do without modifying the Makefile.
You run `make menuconfig ARCH=arm'). It may take a bit of
tweaking here and there before you can actually build the
kernel without error. You will not need to modify most things
- the defaults should be acceptable.

<p>
<ol>
<li> You have to set the system type to SA1100 based ARM system
  and then choose the SA11x0 implementation to be `Simputer(Clr)'
  (or something else, depending on your machine). I had
  also enabled SA1100 USB function support, SA11x0 USB net
  link support and SA11x0 USB char device emulation.

<li> Under Character devices-&gt;Serial drivers, I enabled SA1100
  serial port support, console on serial port support and
  set the default baud rate to 115200 (you may need to set
  differently for your machine).

<li> Under Character devices, SA1100 real time clock and Simputer
  real time clock are enabled.

<li> Under Console drivers, VGA Text console is disabled.

<li> Under General Setup, the default kernel command string
  is set to `root=/dev/mtdblock2 quite'. This may be different
  for your machine.
</ol>

<p>
Once the configuration process is over, you can run 
<p>
make zImage
<p>
and in a few minutes, you should get a file called `zImage'
under arch/arm/boot. This is your new kernel.

<h2> Running the new kernel </h2>

<p>
I describe the easiest way to get the new kernel up and running.

<p>
Just like you have LILO or Grub acting as the boot loader
for your Linux PC, the handheld too will be having a bootloader
stored in its non volatile memory. In the case of the Simputer,
this bootloader is called `blob' (which I assume is the
boot loader developed for the Linux Advanced Radio Terminal
Project, `Lart'). As soon as you power on the machine, the
boot loader starts running - If you start minicom on your
Linux PC, keep the `enter' key pressed and then power on
the device, the bootloader, instead of continuing with booting
the kernel stored in the device's flash memory, will start
interacting with you through a prompt which looks like this:
<p>
blob&gt;
<p>
At the bootloader prompt, you can type:
<p>
blob&gt; download kernel
<p>
which results in blob waiting for you to send a uuencoded
kernel image through the serial port. Now, on the Linux
PC, you should run the command:
<p>
uuencode zImage /dev/stdout &gt; /dev/ttyS1
<p>
This will send out a uuencoded kernel image through the COM
port - which will be read and stored by the bootloader in
the device's RAM. Once this process is over, you get back
the boot loader prompt. You just have to type:
<p>
blob&gt; boot
<p>
and the boot loader will run the kernel which you have right
now compiled and downloaded. 

<h2> A bit of kernel hacking </h2>

<p>
What good is a cool new device if you can't do a bit of kernel
hacking? My next step after compiling and running a new
kernel was to check out how to compile and run kernel modules.
Here is a simple program called `a.c':

<p>
<pre>
#include &lt;linux/module.h&gt;
#include &lt;linux/init.h&gt;

/* Just a simple module */

int 
init_module(void) 
{ 
   printk("loading module...\n");
   return 0;
}

void 
cleanup_module(void) 
{ 
   printk("cleaning up ...\n");
}
</pre>

<p>
You have to compile it using the command line:
<p>
arm-linux-gcc -c -O -DMODULE -D__KERNEL__ a.c  -I/usr/local/src/linux-2.4.18/include
<p>
You can ftp the resulting `a.o' onto the Simputer and load
it into the kernel by running:
<p>
insmod ./a.o
<p>
You can remove the module by running:
<p>
rmmod a
<p>

<h2> Handling Interrupts </h2>

<p>
After running the above program, I started scanning the kernel
source to identify the simplest code segment which would
demonstrate some kind of physical hardware access - and
I found it in the hard key driver. The Simputer has small
buttons which when pressed act as the arrow keys - these
buttons seem to be wired onto the general purpose I/O pins
of the ARM CPU (which can also be configured to act as interrupt
sources - if my memory of reading the StrongArm manual is
correct). Writing a kernel module which responds when these
keys are pressed is a very simple thing - here is a small
program which is just a modified and trimmed down version
of the hardkey driver - you press the button corresponding
to the right arrow key - an interrupt gets generated which
results in the handler getting executed. Our handler simply
prints a message and does nothing else. Before inserting
the module, we must make sure that the kernel running on
the device does not incorporate the default button driver
code - checking /proc/interrupts would be sufficient. 

<p>
Compile the program shown below into an object file (just
as we did in the previous program), load it using `insmod',
check /proc/interrupts to verify that the interrupt line
has been acquired. Pressing the button should result in the
handler getting called - the interrupt count displayed in
/proc/interrupts should also change.

<pre>

#include &lt;linux/module.h&gt;
#include &lt;linux/ioport.h&gt;
#include &lt;linux/sched.h&gt;
#include &lt;asm-arm/irq.h&gt;
#include &lt;asm/io.h&gt;

static void 
key_handler(int irq, void *dev_id, struct pt_regs *regs)
{
  printk("IRQ %d called\n", irq);
}

static int  
init_module(void)
{
  unsigned int res = 0;
  printk("Hai, Key getting ready\n");
  set_GPIO_IRQ_edge(GPIO_GPIO12, GPIO_FALLING_EDGE);
  res = request_irq(IRQ_GPIO12, key_handler, SA_INTERRUPT,
  "Right Arrow Key", NULL);
  if(res) {
     printk("Could Not Register irq %d\n", IRQ_GPIO12);
     return res;
   }
  return res ;
}

static void 
cleanup_module(void)
{
  printk("cleanup called\n");
  free_irq(IRQ_GPIO12, NULL);
}
</pre>

<h2> Future work </h2>

<p>
A Linux based handheld offers a lot of opportunities for
serious fun  - as I learn more about the device, I shall try to
share my findings with the readers.

<h2> References </h2>

<p>
<ol>
<li> <a href="http://www.simputer.org">Simputer Project</a> Home Page.

<li> <a href="http://www.simputerland.com">Simputerland</a> and 
  <a href="http://www.picopeta.com">PicoPeta</a> - information
  about Simputer development activities from companies which
  are manufacturing and marketing the product.

<li> <a href="http://www.arm.linux.org.uk">Arm Linux</a> Project Home Page

<li> <a href="http://www.lart.tudelft.nl">Lart Project</a> Home Page. Lots
  of cool stuff here. You might like to check out the `Clock
  Scaling' link on this site. Clock scaling allows you to
  change the clock speed of the running processor on the
  fly - useful for saving battery power.
</ol>








<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I am an instructor working for IC Software in Kerala, India. I would have loved
becoming an organic chemist, but I do the second best thing possible, which is
play with Linux and teach programming!
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Pramode C.E.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Qubism</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/harsem.html">Jon "Sir Flakey" Harsem</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->
















<EM>These cartoons are scaled down to minimize horizontal scrolling.
	To see a panel in all its clarity, click on it.</EM>


<P>

<A HREF="misc/qubism/qb-remastered.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-remastered.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<A HREF="misc/qubism/qb-lotrdm.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-lotrdm.jpg" 
	WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">

<P> All Qubism cartoons are 
<A HREF="http://www.core.org.au/modules.php?name=Cartoons">here</A>
at the CORE web site.























<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Jon is the creator of the Qubism cartoon strip and current
Editor-in-Chief of the 
<A HREF="http://www.core.org.au/">CORE</A> News Site.  
Somewhere along the early stages of
his life he picked up a pencil and started drawing on the wallpaper.  Now
his cartoons appear 5 days a week on-line, go figure. He confesses to
owning a Mac but swears it is for "personal use".
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Jon "Sir Flakey" Harsem.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Yacc/Bison - Parser Generators - Part 1</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/ramankutty.html">Hiran Ramankutty</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->






<h2><b>Introduction</b></h2>
<p>
<b>Yacc</b> ("Yet Another Compiler Compiler") is used to parse a language
described by a <b>context-free grammar</b>. Not all context-free languages can
be handled by Yacc or Bison and only those that are <b>LALR(1)</b> can be
parsed. To be specific, this means that it must be possible to tell how to
parse any portion of an input string with just a single token of look-ahead. I
will explain that clearly later in this article.
</p>
<p>
<b>Bison</b> is also a parser generator in the style of <b>Yacc</b>. 
It was written primarily by Robert Corbett and Richard Stallman 
made it Yacc compatible. There are differences between Bison and Yacc, 
but that is not the purpose of this article. 
</p>

<h2><b>Languages and Context-Free Grammars</b></h2>
<p>
Grammar can be associated with English language as a set of rules to 
construct meaningful sentences. We can say the same for context-free 
grammars. Almost all programming languages are based on context-free
grammars. The set of rules in any grammar will deal with syntactic 
groupings that will help in the construction of semantic structures. 
To be specific, it means that we specify one or more syntactic 
groupings and give rules for constructing them from their parts. For 
example in C: `expression' is one kind of grouping. One rule for making 
an expression is, "An expression can be made of a minus sign and 
another expression". Another would be, "An expression is an integer".
You must have noticed that the rules are recursive. In fact, every 
such grammar must then have a rule which leads out of the recursion. 
</p>
<p>
The most common formal system for representing such rules is the 
<b>Backus-Naur Form</b> or "BNF". All BNF grammars are context-free
grammars. 
</p>
<p>
In the grammatical rules for a language, we name a grouping as a symbol.
 Those symbols which can be sub-divided into smaller constructs are 
called non-terminals and those which cannot be subdivided are called 
terminals. If a piece of input is a single terminal then it is called a 
token and if it is a single nonterminal it is called a grouping. For 
example: `identifier', `number', `string' are distinguished as tokens, 
Whereas `expression', `statement', `declaration' and `function 
definition' are groupings in C language. Now, the full grammar may use 
additional language constructs with another set of nonterminal symbols. 
</p>

<h2><b>Basic Parsing Techniques</b></h2>
<p>
A parser for grammar G determines whether an input string say `w' is a 
sentence of G or not. If `w' is a sentence of G then the parser 
produces the parse tree for `w' otherwise, an error message is 
produced. By parse tree we mean a diagram that represents the syntactic 
structure of a string `w'. There are two basic types of parsers for 
context-free grammars - <b>bottom-up</b> and <b>top-down</b>, the former one 
being of our interest.
</p>
<h3><b>Bottom-Up Parsing</b></h3>
<p>
It is also known as <b>Shift-Reduce Parsing</b>. Here, attempts to 
construct a parse tree for an input begin at the leaves (bottom) and 
work up towards the root (top). In other words this will lead to a 
process of `reduction' of the input string to the start symbol of the 
grammar based on its production rules. For example, consider the 
grammar:
</p><p></p>
<pre>
<b><i>S -> aAcBe
A -> Ab/b
B -> d</i></b>
</pre>
<p></p>
<p>
Let w = "abbcde". Our aim is to reduce this string `w' to 
<b><i>S</i></b>, where <b><i>S</i></b> is the start symbol. We scan 
"abbcde" looking for substrings that match the right side of some 
production. The substrings `b' and `d' qualify. Again there are 2 b's 
to be considered. Let us proceed with leftmost `b'. We replace it by 
`A' the left side of the production <b><i>A -> b</i></b>. The string 
has now become "aAbcde". We now see that `Ab', `b' and `d' each match 
the right side of some production. This time we will choose to replace
`Ab' by `A', the left side of the production <b><i>A -> Ab</i></b>. 
The string now becomes "aAcde". Then replacing `d' by `B', the left 
side of the production <b><i>B -> d</i></b>, we obtain "aAcBe". The 
entire string can now be replaced by <b><i>S</i></b>.
</p>
<p>
Basically, we are replacing the right side of a production by the left 
side the process being called a <i>reduction</i>. Quite easy! Not always. It 
sometimes so happen that, the substring that we choose to reduce may produce 
a string which is not decomposable to the start symbol <b><i>S</i></b>. 
</p>
The substrings that are the right side of a production and when replaced 
with the left side of that production in the input string that leads 
eventually to the start symbol is called a <b>`handle'</b>. Now, the process 
of bottom-up parsing may be viewed as one of finding and reducing `handles', 
the reduction sequence being known as <b>`handle pruning'</b>. 
</p>
<h4><b>Stack Implementation of Shift-Reduce Parsing</b></h4>
<p>
A convenient way to implement a shift-reduce parser is to use a stack and an 
input buffer. Let `$' symbol mark the bottom of the stack and the right end 
of the input. 
</p>

<p>
The main concept is to shift the input symbols onto the stack until a 
handle <font face=`Symbol'>b</font> is on top of the stack. Now we 
reduce <font face=`Symbol'>b</font> to the left side of the appropriate 
production. The parser repeats this cycle until it has detected an 
error or until the stack contains the start symbol and the input is 
empty:
</p>

<p>
In fact, there are four possible actions that a shift-reduce parser can
make and they are;
</p>
<p></p>
<ol>
<li>In a <i>shift</i> action, the next input symbol is shifted to the top of 
the stack.
<li>In a <i>reduce</i> action, the parser knows that the right end of the 
handle is at the top of the stack. It must then locate the left end of the 
handle within the stack and decide with what nonterminal to replace the 
handle.
<li>In an <i>accept</i> action, the parser announces successful completion 
of parsing.
<li>In an <i>error</i> action, the parser discovers that a syntax error has 
occurred and calls an error recovery routine. 
</ol>
<p>
Let us see how these concepts are put into action in the example below.
</p>
<p>Consider the grammar below:</p>
<p></p>
<pre>
<b>E -> E + E
E -> E * E
E -> (E)
E -> id</b>
</pre>
<p>
Let the input string be 
<b>id<sub>1</sub> + id<sub>2</sub> * id<sub>3</sub></b>
</p>

<P> <A HREF="misc/ramankutty/figure1.png">Figure 1</A> </P>

<h4><b>Constructing a Parse Tree</b></h4>
<p>
The bottom-up tree construction process has two aspects.
</p>
<ol>
<li>When we shift an input symbol <i>a</i> onto the stack we create a 
one-node tree labeled <i>a</i>. Both the root and the yield of this tree 
are <i>a</i>, and the yield truly represents the string of terminals 
"reduced" (by zero reductions) to symbol <i>a</i>.
<li>When we reduce <i>X</i><sub>1</sub><i>X</i><sub>2</sub>...
<i>X</i><sub>n</sub> to <i>A</i>, we create a new node labeled <i>A</i>. Its 
children, from left to right, are the roots of the trees for 
<i>X</i><sub>1</sub>,<i>X</i><sub>2</sub>,...,<i>X</i><sub>n</sub>. If for 
all i<sup>i</sup> the tree for <i>X</i><sub>i</sub> has yield 
<i>x</i><sub>i</sub>, then the yield for the new tree is 
<i>x</i><sub>1</sub><i>x</i><sub>2</sub>...<i>x</i><sub>n</sub>. This string 
has in fact been reduced to <i>A</i> by a series of reductions culminating 
in the present one. As a special case, if we reduce <i>E</i> to <i>A</i> we 
create a node labeled <i>A</i> with one child labeled <i>E</i>.
</ol>

<h2><b>LR Parsing Algorithm</b></h2>
<p>
Construction of LALR parser requires the basic understanding of 
constructing an LR parser. LR parser gets its name because it scans the 
input from left-to-right and constructs a rightmost derivation in 
reverse. 
</p>
<p>
A parser generates a parsing table for a grammar. The parsing table 
consists of two parts, a parsing action function <b>ACTION</b> and a 
goto function <b>GOTO</b>. 
</p>
<p>
An LR parser has an input, a stack, and a parsing table.
The input is read from left to right, one symbol at a time. The stack 
contains a string of the form 
s<sub>0</sub>X<sub>1</sub>s<sub>1</sub>...X<sub>m</sub>s<sub>m</sub> 
where s<sub>m</sub> is on top. Each X<sub>i</sub> is a grammar symbol 
and each s<sub>i</sub> is a symbol called a state. Each state symbol 
summarizes the information contained in the stack below it and is used 
to guide the shift-reduce decision. 
</p>
<p>
The function <b>ACTION</b> stores values for s<sub>m</sub> that is 
topmost stack element and a<sub>i</sub> that is the current input 
symbol. The entry ACTION[s<sub>m</sub>, a<sub>i</sub>] can have one of 
four values:
</p>
<ol>
<li>shift s
<li>reduce A -&gt; <font face="symbol">B</font>
<li>accept
<li>error
</ol>
<p>
The function <b>GOTO</b> takes a state and grammar symbol as arguments 
and produces a state. Somewhat analogous to the transition table of a 
deterministic finite automaton whose input symbols are the terminals 
and nonterminals of the grammar. 
</p>
<p>
A <i>configuration</i> of an LR parser is a pair whose first component 
is the stack contents and whose second component is the unexpended 
input:
</p>
<p align=center>
(s<sub>0</sub> X<sub>1</sub> s<sub>1</sub> . . . X<sub>m</sub> s<sub>m</sub>, a<sub>i</sub> a<sub>i+1</sub> . . . a<sub>n</sub>$) </p>
<p>
The next move of the parser is determined by reading a<sub>i</sub>, the 
current input symbol, and s<sub>m</sub> the state on top of the stack, 
and then consulting the action table entry 
ACTION[s<sub>m</sub>, a<sub>i</sub>]. The four value mentioned above 
for action table entry will produce four different configurations as 
follows:
</p>
<p></p>
<ol>
<li> If ACTION[s<sub>m</sub>, a<sub>i</sub>] = shift s, the parser 
executes a shift move, entering the configuration 
<p align=center>
(s<sub>0</sub> X<sub>1</sub> s<sub>1</sub> . . . X<sub>m</sub> s<sub>m</sub> a<sub>i</sub> s, a<sub>i+1</sub> . . . a<sub>n</sub>$) </p> 
Here the configuration has shifted the current input symbol 
a<sub>i</sub> and the next state 
s = GOTO[s<sub>m</sub>, a<sub>i</sub>] onto the stack; 
a<sub>i+1</sub> becomes the new current input symbol.
<li>If ACTION[s<sub>m</sub>, a<sub>i</sub>] = 
reduce A - &gt; <font face="symbol">B</font>,then the parser 
executes a reduce a move, entering the configuration 

<p align=center>
(s<sub>0</sub> X<sub>1</sub> s<sub>1</sub> . . . X<sub>m-r</sub> s<sub>m-r</sub> A s, a<sub>i</sub> a<sub>i+1</sub> . . . a<sub>n</sub>$) </p>

where s = GOTO[s<sub>m-r</sub>, A] and r is the length of 
<font face="symbol">B</font>, the right side of the production. 
Here the first popped 2r symbols off the stack (r state symbols and r 
grammar symbols), exposing state s<sub>m-r</sub>. The parser then 
pushed both A, the left side of the production, and s, the entry for 
ACTION[s<sub>m-r</sub>, A], onto the stack. The current input symbol 
is not changed in a reduce move. Specifically, 
X<sub>m-r+1</sub> . . . X<sub>m</sub>, the sequence of grammar symbols 
are popped off the stack and will always match 
<font face="symbol">B</font>, the right side of the reducing 
production.
<li> If ACTION[s<sub>m</sub>, a<sub>i</sub>] = accept, parsing is 
completed.
<li> If ACTION[s<sub>m</sub>, a<sub>i</sub>] = error, the parser has 
discovered an error and calls an error recovery routine. 
</ol>
<p>
The LR parsing algorithm is simple. Initially the LR parser is in the 
configuration 
(s<sub>0</sub>, a<sub>1</sub>a<sub>2</sub>...a<sub>n</sub>$) where 
s<sub>0</sub> is a designated intial state and 
a<sub>1</sub>a<sub>2</sub>...a<sub>n</sub> is the string to be parsed. 
Then the parser executes moves until an accept or error action is 
encountered.
</p>
<p>
I mentioned earlier that the GOTO function is essentially the 
transition table of a deterministic finite automaton whose input 
symbols (terminals and nonterminals) and a state when taken as 
arguments produce another state. Hence the GOTO function can be 
represented by a graph (directed) like scheme, where each node or state
will be a set of items with elements that are productions in the 
grammar. The elements comprise the core of the items. The edges 
representing the transition will be labeled with the symbol for which 
the transition from one state to another is predetermined. 
</p>
<p>
In the LALR (<i>lookahead</i>-LR) technique, LR items with common core 
are coalesced, and the parsing actions are determined on the basis of 
the new GOTO function generated. The tables obtained are considerably 
smaller than the LR tables, yet most common syntactic constructs of 
programming languages can be expressed conveniently by LALR grammar.
</p>
<p>
I am not going deep into construction of tables. Instead, I would like
to explain the use of a tool called <b>Yacc</b> for parser generation.
</p>

<h2><b>Calculator Using Yacc</b></h2>
<p>
Input to Yacc can be divided into three sections:
</p>
<p></p>
<ol>
<li>definitions sections that consists of token declarations, and C 
code bracketed by "%{" and "}%"
<li>the BNF grammar in the rules section
<li>and user subroutines in the subroutines section.
</ol>
<p></p>
<p>
We shall illustrate that by designing a small calculator that can 
add and subtract numbers. Let us start with the definitions section 
for the Yacc input file:
</p>
<p></p>
<pre>
/* File name - calc1.l*/
%{ 
	#include "y.tab.h"
	#include &lt; stdlib.h &gt;
	void yyerror(char *);
}%

%%

[0-9]+	{
		yylval = atoi(yytext);
		return INTEGER;
	}

[-+\n]	{
		return *yytext;
	}

[ \t]	;	/*skip whitespace*/

.	yyerror("Unknown character");

%%

int yywrap(void) {
	return 1;
}
</pre>
<p></p>
<p>
Yacc when run generates a parser in the file <b>y.tab.c</b>, along side 
which another file <b>y.tab.h</b> is also generated. Lex includes this 
file and utilizes the definitions for token values. Lex returns the 
values associated with the tokens in variable <b>yylval</b>. But to get 
tokens, yacc calls <b>yylex</b> the return value of which is integer. 
</p>
<p>
The yacc input specification is given below:
</p>
<pre>
/* file name calc1.y */
%{
    int yylex(void);
    void yyerror(char *);
%}

%token INTEGER

%%

program:
        program expr '\n'         { printf("%d\n", $2); }
        |
        ;

expr:
        INTEGER
        | expr '+' expr           { $$ = $1 + $3; }
        | expr '-' expr           { $$ = $1 - $3; }
        ;

%%

void yyerror(char *s) {
    fprintf(stderr, "%s\n", s);
}

int main(void) {
    yyparse();
    return 0;
}
</pre>
<p></p>
<p>
Here, the grammar is specified using productions. Left hand side of a 
production being a non terminal followed by a colon and then the right 
hand side of a production. The contents of the braces show the action 
associated with the productions. So what does the rules say ?
</p>
<p>
It says that a program consists of zero or more expressions. Each 
expression terminates with a newline. When a newline is detected, we 
print the value of the expression. 
</p>
<p>
Now execute yacc as shown:
</p>
<p></p>
<pre>
yacc -d calc1.l
</pre>
<p></p>
<p>
You get a message "shift/reduce conflict". Shift/reduce conflict arises
when the grammar is ambiguous and there is a possibility of more than 
one derivation tree. To understand this, consider the example given in 
the stack implementation of shift-reduce parsing. In step 6, instead of 
shifting we could have reduced appropriately as per the grammar . Then 
addition will have higher precedence over multiplication.
</p>
<p>
Before proceeding you must know about another kind of conflict that is 
reduce-reduce conflict. This arises when there are more than one option 
for reducing a stack symbol. For example: In the grammar below 
<b>id</b> can be reduced to <b>T</b> or <b>E</b>.
</p>
<p></p>
<pre>
E -&gt; T
E -&gt; id
T -&gt; id
</pre>
<p></p>
<p>
Yacc takes a default action when conflicts arise. When there is 
shift-reduce conflict, yacc will shift and when there is reduce-reduce 
conflict, it will use the first rule in the listing. Yacc also issues a 
warning message when conflicts arise. Warnings can be eliminated by 
making the grammar unambiguous.
</p>
<p>
Coming back, yacc produces two files; <b>y.tab.c</b> and <b>y.tab.h</b>.
Some lines one has to notice are:
</p>
<p></p>
<pre>
#ifndef YYSTYPE
typedef int YYSTYPE
#endif
#define INTEGER 257
YYSTYPE yylval
</pre>
<p></p>
<p>
Internally, yacc maintains two stacks in memory; a parse stack and a 
value stack. The current parsing state is determined by the terminals 
and/or non terminals that are present in the parse stack. The value 
stack is always synchronized and holds an array of <b>YYSTYPE</b> 
elements, which associates a value with each element in the parse stack.
So for example, when lex returns an INTEGER token, yacc shifts this 
token to the parse stack. At the same time, the corresponding yylval is 
shifted to the value stack. This makes it easier in finding the value 
of a token at any given time.
</p>
<p>
So when we apply the rule
</p>
<p></p>
<pre>
expr: expr '+' expr	{ $$ = $1 + $3; }
</pre>
<p>
we pop <b>"expr '+' expr"</b> and replace it by <b>"expr"</b>. In other 
words we replace the right hand side of a production by left hand side 
of the same production. Here we pop three terms off the stack and push 
back one term. The value stack will contain "$1" for the first term on 
the right-hand side of the production, "$2" for the second and so on. 
"$$" designates the top of the stack after reduction has taken place. 
The above action adds the values associated with two expressions, pops 
three terms off the value stack, and pushes back a single sum. Thus the 
two stacks remain synchronized and when a newline is encountered, the 
value associated with <b>expr</b> is printed.
</p>
<p>
The last function that we need is a 'main'. But the grammar is 
ambiguous and yacc will issue shift-reduce warnings and will process 
the grammar using shift as the default operation. 
</p>
<p>
I am not giving the function here because there is more to learn. 
I shall come up with that in the next part. I shall also explain how 
to remove ambiguity from the grammar and then design the calculator 
for it. In fact, some more funcionalities shall be incorporated into 
the grammar to have a better understanding. 









<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I am a final year student of Computer Science at Government Engineering
College, Trichur, Kerala, India. Apart from Linux I enjoy reading books
on theoretical physics.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Hiran Ramankutty.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">I Built a Custom Debian CD from Knoppix</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/sunil.html">Sunil Thomas Thonikuzhiyil</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->










<html>
<h3>Introduction</h3>
<p>    <a href=http://knopper.net/knoppix>Knoppix </a> is a  live cd distribution based on debian GNU/Linux.It contains a large number of applications which can come in handy even on minimal hardware.Knoppix supports alarge number of graphics cards sound cards scsi and USB devices.It can be used as a Linux demo, educational cd, rescue system or adapted and used as a platform for commercial product demo. It is not necesary to install anything to hard disk
         There is an installation program which can install the entire cd to a hard disk, if you like. It means that you have a full fledged debian installation in 20 minutes. This document describes how I built a  custom live cd  from knoppix. My primary motivation to build this cd was to include some of my favorite applications which are missing from stock knoppix CD. If you find any errors in this document please drop me a mail  <a href=mailto:sunil_tt@yahoo.com>here </a>
</p>             
<h3> Requirements</h3>
<h4>    a) Software</h4>
<p>     To start with you  have to download knoppix image  from knoppix site. There is a release every one or two week. There are 2 images: German and  English. I did my setup based on 31-10-2002-EN release.  </p>
<p>  If   you already have an image you can try to rsync it to the most recent version as  below. However don't expect much bandwidth saving since the knoppix image is compressed. If you have a knoppix cdrom create an image by 
 #dd if=/dev/cdrom of=knoppix.iso)</p>
<p>  Rename the Knoppix iso image to reflect the current release name.<br>
 Example<br>
      I have downloaded   
       KNOPPIX_V3.1-23-10-2002-EN.iso<br>
      I want to update it to KNOPPIX_V3.1-31-10-2002-EN.iso<br>
      Rename     KNOPPIX_V3.1-23-10-2002-EN.iso
       to KNOPPIX_V3.1-31-10-2002-EN.iso<br>
      Then <br>
     rsync -P --stats ftp.leo.org::Knoppix/KNOPPIX_V3.1-31-10-2002-EN.iso
 .<br>
  ( you can use any other rsync site  of knoppix. Always check the site for latest release) </p>
<h4> b)  Hardware </h4>
<p>   A Computer with tons of free hard disk space and memory. I did this on a Pentium 3  950MHZ machine with  128 mb RAM. </p>
<hr>             
<h3> <b>Initial setup<br></b></h3>
    <p>Make a lot of disk space free You need a lot of real estate for
 re-mastering  KNOPPIX CD<br>
      I  made two fresh partitions  on my 20 GB Hard disk<br>
           hda2 		with 2GB for swap<br>
           hda3 		with 5 GB for re-mastering work ( you can also use an existing Linux partition if it has sufficient free space) </p>
           
<p> Now boot the machine with Knoppix cd ( You can also do the
re-mastering after a hard disk install of knoppix . A how to for hard disk
install can be found <a href=http://www.freenet.org.nz/misc/knoppix-install.html> here </a> ) </p>
<p>  At boot prompt press enter. Knoppix now boots into GUI.   The  default is KDE . You can change it at boot prompt if you want . I did re-mastering while booted to KDE. It is assumed that you are somewhat familiar with Knoppix.
Read Knoppix  cheat codes on the CD for more information on booting. </p>
<h4> a) Configure networking from the KDE menu </h4>
   Click on <br>
    K/Knoppix/network-Internet/Network-card-configuration <br>
 <p>    I am connected to a Lan and I configured IP address,  netmask, name
server  and gateway This step is very important since you  have to get the custom stuff to be installed from  else where</p>
<h4>b) Setup partitions </h4>          
<p> Open a root shell from KDE menu (K/Knoppix/Root-shell) You will get # prompt</p>
<p> Run cfdisk </p>
<p> Next you have to make the necessary partitions . I created two partitions
     hda2 with 2 GB and hda3 with 5 GB</p>
<p>  Make the 2GB partitions type as swap ( /hda2 in my case) </p>
<p>  Make the 5 GB partitions type as   Linux native( ext2) (hda3 here)<br>
      Save the modified partition information </p>
<p>  Quit  cfdisk </p>
<p> For creating compressed file system we need a lot of swap space .
     I created the swap with <br>
      # mkswap /dev/hda2<br>
      # swapon /dev/hda2        </p>
    ( it is also possible to use a swap file ) <br>         
<p> Create an ext2 file system on the 5GB partition <br>
   #mke2fs /dev/hda3 </p>
<p> Mount the 5GB  partition to the Knoppix file system  <br>
    # mount /dev/hda3 /mnt/hda3 </p>
<p> The basic setup for re-mastering  is ready </p>
<hr>           
<h3><b>Installing and Removing Software</b></h3>
<p> The knoppix CD is organized somewhat like the figure below ( Correct me if I  am wrong. it may look different when you look at it from windows or another Linux distro)<br>
<pre>     
/--demos
|--talks
|--index.html
|--autorun.bat
|--autorun.inf
|--knoppix.ico
|--KNOPPIX
      |--KNOPPIX
      |--boot.img
      |--background.gif
      |- (Some more files here)
</pre>
<p> The   file KNOPPIX in /KNOPPIX directory on the cd is approxiamtley
700MB. The  file contains a <a
 href="http://www.knopper.net/download/knoppix/cloop.README">compressed image
 </a>of the file system. We have to modify this file alone and can leave
the  rest of the cd intact (unless you want to modify boot image startup
files  etc).</p>
<h4> a) Copy Knoppix file system to hard disk </h4>
When Knoppix CD is booted compressed image file is mounted at /KNOPPIX
You have to copy it to  your target partition.I did a<br>
      # cp -Rp /KNOPPIX   /mnt/hda3/ <br>
 ( -R option is for recursive copying -p is for preserving ownership time stamp etc) This places all the files you need to make a custom cd on your hard disk at  /mnt/hda3/KNOPPIX/ directory . Take a look at it </p>
<h4> b) Chroot </h4>            
<p>  You have to install/uninstall software under this tree( if you don't have networking copy your  sources to (say)  /mnt/hda3/KNOPPIX/root/ and if you have debs  copy them to /mnt/hda3/KNOPPIX/var/cache/apt/archives)<br>
 Now we are going to change the  root of the file system to /mn/hda3/KNOPPIX <br>
        #chroot /mnt/hda3/KNOPPIX </p>
<p> you  will get back # prompt ( If you get  /dev/null permission denied message here just press control C)<br>
   You are at  /   ( chrooted to /mnt/hda3/KNOPPIX) </p>
<p> Next mount the  proc file system <br>
   #mount  -t proc /proc proc    <br>
<h4> c) Setup networking </h4>
Add to /etc/resolv.conf <br>
nameserver ip-of-ur-nameserver </p>
<i> ( I had a curious problem /etc/resolv.conf was a symlink to /etc/dhcp/resolv.conf. Ping did not work. I removed the symlink and created a /etc/resolv.conf afresh and it worked. Make sure that you restore the symlink once you are
 finished)    </i>
<p> Verify your ip address  now with  ifconfig. (It should be same as what you have out side chroot) Then try ping google.com. If you can ping google.com your network setup is ok under chroot.Do an apt get update </p>
<h4> d) Install/Uninstall </h4>            
<p>  You can install /uninstall whatever software you need using apt. Since the original Cd has a lot of software installed it may not be an easy
task.The following is a partial list of packages I removed </p>
<h4><b>Games</b> </h4>
  falconseye-data<br>
  rocks-n-diamonds<br>
  amor<br>
  nethack-x11<br>
  gnome-games-locale<br>
  xboard<br>
  gnocatan-client<br>
  imaze<br>
  kmahjongg<br>
  gnome-gnibbles<br>
  freeciv-gtk<br>
  ktuberling<br>
  gnocatan-help<br>
  ksirtet<br>
  gnome-gnobots2<br>
  jumpnbump<br>
  ksnake<br>
  xgalaga<br>
  lskat<br>
  katomic<br>
  kshisen<br>
  konquest<br>
  chromium<br>
  ktux<br>
  moon-buggy<br>
  kmoon<br>
  ksame<br>
  gnuchess<br>
  ktron<br>
  frozen-bubblekjumpingcube<br>
  fortune-mod<br>
  kodo<br>
  gnocatan-ai<br>
  gnocatan-server-console<br>
  gnocatan-server-data<br>
  nethack<br>
  821<br>
  fortunes<br>
  searchandrescue<br>
  xbill<br>
  kspaceduel<br>
  libkdegames<br>
  tipptrainer-data-dexconq<br>
  gcompris<br>
  gnome-chess<br>
  tuxracer-data<br>
  abuse-frabs<br>
  gnome-gnotski<br>
  frotz<br>
  kblackbox<br>
  gnome-games<br>
  gnome-gtali<br>
  gnome-iagno<br>
  gnome-stones<br>
  gnocatan-server-gtk<br>
  lxdoom-x11<br>
  maelstrom<br>
  kabalone<br>
  gnome-gnotravex<br>
  fortunes-min<br>
  chromium-data<br>
  kdegames<br>
  pingus-data<br>
  task-kde-games<br>
  stax<br>
  gnome-card-games<br>
  xtris<br>
  xtux<br>
  kjezz<br>
  lxdoom<br>
<h4><b>Non -free</b><br></h4>
  x3270<br>
  xanim festlex-oald<br>
  netscape-java-477<br>
  j2re1.3<br>
  3270-common<br>
  tgif<br>
  giflib-bin<br>
  frotz xfractint<br>
  giflib3g communicator-smotif-477<br>
  netscape-base-477<br>
  maelstrom communicator-base-477<br>
  gimp1.2-nonfree<br>
  acroread<br>
  lha<br>
  unarj<br>
  xsnow<br>
<h4> <b>Misc </b> </h4>
  tetex-base <br>
  tetex-extra <br>
  j2re1.3 <br>
  lyx<br>
  acroread <br>
  qcad<br>
  rocks-n-diamonds<br>
  kde-i18n-da <br>
  kde-i18n-it <br>
  kde-i18n-de<br>
  kde-i18n-fr<br>
  kde-i18n-ru<br>
  kde-i18n-nl<br>
  kde-i18n-ja<br>
  kde-i18n-es<br>
  kde-i18n-cs <br>
  kde-i18n-pl <br>
  kde-i18n-tr<br>
  xfonts-intl-chinese<br>
  kword<br>
  kpresenter<br>
  abiword-gtk<br>
  karbon <br>
  kchart<br>
  kformula<br>
  kivio <br>
  koffice-libs <br>
  kontour <br>
  koshell<br>
  kspread <br>
<p>I copied the above list to a file ( say kicklist)
  then did  <br>
   #dpkg -P `cat kicklist` <br>
  It removed all files listed (notice the back quote
above )</p>
<p>If you are looking for big installed packages <br>
    # dpkg-awk "Status: .* installed$" -- Package Installed-Size| awk 
'{print $2}' | egrep -v '^$' | xargs -n2 echo | perl -pe 's/(\S+)\s(\S+)/$2 
$1/' | sort -rg<br>
    will list the packages with size in descending order.<br>
  </p>
<p> Finally run deborphan to check if there are any orphaned packages<br>
  #deborphan &gt; /tmp/orphanlist<br>
  #dpkg -P `cat /tmp/orphanlist`<br>
  # rm /tmp/orphanlist </p>
<p>  An alternate method is to use synaptic and add/remove packages from GUI.
Synaptic  is good graphical front end to apt </p>
<p>  For this do <br>
      #  apt-get install synaptic <br>
  You have to export DISPLAY environment variable for synaptic to work properly <br>
    #DISPLAY=myip:0.0  ( replace my ip with your actual IP) <br>
    #export DISPLAY <br>
    #synaptic </p>
<p> It will start synaptic <br>
    Enjoy apt through synaptic
   </p>
<p>  Once you are finished with synaptic you can re master the cd. If you are working from a hard disk install of knoppix and want synaptic to work, look in/etc/X11/xinit/xserverrc and see that -nolisten tcp is removed.Also do xhost + as a non root user) </p>
<p> Unmount proc ( This is very <b>important</b>) <br>
      #umount /proc  </p>
<p>Press control D to leave chrooted environment<p>
<h3><b>Further Customization</b> </h3>
<b>   1 Installing applications compiled from source </b>
  <p>Download the software source inside chroot environment. Compile and install as usual . If it is an X11 application export  display before you test<br>
I use checkininstall <a href="asic-linux.com.mx/%7Eizto/checkinstall/">asic-linux.com.mx/~izto/checkinstall/</a> to install and maintain home brew debs<br>
Remember to remove the sources once you are finished (it will take up space on your CD). </p>
<b> 2) Changing user settings</b>
 <p> It is possible to set password for users. Just set it under chrooted
environment </p>
<b> 3) Changing backgrounds </b>
   <p> /usr/local/lib/knoppix.gif is the default background image in X </p>
<b> 4) Modifying Boot Screen </b>
    <p>The Knoppix Cd uses <a href="http://syslinux.zytor.com/">syslinux</a> to boot. If you want to change the boot screen/messages do the 
following. Make a temporary directory on your hard disk (I did mkdir
/mnt/hda3/image)<br>
   Copy the boot.img file from Knoppix directory of your knoppix cd<br>
     #cp /KNOPPIX/boot.img /mnt/hda3<br>
    Mount the image as follows<br>
       #mount -t msdos -o loop  /mnt/hda3/boot.img /mnt/hda3/image<br>
     Now look in the image directory you created. There are a number of interesting files in this directory </p>
  a) Boot logo <br>
    logo.16 is the image displayed on boot screen. It is
 encoded in a special format. For replacing it grab a 640*400 16 color image. I downloaded an image  from gnu.org.Convert the image to a png file ( call it logo.png) <br>
   <pre> 
     #pngtopnm &lt;logo.png &gt;logo.pnm<br>
   #ppmtolss16 &lt;logo.pnm &gt;logo.16<br>
    # cp logo.16 /mnt/hda3/image/logo.16 
   </pre>
<p> (Keep the size of the final log.16 around 50 k). Unmount image directory. Copy the boot.img to a floppy<br>
   #dd if=boot.img of=/dev/fd0<br>
 Boot the machine from the floppy you have made.
 If it boots up properly you are done  </p>
 b) syslinux.cfg <br>
 By modifying syslinux.cfg you can change a number of parameters passwd on to the kernel. Read the man pages of syslinux  for more details<br> 
<b> 5)Modifying kernel ( ****Untested ****)</b>
   <p> Make a new custom kernel using kernel package . Keep the kernal
size small. Copy the kernal to and modules to boot.img file. replace /lib/modules/2.4.19-xfs with modules of your new kernel<br>
    Replace files in /boot 
      </p>
<b> 6)Changing default GUI to Gnome/ icewm    </b></br>
    Changing default gui to something else is quite easy<br>
    Under the chrooted environment open the file <br>
    /etc/init.d/knoppix-autoconfig </p>
<p>  Look for the following lines<br>
   ---------------------------------------<br>
<p>#Also read desired desktop, if any   </p>
<p>DESKTOP="$(getbootparam desktop 2&gt;/dev/null)"</p>
<p># Allow only supported windowmanagers </p>
<p>case "$DESKTOP" in gnome|kde|larswm|xfce|windowmaker|wmaker|icewm|fluxbox|twm)
 ;; *)
   </p>
<p> DESKTOP="KDE"; ;; esac<br>
   --------   ^^  --------------------------------------<br>
   </p>
<p> Change the KDE above to gnome and that is all </p>
<b> 7)   Remove any temporary files   </b><br>
   a)  Look in /root for hidden files such as .bash_history .viminfo<br>
    b)  Nuke all deb files in /var/cache/apt/archives<br>
  c)  Run the knoppix.clean script  ( Be careful and run
it only from chrooted environmant) </p>
<p>(* link to the script goes here*)  </p>
<h3><u><b>Re mastering the CD</b></u> </h3>
<b>a)Make an ISO image</b>
<p> 1) Make a new directory on /mnt/hda3<br>
       I called it NewCd<br>
      Copy  Everything except Compressed image file(KNOPPIX) from 
knoppix cd  (look at /cdrom). You can safely delete the directories demos and talks <br>
 2) Create the compressed Image<br> 
       #mkisofs -R  /mnt/hda3/KNOPPIX | create_compressed_fs -  65536  &gt; /mnt/hda3/NewCD/KNOPPIX/KNOPPIX </p>
<p>3) Recreate the bootable CD <br>
    #cd /mnt/hda3  </p>
<p>#mkisofs -r -J -b KNOPPIX/boot.img -c KNOPPIX/boot.cat  -o myknoppix.iso NewCd </p>
<b>b)Testing the image </b>
<p> Create a boot floppy <br>
    # dd if=/mnt/hda3/KNOPPIX/boot.img of=/dev/fd0 <br>
  Copy the compressed file you created to a directory /KNOPPIX on any partition. The boot floppy i will look for /KNOPPIX/KNOPPIXon hard disk partitions.This makes your testing easy. Once you are satisfied with your image   burn
itto a CD   </p>
     
<h3><b>FAQ </b> </h3>
     
<p> 1) How do I stop konquerer at startup<br>
       To stop konquerers you have to modify<br>
    /etc/X11/Xsession.d/45xsession<br>
 Look for the following lines </p>
<p>-------------------------------------------<br>
if [ -e "$INDEXFILE" ]; then<br>
cat &gt;&gt; $HOME/Desktop/KNOPPIX.desktop &lt;&lt;EOF<br>
[Desktop Entry]<br>
Name=KNOPPIX<br>
Exec=kfmclient openProfile webbrowsing $INDEXFILE<br>
Type=Application<br>
Icon=html<br>
Terminal=0<br>
EOF<br>
ln $HOME/Desktop/KNOPPIX.desktop $HOME/.kde/Autostart/showindex.desktop<br>
fi</p>
  -----------------------------------------<br>

<p> It makes an autostart file. Comment it out </p>
<p>  2) I have booted knoppix cd and mounted a hard disk how do i copy something via scp to the hard disk<br>
     Open a shell <br>
     set a password for user knoppix<br>
     start ssh (/etc/init.d/ssh start)<br>
     Then copy with scp</p>
<p>3 I am at $ prompt I want to su<br>
    Do sudo passwd <br>
     set a root password<br>
    then su
</p>
     
<p>4) default text mode boots up in frame buffer and characters are very small
how do I fix it<br>
     Mount boot.img<br>
    look for syslinux.cfg<br>
    under Default vmlinuz<br>
    change VGA=791 to VGA=normal </p>
   
<p> 5 )My keyboard lay out is German. How do i change it to English<br>
 Open KDE control center select system -&gt;keyboard and change 
it to US English </p>
 <h3> References</h3>
    I have adapted lot of material from the following links. Also #knoppix
 on irc.freenode.net is a good source of information <br>
1)<a href=http://home.bellsouth.net/p/PWP-tech2k>Tech2k home page </a><br>
   <b>Ken Burk</b> helped me a lot on irc to improve this  document . His site has excellent information which you can always rely on.His kix remastering page is also very good<br>
2) <a href=http://knoppix.net> Knoppix.net </a><br>
  The unofficial knoppix site is a great source of information. Lots of new stuff regarding re-mastering appear there regularly <br>
3) <a href= http://www.linuxtag.org/forum/> Knoppix forum </a> at linuxtag<br>
    This site mixture of German and English . Very good source
 on Knoppix   </p>












<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I work as  consultant information technology at the Kerala  Legislative
Assembly Trivandrum India. I have been hooked on Linux since 1996. I have a
Masters in Computer Science from Cochin University. I am interested in all
sorts of operating systems. In my free time I love to listen to Indian
classical music.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Sunil Thomas Thonikuzhiyil.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Encryption using OpenSSL's crypto libraries</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/vinayak.html">Vinayak Hegde</A></STRONG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->



<h2> Motivation for the article </h2>

<p align="justify">
Linux has already made quite a few inroads into the corporate world.
One of the persistent demands of the corporate world has been a need
for better data security. This is where encryption comes in, to hide
sensitive data from a third party intruder. Open-source software 
has a reputation for secure programming. This article is another
step in that direction.
</p>

<p align="justify">
OpenSSL's libcrypto is a really good library if you want to use encryption
without bothering with the details of underlying implementation of the 
algorithm. The problem is that the documentation is really minimal.
You can obviously read the source and figure out what going on. Also the 
fact that function names are intuitive helps to some extent. Another way 
of getting help is joining the various mailing lists from the 
<a href="www.openssl.org"> OpenSSL </a> website.
However the command line tools of OpenSSL are pretty well documented and 
easy to use. I shall explain in this article how to use the blowfish 
algorithm for encryption using OpenSSL's crypto libraries.
</p>

<h2> Some Background Information</h2>

<p align="justify"> 
During the early days of cryptography, algorithms as well as keys were
secret. However now that trend has changed. Now algorithms are publicly
known and keys are kept secret. The best example of this is the RSA
algorithm which is widely known and implemented. The public key are
known to the world but the private keys are kept secret. RSA is an
asymmetric algorithm as it does not use the same key for encryption
and decryption. Also it is generally not advisable to use RSA for 
encrypting large amounts of data as the it is computationally intensive.
</p>

<p align="justify">
For encrypting large amounts of data, generally less computationally
intensive algorithms are prefered. In this article we use the blowfish
algorithm for encrypting and decrypting data. Blowfish is a symmetric
algorithm which means it uses the same key for encryption and
decryption. Blowfish was designed by the famous cryptographer Bruce Schneier.
Blowfish is a fast algorithm for encryption/decryption.
</p>

<h2> Generating the key</h2>

<p align="justify">
For the purposes of demonstration we shall use a 128-bit key. This is 
stored as an character array in the program. We also generate an 64 bit 
initialization vector(IV). For our program we will use <b> Cipher Block
Chaining (CBC) </b> mode. Also we will not use the blowfish functions directly 
but use then through a the higher level interface. 
</p>

<p align="justify">
An <b>initialization vector</b> is a bit of random information that is used as 
an input in chained encryption algorithms, that is, when each stage of 
encrypting a block of input data provides some input to the encryption 
of the next block. (blowfish uses 64-bit blocks for encryption).
The IV provides the first bit of input for encrypting the
1st block of data, which then provides input for the
2nd block and so on. The bit left over at the end is discarded.
</p>

<p align="justify">
The random bits are generated from the character special file <b> /dev/random
</b> which provides a good source for random numbers. See the manpage for more
information.
</p>

<table border = 2>
<tr> <td bgcolor=#FFFF99> 
<pre>

int
generate_key ()
{
	int i, j, fd;
	if ((fd = open ("/dev/random", O_RDONLY)) == -1)
		perror ("open error");

	if ((read (fd, key, 16)) == -1)
		perror ("read key error");

	if ((read (fd, iv, 8)) == -1)
		perror ("read iv error");
	
	printf("128 bit key:\n");
	for (i = 0; i < 16; i++)
		printf ("%d \t", key[i]);
	printf ("\n ------ \n");

	printf("Initialization vector\n");
	for (i = 0; i &lt; 8; i++)
		printf ("%d \t", iv[i]);

	printf ("\n ------ \n");
	close (fd);
	return 0;
}

</pre> 
</td> </tr>
</table>

<h2> The Encryption routine </h2>

<p align="justify">
The encryption routine takes two parameters - the file descriptors of input file and
the output file to which the encrypted data is to be saved. It is always a good idea
to zero-fill your buffers using the memset or bzero commands before using the buffers 
with data. This is especially important if you plan to reuse the buffers. In the program
below, the input data is being encrypted in blocks of 1K each.
</p>

<p align="justify">
The steps for encryption are as follows :-

<ol>
	<li> Create a cipher context </li>
	<li> Initialize the cipher context with the values of Key and IV </li>
	<li> Call EVP_EncryptUpdate to encrypt successive blocks of 1k eack </li>
	<li> Call EVP_EncryptFinal to encrypt "leftover" data </li>
	<li> Finally call EVP_CIPHER_CTX_cleanup to discard all the sensitive information from memory </li>
</ol>

</p>

<p align="justify">
You may be wondering what "leftover" data is? As mentioned earlier, Blowfish
encrypts information in blocks of 64-bit each. Sometimes we may not have 64 bits
to make up a block. This may happen if the buffer size in the program below or 
the file/input data size is not a integral multiple of 8 bytes(64-bits).So 
accordingly the data is padded and then the partial block is encrypted using
EVP_EncryptFinal. The length of the encoded data block is stored in the 
variable tlen and added to the final length.
</p>

<table border = 2>
<tr> <td bgcolor = #FFFF99> 
<pre>

int
encrypt (int infd, int outfd)
{
	unsigned char outbuf[OP_SIZE];
	int olen, tlen, n;
	char inbuff[IP_SIZE];
	EVP_CIPHER_CTX ctx;
	EVP_CIPHER_CTX_init (&amp; ctx);
	EVP_EncryptInit (&amp; ctx, EVP_bf_cbc (), key, iv);

	for (;;)
	  {
		  bzero (&amp; inbuff, IP_SIZE);

		  if ((n = read (infd, inbuff, IP_SIZE)) == -1)
		    {
			    perror ("read error");
			    break;
		    }
		  else if (n == 0)
			  break;

		  if (EVP_EncryptUpdate (&amp; ctx, outbuf, &amp; olen, inbuff, n) != 1)
		    {
			    printf ("error in encrypt update\n");
			    return 0;
		    }

		  if (EVP_EncryptFinal (&amp; ctx, outbuf + olen, &amp; tlen) != 1)
		    {
			    printf ("error in encrypt final\n");
			    return 0;
		    }
		  olen += tlen;
		  if ((n = write (outfd, outbuf, olen)) == -1)
			  perror ("write error");
	  }
	EVP_CIPHER_CTX_cleanup (&amp; ctx);
	return 1;
}
</pre> 
</td> </tr>
</table>


<h3> The Decryption routine </h3>

<p align="justify">
The decryption routine basically follows the same steps as the encryption routine. The following code show how the decryption is done.
<table border = 2>
<tr> <td bgcolor = #FFFF99> 
<pre> 

int
decrypt (int infd, int outfd)
{
	unsigned char outbuf[IP_SIZE];
	int olen, tlen, n;
	char inbuff[OP_SIZE];
	EVP_CIPHER_CTX ctx;
	EVP_CIPHER_CTX_init (&amp; ctx);
	EVP_DecryptInit (&amp; ctx, EVP_bf_cbc (), key, iv);

	for (;;)
	  {
		  bzero (&amp; inbuff, OP_SIZE);
		  if ((n = read (infd, inbuff, OP_SIZE)) == -1)
		    {
			    perror ("read error");
			    break;
		    }
		  else if (n == 0)
			  break;

		  bzero (&amp; outbuf, IP_SIZE);

		  if (EVP_DecryptUpdate (&amp; ctx, outbuf, &amp; olen, inbuff, n) != 1)
		    {
			    printf ("error in decrypt update\n");
			    return 0;
		    }

		  if (EVP_DecryptFinal (&amp; ctx, outbuf + olen, &amp; tlen) != 1)
		    {
			    printf ("error in decrypt final\n");
			    return 0;
		    }
		  olen += tlen;
		  if ((n = write (outfd, outbuf, olen)) == -1)
			  perror ("write error");
	  }

	EVP_CIPHER_CTX_cleanup (&amp; ctx);
	return 1;
}
</pre> 
</td> </tr>
</table>

<h2> The complete code </h2>

<p align="justify">
A minimal interactive program implementing the above routines can be 
downloaded from <a href="misc/vinayak/sym_funcs.c.txt"> here </a>.
The command for compiling the program is 

<table border = 2 >
<tr> <td bgcolor = #FFAADD>

<pre>
# gcc -o blowfish sym_funcs.c -lcrypto
</pre>

<td> </tr> 
</table>

The program takes three files from the command line

<ol>
	<li> File to be encrypted </li>
	<li> File is which the encrypted data is to be stored </li>
	<li> File in which decrypted data is to be stored </li>
</ol>

Don't forget to generate a key before encrypting ;).
</p>
 
<h2> An Example Application - A Secure Instant Messenger </h2>

<p align="justify">
Consider an instant messenger software (IM) which wants to communicate with 
another IM securely. The following approach could be followed.

<ol>
	<li> Each IM client has it's own public and private key.
	<li> The IM client has the public keys of all the IMs it wants to communicate with. 
 		(say friends' IMs).
	<li> The session key is generated by the client which initiates the connection.
 		This session key is used for encrypting the messages between the two clients.
	<li> The session key is encrypted and exchanged between two/multiple clients using public-Key 
		encryption.(eg. RSA algorithm). Thus Authentication is also taken care of.
	<li> The exchange of encrypted data (using Blowfish symmetric encryption) thereafter
		takes place between the different clients after this "security handshake".
</ol>
</p>

<h2> Resources </h2>

<ol>
	<li> <a href="http://www.openssl.org"> OpenSSL Homepage </a>
	<li> <a href="http://www.counterpane.com/blowfish.html"> The Blowfish Algorithm </a>
	<li> <a href="http://www.cacr.math.uwaterloo.ca/hac/"> Handbook of Applied Cryptography </a>
</ol>




<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>My life changed since I discovered Linux. Suddenly Computers became
interesting as i could try out lots of stuff on my Linux box due to the easy
availabily of source code. My interests are predominantly in the fields of
networking, embedded systems and programming languages. I currently work for
Aparna Web services where we make Linux accessible for academia/corporations by
configuring remote boot stations (Thin Clients).
</em>
<br CLEAR="all">
<!-- *** END bio *** -->

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Vinayak Hegde.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>


<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png" 
	WIDTH="200" HEIGHT="41" border="0"></A> 
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD WIDTH="380">


<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Back Page</FONT></STRONG></BIG></BIG>
</CENTER>

</TD></TR>
</TABLE>
<P>

<!-- END header -->











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

<center><H3><font color="maroon">World of Spam</font></H3></center>

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

<P> The Nigeria scams riled up one person enough to write a parody
spam.

<PRE>
X-Spam-Status: No, hits=4.3 required=5.0
	tests=BILLION_DOLLARS,DEAR_SOMETHING,IN_REP_TO,ITS_LEGAL,
	      LINES_OF_YELLING,LINES_OF_YELLING_2,LINES_OF_YELLING_3,
	      NIGERIAN_TRANSACTION_1,NIGERIAN_TRANSACTION_2,REFERENCES,
	      SIGNATURE_SHORT_DENSE,SPAM_PHRASE_05_08,SUPERLONG_LINE,
	      UPPERCASE_75_100,USER_AGENT,USER_AGENT_MUTT,US_DOLLARS_3
	version=2.43
X-Spam-Level: ****

HIGHLY CONFIDENTIAL 

FROM: GEORGE WALKER BUSH 
DEAR SIR / MADAM, 

I AM GEORGE WALKER BUSH, SON OF THE FORMER PRESIDENT OF THE UNITED STATES OF
AMERICA GEORGE HERBERT WALKER BUSH, AND CURRENTLY SERVING AS PRESIDENT OF THE
UNITED STATES OF AMERICA. THIS LETTER MIGHT SURPRISE YOU BECAUSE WE HAVE NOT
MET NEITHER IN PERSON NOR BY CORRESPONDENCE. I CAME TO KNOW OF YOU IN MY SEARCH
FOR A RELIABLE AND REPUTABLE PERSON TO HANDLE A VERY CONFIDENTIAL BUSINESS
TRANSACTION, WHICH INVOLVES THE TRANSFER OF A HUGE SUM OF MONEY TO AN ACCOUNT
REQUIRING MAXIMUM CONFIDENCE. 

I AM WRITING YOU IN ABSOLUTE CONFIDENCE PRIMARILY TO SEEK YOUR ASSISTANCE IN
ACQUIRING OIL FUNDS THAT ARE PRESENTLY TRAPPED IN THE REPUBLIC OF IRAQ. MY
PARTNERS AND I SOLICIT YOUR ASSISTANCE IN COMPLETING A TRANSACTION BEGUN BY MY
FATHER, WHO HAS LONG BEEN ACTIVELY ENGAGED IN THE EXTRACTION OF PETROLEUM IN
THE UNITED STATES OF AMERICA, AND BRAVELY SERVED HIS COUNTRY AS DIRECTOR OF THE
UNITED STATES CENTRAL INTELLIGENCE AGENCY. 

IN THE DECADE OF THE NINETEEN-EIGHTIES, MY FATHER, THEN VICE-PRESIDENT OF THE
UNITED STATES OF AMERICA, SOUGHT TO WORK WITH THE GOOD OFFICES OF THE PRESIDENT
OF THE REPUBLIC OF IRAQ TO REGAIN LOST OIL REVENUE SOURCES IN THE NEIGHBORING
ISLAMIC REPUBLIC OF IRAN. THIS UNSUCCESSFUL VENTURE WAS SOON FOLLOWED BY A
FALLING OUT WITH HIS IRAQI PARTNER, WHO SOUGHT TO ACQUIRE ADDITIONAL OIL
REVENUE SOURCES IN THE NEIGHBORING EMIRATE OF KUWAIT, A WHOLLY-OWNED
U.S.-BRITISH SUBSIDIARY. 

MY FATHER RE-SECURED THE PETROLEUM ASSETS OF KUWAIT IN 1991 AT A COST OF
SIXTY-ONE BILLION U.S. DOLLARS ($61,000,000,000). OUT OF THAT COST, 
THIRTY-SIX BILLION DOLLARS ($36,000,000,000) WERE SUPPLIED BY HIS PARTNERS IN
THE KINGDOM OF SAUDI ARABIA AND OTHER PERSIAN GULF MONARCHIES, AND SIXTEEN
BILLION DOLLARS ($16,000,000,000) BY GERMAN AND JAPANESE PARTNERS. 

BUT MY FATHER'S FORMER IRAQI BUSINESS PARTNER REMAINED IN CONTROL OF THE
REPUBLIC OF IRAQ AND ITS PETROLEUM RESERVES. 

MY FAMILY IS CALLING FOR YOUR URGENT ASSISTANCE IN FUNDING THE REMOVAL OF THE
PRESIDENT OF THE REPUBLIC OF IRAQ AND ACQUIRING THE PETROLEUM ASSETS OF HIS
COUNTRY, AS COMPENSATION FOR THE COSTS OF REMOVING HIM FROM POWER. 

UNFORTUNATELY, OUR PARTNERS FROM 1991 ARE NOT WILLING TO SHOULDER THE BURDEN OF
THIS NEW VENTURE, WHICH IN ITS UPCOMING PHASE MAY COST THE SUM OF 100 BILLION
TO 200 BILLION DOLLARS ($100,000,000,000 - $200,000,000,000), BOTH IN THE
INITIAL ACQUISITION AND IN LONG-TERM MANAGEMENT. 

WITHOUT THE FUNDS FROM OUR 1991 PARTNERS, WE WOULD NOT BE ABLE TO ACQUIRE THE
OIL REVENUE TRAPPED WITHIN IRAQ. THAT IS WHY MY FAMILY AND OUR COLLEAGUES ARE
URGENTLY SEEKING YOUR GRACIOUS ASSISTANCE. OUR DISTINGUISHED COLLEAGUES IN THIS
BUSINESS TRANSACTION INCLUDE THE SITTING VICE-PRESIDENT OF THE UNITED STATES OF
AMERICA, RICHARD CHENEY, WHO IS AN ORIGINAL PARTNER IN THE IRAQ VENTURE AND
FORMER HEAD OF THE ALLIBURTON OIL COMPANY, AND CONDOLEEZA RICE, WHOSE
PROFESSIONAL DEDICATION TO THE VENTURE WAS DEMONSTRATED IN THE NAMING OF A
CHEVRON OIL TANKER AFTER HER. 

I WOULD BESEECH YOU TO TRANSFER A SUM EQUALING TEN TO TWENTY-FIVE PERCENT
(10-25 %) OF YOUR YEARLY INCOME TO OUR ACCOUNT TO AID IN THIS IMPORTANT
VENTURE. THE INTERNAL REVENUE SERVICE OF THE UNITED STATES OF AMERICA WILL
FUNCTION AS OUR TRUSTED INTERMEDIARY. I PROPOSE THAT YOU MAKE THIS TRANSFER
BEFORE THE FIFTEENTH (15TH) OF THE MONTH OF APRIL. 

 
I KNOW THAT A TRANSACTION OF THIS MAGNITUDE WOULD MAKE ANYONE APPREHENSIVE AND
WORRIED. BUT I AM ASSURING YOU THAT ALL WILL BE WELL AT THE END OF THE DAY. A
BOLD STEP TAKEN SHALL NOT BE REGRETTED, I ASSURE YOU. PLEASE DO BE INFORMED
THAT THIS BUSINESS TRANSACTION IS 100% LEGAL. IF YOU DO NOT WISH TO CO-OPERATE
IN THIS TRANSACTION, PLEASE CONTACT OUR INTERMEDIARY REPRESENTATIVES TO FURTHER
DISCUSS THE MATTER. 

I PRAY THAT YOU UNDERSTAND OUR PLIGHT. MY FAMILY AND OUR COLLEAGUES WILL BE
FOREVER GRATEFUL. PLEASE REPLY IN STRICT CONFIDENCE TO THE CONTACT NUMBERS
BELOW. 

SINCERELY WITH WARM REGARDS, 
GEORGE WALKER BUSH 
</PRE>
 








<HR> <!-- ************************************************************** -->

<P> Happy Linuxing!

<P> Mike ("Iron") Orr<br>
Editor, <A HREF="http://www.linuxgazette.com/"><i>Linux Gazette</i></A>, <A
HREF="mailto:gazette@ssc.com">gazette@ssc.com</a>
<BR CLEAR="all">















<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>

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


<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, .
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR> 
Published in Issue 87 of <i>Linux Gazette</i>, February 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>

</BODY></HTML>