1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> Linux Gazette Table of Contents LG #83</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>October 2002, Issue 83
Published by <I>Linux Journal</I></H2>
<A HREF="../index.html">Front Page</A> |
<A HREF="../index.html">Back Issues</A> |
<A HREF="../lg_faq.html">FAQ</A> |
<A HREF="../mirrors.html">Mirrors</A> <!-- | --><BR>
<A HREF="../tag-kb.html">The Answer Gang knowledge base</A> (your Linux questions here!) <!-- | --><BR>
<A HREF="http://www.linuxgazette.com/search.html">Search (www.linuxgazette.com)</A>
<!-- *** BEGIN mirror site search link *** -->
<!-- <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>
<LI> <a HREF="evans.html">Saving Users From Themselves -or- Dealing with User Input in Python</A> , <EM>by Paul Evans</EM>
<LI> <a HREF="heriyanto.html">Creating Makefiles: A Mini Tutorial</A> , <EM>by Tedi Heriyanto</EM>
<LI> <a HREF="klimkiewicz.html">Multi-Account E-mail with Mutt</A> , <EM>by Kamil Klimkiewicz</EM>
<LI> <a HREF="okopnik.html">Replicating a Linux System - Yet Another Method</A> , <EM>by Ben Okopnik</EM>
<LI> <a HREF="padala.html">Exploring Perl Modules - Part2: Creating Charts with GD::Graph</A> , <EM>by Pradeep Padala</EM>
<LI> <a HREF="prasad.html">Handling Power Status Using snmptrapd</A> , <EM>by A B Prasad</EM>
<LI> <a HREF="qubism.html">Qubism</A> , <EM>by Jon "Sir Flakey" Harsem</EM>
<LI> <a HREF="ramankutty.html">Programming in Ruby, part 2</A> , <EM>by Hiran Ramankutty</EM>
<LI> <a HREF="sandeep.html">Process Tracing Using Ptrace, part 2</A> , <EM>by Sandeep S</EM>
<LI> <a HREF="stoddard.html">DVD Authoring</A> , <EM>by Chris Stoddard</EM>
<LI> <a HREF="thangaraju.html">Risk-Free Resource Allocation for I/O Memory-Mapped Device Drivers</A> , <EM>by Dr B Thangaraju</EM>
<LI> <a HREF="tougher.html">Apache Log Analysis Using Python</A> , <EM>by Rob Tougher</EM>
<LI> <a HREF="ward.html">Subnetting your local network with DHCP</A> , <EM>by Alan Ward</EM>
<LI> <a HREF="lg_backpage.html">The Back Page</A> , <EM>by Mike ("Iron") Orr</EM>
</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 © 1996-2002 Specialized Systems Consultants, Inc.</H5>
</center>
<HR NOSHADE>
<!--=================================================================-->
<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>
<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="http://www.linuxgazette.com/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="../tag/members-faq.html">The Answer Gang</A>.
</STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#wanted/1"
><strong>An idea to the Linux Project. Make a complete new Help System/manuals :-)</strong></a>
<li><A HREF="#wanted/2"
><strong>PC-MOS</strong></a>
<li><A HREF="#wanted/3"
><strong>Minimal Linux (Redhat 7.2) Installation</strong></a>
<li><A HREF="#wanted/4"
><strong>U of Phoenix</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">An idea to the Linux Project. Make a complete new Help System/manuals :-)</FONT></H3>
Thu, 26 Sep 2002 14:18:11 +0200
<BR>Niels Larsen (<a href="mailto:linux-questions-only@ssc.com?cc=torvalds@transmeta.com&cc=njlarsen@tiscali.se&subject=%20Re%3A%20%5BLG%2083%5D%20help%20wanted%20%231better%20manuals">njlarsen from tiscali.se</a>)
<blockquote><font color="#000066">As I initially planned to go after this with the Editors'
Scissors I couldn't decide quite what to snip without having to put my own nickel's
worth in at multiple places. Leaving it intact is a better example of
the sort of ordinary soul who wants a simple set of instructions.
</font></blockquote>
<blockquote><font color="#000066">I'll suffice to say that I favor his attitude, but fear
the sort of people who already have even heard of <EM>Linux Gazette</EM> might be above his
"level 1" threshold, and he is not in the least bit clear where to draw
dividers for his other 4 levels. He also shows a bit of intelligence
and may be beyond "level 1" himself, too.
</font></blockquote>
<blockquote><font color="#000066">Many commercial distros come with "quick start" guides
geared for the discs in the package. If you need that, I urge you, it's worth spending
the money.
</font></blockquote>
<blockquote><font color="#000066">Beyond a fairly minimum start, what's a spreadsheet if
you won't put numbers in it, an email program if you can't decide who to send mail
to ... do we know any mail programs that will tell you why not to
spam before letting you use them? There is more to life than simply
being told, step by step, which button to push.
</font></blockquote>
<blockquote><font color="#000066">On the other hand, the big name distros at this point
have so many applications in them that a "level 1" manual covering each would get so
huge no level 1 personality would dare crack it, or the set of them, open.
We used to have it as a cartoon on the wall back when I was in tech
support: "I can tell I'm getting to this guy. I heard him open the
shrink wrap on the manual."
</font></blockquote>
<blockquote><font color="#000066">But we will cheerfully point a News Byte entry at
resources that make some effort to divide up the world of Linux info along the lines of
how much experience you have. And yes, Mr. Larsen, that will require
us to point you at a website somewhere. The weapon, should it come
to exist, is no good if we truly keep it a secret.
-- Heather</font></blockquote>
<P>
This mail is about making an even better manual -and help system, which
ordinary endusers can understand, and read and USE. <em>smile - positive -
friendly - but not clever</em>
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</P>
<P>
I am sorry, that I try to pass my idea around to various people by
e-mail, but I have not yet found out the perfect way to do do.
</P>
<P>
I hope, that my ideas would saw an even better idea, because I am not
that clever.
</P>
<P>
I am running my private "war" <EM>laugh</EM> to make Linux user friendly.
</P>
<P>
And this is my contribution to the Linux Project, I mean this idea.
</P>
<P>
If you don't like me, just scrap this letter
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</P>
<P>
There is sitting so many ordinary people out there, surfing the
internet, using windows, and having lots of problems. So it is for me. I
have worked with win3.11, 95 and now win 98. The screen freeze, programs
cannot work together and so on. You probably know?
</P>
<P>
Therefore I now find that "D-day" has come, to attack. <EM>joking</EM>
</P>
<P>
It is time to make the millions og people, surfing the Internet, shift
from windows to Linux.
</P>
<P>
But in order to accomplish this, it is needed with a campagn called:
"Now Linux has become really userfriendly to install, use and surf the
internet with", or maybe a better name ?
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</P>
<P>
Therefore my idea goes towards making e.g. 5 levels of help manuals.
The total easy manual could be level 1. The levels for the professionals
2 - 5 <EM>hi</EM>
</P>
<P>
Keep -and continue developing Linux and its help -and manualsystem as
is.
</P>
<P>
This level 1 manual should be made, by letting a completely newbie sit
next to an Linux expert. Then they together shall install -and use
Linux, and the necessary programs. Then let's say, a journalist shall
write alle the stupid questions down into a manual. Just like the
conversation goes on. It must be completely simple, only ordinary words.
</P>
<P>
E.g. "You take the Linux cd called binary 1, and put it into the cd box"
and so on !!
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
The whole way, like this.
</P>
<P>
Then the same thing with all the important everyday programs. I mention:
Start and log into Linux
Connection to the internet - set up same -browser - mail program - news
program - text editor - spread sheet - zip program - backup program -
pgp program - wine - direct cable - real player - scandisk - webcopier
(wget) - how to install a new program - and to remove it - and probably
some more. Those are my minimum windows programs.
I just mention those I use. I mean just the minimum number of programs.
All above programs shall have this minimum level 1 manual, so people can
start using Linux and more important open the individual program and
immediately start using it.
Only the minimum points, so you do not have to read pages and pages, to
make it work.
And please lots and LOTS OF EXAMPLET. That is the simplest way.
</P>
<P>
Keep all the existing (man - info - howto etc) as is. They belong to
level 2 - 5 !!
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
They shall be used as cross reference. But here also is needed a
complete Linux reference book, covering about everyting, because Linux
now is so extensive.
</P>
<P>
I know, because I was at one point working with the High Pack surveying
program. It came with huge manuals. Nobody was able to read it, og had
the time. Then I made a manual of some a4 pages. I just wrote down just
what I did, which buttons I pressed.
</P>
<P>
If you do not change attitude towards the paedagogic principles,
concerning using computer programs, one do not move much towards getting
people using Linux.
</P>
<P>
Only the minimum programs and their level 1 manuals, so people can begin
using Linux. Then they later can fiddle into the more extensive matters,
if they want to, or are able to.
</P>
<P>
Also, tell the programmers, to make their user programs simpler, and not
having so many possibilities. Because it confuses normally people.
</P>
<P>
I say, make it SIMPLE and "talking" normally language, Do not call
things devices, but floppy, cd, etc. because people do not understand
it, and they then just stick to windows, because they have been
brainwashed to use this!
</P>
<P>
Hope you get my message???
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<P>
I repeat, keep the existing as is, but make this simple manual, as the
secret weapon of Linux.
I shall here in the end just mention, that I gave above idea to Bill
Gates. But he just told me to approach him with a lawyer. He was afraid
to be sued by me. But that is not my idea. Just giving a suggestion.
</P>
<P>
Maybe you can get just a tiny new thinking from this letter.
</P>
<P>
I am an old pensioner, and I can only give this idea, as my contribution
to the Linux Project, which I find fantastic. But I still have
difficulties in getting my Linux work. I cannot remember all I read. And
please also free us from this phrase: "just go to this and this
website". It is ok on level 2 - 5.
</P>
<P>
I am wondering, that now data programs has existed for so long, but
still one is using this ridiculous complex manuals. I think programmers
has been brainwashed by windows manuals/help system, which really is no
good.
</P>
<P>
I think that the closest way to get enduser using Linux in buried in the
help system, which has been neclected, I think ! I think this clever
programmers are buried in the very programming, and are missing the link
to the end-user
</P>
<P>
An example of what I mean:
Word Perfect is a program, which main purpose is to be used to write a
letter:
In order to use the program do the following:
1. To open the program do so and so....
2. To write a letter do so and so....
3. When you have written the letter you should save it to both a harddisk and a floppy disk. Do so and so....
4. To print the letter do so and so......
5. And so on......
All the smart gadgets with the program is not necessary to show.
</P>
<P>
I mean, that the important thing is, to be able to use the various
programs immediately.
</P>
<P>
Then if you want to do the more complex things with the program, use
level 2, 3, 4 or 5.
<EM>smile a lot</EM> ( I think, that even my older sister would be able to
understand!)
</P>
<P>
If you can get lots of people going surfing the Internet and writing
letters, as a minimum, using Linux, maybe a part of them slowly will
begin digging into other parts of Linux. And that would be good, at
least I think so!
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
Maybe, even that was your ultimate goal?
</P>
<P>
Sorry, if I repeat something, but I am old.
Kind regards
A grass root, who hope to saw just a tiny seed <em>still -laughing -
positive - friendly</em>
<br>September 2002.
</P>
<P>
Please do not reply, thank you
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</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">PC-MOS</FONT></H3>
Mon, 16 Sep 2002 12:36:20 -0700
<BR>Derek Isbell (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com&cc=derek@holladays.com&subject=%20Re%3A%20%5BLG%2083%5D%20help%20wanted%20%232%20PC%20MOS">derek from holladays.com</a>)
<P><STRONG>
This is a multi-part message in MIME format.
</STRONG></P>
<P>
[argh. stop that, it's a serious waste of bits. For a oneliner question
you just sent 3 extra email header lines, and a stack of HTML.]
</P>
<P><STRONG>
Where can i find myself a copy of PC-MOS?
</STRONG></P>
<P>
We don't know. The fact that the Answer Guy, Jim Dennis, took a best
shot at poking around the internet a number of years ago, to answer a
question about it, is the best we've got. PC-MOS itself appears to have
disappeared and all that remains may well be all the search engine
entries that point to our dusty little tidbits on the topic.
</P>
<P>
But if you've got a Linux question, or you got a thing you were trying
to do with PC-MOS and wonder if some flavor or other of Linux is up to
doing that for you... please, feel free to ask in more detail!
</P>
<!-- 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">Minimal Linux (Redhat 7.2) Installation</FONT></H3>
Tue, 24 Sep 2002 10:28:23 -0700 (PDT)
<BR>V Sreejith (<a href="mailto:linux-questions-only@ssc.com?cc=sree707@yahoo.com&subject=%20Re%3A%20%5BLG%2083%5D%20help%20wanted%20%233minidisc%20RH">sree707 from yahoo.com</a>)
<P>
I have a 40 GB hard disk.
I have Redhat 7.2 installed
with all the features on the hard
disk taking about 2GB.
I used the grub boot loader.
</P>
<P>
Now I have done a minimal redhat(7.2) installation
on my hard disk.I could not go below 275
mb though.
I edited my old grub.conf
that is with the first installation and
added this new redhat minimum installation
paths.
</P>
<P>
During the boot when i select minimum version
i got an error saying bios wasn't able
to reach my new installation because of
the cylinder limit.
So I made a work around by specifying
the boot of the old installation(
both of them are same versions)
and changed the root to my new installation.
This worked and i was able to boot into my
new installation.
</P>
<P>
Now after booting into my new minimum installation
i deleted all the docs and man pages and further
reduced my installation size from 250 mb
to about 135 mb.
After this i used the dd command to image
the new installation to another linux partition
which i created and having a size of only 200mb.
I copied only the first 135 mb
from the source partition to the target partition.
</P>
<P>
I added another label in grub.conf to point
to this partition and tried to boot.
But after some initialisation messages
it stopped after showing the message kernel panic.
I saw a message stating that "attempt
to access block beyond reach" and showed
the block limit on the partition and
the block which was tried to access.
Obviously the block it was trying to
access was beyond the limit.
</P>
<P>
I am doubting whether this is some kind of
fragmentation problems.Whether the first 135
mb of the source disk
doesn't contain all the installed data.
Could it be that this data is scattered
all over this partition and i cannot image it
directly into another partition.
If that is the case what can i do about this?
Is there any defragmentation tools available
under linux?
</P>
<P>
My aim is to reduce the linux installation
size and to make an image of this reduced
installation on a seperate 200 mb disk
and to be able to boot and work on it.
</P>
<P>
I actually don't know whether this method
works.This is a sort of experimentation.
</P>
<P>
Are there any other way of achieving this aim?
</P>
<P>
thanx
</P>
<P>
sree
</P>
<!-- end 3 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="75%" ALIGN="center">
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">U of Phoenix</FONT></H3>
Fri, 30 Aug 2002 06:40:10 -0500
<BR>Pat Norton (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com&cc=nortonpc@email.uophx.edu&subject=%20Re%3A%20%5BLG%2083%5D%20help%20wanted%20%234%20U%20of%20Phoenix">nortonpc from email.uophx.edu</a>)
<P><STRONG>
Tue, 13 Feb 2001 10:00:12 -0500
<br>K.Woodward (kwoodwar from mindspring.com)
</STRONG></P>
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
I have a problem trying to setup Linux to access the servers at the
University of Phoenix. The servers (Microsoft IIS) require a "log on
using Secure Password Authentication" under Microsoft Outlook Express. I
understand that this requires a email and news reader to authenticate
using the WindowsNT Challenge/Response (NTCR) protocol [a really bad use
of the http protocol]. The school does have a website to get to the
email and news groups but it is timed and is very particular and seems
to like rejecting Netscape Navigator access. The UOP Tech group's pat
answer is that they only support Outlook Express under Windows, I want a
Linux answer.
</STRONG></P>
<P><STRONG>
Is there any program or daemon that I could run to allow me to
authenticate using this protocol so I could use Linux based email and
news readers? I have tried using pine, staroffice, and leafnode and
several others which are common under <A HREF="http://www.kde.org/">KDE</A>/RedHat 6.2.
</STRONG></P>
<P><STRONG>
Thanks,
</STRONG></P>
<P><STRONG>
K. Woodward
</STRONG></P>
<P>
I am using linux to try to connect to UOP now and have not found an
answer to the problem that you had did you ever find a solution that
worked if you did could you outline it for me.
</P>
<P>
Thank you,
<BR>Pat Norton
</P>
<P>
<A HREF="mailto:nortonpc@email.uophx.edu"
>nortonpc@email.uophx.edu</A>
</P>
<P>
<A HREF="mailto:nortonpc1@cvol.net"
>nortonpc1@cvol.net</A>
</P>
<!-- end 4 -->
<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>[LG 82] 2c Tips #2 completion</strong></a>
<li><A HREF="#mailbag/2"
><strong>How about Jed?</strong></a>
<li><A HREF="#mailbag/3"
><strong>Penguins, Lizards, and Pandas?</strong></a>
<li><A HREF="#mailbag/4"
><strong>Thank you!</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">[LG 82] 2c Tips #2 completion</FONT></H3>
Wed, 04 Sep 2002 16:58:19 +0700
<BR>Bill Thompson (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20mailbag%20%231%20completion">billt from samart.co.th</a>)
<P>
Adam,
</P>
<P>
The site for this Tip doesn't appear to be up any more.
Do you have an alternate source or can send me the rpm
or the source rpm?
</P>
<P>
Thanks,
</P>
<P>
Bill Thompson
</P>
<P><em>
I (the LG editor) was unable to reach that link when I was proofreading
2-Cent Tips ("connection timed out"), but I was hoping it was a temporary
error. We at LG do not have any alternate sources or RPMs. Maybe
Adam who submitted the tip does.
-- Mike</em></P>
<blockquote><font color="#000066">I usually go poking around for them on rpmfind.net if I know some file
they contain, or on freshmeat.net if I know the name of the project, in
the hopes of finding whatever upstream source tree might remain.
Sometimes I can find out why there's not an rpm anymore, but that's
pretty rare.
-- Heather</font></blockquote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="mailbag/2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">How about Jed?</FONT></H3>
Thu, 5 Sep 2002 09:34:07 +0200
<BR>Grabuñ £ukasz (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20mailbag%20%232%20Jed">l.grabun from arr.gov.pl</a>)
<P><STRONG>
First of all: LG is great! One of the best newsletters (?) I've ever read.
Easy to browse webpage, understandable language, various topics. Great, just
great.
</STRONG></P>
<P><STRONG>
There's just one thing I'm missing: there was a column for Emacs - fans, a
nmber of articles about vim, even nano was mentioned. And what about jed?
It's as powerful and customizable as emacs, but much lighter and easier to
use. Will there be a few lines about this great tool?
</STRONG></P>
<P><STRONG>
regards,
<BR>Lukasz Grabun
</STRONG></P>
<P>
We'd be happy to publish an article on jed if somebody volunteers to write
it. Would you? The Author Information at
<A HREF="../faq/author.html"
>http://www.linuxgazette.com/faq/author.html</A>
shows the desired HTML format.
</P>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="mailbag/3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Penguins, Lizards, and Pandas?</FONT></H3>
Mon, 23 Sep 2002 10:38:12 -0400 (EDT)
<BR>Virtual Sky Media Group (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20mailbag%20%233%20Windowmaker%20panda">virtualsky_sk from yahoo.ca</a>)
<P>
I'm proud to say that I've been a Linux user since
July 2002 and I've enjoyed my new found computing
freedom very much. I've also learned a lot, too.
</P>
<P>
I began my Linux experience with my purchase of
Mandrake 8.2, a great distro. for a beginner, like
myself. I also started out using <A HREF="http://www.kde.org/">KDE</A> as my desktop
manager, but have now found new liberties with the use
of Window Maker. Which brings me to my submission to
you today.
</P>
<P>
Linux itself has the wonderful Tux as its
representative. KDE has a dragon-like lizard, and
Gnome has a footprint of a gnome, I'm assuming. After
reading from the Window Maker web site, I learned that
Window Maker has chosen a Panda as it's mascot. So, I
decided to make a contribution to the line up of cute
and cuddly cartoon PR "toons" with this
drawing of Amanda, the Window Maker panda:
<BR>
<img src="misc/mail/WM_Panda2-small.png"
alt="[cute Windowmaker panda]"
HSPACE="20" VSPACE="20">
</P>
<P><em>
Oh, that's soooo cute! A panda with an attitude. <TT>/me</TT> likes.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
-- Ben</em>
</P>
<P>
Now, don't you just want to start using Window Maker?
:o)
</P>
<P><em>
Nope.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> But then, I'm an "icewm" junkie from way back.
</em></P>
<P><em>
I think I'll have to lobby Marko Macek for a mascot now.
-- Ben</em>
</P>
<P>
Keep the very informative issues of Linux Gazette
coming! I enjoy them very much.
</P>
<P>
David Bouley
</P>
<P><em>
Glad you like'em, David! Stick around; there's always more good stuff in
the works.
-- Ben</em>
</P>
<P>
An explanation sidebar might be inline about what a PNG is, why GIF,
and now JPEG, are Bad Ideas, and why Internet Exploiter 5 doesn't know
how to deal with PNG's. At least not as URLs; maybe it gets them right
as inlines...
-- jra
</P>
<P><em>
The only problem I've seen with PNG is that Netscape 4 displays a solid filled
rectangle instead of the image <EM>if</EM> the image contains any transparency.
</em></P>
<P><em>
As for JPG, I've heard conflicting information on whether any patent applies to
it, but the last I heard was that there wasn't a problem. Have you heard
differently?
-- Nike</em>
</P>
<P><em><b>
JPEG is fine. The so-called JPEG patent is bogus, and if Forgent
tries to use it, they will lose it (like BT and the hyperlink patent)
(This is from the leading <EM>defender</EM> of software patents, Greg
Aharonian: <A HREF="http://www.aful.org/wws/arc/patents/2002-07/msg00029.html"
>http://www.aful.org/wws/arc/patents/2002-07/msg00029.html</A>)
</b></em></P>
<P><em><b><DL><DT>
PNG support in browsers (inluding MSIE) is "quite good":
<DD><A HREF="http://www.libpng.org/pub/png/pngstatus.html#browsers"
>http://www.libpng.org/pub/png/pngstatus.html#browsers</A>
</DL></b></em></P>
<P><em><b>
(Linux Journal has been using PNG instead of GIF since our redesign last
year, and there have been no complaints.)
-- Don</b></em>
</P>
<blockquote><font color="#000066">And of course, Don ought to know, since he cheerfully burns all GIFs.
(<A HREF="http://www.burnallgifs.org"
>http://www.burnallgifs.org</A>) It's a good site to check on why a number
of patents out there are really quite foolish.
-- Heather</font></blockquote>
<P><em>
In any case, PNG and JPG have quite different uses. PNG is good at compressing
line art but bad at compressing things with lots of colors (e.g., photographs),
whereas for JPG it's the reverse. Whenever somebody sends a GIF to LG, I convert
it to both PNG and JPG, and take whichever one has the best compromise of small
size and color brilliance. It's not always one or always the other. Sometimes
the sizes are hugely different, as in one being four times the size of the other.
-- Mike</em></P>
<!-- end 3 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="75%" ALIGN="center">
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Thank you!</FONT></H3>
Thu, 19 Sep 2002 14:54:05 -0500
<BR>Bryan Lord (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20mailbag%20%234%20thanks%20101">blord from wlgroup.com</a>)
<P>
I read your article "Routing & Subnetting 101", and... wow! I listened to my
teacher ramble on for almost 3 hours and I didn't absorb a darn thing.
By reading your article I think I know enough to really get my hands dirty.
</P>
<P>
Thanks, Again.
<br>Bryan Lord
</P>
<!-- end 4 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GAZETTE MATTERS</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#gaz/1"
><strong>Questions to linux-questions-only@ssc.com and linux-questions-only@ssc.com</strong></a>
<li><A HREF="#gaz/2"
><strong>bridging and routing</strong></a>
<li><A HREF="#gaz/3"
><strong>(no subject)</strong></a>
<li><A HREF="#gaz/4"
><strong>Pl give solution</strong></a>
<li><A HREF="#gaz/5"
><strong>Letter of inquiry</strong></a>
<li><A HREF="#gaz/6"
><strong>ssc subscription</strong></a>
<li><A HREF="#gaz/7"
><strong>How to Ask a Question</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Questions to linux-questions-only@ssc.com and linux-questions-only@ssc.com</FONT></H3>
Wed, 4 Sep 2002 10:44:33 -0700
<BR>Heather Stern (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%231%20aliases"><em>Linux Gazette</em> Technical Editor</a>)
<P><dl><dt>
This is a reminder that although the aliases:
<dd><A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>
<DT>
and:
<DD><A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>
</DL></P>
<P><DL><DT>
work, the real address of the Linux Gazette Answer Gang is:
<DD><A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>
</DL></P>
<P>
We're working towards getting all sites that mention us to give the
correct address, and to get them to not mention us if they suggest we
cover anything that's not about computers.
</P>
<P>
Please spread the word!
</P>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">bridging and routing</FONT></H3>
Mon, 9 Sep 2002 11:43:31 -0700
<BR>Mike Orr (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%232%20anon"><em>Linux Gazette</em> Editor</a>)
<!-- sig -->
<P><STRONG><FONT COLOR="#000066"><EM>
Please do not publish my email address; I will read the Gazette for any
responses.
</EM></FONT></STRONG></P>
<P><STRONG>
Email address will not be published. It shows up in this correspondence,
but there's no public archive of this list.
</STRONG></P>
<P>
We do publish addresses for Mailbag items and 2-Cent Tips, but not for Answer
Gang questions. That's Heather's choice as the TAG Editor Gal. If I were
doing it I'd publish addresses in the Answer Gang column too, because why
should that column be different? In any case, you don't know which of the
three columns your letter might appear in. A lot of it has to do with whether
it produces one or two short replies or a long discussion.
</P>
<P>
So the only way a reader can guarantee his/her address won't be published
is to specifically ask us not to.
</P>
<P>
-- Mike
</P>
<blockquote><font color="#000066">Originally, the Answer Guy column was purely the answers of Jim, but as
it changed, The Answer Gang column is now about matters which have
pretty much been solved, or discussed to death in some fascinating way.
Therefore unless the original querent's problem remains unsolved -- a
real stumper -- there's little need to provide his or her email address,
but we do mention the name.
</font></blockquote>
<blockquote><font color="#000066">In the case of Tips other people may have useful comments, so the
address is offered.
</font></blockquote>
<blockquote><font color="#000066">Unless, of course, they'd like to be anonymous.
</font></blockquote>
<blockquote><font color="#000066">People do not get selected for Help Wanted if they wish to be anonymous.
You can't beg a few thousand readers for help that way. They just have
to have a complete and interesting enough description to tantalize one
of the Gang to answer them.
-- Heather</font></blockquote>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">(no subject)</FONT></H3>
Tue, 24 Sep 2002 07:14:02 +0530
<BR>anonymous (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%233confidential"></a>)
<!-- sig -->
<P>
[ An 8 line sig block claiming confidentiality, erased per its
instructions. ]
</P>
<P>
Must be confidential indeed; it didn't say anything but this!
</P>
<P>
This mailing list (The Linux Gazette Answer Gang, which makes its home
at <A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>) is not a confidential location. It is
a mailing list filled with a medium sized handful of Linux folk, who
expect as their main pay a bunch of warm fuzzies and the knowledge that
a really juicy answer can be published for the readers of our monthly
magazine. Opinions are likely to run rampant, conclusions may or may
not occur (we guarantee nothing) and attachments in HTML are often
ignored or grumbled about unless you're defending a foreign character
set (yes, we have translators). It's a good idea to actually dust off
your sense of humor because we definitely use ours.
</P>
<P>
If you need an answer in some business-like fashion, you'll have to
consider a consultant instead. LinuxPorts has a good list of them.
</P>
<P>
If you want an answer in a "Making Linux a Little More Fun" fashion
you'll at <EM>least</EM> need to provide us a real question, and if this
sig block of yours is automatic, a disclaimer that supercedes it and
grants publishing permission. We have examples in our "Ask The Gang"
FAQ; see <A HREF=".."
>http://www.linuxgazette.com</A> for more. Lots more
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<P>
Your HTML attachment has been sent to the shredder; it wanted a snack
and we won't be passing out candy for almost a <EM>month</EM> !
</P>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Pl give solution</FONT></H3>
Wed, 18 Sep 2002 09:57:06 +0200
<BR>Frank Rodolf (<a href="mailto:gazette@ssc.com?cc=chothmal_c@yahoo.com&subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%234%20homework">linux from rodolf.com</a>)
<BR>Question by choudhary chothmal (chothmal_c from yahoo.com)
<P>
Hi choudhary,
</P>
<P><STRONG>
Dear sir,
Pl give sol these problem
1
Write a shell script to print end of a glossary file,
in reverse order . using array (Hint use awk ,tail )
</STRONG></P>
<P><STRONG>
Q-2 Modify call command to accept more than one month?
Q-3 Write a shell script to print file names one per
line has directory showing serial number of file
</STRONG></P>
<P>
I see schools have started again...
</P>
<P>
While we're perfectly willing to help you with any questions you have
about Linux, we will NOT help you with your homework.
</P>
<P>
I am sure you will find all the info to solve the problems in the
textbook(s) your professor gave you (or had you buy). It (they) might be a very
interesting read - just try it.
</P>
<P>
Grtz,
</P>
<P>
Frank
</P>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Letter of inquiry</FONT></H3>
Thu, 19 Sep 2002 02:16:09 -0700 (PDT)
<BR>dang mangaoang (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%235%20inquiry">jomegs143 from yahoo.com</a>)
<P><STRONG>
Dear Sir,
</STRONG></P>
<P><STRONG>
I am writing this letter to inquire about your product <A HREF="http://www.redhat.com/">Red Hat</A>
Linux. I saw Red Hat Software's advertisement . . .
</STRONG></P>
<blockquote><font color="#000066">Red Hat is a company of its own; you should follow contact
information provided in the advertisement.
-- Heather</font></blockquote>
<P><em>
Try
<br><A HREF="http://www.redhat.com"
>http://www.redhat.com</A>
-- Dan Wilder
</em></P>
<P>
We don't make Linux, we just blather about it.
</P>
<P>
See
<br><A HREF="http://www.redhat.com"
>http://www.redhat.com</A> as well as
<br><A HREF="http://www.linux.org"
>http://www.linux.org</A> and probably
<br><A HREF="http://www.li.org"
>http://www.li.org</A> not to mention
<br><A HREF="http://www.tldp.org"
>http://www.tldp.org</A>
</P>
<P>
-- jra
</P>
<P><STRONG>
. . . for version 5.1 of Linux in the issue of Linux Journal.
</STRONG></P>
<blockquote><font color="#000066">That's an interesting case of time travel you have there; you've
reached the <i>Linux Gazette</i>, which is a related pubication in that we're
hosted by the same publishing company.
</font></blockquote>
<blockquote><font color="#000066">Red Hat 5.1 is quite ancient...
-- Heather</font></blockquote>
<P>
RedHat is up to 7.3 in production release, and there's a beta 7.4 out
there somewhere, I think, rotting people's cats' teeth.
-- jra
</P>
<blockquote><font color="#000066">They [Red Hat] are
mirrored in a number of countries so it should be possible to find an
instance of the 7.2 "GPL edition" disc on servers nearer to you. Beware
that downloading 650 MB can take a while, though.
-- Heather</font></blockquote>
<P><STRONG>
I was quite impressed with the capabilities
as listed in the advertisement, and I would like to learn some more
about the product. I am a student and we are studying about Linux and
this is the reason why I want to learn more about the product.
</STRONG></P>
<blockquote><font color="#000066">Running older versions of Linux for experimental purposes, or studying
what was claimed of Linux a few years ago to see how it has grown, are
both valid student projects.
-- Heather</font></blockquote>
<P><STRONG>
another thing is I want to subscribe a magazine about linux operating
system.
</STRONG></P>
<blockquote><font color="#000066">In that case you came to the right place, almost :D
</font></blockquote>
<blockquote><font color="#000066">I cheerfully direct you to the website for Linux Journal,
<A HREF="http://www.linuxjournal.com"
>http://www.linuxjournal.com</A>
where you can use a secure connection to subscribe, or find more
information about having it sent to you monthly.
</font></blockquote>
<blockquote><font color="#000066">Linux Gazette is only available as a webzine although that leads to some
unusual "subscription" models in the form of Sitescooper, debian
packages (lg-subscription), and services that can tell you when a
website changes. These features are not provided by staff of the
Gazette but rather, by volunteers elsewhere.
-- Heather</font></blockquote>
<P><STRONG>
Hope you could reply me as soon as possible.
</STRONG></P>
<P><STRONG>
Sincerely yours,
</STRONG></P>
<P><STRONG>
Dang
</STRONG></P>
<blockquote><font color="#000066">Hope you found this useful!
</font></blockquote>
<blockquote><font color="#000066">Thank you, and enjoy Linux.
-- Heather</font></blockquote>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz/6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">ssc subscription</FONT></H3>
Mon, 02 Sep 2002 09:18:37 -0700
<BR>John R. Sowden (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%20%236%20email%20subscription">jsowden from americansentry.net</a>)
<P><STRONG>
I subscribe to various linux/dos/security/pascal/xbase lists, so knowing
what "ssc" is is somewhat difficult. Once a month you send me a reminder
to make sure I still want to subscribe. Please consider describing the
various subscriptions, including other ones that might be of interest.
</STRONG></P>
<P>
SSC is Specialized Systems Consultants, Inc, the company that
publishes Linux Gazette, the print magazine Linux Journal
(<A HREF="http://www.linuxjournal.com"
>http://www.linuxjournal.com</A>), and books and reference cards
about Linux/Unix. The message you get once a month is from our
mailing-list server, reminding you how to unsubscribe or change
your settings. Other mailing lists we run are are at
<A HREF="http://www.ssc.com/mailman/listinfo"
>http://www.ssc.com/mailman/listinfo</A>
and in the top right corner of <A HREF="http://www.linuxjournal.com"
>http://www.linuxjournal.com</A> .
A few are discussion lists, but most are announcement-only lists
(newsletters).
</P>
<P>
-- Mike
</P>
<!-- end 6 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="75%" ALIGN="center">
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">How to Ask a Question</FONT></H3>
Fri, 30 Aug 2002 09:48:01 -0400 (EDT)
<BR>Naresh (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%20gazette%20matters%207%23how%20to%20ask">nganta from myrealbox.com</a>)
<P><STRONG>
How can I ask a question to the answer gang?
</STRONG></P>
<P><STRONG>
Naresh
</STRONG></P>
<blockquote><font color="#000066">Send your note to the address:
<A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>
</font></blockquote>
<blockquote><font color="#000066">Make your subject a useful one.
</font></blockquote>
<blockquote><font color="#000066">Make your description of what you're trying to do, and
what is going wrong, sufficiently detailed and interesting
that some of the gang can answer it.
</font></blockquote>
<blockquote><font color="#000066">We might answer in a big burst, or after a long time, or
not at all. A small portion of the "not at all" get pubbed
as Help Wanted and readers from all over the world may give
those a shot - but for that the description does have to be
pretty clear.
</font></blockquote>
<blockquote><font color="#000066">We've more details in the Linux Gazette FAQs.
</font></blockquote>
<blockquote><font color="#000066">Good luck!
-- Heather</font></blockquote>
<!-- end 7 -->
<P> <hr> </p>
<!-- *** 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 © 2002
<br>Copying license <A HREF="http://www.linuxgazette.com/copying.html">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">More 2-Cent Tips</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/.html"></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>Canon BJC 250</strong></a>
<li><A HREF="#tips/2"
><strong>sendmail and Courier</strong></a>
<li><A HREF="#tips/3"
><strong>Postfix hates Outlook</strong></a>
<li><A HREF="#tips/4"
><strong>ping with ipmasq</strong></a>
<li><A HREF="#tips/5"
><strong>multilink</strong></a>
<li><A HREF="#tips/6"
><strong>power management</strong></a>
<li><A HREF="#tips/7"
><strong>Adding Win98 to a second HD</strong></a>
<li><A HREF="#tips/8"
></a>MDaemon Warning - Virus Found --or--
<br><A HREF="#tips/8"
><strong>If You're Not Part of the Solution, You're Part of the Precipitate</strong></a>
<li><A HREF="#tips/9"
><strong>autocad on linux</strong></a>
<li><A HREF="#tips/10"
><strong>ringing a bell when compilation is finished</strong></a>
<li><A HREF="#tips/11"
></a>RedHat 7.3 on Dell Inspiron 8100 Laptop --or--
<br><A HREF="#tips/11"
><strong>Configuring the GUI, the GUI way</strong></a>
<li><A HREF="#tips/12"
><strong>Diald problems again</strong></a>
<li><A HREF="#tips/13"
><strong>dual boot with XP</strong></a>
<li><A HREF="#tips/14"
><strong>Hiding SAMBA shares</strong></a>
<li><A HREF="#tips/15"
><strong>recompiling the kernel with a X11 keymap</strong></a>
<li><A HREF="#tips/16"
><strong>Linux multilanguage</strong></a>
<li><A HREF="#tips/17"
><strong>Re: exe to iso files</strong></a>
<li><I>Linux Journal's</I> Weekly News Notes
<a href="#tips/lj">Tech Tips</a>
<ul>
<LI>Keeping NAT connections alive
<li><A HREF="http://noframes.linuxjournal.com/subscribe/lja-sub.html"
>subscribe</A> to LJWNN
</ul>
<!-- 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">Canon BJC 250</FONT></H3>
Sun, 15 Sep 2002 12:08:39 -0700
<BR>dfox (<a href="mailto:linux-questions-only@ssc.com?cc=dfox@m206-157.dsl.tsoft.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%231">dfox from m206-157.dsl.tsoft.com</a>)
<!-- sig -->
<!-- sig -->
<P>
Regarding Bessie's problem in the sept. 2002 issue of LG (Help Wanted
#1):
<A HREF="../issue82/lg_mail.html#wanted/1"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/1</A>
</P>
<P>
I also have one of these printers, and it has worked nicely, at least for
monochrome. I have done limited color testing - early on, it would print in
color if I selected a different printer driver at that time (bj 200 is only
capable of doing monochrome). Colors were somewhat washed out, and i never
got around to really testing things like gamma correction. Besides, that was
some time ago, before cups et al.
</P>
<P>
I sent bessie an email asking if she were using cups. There is a little
difference in the revs of cups at least with Mandrake 8.1 which is what I'm
currently running. If I use printerdrake, i am able to select a bj200 driver,
which is perfect for doing monochrome printing, and the test page prints just
fine. If i use another printer configuration tool, there is no corresponding
entry for my printer. However, selecting a similar model driver is doable if
the exact model is not listed -- and seemingly in (how?) recent cups it is
not. And seemingly, there are different printer databases. (i built cups
1.1.10 I think sometime ago from source).
</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">sendmail and Courier</FONT></H3>
Thu, 5 Sep 2002 07:45:51 -0700
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com,&cc=dan@ssc.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%232">dan from ssc.com</a>)
<!-- sig -->
<!-- sig -->
<blockquote><font color="#000066">This is in regards to September's help wanted #2:
<A HREF="../issue82/lg_mail.html#wanted/2"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/2</A>
-- Heather</font></blockquote>
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
First, you'll have a problem using sendmail and maildir, since, sendmail
does not support maildir, only qmail and postfix support this. If you've a
</STRONG></P>
<P>
However, consider using procmail as the local delivery agent. I believe
sendmail will support this, though I should mention I haven't used
sendmail for quite a few years. Anyway, procmail supports maildir
delivery.
</P>
<P>
-- Dan Wilder
</P>
<blockquote><font color="#000066">A different reader seemed to believe that sendmail cannot, only postfix
and qmail -- but yet another reader chimed in that it's the default on
his distro for sendmail to use procmail as its local delivery, after
which it's of course no problem. Sadly they had confidentiality notes
on their mails, so no juicy details. Sorry.
-- Heather</font></blockquote>
<!-- 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">Postfix hates Outlook</FONT></H3>
Sat, 07 Sep 2002 01:33:43 -0500
<BR>Dustin Puryear (<a href="mailto:linux-questions-only@ssc.com?cc=dustin@puryear-it.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%233">dustin from puryear-it.com</a>)
<!-- sig -->
<!-- sig -->
<blockquote><font color="#000066">This is for help wanted #3 in September's issue:
<A HREF="../issue82/lg_mail.html#wanted/3"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/3</A>
-- Heather</font></blockquote>
<P>
Determine if the mail server is trying to perform reverse resolution for
your IP address. This can lead to odd time-out problems with various
services. A quick test is to add a mapping for your IP address to the mail
server's <TT>/etc/hosts</TT> and see if the problem goes away.
</P>
<P>
Regards, Dustin
</P>
<HR width="10%" align="center"><P>
From: SnT_BaBS <<A HREF="mailto:babs@sntteam.org"
>babs@sntteam.org</A>>
</P>
<P>
I think that u can't access root account with pop3 server for security reason ...
</P>
<P>
Maybe i'm wrong ... but it can be ...
</P>
<P>
Regards
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<blockquote><font color="#000066">Babs here has to at least be partly right. Postfix doesn't speak POP3
-- it speaks SMTP! Common pop3 servers include qpopper, solidpop,
or ipop3d.
-- Heather</font></blockquote>
<!-- 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">ping with ipmasq</FONT></H3>
Mon, 02 Sep 2002 11:12:44 -0700
<BR>David Ranch (<a href="mailto:linux-questions-only@ssc.com?cc=dranch@trinnet.net&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%234">dranch from trinnet.net</a>)
<!-- sig -->
<!-- sig -->
<blockquote><font color="#000066">This is in reply to the September 2002 help wanted #4:
<A HREF="../issue82/lg_mail.html#wanted/4"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/4</A>
-- Heather</font></blockquote>
<P>
Hello Matt and LG,
</P>
<P>
My name is David Ranch and I am the author of the IP Masquerade HOWTO
as well as the TrinityOS documentation project.
</P>
<P>
Anyway, regarding your eth0/eth1 issue, have you checked the DUPLEX
setting on the Ethernet switch? The tell-tale signature of this
is the "carrier" transitions in your "ifconfig' output. Since you
have a switch and not a dual-speed hub, make sure it's set to FULL
DUPLEX for that port connected to eth1. You also might want to
force the speed on that port to 100 as well. Ethernet auto-negotiation
has always been a problem.
</P>
<P>
If that doesn't fix things, do you have a different Ethernet card
to try? Personally, I think all LNX* network cards are pretty crappy
though they do work. I've had great luck with any Tulip-based network
card (Netgear FA310 [not the 311, etc]), Intel EtherExpress, etc.
</P>
<P>
Ps. The comment from Heather at the bottom of
</P>
<P>
<A HREF="../issue82/lg_mail.html#wanted/4"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/4</A>
</P>
<P>
is plain wrong. The IPMASQ code has supported ICMP MASQ since
the Linus kernel 1.2 days (possibly earlier).
</P>
<P>
--David
</P>
<blockquote><font color="#000066">In fact, I did see some references to it behaving correctly - later -
but never have figured out why it wouldn't work in real life while I was
dealing with it. Which means that while it's surely supported, if I'm
in a situation on a 2.2.x kernel where ICMP is not working past NAT, I
have no idea how to convince it to start working.
</font></blockquote>
<blockquote><font color="#000066">Oh well, we all have our specialties; I'll go back to tweaking X
displays and tuning up laptops, now.
</font></blockquote>
<blockquote><font color="#000066">I absolutely agree that the Tulip chipset is the good stuff. Never
leave home without it.
-- Heather</font></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">multilink</FONT></H3>
Mon, 02 Sep 2002 13:19:44 -0700
<BR>David A. Ranch (<a href="mailto:linux-questions-only@ssc.com?cc=dranch@trinnet.net&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%235">dranch from trinnet.net</a>)
<!-- sig -->
<!-- sig -->
<P>
Hello John, LG,
</P>
<P>
My name is David Ranch and I am the author of the
IP Masqeurade HOWTO as well as the TrinityOS
guide.
</P>
<P>
Anyway, I saw your LG question:
</P>
<P><BLOCKQuote>
<A HREF="../issue82/lg_mail.html#wanted/5"
>http://www.linuxgazette.com/issue82/lg_mail.html#wanted/5</A>
</BLOCKQuote></P>
<P>
First off, one of the posters mention that EQL is the
solution. This is incorrect as EQL is rarely
supported any other terminal servers than possibly
older Livingston Portmaster. Like you mentioned,
you want MultiLink PPP.
</P>
<blockquote><font color="#000066">Oops, I thought they were one and the same. Thanks for pointing out my
misconception.
-- John Karns
-- Heather</font></blockquote>
<P>
Before you start looking into setting this up,
you should call your ISP and see if they allow
ML-PPP? Many don't and the few that do usually
only support it for ISDN users.
</P>
<blockquote><font color="#000066">Good point, one which I forgot to make.
-- John
-- Heather</font></blockquote>
<P>
Anyway, here are some URLs that should help you
in your MLPPP quest if your ISP does infact support
ML-PPP for dialup users.
</P>
<P>
<A HREF="http://www.google.com/search?hl=en&"
>http://www.google.com/search?hl=en&</A>;ie=UTF-8&oe=UTF-8&q=setting+up+multilink+ppp+on+linux&btnG=Google+Search
</P>
<P>
--David
</P>
<blockquote><font color="#000066">And thanks for the URL's.
-- John
-- Heather</font></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">power management</FONT></H3>
Tue, 17 Sep 2002 08:47:00 +0000
<BR>sgupta (<a href="mailto:linux-questions-only@ssc.com?cc=sgupta@pressroom.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%236">sgupta from pressroom.com</a>)
<!-- sig -->
<!-- sig -->
<P>
Hello.
</P>
<P>
My new PC running Linux has the new Intel motherboard that supports only
ACPI, not APM. I understand from the vendor that Linux does not support
ACPI as yet. Hence, I can't put my machine in stand-by or sleep mode.
The only solutions are to keep it running (room temperature gets high
during day time ~80 degrees) or power off.
</P>
<P>
Is Linux planning to support ACPI any time soon? Are there other
alternatives to power off? After all, one of the best advantages of Linux
is that you don't need to boot it every time you want to use the machine.
It can run for a long time without crashing.
</P>
<P>
Thanks.
<BR>SG
</P>
<BLOCKQUOTE>
[Ashwin N]
Linux <EM>has</EM> support for ACPI in 2.4.x kernels. I suppose it wasn't there
in the older kernels.
</BLOCKQUOTE>
<BLOCKQUOTE>
You'll need to install/upgrade your Linux distribution/kernel.
</BLOCKQUOTE>
<P><STRONG>
Hello.
Thanks for the prompt reply. I guess the vendor knows less about Linux than I
do. He installed RH 7.3 with kernel 2.4.18-3 on the PC, which as you say supports
ACPI. Unfortunately, it is not activated. In the directory <TT>/etc/rc.d/init.d</TT> I
can find apmd but not acpid. Do I have to reconfigure/recompile the kernel to get it
working. I checked up all the Linux How-Tos and FAQs and can't find any information
about getting ACPI to work.
</STRONG></P>
<P><STRONG>
Thanks.
<BR>SG
</STRONG></P>
<BLOCKQUOTE>
[Rick Moen]
Googling found this unofficial HOWTO:
<A HREF="http://www.columbia.edu/~ariel/acpi/acpi_howto.txt"
>http://www.columbia.edu/~ariel/acpi/acpi_howto.txt</A>
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
It's linked from this summary page:
<DD><A HREF="http://mobilix.org/apm_linux.html"
>http://mobilix.org/apm_linux.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
And perhaps you've already come across the ACPI 4 Linux Project:
<DD><A HREF="http://acpi.sourceforge.net"
>http://acpi.sourceforge.net</A>
</DL></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">Adding Win98 to a second HD</FONT></H3>
Fri, 13 Sep 2002 21:57:46 +0300
<BR>Nigel Ridley (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com&cc=nigel@i-amfaithweb.net&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%237">nigel from i-amfaithweb.net</a>)
<!-- sig -->
<!-- sig -->
<P>
O.K. I know this is a lame one but I don't want to mess up!
</P>
<P>
My children are now of the age that they are fighting over whose turn it
is on the (old) computer - it has Windows 95 and (unfortunately) they like
some of the silly games that children love - namely Mario (no I haven't
found one to run under Linux).
</P>
<P>
So now I am under pressure to use my Linux box as a second Windows machine
to satisfy the children (no funds for even a second hand 'puter).
</P>
<P>
On my Linux box I have two hd's, one 20 GB - the main one and a second one
of 6 GB. I want to put Windows 98 on the second hd.
How do I make sure that Windows uses the second hd and not wipe out my
Linux one?
Also how do I rescue the mbr from Windows after the install? - I'm using
Mandrake 8.2 with Lilo.
</P>
<P>
Nigel Ridley
</P>
<BLOCKQUOTE>
[JimD]
Take out the Linux drive. Make it a slave. Install the smaller
drive (as standalone at first). Install Win '9x. Change the smaller
drive to be the master (if necessary) and re-install the big drive.
(Leave a small non-DOS partition near the front of it if you can).
</BLOCKQUOTE>
<BLOCKQUOTE>
Now boot from a rescue CD or floppy specifying root=/dev/hdbX (as
appropriate) and add the appropriate entries for an "other" stanza
to your <TT>/etc/lilo.conf.</TT> Then run <TT>/sbin/lilo</TT> to install a new MBR
on the little drive.
</BLOCKQUOTE>
<BLOCKQUOTE>
(The MBR on the big drive will be preserved, irrelevant until it's
put back into a system as a master or standalone).
</BLOCKQUOTE>
<BLOCKQUOTE>
You might not need to use that small non-DOS partition that you
created --- but I'd reserve it anyway (if the Win '9x installer will
let you). You can boot from a Linux rescue disc or diskette to run
Linux fdisk and mark the small partition as OS/2 or with some sort
of hibernation volume type --- anything but Linux, since I hear that
newer Microsoft releases with eradicate Linux partitions with extreme
prejudice
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> .
</BLOCKQUOTE>
<BLOCKQUOTE>
There are undoubtedly a multitude of alternative approaches. You
could use GRUB and it's notion of "hidden" drives (to swap the
identities of the two drives during the boot process, in memory).
You might be able to install it (standalone) and then make it the
slave (LILO) but I think MS Windows would get unhappy about not having
a C drive.
</BLOCKQUOTE>
<BLOCKQUOTE>
[John K.]
If one is resigned to using sharing the system with the rogue OS, then the
above is another good reason to keep MSW straight-jacketed in an
environment such as a virtual machine where it can't do any damage to
things it has no business touching.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
I think John is thrying to suggest that you could use VMWare (or
Plex86 if you're daring, or <A HREF="http://www.winehq.com/">WINE</A>) to run Win '9x as a process under
Linux.
</BLOCKQUOTE>
<BLOCKQUOTE>
This works pretty well --- but has a few downsides that might
apply to you're needs:
</BLOCKQUOTE>
<blockQuote><ol>
<LI>VMWare needs lots of memory and plenty of CPU horsepower.
If you machine is older (less than about a 650Mhz Pentium II
or so) or doesn't have lots of memory (128Mb minimum, 512Mb
won't be wasted) then you may find this approach acceptable.
<LI>You might have relatively limited support for sound, USB
joysticks, etc. You said you're kids are fighting over games
(IIRC) and Windows' rehosted under a virtual machine and
running a game is likely to be unpleasantly slow.
<LI>VMWare is pretty good as a product. However it's not free
-- purchasing it will more than double your cost over buying
the requisite copy of Win '98. Plex86 (FreeMWare) is free but
many not be up to the task of running the software you need nor
supporting your hardware. It will certainly be more work (learning
curve) on your part.
<LI>You're kids may have to learn a little Linux/UNIX in order to get
the VMWare (or other) virtual machine running and booted, possibly
switching it to full screen mode and sometimes (perhaps) get back
to it or out of it and back to the Linux host under various
possible situations. You might make this all pretty transparent
(they log in via xdm/gdm/kdm etc, it starts the VM session and
then the just choose shutdown and they log back out).
</ol></blockQuote>
<BLOCKQUOTE>
However, it might be just what you're looking for. Take a look at
these websites:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
VMWare:
<DD><A HREF="http://www.vmware.com"
>http://www.vmware.com</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
WINE:
<DD><A HREF="http://www.winehq.com"
>http://www.winehq.com</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
CodeWeavers (WINE related):
<DD><A HREF="http://www.codeweavers.com"
>http://www.codeweavers.com</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
TransGaming (WINEX):
<DD><A HREF="http://www.transgaming.com"
>http://www.transgaming.com</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Plex86 (FreeMWare):
<DD><A HREF="http://www.plex86.org"
>http://www.plex86.org</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
[Heather]
They might enjoy TuxRacer, which I've actually seen in stores. Linux
can also emulate Nintendos, Game Boys, and some other gaming systems --
you have lots of options.
</BLOCKQUOTE>
<!-- 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">If You're Not Part of the Solution, You're Part of the Precipitate</FONT></H3>
Thu, 29 Aug 2002 16:54:14 -0700
<BR>Rick Moen (<a href="mailto:linux-questions-only@ssc.com?cc=dan@ssc.com&cc=rick@linuxmafia.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%238">the <em>LG</em> Answer Gang</a>)
<!-- ::
If You're Not Part of the Solution, You're Part of the Precipitate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P>
Quoting Dan Wilder:
</P>
<P><STRONG><BLOCKQuote>
Another spate of Klez worm reports to the victim, whose email
address is forged in the "From: " header of the virus-bearing mail.
</BLOCKQuote></STRONG></P>
<P>
I've started letting people whose autoresponders send me these
misdirected advisories that they have one day to turn it off or disable
it, after which they'll be permanently killfiled after the next offence.
</P>
<P>
Dear readers: If you don't know how to (or buy) an autoresponder that
does <EM>competent</EM> SMTP header analysis, so you're <EM>sure</EM> it's sending
virus advisories to the correct party, then you honestly have no
business running one, and will end up causing large numbers of people to
classify you as, in effect, a spammer and to act accordingly.
</P>
<P>
Trust me, you don't want to put yourself in that category -- and
nobody's going to care about your protestations of meaning well.
</P>
<!-- sig -->
<!-- sig -->
<!-- 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">autocad on linux</FONT></H3>
Sat, 31 Aug 2002 13:06:04 -0500
<BR>Richard Brown (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com&cc=rtbrown@sbcglobal.net&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%239">rtbrown from sbcglobal.net</a>)
<!-- sig -->
<!-- sig -->
<P>
Saw your not yet. I am a mechanical engineer. I run autocad daily on linux
using vmware. (Running <A HREF="http://www.suse.com/">SuSE</A> 8.0 or 7.3, AMD 1.4 with 768 Mg) Works
beautifully. Frequently I had 10 or 15 sessions of autocad running at the
same time. Never a problem. Nice also when want to reload or update as
from 7.3 to 8.0 simply copy the back the windows 2000 file. To me it is the
preferrable way to run autocad.
</P>
<P>
-richard
</P>
<!-- end 9 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips/10"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">ringing a bell when compilation is finished</FONT></H3>
Tue, 24 Sep 2002 11:19:14 -0400
<BR>Allan Peda (<a href="mailto:linux-questions-only@ssc.com?cc=pedaa@rockefeller.edu&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2310">pedaa from rockefeller.edu</a>)
<!-- sig -->
<!-- sig -->
<P>
Hi:
</P>
<P><BLOCKQuote>
I wanted to share a little bash function I put together to check for the
status code returned by a process (typically "make").
After using IDEs which generate audio feedback after successful
compilation, I realized that this could be done by a bash function,
which I call "ok".
</BLOCKQuote></P>
<P>
I typically run the function right after a long build like this:
</P>
<blockquote><code><font color="#000033"><br>make -f Makefile ; ok
</font></code></blockquote>
<P>
It then returns a pleasant note if all went well, and something less
pleasant if not. Here is the source:
</P>
<blockquote><pre>[zorro@box84 build]$ cat /etc/profile.d/check_return_value.sh
#!/bin/sh
ok() {
if [ $? -eq 0 ]; then
play /usr/share/sounds/chord.au
echo " SUCCESS "
else
play /usr/share/sounds/warning.wav
echo " *ERROR* "
fi
}
</pre></blockquote>
<P>
Works every time (so far).
</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">Configuring the GUI, the GUI way</FONT></H3>
Sat, 24 Aug 2002 15:23:18 -0400
<BR>Benjamin A. Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=star@starshine.org&cc=ben@callahans.org&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2311">ben from callahans.org</a>)
<BR>Question by Heather Stern (<a href="mailto:linux-questions-only@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2311">star@starshine.org</a>)
<!-- ::
Configuring the GUI, the GUI way
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P>
Heather Stern wrote:
</P>
<P><BLOCKQuote>
(In response to q querent having trouble with mice)
</BLOCKQuote></P>
<P>
The section you are looking for in your <TT>/etc/X11/XF86Config-4</TT> file
(well, it might be in just plain <TT>/etc</TT>, but anyway) is "Pointer" for
the mice declarations themselves and "ServerLayout" for the list of
gadgets it will honor.
</P>
<BLOCKQUOTE>
[Ben]
You could also use "<tt>xf86cfg</tt>" if you like graphical tools. I've found
that it takes a little getting used to, but is well done, and - once you
understand the basic idea behind the layout - nicely intuitive.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Heather]
Ben presumes you use <A HREF="http://www.debian.org/">Debian</A>. If you use RedHat, you'd want
"<tt>Xconfigurator</tt>". If you use <A HREF="http://www.suse.com/">SuSE</A>, the correct beastie is "<tt>SaX</tt>" and
can also be found in the YaST menus.
</BLOCKQUOTE>
<BLOCKQUOTE>
On older distros there was a TCL/tk app called "<tt>XF86Setup</tt>" but it does
nothing to help guess your video card or monitor characteristics. If
you need this, a brief glance at the results of "<tt>lspci</tt>" is worth your
while, and check your notes about what the maximum resolution is for your
monitor, <EM>before</EM> you run the app. It's not very happy when you switch
away from its task and back again.
</BLOCKQUOTE>
<BLOCKQUOTE>
The XF86Setup program, at least, has keyboard commands for everything,
so it will work that way until you finally pick the right mouse protocol
and can start clicking on things.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you're afraid of jumping to graphical mode until you've got something
like a useful config file created, "<tt>xf86config</tt>" is a totally text mode
program, which asks you questions from the database of X gadgetry.
But do make sure that it creates an XFree86 version 4.x file, and not a
version 3.x file ... they are very different. The section
"ServerLayout" mentioned above didn't exist in version 3.
</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">Diald problems again</FONT></H3>
Sun, 1 Sep 2002 09:08:59 +0100
<BR>Neil Youngman (<a href="mailto:linux-questions-only@ssc.com?cc=n.youngman@ntlworld.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2312">n.youngman from ntlworld.com</a>)
<!-- sig -->
<P>
I've got <A HREF="http://www.debian.org/">Debian</A> 3.0 almost set up to my liking, but one thing I can't get to
work is diald.
</P>
<P>
I installed Debian from scratch and pppd configuration was quite easy. "pon
ntlworld" works, similarly kppp only required me to change auth to noauth in
ppp.options and it worked. Diald OTOH has me puzzled.
</P>
<P>
Debian 3.0 has a completely new diald configuration. All the stuff that used
to appear in <TT>/etc/diald</TT> has gone. The only configuration file it uses seems
to be in <TT>/var/cache.</TT>
</P>
<P>
"ps aux" shows that diald starts up OK. "route" shows that it has set up sl0
as the default interface, but when I try to access anything on the internet I
get an immediate DNS lookup failure. There are none of the usual messages in
<TT>/var/log/messages</TT> indicating that it's trying to dial out and do a DNS lookup.
</P>
<P>
What have I tried?
</P>
<blockQuote><ul>
<LI>I've reconfigured it half a dozen times.
<LI>I've tried "grep diald /var/log/*"
<LI>I've copied my old /etc/diald from potato and selected "old-config" in
"dpkg-reconfigure diald".
<LI>I've copied the dialup rules from old standard.filters into /etc/diald.options
<LI>I've read everything I could find about the new configuration in
/usr/share/doc/diald
<LI>I've google searched for "debian woody diald problem"
<LI>I've searched the debian-user archives
</ul></blockQuote>
<P>
Now I'm stumped. I could throw away the new <TT>/etc/init.d/diald</TT> script and
import the old one potato, together with all the rest of the configuration
for potato, but even if that works, I would prefer not to rely on an
"obsolete" configuration.
</P>
<HR width="10%" align="center">
<blockquote><font color="#000066">But, about a week later, Neil solved it...
-- Heather</font></blockquote>
<P>
I've got this working. It still doesn't work with the Debian 3.0
configuration, but I noticed that one difference from 2.2 was that there was
no named running on 3.0. I installed bind and this together with the 2.2
configuration seems to have got it working.
</P>
<P>
Neil
</P>
<blockquote><font color="#000066">I know that a few apps want to look up the local machine by hostname; I
usually deal with this by adding /etc/hosts entries. But there are a
handful of other advantages to using a local caching name daemon. If
you need the cache to persist through reboots (bad power lines, maybe?)
consider pdnsd.
-- Heather</font></blockquote>
<!-- 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">dual boot with XP</FONT></H3>
Tue, 24 Sep 2002 01:45:27 -0700
<BR>Heather Stern (<a href="mailto:linux-questions-only@ssc.com?cc=debojitacharya@yahoo.com&cc=star@starshine.org&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2313"><em>Linux Gazette</em> Technical Editor</a>)
<BR>Question by debojit acharya (<a href="mailto:linux-questions-only@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2313">debojitacharya@yahoo.com</a>)
<!-- sig -->
<!-- sig -->
<P><STRONG>
HalloMy name is Debojit Acharya and i am from india. It will be highly
apperciated if you kindly answer the questions furnished below :-1. I
have a 10 GB hard disk with Win 98 installed on it. Now i want to Install
Win XP and <A HREF="http://www.redhat.com/">Red Hat</A> Linux 7.2 on to a new 80 GB hard drive.
</STRONG></P>
<P>
I have seen this succeed; it depends a little bit on whether your BIOS
likes such large drives, but once you can get the OS' to see them they
deal with the rest of the details pretty well.
</P>
<P><STRONG>
I want to have
multibooting feature with Win 98 (on the old 10GB HDD), Win XP and Linux
(on the new 80 GB HDD) as OSs.
</STRONG></P>
<P>
I don't know if mswin will let you boot XP from a second drive.
</P>
<P>
The easiest way by far for Linux, would be to have <TT>LOADLIN.EXE</TT> and a copy
of your favored linux kernel sitting on the old win98 C: ... then just
offer Linux as one of the mswin boot menu choices.
</P>
<P>
A floppy would work (for Linux at least; possibly for winxp but don't
believe <EM>me</EM> ... check their knowledgebase).
</P>
<P><STRONG>
How to go about it? 2. I had Mandrake Linux 8.2 installed on one of
old HDD's partitions. Later i had tried to delete the partition by
booting from the Mandrake bootable CD. Though the partition got
deleted but had not been uninstalled properly because even now,
at the system startup screen, the default OS is shown as Linux with
Win 98 as the second choice. But after logging into Linux it gets
hanged.
</STRONG></P>
<P>
You still have the old LILO master boot record from the time when you
had Mandrake on <TT>/dev/hda</TT>, however since Mandrake itself ... or more
correctly speaking, that kernel ... is no longer there, the menu option
goes to an explicit location on disk -- which no longer has a kernel!
</P>
<P>
If you store at least one Linux kernel on your <TT>/dev/hda</TT> drive -- for
example, in C:\LINUX -- then you will be able to install a fresh LILO
boot record which points at it, and knows about you wanting to mount
a <TT>/dev/hdbN</TT> partition as your root volume when you select Linux. You
must re-run <TT>/sbin/lilo</TT>, after editing <TT>/etc/lilo.conf</TT> to meet your
new setup. Unfortunately, the kernel and bootloader really do have
to be on the same disk.
</P>
<P>
If you switch to GRUB a different story follows, but it's still probably
a good idea to keep a kernel on your first hard drive.
</P>
<P><STRONG>
Pls help me get out of this.
<br>Thanks. Bye,Debojit.
</STRONG></P>
<!-- sig -->
<!-- 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">Hiding SAMBA shares</FONT></H3>
Tue, 27 Aug 2002 12:59:52 -0700
<BR>CHADWICK (<a href="mailto:linux-questions-only@ssc.com?cc=chadwick@crosslink.net&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2314">chadwick from crosslink.net</a>)
<!-- sig -->
<!-- sig -->
<P>
Take a look at this link it may help:
</P>
<P><BLOCKQuote>
<A HREF="http://www.oreilly.com/catalog/samba/chapter/ch05.html"
>http://www.oreilly.com/catalog/samba/chapter/ch05.html</A>
</BLOCKQuote></P>
<P>
Look down the page to the section on Preventing Browsing (5.1.1)
</P>
<P>
O'Reilly's books are really great references for technical materials.
</P>
<P>
Hope this helps.
</P>
<!-- end 14 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips/15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">recompiling the kernel with a X11 keymap</FONT></H3>
Sat, 21 Sep 2002 15:05:39 -0700
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=&cc=dan@ssc.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2315">dan from ssc.com</a>)
<BR>Question by hrdo (<a href="mailto:linux-questions-only@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2315"></a>)
<!-- sig -->
<P><STRONG>
Hello Answers Gang,
</STRONG></P>
<P><STRONG>
Is there a way to recompile the kernel so as to get
the X11 keymap in the console?
</STRONG></P>
<P>
See
</P>
<blockquote><code><font color="#000033"><br>linux/drivers/char/defkeymap.c
<br>linux/drivers/char/consolemap.c
</font></code></blockquote>
<P>
paying special attention to the comments at the beginning of
defkeymap.c
</P>
<P>
However, it is not necessary to recompile the kernel. Your
initialization scripts (in <TT>/etc/rc.d</TT>, <TT>/etc/rc.d/init.d</TT>, or <TT>/etc/init.d</TT>
depending on your distribution) very likely have a call to "loadkeys"
someplace in them. This loads a keymap at boot time. If not, you can
easily add such. See
</P>
<blockquote><code><font color="#000033"><br>man loadkeys
</font></code></blockquote>
<!-- 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">Linux multilanguage</FONT></H3>
Tue, 3 Sep 2002 12:27:00 -0500
<BR>Dan Wilder, Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=Jeffrey_Kwiatkowski@baylor.edu&cc=linux-questions-only@ssc.com&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2316">tag from ssc.com</a>)
<BR>Question by Jeff Kwiatkowski (<a href="mailto:linux-questions-only@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2316">Jeffrey_Kwiatkowski@baylor.edu</a>)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Hey Jim,
</STRONG></P>
<P><STRONG>
I was reading over some of your responses to people's problems and
it seems you are pretty knowledgable of the linux os.
</STRONG></P>
<BLOCKQUOTE>
[Ben]
These days, Jim sits by the fire in his slippers and points with his
pipe to stuff he wants done... or something like that.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> The Answer Guy
is now The Answer Gang, and we all share the load.
</BLOCKQUOTE>
<blockquote><font color="#000066">With quite a shell collection on the mantelpiece, I'd add. (Jim is our
resident shell-script expert. He has no problem constructing shell
pipelines several apps deep.)
-- Heather</font></blockquote>
<BLOCKQUOTE>
I was wondering
if you could point me in the correct direction with an issue i am
facing. I am looking to write a C program that will use some sort of
API call to detect what language is installed on a linux box and then
launch a correct web page. Does linux have an API? How do you find out
these environment variables? I have been researching for hours and have
come up empty. Any help would be very appreciated.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Dan]
No doubt Jim or somebody else has more info, but for starters,
try
</BLOCKQUOTE>
<blockquote><code><font color="#000033"><br> apropos locale
</font></code></blockquote>
<BLOCKQUOTE>
and the related manpages, for example
</BLOCKQUOTE>
<blockquote><code><font color="#000033"><br> man 7 locale
</font></code></blockquote>
<BLOCKQUOTE>
A system's locale is set during installation, and controls
among other things the multilanguage support built into many
GNU programs using the "gettext" utilities. See also
</BLOCKQUOTE>
<blockquote><code><font color="#000033"><br> man gettext
</font></code></blockquote>
<BLOCKQUOTE>
[Ben]
Take a look at the LANG variable. It's somewhat odd (e.g., the default
value for English is 'C' (???))
</BLOCKQUOTE>
<BLOCKQUOTE>
[Heather]
I think the default <EM>value</EM> is 'C' and if you have a basically English
distro that's the language you'll, ahem, C. You can specify one or
another of the English variants but I've seen it cause some things to
act weird - I assume the exact same weirdness they'd offer if I picked
an international variant they dunno how to handle.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Ben]
...but mostly it follows the ISO3166
standard for naming, e.g. "de", "fr", "kr", etc. It's also far from
certain that everyone will have it set on their system. For example, I
read a lot of Russian stuff, but leave my LANG at the default setting
and execute specific programs with a local LANG definition:
</BLOCKQUOTE>
<blockquote><pre>LANG=ru_RU rxvt -n Muttley -e mutt -y
</pre></blockquote>
<BLOCKQUOTE>
In my opinion, though, LANG is as close as you'll come to what you're
looking for as is possible in the wild wooly world of Unix.
</BLOCKQUOTE>
<!-- end 16 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips/17"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Re: exe to iso files</FONT></H3>
Tue, 27 Aug 2002 00:17:37 -0700
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=jra@baylink.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2317">the <em>LG</em> Answer Guy</a>)
<BR>Question by Jay R. Ashworth (<a href="mailto:linux-questions-only@ssc.com?subject=%20Re%3A%20%5BLG%2083%5D%202c%20Tips%20%2317">jra@baylink.com</a>)
<!-- sig -->
<!-- sig -->
<blockquote><font color="#000066">And if you're trying to write a Linux or otherwise generated ISO under
Windows, you can see "Best of ISO Burning Under Windows" - Issue 68,
11th TAG article:
<A HREF="../issue68/tag/11.html"
>http://www.linuxgazette.com/issue68/tag/11.html</A>
-- Heather</font></blockquote>
<P><STRONG>
Interestingly enough, I discovered, apparently El Torito bootability is
a feature of the image -- I burned those Linux BBC's from a bare ISO,
no command switches to tell the Windows burner to make it bootable, and
it Just Worked.
</STRONG></P>
<P><STRONG>
I hadn't realized that it was (in Linux terms) mkisofs, not cdrecord,
that did that work.
</STRONG></P>
<BLOCKQUOTE>
[JimD]
Yes, it's the -b option to mkisofs that does the trick (and it's obviously
not necessary at record time --- though most other OS have software that
integrate the mkisofs with the burn. I prefer the modularity of he Linux
approach.
</BLOCKQUOTE>
<P><STRONG>
In retrospect it ought to be obvious, but I don't even want to admit to
the amount of time I spent looking for that switch in my (by which I
mean "my sister's") Windows burner software.
</STRONG></P>
<!-- end 17 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips/lj"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">LJWNN Tech Tips</FONT></H3>
Mon, 30 Sep 2002 11:22:02 -0700
<h4 align="center"><br>Keeping NAT connections alive
</h4>
<P>
When you ssh from a NAT network, do your connections mysteriously drop
after a few minutes of activity?
</P>
<P>
Keep ssh connections up by adding
</P>
<P>
ProtocolKeepAlives 30
</P>
<P>
to your ~/.ssh/config file.
</P>
<P>
See man ssh_config.
</P>
<!-- end 18 -->
<!-- *** 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 © 2002
<br>Copying license <A HREF="http://www.linuxgazette.com/copying.html">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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 -->
<H3>Contents:</H3>
<dl>
<dt><a href="#tag/greeting"
><strong>¶: Greetings From Heather Stern</strong></A></dl>
<DL>
<!-- index_text begins -->
<dt><A HREF="#tag/1"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Issue 80 - The Mailbag -> Kylix - observations</strong></a>
<dt><A HREF="#tag/2"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>starting services in "/etc/init.d"</strong></a>
<dt><A HREF="#tag/3"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>A LAN Question</strong></a>
<dt><A HREF="#tag/4"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Homework question: defining subnets</strong></a>
<dt><A HREF="#tag/5"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>thx for ur ncurses, u have networking howto?</strong></a>
<dt><A HREF="#tag/6"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>How to kill a process in uninterruptible sleep state?</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="(¶) " border="0"
>Greetings from Heather Stern</H3>
<!-- begin hgreeting -->
<blockQuote>
Dear readers, welcome to October in the world of The Answer Gang.
</blockQuote>
<blockQuote>
Statistics: About 680 messages this month. I say "about" because I can't count spam
that hit the filters, and I'm not counting admin notes that I spotted and put aside
early. That's just the total I had to split.
</blockQuote>
<blockQuote>
Peeves of the month --or-- how <EM>not</EM> to get an answer:
</blockQuote>
<blockQuote><ol>
<LI>ask a question about printers, and don't bother to look at <A HREF="http://www.linuxprinting.org"
>http://www.linuxprinting.org</A> first.
A lot of our answers are gentle pointers to HOWTOs, as we assume real newbies
don't know about The Linux Documentation Project (<A HREF="http://www.tldp.org"
>http://www.tldp.org</A>) yet, either.
<br>
<br>If you <EM>have</EM> already looked at a a HOWTO, for a pumpkin's sake do <EM>not</EM> say
"I looked at all the HOWTOs and it made no sense." That just makes us sad and worried
that our own answers won't help you any either.
<br>
<br>Tell us whatever phrases confused
you, and tell us what sort of sense you expected of it. We may be inspired to "translate"
the techie bits into English, or point you at the pre-requisite HOWTO that goes before
it, which already does. Probably we'd copy the maintainer so that the clearer answer
gets to help a lot more people. If so you could feel proud you'd helped the LDP by
making it more readable
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
<LI>gosh, it's my first week of school, maybe those Answer Guys will do my homework
for me. I dunno what the prof is talking about anyway, so I won't even rephrase
he question.
<br>
<br>"sure, give us your professor, we'll advise him on a few pointers to give you." Here's
the first hint; try the class textbook. The second: if you don't understand the
question ask the professor about it. It's his or her job to explain it to you; you
pay the school good money for that.
<br>
<br>Especially distressing were the ones who want us to pick their masters thesis for them.
Research and new insights are the basis for handing out such a degree, right? So I'd
think it needs a bit more research than firing a note off to a batch of linux gurus
on some mailing list somewhere. You need some background, you need a topic, you need
some actually interesting new theory, you need some ways to test or explore that theory,
and then you need to make the paper presentable at an academic level. I suggest typing
the keywords "linux" and "proceedings" into the nearest search engine, and following their
examples for style, reading them for content, and considering whether they are aiming
for the same academic audience or if you need a slightly different tone. Simmer with
new ideas, garnish lightly with a conclusion, publish to taste. Keep notes throughout
and have a complete bibliography so people can follow how you came to think of it all.
</ol></blockQuote>
<blockQuote>
Not really a peeve at all, but rather interesting: Crossover questions with Microsoft OS'
are up. On the other tentacle, awareness that they're talking to Linux people here is too.
For the record two Knowledgebases might come in handy:
</blockQuote>
<blockQuote><ul>
<!-- *) ours -- http://www.linuxgazette.com/tag/kb.html -->
<LI>ours -- <A HREF="../tag/kb.html"
>http://www.linuxgazette.com/tag/kb.html</A>
<!-- *) theirs -- http://support.microsoft.com/ -->
<LI>theirs -- <A HREF="http://support.microsoft.com"
>http://support.microsoft.com</A>
</ul></blockQuote>
<blockQuote>
No, we have no idea whether any MS varieties can boot off a second drive. We suggest
swapping the disks. Linux will boot fine as long as the bootloader has a kernel on
the same media. Even if that's a floppy with SYSLINUX, or a Windows install with
<TT>LOADLIN.EXE</TT> lying around.
</blockQuote>
<blockQuote>
Here's a touch of what The Answer Guy himself (Jim Dennis) and I have been up to. We
visited Portland, Oregon this weekend - meeting some old friends - and got a tip about
this great recycling project, <A HREF="http://www.FreeGeek.Com"
>http://www.FreeGeek.Com</A>. We swung by their offices and
it's just the coolest thing... assuming that you find big boxes piles of discarded cards
and monitors and so on fascinating, of course. We sure did
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</blockquote>
<blockquote>Anyways, they get people
in the community involved in putting these old bits back together into wimpy little
machines that Linux can still make usable. The stuff that's hopeless, they snip the
heavy metals and chips out of for recycling. Meanwhile some folks who previously knew
nothing about computers, except maybe "where's the on switch" are learning how to tell
an ethernet card from a modem, and so on. There are probably other projects like this
out there, too. I'd like to hear from a few of them.
</blockQuote>
<blockQuote>
Now on to some All Hallow's Eve fun.
</blockQuote>
<blockQuote>
We really had to start coughing while cleaning out the cobwebs this time. Not one, but <EM>two</EM>
questions about copies of <A HREF="http://www.redhat.com/">Red Hat</A> so old the moths are stuffed and buzzing around with beards
and canes. The answers weren't very tasty, so you'll be spared them.
</blockQuote>
<blockQuote>
For slimy worms we've been pestered by the Klez worm all month. See the Two Cent Tips for
more on <EM>that</EM>. Ugh.
</blockQuote>
<blockQuote>
We do have some candy though.
</blockQuote>
<blockQuote>
Ghoulies and monsters, we've got a definition of the term daemon that might
be particularly useful this month. Plus how to get 'em started. LAN stuff
got you spooked? We've got some great notes to chew on. if you find
uninterruptiple sleep bothers you, we'll tell you how to kill that ghost...
probably! Mwa ha ha ha, ha ha! See you next month!
</blockQuote>
<!-- end hgreeting -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/1"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Issue 80 - The Mailbag -> Kylix - observations</H3>
<p><strong>Translation (c) 2002 Santy
</strong></p>
<p align="right"><strong>Answered By Faber Fedor, Ben Okopnik, John Karns, Mike Orr, Heather Stern
</strong></p>
<blockQuote>
Hello!, I suppose that somebody already will have clarified this to you,
but just in case...
</blockQuote>
<blockQuote>
(I am Spanish, and my English is not very good, I hope that it is
sufficient to explain to me well...)
</blockQuote>
<blockquote><code><font color="#000033"><br>Kylix
<br>Fri, 21 Jun 2002 14:37:51 -0400
<br>Octavio Aguilar (oam from mail.cosett.com.bo)
<br>translated by Mike Orr, except for one part by Heather Stern.
</font></code></blockquote>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
!ah! Un comentario demonio (daemon )siguifica Dinamic access memory, estoy
equivocado?
</P>
<P>
Ah! A daemon commentary means dynamic access memory, or am I mistaken?
</STRONG></P>
<P><STRONG>
Octavio-- Sorry, I've never used Kylix. I just ran a demo once. I don't understand your
second question. Memory is hardware; a daemon is software. And what's a "daemon
commentary"?
</STRONG></P>
<blockQuote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Santy]
Here Octavio asks if daemon (demon is "demonio" in spanish) means "dynamic access
memory" I believe that he thinks that daemon is an acronym ->"D-ynamic A-ccess
EM-memory ON-???) or so, of course this mistaken, it cames from Day Monitor
¿yes?.
</blockQuote>
<blockQuote>
I believe that this clarifies your doubt, I hope...
</blockQuote>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Intente bajar de internet el mismo paquete pero el resultado para instalarlo es el
mismo error.
(Heather: oboy, my spanish is rustier than Mike's, but I'll try.)
I intend to go under the internet to packets (maybe: download the package ?) but the
result of installing is an error.
</STRONG></P>
<blockQuote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Santy]
I intend to download the package from internet but the result of installing is the same
error.
</blockQuote>
<blockQuote>
Bye!
</blockQuote>
<HR width="10%" align="left"><P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Santy writes:
</STRONG></P>
<P><STRONG><BLOCKQuote>
of course this mistaken, it cames from Day Monitor ¿yes?.
</BLOCKQuote></STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
I've heard that daemon stands for Disk And Execution MONitor. Whether
that's true or not is, I suspect, lost in the mists of history.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
In The Jargon File:
</blockQuote>
<blockQuote><BLOCKQuote>
:daemon: <TT>/day</TT>'mn/ or <TT>/dee</TT>'mn/ <TT>/n./</TT> [from the mythological
</BLOCKQuote></blockQuote>
<blockQuote>
meaning, later rationalized as the acronym `Disk And Execution
MONitor'] A program that is not invoked explicitly, but lies
dormant waiting for some condition(s) to occur.
....
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
According to my first edition copy of "UNIX System Administration
Handbook", Nemeth, Synder & Seebass, pp 403-404,
</blockQuote>
<blockQuote>
"Many people equate the word 'daemon' with the word 'demon' implying some
kind of Satanic connection between UNIX and the underworld. This is an
egregious misunderstanding. 'Daemon' is actually a much older form of
'demon'; daemons have no particular bias towards good or evil, but rather
serve to help define a person's character or personality.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Mike Orr]
Similar to the Russian word "chyort", which means "earth spirit", but
Christian theology and writers (e.g., Tolstoy) tended to redefine as "devil".
</blockQuote>
<blockQuote>
There's an anecdote about a priest who's conducting a funeral service.
As the casket is about to be buried, an earthquake erupts, pushing the casket
into the earth. "Chyort voz'mi!" ("The devil take it!") mutters the priest and
continues the service, not realizing the literal meaning of that common expression.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
The ancient
Greeks' concept of a "personal daemon" was similar to the modern concept
of a "guardian angel" -- "eudaemonia" is the state of being helped or
protected by a kindly spirit. As a rule, UNIX systems seem to be infested
with both daemons and demons. [ :-^) as it were, hehe! - jk]
</blockQuote>
<blockQuote>
The word daemon was first used as a computer term by Mick Bailey, a
British gentleman who was working on the CTSS programming staff at MIT
during the early 1960's. (footnoted: This bit of history comes from Jerry
Saltzer at MIT, via Dennis Ritchie, via Kirk McKusick.) Mick quoted the
Oxford Dictionary in support of both the meaning and spelling of the word.
Daemons made their way from CTSS to Multics to UNIX, where they are so
popular they need a superdaemon to manage them. Daemons are featured on
the cover of the BSD UNIX manuals.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
I've been told that the little trident in the BSD Daemon's hands is not
a weapon, simply his implementation of the <TT> fork()</TT> system call... but I
couldn't find a canonical reference to say so.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
... cyber-history class dismissed
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
These figures [defining the personality] also appear prominently in
Tibeten (and Hindu if I'm not
mistaken) drawings called mandalas. Many of the mandalas have these
figures painted in a circular or horse shoe pattern surrounding a central
figure. At the moment I forget the term that <EM>they</EM> use to name the
entities, but they are representative of universal characteristics of the
subconscious, which every person who follows "the path" must master /
transcend.
</blockQuote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/2"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 2 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>starting services in "/etc/init.d"</H3>
<p><strong>From Benjamin A. Okopnik
</strong></p>
<p align="right"><strong>Answered By Jay R. Ashworth, Mike "Iron" Orr, John Karns, Jim Dennis
</strong></p>
<P><STRONG>
There are a number of services available in "<TT>/etc/init.d</TT>" that I use
only occasionally - "pdnsd" and "ntpdate", for example - and so they're
not auto-started in my "<TT>/etc/rc*.d</TT>". In order to save myself repeatedly
typing
</STRONG></P>
<blockquote><code><font color="#000033"><br>su -c '/etc/init.d/pdnsd start'
</font></code></blockquote>
<P><STRONG>
"stop", etc., I decided to make the command line a bit clearer via the
following script:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/okopnik.usr-local-bin-start.bash.txt">okopnik.usr-local-bin-start.bash.txt</a></tt></p>
<P><STRONG>
After creating it, I made a number of symlinks to it:
</STRONG></P>
<pre><strong>cd /usr/local/bin
for n in stop reload restart force-reload; do ln -s start $n; done
</strong></pre>
<P><STRONG>
Now, all I have to do is type an action followed by the service name,
like
</STRONG></P>
<pre><strong>reload pdnsd
start fetchmail
stop mysql
</strong></pre>
<P><STRONG>
etc., as root (or invoke it via "su"). More obvious, less typing.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
Except that they're a bit too generic in the global unix namespace,
IMHO. I did something similar, with a script called svc, about a
release or two before RedHat did something almost identical (though a
bit spiffier) called service.
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
<shrug> It's easy enough to modify for other "rc.d" variants. The
important thing here was the idea, and the, erm, "source" is available.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
For a simpler (and more simplistic way), you can throw these shell functions
into .zshrc.
</blockQuote>
<blockquote><pre>function start () { /etc/init.d/$1 start ; }
function stop () { /etc/init.d/$1 stop ; }
function reload () { /etc/init.d/$1 reload ; }
function restart () { /etc/init.d/$1 restart ; }
function ctest () { /etc/init.d/$1 ctest ; }
</pre></blockquote>
<blockQuote>
Also easier to type than 'service start'....
</blockQuote>
<blockQuote>
(I assume bash works the same way?)
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
You need to have semicolons on the ends...
</P>
<blockquote><em><font color="#000066">which I added.
-- Heather</font></em></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
That may be a bashism; it works in zsh without the semicolon. And why would
you need a semicolon? You normally only need a semicolon between statements,
in "for WORDS ;do", and in the case statement.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
Actually this was fixed in bash 2.x. The fact that bash 1.x allowed
{ WORDS } (with no semicolon) is considered a bug in its parser. That's
because } is NOT a command separator --- and the command echo } should
simply echo a closing brace. That leads to an ambiguity in the following:
</blockQuote>
<blockQuote><BLOCKQuote>
{ echo }
</BLOCKQuote></blockQuote>
<blockQuote>
... is that a complete command group (in the braces) or is it a fragment
including the beginning of a command group (the opening brace) followed
by an echo command (which will print out a close brace character, and a
newline)?
</blockQuote>
<blockQuote>
Alternatively the command line:
</blockQuote>
<blockQuote><BLOCKQuote>
{ echo ; }
</BLOCKQuote></blockQuote>
<blockQuote>
... is unambiguous.
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
It's an "sh"-ism, too. You need one because it terminates a group command. From the "bash" man page:
</P>
<pre> { list; }
list is simply executed in the current shell environment.
list must be terminated with a newline or semicolon. This is
known as a group command.
</pre>
<P>
It doesn't work in .bashrc. Remember that you have to "su" to run them:
</P>
<pre>Baldur:~$ ztart() { /etc/init.d/$1 start; }
Baldur:~$ su -c 'ztart pdnsd'
Password:
bash: ztart: command not found
Baldur:~$ typeset +f | grep -A3 ztart
ztart ()
{
/etc/init.d/$1 start
}
</pre>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
I rarely use the "su -c" syntax. By the time you get done typing the convoluted
syntax with quotes around the command, you can already be done with an
interactive su session.
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
The point here is that doing it the way you suggest makes it more
complex (dependent on whether you did "su" or "su -", for example) and
more fragile. I suppose you could always put it in "<TT>/etc/profile</TT>"...
uh, nope, that would break for "csh", "tcsh", etc. users. This is one
of those cases where a script is simply better.
</P>
<P>
No idea what you mean by "convoluted syntax", but the same reasoning
applies.
</P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
In the case of zsh it appears to treat the close brace as a special
case delimiter. This leads to inconsistencies like this:
</blockQuote>
<blockquote><pre> zsh$ echo {}
{}
zsh$ echo {
{
zsh$ echo }
zsh: parse error near `}'
</pre></blockquote>
<blockQuote>
(or something like that). This is probably a bug in zsh (with regards
to Bourne and Korn shell compatibility. As I say, it was considered to
be a bug in bash that was noted in a change log for 2.x.
</blockQuote>
<blockQuote>
All of that hairsplitting aside I must say that this is one of the most
annoying changes in bash 2.x. Like many other shell scripters I'd gotten
into the habit of using constructs like { ...; foo } and I still get
bitten by it occasionally. (Note that in this example foo is being called
with an argument of } (closing brace) and the group is incomplete.
We must insert a semicolon or a newline (command separators) for it to
parse correctly.
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I'd simply learned it as "this is the way it's done"; I guess I came to
it fairly late. One thing that I remember annoyed the hell out of me
early on: trying to launch two progs and background the first one;
seemed like an obvious thing to do
</P>
<P>
prog1 &; prog2
</P>
<P>
- right? Wrong! Only later did I realize that '&' was a valid
</P>
<P>
terminator, just like ';' and newline. Oh, and trying to explain the
order in
</P>
<P>
prog > <TT>/dev/log</TT> 2>&1 &
</P>
<P>
to my students involves removing their brains and installing them upside
down...
</P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
Consistency is the hobgoblin of a small mind. Computers have "small
minds" indeed!
</blockQuote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
<snort> Indeed.
</P>
<HR width="10%" align="left"><blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
Interesting, as I did virtually the same thing a while back:
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/karns.usr-local-sbin-start.sh.txt">karns.usr-local-sbin-start.sh.txt</a></tt></p>
<blockQuote>
but I put it all in <TT>/usr/local/sbin</TT>, since it has to run as root
</blockQuote>
<blockquote><pre>lrwxrwxrwx 1 root root 9 Dec 7 2001
/usr/local/sbin/start -> initScrpt*
</pre></blockquote>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<blockquote><code><font color="#000033"><br># echo "command = /etc/init.d/$1 $0"
<br>CMD=`echo $0 | cut -f5 -d/`
</font></code></blockquote>
<p align="center">...............</p>
</TD></TR></TABLE>
<blockquote><em><font color="#000066">This should chop off 5 fields worth of text, delimited by slashes.
Any time you see fixed numbers while doing string handling, you
should beware that it won't work for the general case.
-- JimD
</font></em></blockquote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Yikes! Highly breakable (try invoking it from its own directory, one
level above it, etc.) How about just "${0##*/}" instead? That'll work
every time.
</STRONG></P>
<blockquote><em><font color="#000066">This offers to chop everything up to the last slash, and leave the
last part, whatever it is. Also it's a built-in. But that may be
true only for bash... and probably ksh. The rest is left as an exercise
in shell debugging, but those of you who prefer working code should just
skip to the end.
-- JimD
</font></em></blockquote>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<blockquote><code><font color="#000033"><br>if [ $0 = 'stop' ] ; then
</font></code></blockquote>
<p align="center">...............</p>
</TD></TR></TABLE><P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Has this ever worked for you? I'd be very surprised if so; $0 will never
equal just "stop" (it'll be "<TT>./stop</TT>" at the very least.)
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
Yes.
</blockQuote>
<blockquote><pre>jkInsp8000:~ # stop nscd
Shutting down Name Service Cache Daemon
</pre></blockquote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Doesn't work for me. Obviously, something in your script is tripping off
"stop", but I see no way that it can be the above "if" statement.
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/okopnik.testing-karns.sh-transcript.txt">okopnik.testing-karns.sh-transcript.txt</a></tt></p>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
As a test I truncated the script as:
</blockQuote>
<blockquote><pre>CMD=`echo $0 | cut -f5 -d/`
echo "CMD = $CMD"
exit 0
</pre></blockquote>
<blockQuote>
... then ran the tests
</blockQuote>
<blockQuote>
..from root's home dir:
</blockQuote>
<blockquote><pre>jkInsp8000:~ # stop nscd
CMD = stop
</pre></blockquote>
<blockQuote>
..from the scripts own dir:
</blockQuote>
<blockquote><pre>jkInsp8000:~ # cd /usr/local/sbin/
jkInsp8000:/usr/local/sbin # stop nscd
CMD = stop
</pre></blockquote>
<blockQuote>
..and from one level above:
</blockQuote>
<blockquote><pre>jkInsp8000:/usr/local # stop nscd
CMD = stop
</pre></blockquote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Mine acts completely differently
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">
</STRONG></P>
<pre><strong>Baldur:~$ cat << ! > /usr/local/bin/tst1
> CMD=`echo $0 | cut -f5 -d/`
> echo "CMD = $CMD"
> exit 0
> Baldur:~$ chmod +x /usr/local/bin/tst1
Baldur:~$ tst1
CMD =
Baldur:~$ cd /usr/local/bin
Baldur:/usr/local/bin$ tst1
CMD =
</strong></pre>
<P><STRONG>
Doesn't work for me, John. I can't see how it would work for you. If
one of the other Gangsters wants to try it out, cool, but I don't see
how it's even possible (unless you have another script, alias, or
function called "stop".) Here is a simple test:
</STRONG></P>
<pre><strong>echo "./foo" | cut -f5 -d/
</strong></pre>
<P><STRONG>
If you get "foo" out of that, then your "cut" is doing something
magical. Or maybe it's "echo". Of course it could always be gremlins.
</STRONG></P>
<P><STRONG>
Just out of curiosity - you <EM>are</EM> copying and pasting (NOT retyping) the
code, yes?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
I'm too lazy to <EM>type</EM> it!
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> At this point I'm tempted to say that I
personally modified the bash code to suite my misguided purpose (ah, the
joy of open source), but I didn't.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I didn't think you had, but I was wondering about your gremlins. You
just never know.
</STRONG></P>
<pre><strong>jkarns@jkInsp8000:~ > grep gremlin /etc/passwd
gremlin:x:0:666:i_gotz_r00t:/proc/bus/pci/...:/bin/bash
</strong></pre>
<P><STRONG>
<IMG SRC="../gx/dennis/smily.gif" ALT="<grin>"
height="24" width="20" align="middle">
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
That's the only script - as I said I modified it for the test, and it
responded according to my mod, so it's the one being called. Bash version
is:
</blockQuote>
<blockquote><pre>GNU bash, version 2.04.0(1)-release (i386-suse-linux)
Copyright 1999 Free Software Foundation, Inc.
</pre></blockquote>
<blockQuote>
Running your test:
</blockQuote>
<blockquote><pre>jkarns@jkInsp8000:~ > echo "./foo" | cut -f5 -d/
jkarns@jkInsp8000:~ >
</pre></blockquote>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
OK, in that case, here's a guaranteed way to break it:
</P>
<pre>cd /wherever/the/script/is
./stop
</pre>
<P>
I can promise you that it's going to fail.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Same story if you ever
move it into a directory that's "deeper" or "shallower" than the current
one (*there's* a hell of a problem to troubleshoot!) If you use
"${0##*/}", or even "echo $0|sed 's#.*/##'", that fragility goes away.
</P>
<blockquote><em><font color="#000066">Or get <EM>really</EM> lazy and just use "basename" which is designed for this.
-- JimD
</font></em></blockquote>
<p align="center">See attached <tt><a href="misc/tag/debugged.usr-local-sbin-start.sh.txt">debugged.usr-local-sbin-start.sh.txt</a></tt></p>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>A LAN Question</H3>
<p><strong>From santyx
</strong></p>
<p align="right"><strong>Answered By Ben Okopnik, Karl-Heinz Herrman, John Karns, Jim Dennis, Matthias Posseldt
</strong></p>
<P><STRONG>
Hello Gang!!!
Thanks and congratulations for your good work!!!
</STRONG></P>
<P><STRONG>
I'm Santiago (santyx), from San Rafael-Mendoza-Argentina.
I don't speak English very well, but I hope you understand my question.
I'm working in a LAN in my University and I've installed a <A HREF="http://www.redhat.com/">Red Hat</A> Linux 7.1
in my work station (puesto17).
The LAN looks like this:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/map-university-network.txt">map-university-network.txt</a></tt></p>
<P><STRONG>
Where SANRAFAEL is a WINDOWS NT server for the 192.168.2.X subnet and CHARLY
</STRONG></P>
<P><STRONG>
is a <A HREF="http://www.suse.com/">SuSE</A> LINUX server for the 192.168.1.X subnet.
SANRAFAEL is connected to the Internet, and allowing all the work stations
in
the network to connect to the Internet too, with a proxy software.
As you see, I don't have a direct connection to the Internet from puesto17.
I can do "ping" to 192.168.1.X or 192.168.2.X, but I can't do "ping", for
example, to <A HREF="http://www.argentina.com"
>http://www.argentina.com</A> if I want.
I can do "traceroute" to 192.168.1.X or 192.168.2.X, but I can't do
"traceroute", for example, to <A HREF="http://www.hotmail.com"
>http://www.hotmail.com</A> if I want.
I can do "ftp" to 192.168.1.X or 192.168.2.X, but I can't do "ftp", for
example, to my ISP to upload web pages if I want.
I can't connect to the News Servers in the Internet and I can't use my pop3
mail server from my work station.
I can't go out of my network!!!
</STRONG></P>
<P><STRONG>
Which is the best way to change this?
Can I change this from my Linux box?
Or the only way is changing the things in the SANRAFAEL Server?
</STRONG></P>
<P><STRONG>
I really need a solution, specially for the FTP, since I'm working in a web
site for my University.
</STRONG></P>
<P><STRONG>
Thanks in advance!!!.
Santyx.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Hi, Santyx -
</blockQuote>
<blockQuote>
It sounds like SANRAFAEL is running a firewall that's blocking (at
least) ports 7 (echo), 21 (ftp), 110 (pop), and 119 (nntp). Your system
administrator would have to open those for you.
</blockQuote>
<blockQuote>
Another possibility, depending on how your proxy is set up, is that you
might also be able to get out through that proxy. To do that, you'd have to
define some environment variables:
</blockQuote>
<blockquote><pre># Most programs want this in lowercase, but there are some that want it
# capitalized!
export http_proxy=http://x.x.x.x:y
export HTTP_PROXY=http://x.x.x.x:y
export ftp_proxy=http://x.x.x.x:y
export FTP_PROXY=http://x.x.x.x:y
</pre></blockquote>
<blockQuote>
'x.x.x.x' is the IP address of the proxy; 'y' is the proxy port.
</blockQuote>
<blockQuote>
Note that the "http://" part of the proxy location stays the same
even when you're defining an FTP proxy. Strange, but that's how it
works.
</blockQuote>
<blockQuote>
Again, this is only a possibility; you'd have to discuss the setup with
your system administrator to be sure.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [K.-H.]
If that NT box is only running a proxy service for http that's all you get.
If on the other hand machines off sanrafael (IP probably 192.168.2.X ) have
full access (including ping, outside pop accounts, ftp,...) the NT box seems
to run a port-forwarding firewall ... or maybe merely ip masquerading...
and you should basically be able to do the
same -- <EM>IF</EM> the NT box is offering the service for 192.168.1.X.
</blockQuote>
<blockQuote>
What happens if you do all your tests from Charly? Charly probably also
has no internet connection (besides the http proxy).
</blockQuote>
<blockQuote>
Also for ftp through firewall make sure you run ftp in "passive" mode. For
ftp originally the server was opening a connection back to your client on a
different port -- which usually fails for through firewalls (so might not
fail with recent firewall port masquerading).
On a "recent" *nix ftp client typing "passive" before trying to "ls" or
get/put will do.
</blockQuote>
<blockQuote>
But I guess (like Ben) that the NT box is blocking you.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
Do you have DNS referencing (i.e., etc/resolve.conf) setup on CHARLY?
As K-H mentioned, it would seem that IP masquerading should be set up on
CHARLY if it isn't already. You need to have the packets from the
192.168.2 subnet appear as 192.168.1 subnet packets to get the same
treatment from the NT server for the .2 subnet as it gives to the .1
subnet.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Hello Gang!!!
Santyx again.
Thanks for your answers about "A LAN Question"
The net admin of my University made the changes in the sanrafael server,
and now I can do telnet from
my work station, but I can't do FTP.
When I connect to sanrafael doing FTP from Linux the proxy answer well,
the connection is done.
But the commands don't answer and I got to kill the connection from another
console.
It doesn't happens from windows.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
Try the same FTP connection using a web browser (even lynx, the
venerable text-mode curses or w3m, a newer curses mode browser).
</blockQuote>
<blockQuote>
If that works than you probably have a problem with your firewall
(or packet filters) that rejects "active" mode FTP connections.
</blockQuote>
<blockQuote>
In FTP the session you establish is a control channel, it's used to
send your FTP client's commands (you say "get" and your client changes
that to RETR, you say "ls" and your client sends 'LIST' or 'NLIST',
or whatever). The response codes (numeric and text) are also returned
on this control channel (which is on destination port 21 on the server
from some unprivileged port on your client host).
</blockQuote>
<blockQuote>
In active FTP the FTP server attempts to create a data connection for
each stream of data that you get. That includes each file that you
fetch, of course. However it also includes connections for directory
listings. The problem is that most firewalls and packet filters block
inbound connections (from the FTP server back towards your client) on
low numbered (privileged) ports.
</blockQuote>
<blockQuote>
With passive FTP the client specifies a non-privileged port (greater than
1024) for the data channels. The back channel is still inbound from the
server back to the client. The difference is that the client specificies
an available port (by sending a PORT command over the control connection).
That works with most packet filter configurations and firewalls. However,
it won't necessarily work with all of them.
</blockQuote>
<blockQuote>
In most FTP clients you can set passive mode by typing a command like
"quote pasv" (in ncftp you can use the command "set passive").
</blockQuote>
<blockQuote>
If a web browser works using an ftp://.... url, then passive mode from
your FTP client should work as well. Most web browsers default to
passive mode. If passive mode doesn't work, then you may need to use
a proxy system. I won't go into details on those --- you'd be best
checking with your local system/network administrator if you think you
need that.
</blockQuote>
<blockQuote>
Occasionally I've found other causes for the situation you describe.
However, they are much less likely. In one case I found that it was
related to MTU (maximum transmission units). Web and other traffic would
work, but FTP data connections would fail (apparently because it was
more likely to use maximum sized packets --- due to its socket options).
</blockQuote>
<blockQuote>
I doubt you'll encounter this sort of problem.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I got another question.
It's about GNU Grub.
I've installed the 0.92 version to load win98 and Red Hat Linux 7.1
Everithing goes O.K, but I want to make a graphic menu and I can't.
I put the following line in the menu.lst to show a graphic file
</STRONG></P>
<pre><strong>splashimage=3D(hd0,1)/boot/grub/fun.xpm.gz
</strong></pre>
<P><STRONG>
Where (hd0,1) is the Linux partition and <TT>/boot/grub/fun.xpm.gz</TT> is the path
of the graphic file.
The image is 640x480, 4 colors.
</STRONG></P>
<P><STRONG>
But nothig happens.
How can I make my own menu for Grub?
</STRONG></P>
<P><STRONG>
Thanks again.
santyx
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Matthias]
RedHat'S GRUB version has a splashimage patch applied. It can read XPM's
and display them. The patch and a vga-16 patch are available on the net
for GRUB 0.91, but not part of the standard GRUB package. So you have to
hunt down a patch for 0.92, apply and rebuild.
</blockQuote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/4"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 4 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Homework question: defining subnets</H3>
<p><strong>From Darren Collins
</strong></p>
<p align="right"><strong>Answered By Faber Fedor, Frank Rodolf, Jim Dennis
</strong></p>
<P><STRONG>
How do you specify the first 6 & last 2 available subnets defined by the
IP address and subnet mask (155.25.0.0/23) Any help on this would be
greatly appreciated.
</STRONG></P>
<P><STRONG>
Sincerly, Darren
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
How do I? Very well, actually. I usually use a calculator, but using
an abacus is much more challenging!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Frank]
But doing it by hand is more fun!
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
Have you looked here <A HREF="http://www.learntosubnet.com"
>http://www.learntosubnet.com</A> ?
</blockQuote>
<blockQuote>
BTW, we don't do homework assignments around here, except for our own,
of course.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
The reason we know it's a homework assignment is because no one uses
this scheme in the real world. This would define 126 subnets of
510 hosts each (or 128 subnets --- with modern equipment). The first
subnets would be 155.25.0.* <EM>AND</EM> 155.25.1.*; the next would be
.2.* and .3.*; etc.
</blockQuote>
<blockQuote>
This is a bit-aggregation (supernetting) over the traditional "class
C" sized network. Normally people would go for a 4-bit aggregation
--- giving them 16 networks of about 4000 hosts each (and possibly
fanning those into class C sized networks through another hierarchical
layer of routers).
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Frank]
Actually, there are real world exceptions to the 4-bit aggregation.
The multinational I am working at nowadays uses a 21-bit mask on a lot
of sites. (And it still has me confused at times.)
</blockQuote>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/5"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 5 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>thx for ur ncurses, u have networking howto?</H3>
<p><strong>From deepak a.l
</strong></p>
<p align="right"><strong>Answered By Pradeep Padala, Heather Stern
</strong></p>
<blockquote><em><font color="#000066">The original subject had been:
</font></em></blockquote>
<blockquote><em><font color="#000066">hi mr pradeep padala need help free source code for a networking project under linux topics like ppp
-- Heather</font></em></blockquote>
<P><STRONG>
hi pradeep padala
</STRONG></P>
<P><STRONG>
im deepak from bangalore , a very
good lover of linux and its extra features ,me and my
batch mate are doing a project on "networking using
linux as a platform"" plese help me out regarding this
regard,ur howto ncurses programming helped us a lot
for building up the editor,thanks for the ncurses
programming ,it was helpful ,
</STRONG></P>
<P><STRONG>
so i wanted to ask u whether u have "Networking Howto"
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Pradeep]
A wealth of information is available regarding networking on Linux. If you
want a generic introduction to networking, TLDP (The LinuxDoc Project) has
following howtos
</blockQuote>
<blockQuote><DL><DT>
Net-Howto:
<DD><A HREF="http://www.tldp.org/HOWTO/Net-HOWTO/index.html"
>http://www.tldp.org/HOWTO/Net-HOWTO/index.html</A>
</DL></blockQuote>
<blockQuote><DL><DT>
Networking-Howto:
<DD><A HREF="http://www.tldp.org/HOWTO/Networking-Overview-HOWTO.html"
>http://www.tldp.org/HOWTO/Networking-Overview-HOWTO.html</A>
</DL></blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
Also within the pages of the Linux Gazette itself, the very long Jim
Dennis message "Routing and Subnetting 101" is still available:
<A HREF="../issue36/tag/a.html"
>http://www.linuxgazette.com/issue36/tag/a.html</A>
</blockQuote>
<blockQuote>
We have had other good messages on networking topics too. These are
mentioned in the Answer Gang Knowledgbase:
<A HREF="../tag/kb.html"
>http://www.linuxgazette.com/tag/kb.html</A>
</blockQuote>
<blockQuote>
While most of the questions asked of us are about configuring the
network to be visible, certain kinds of questions lead to a discussion
of how it works under the hood. Many are laden with additional URLs
well worth reading into. But I'd say a fair number of them mention the
HOWTOs that Pradeep listed above.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
plese help us out ,we want to do well in our project
with ur wishes, plese let me know as soon as possible
of networking projects sites offering free source code
or any thing tutorial written by u regarding
networking under linux, i mean the manpages which
display help for networking,
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Pradeep]
I guess you are looking for information on socket programming. There are
tons of tutorials on net. The man pages must be available on your linux
system. I am forwarding a mail I wrote answering a similar question.
</blockQuote>
<blockQuote>
For source code you can have a look at various projects at
<A HREF="http://freshmeat.net"
>http://freshmeat.net</A> and
<A HREF="http://sourceforge.net"
>http://sourceforge.net</A>
</blockQuote>
<blockQuote>
Good luck
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
we would be really
thankful to u if u please help us in this regard
i mean if u have a documentation or example source
code which could help us in building the networking
project ,please suggest me some sites reagading
networking,pleaseeeee
</STRONG></P>
<P><STRONG>
regards
</STRONG></P>
<P><STRONG>
deepak
sanjay
</STRONG></P>
<P><STRONG><CODE>
from Bangalore
</CODE></STRONG></P>
<P><STRONG>
thank u!!!
</STRONG></P>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<P><STRONG>
Forwarded Message
</STRONG></P>
<P><STRONG>
can u tell me how the data packets are sent from
</STRONG></P>
<P><STRONG>
one pc to other in a LAN. in other words about the tcp
ip in linux. lastly if u have any code in c or cpp to
do this job.
</STRONG></P>
<P><STRONG>
That's quite a broad question. Gurus like Richard Stevens, Douglas E
Comer wrote atleast three volumes each on this topic. I suggest you read
Richar Stevens' "UNIX Network Programming" book.
</STRONG></P>
<P><STRONG>
If you want to know about socket programming(I guess that's what you mean
by c code), there are plenty of articles on web. Google.com is the best
place to search. This is one of the articles I found
</STRONG></P>
<P><STRONG>
<A HREF="http://www.scit.wlv.ac.uk/~jphb/comms/sockets.html"
>http://www.scit.wlv.ac.uk/~jphb/comms/sockets.html</A>
</STRONG></P>
<P><STRONG><DL><DT>
There's a TCP/IP resource list on faqs.org:
<DD><A HREF="http://www.faqs.org/faqs/internet/tcp-ip/resource-list"
>http://www.faqs.org/faqs/internet/tcp-ip/resource-list</A>
</DL></STRONG></P>
<P><STRONG>
If you want to learn how TCP/IP implementation in Linux, best way to do is
to look through source which can be browsed online at <A HREF="http://lxr.linux.no"
>http://lxr.linux.no</A>.
Apart from that, the following document can give you some info
</STRONG></P>
<P><STRONG>
<A HREF="http://www.cs.unh.edu/cnrg/gherrin"
>http://www.cs.unh.edu/cnrg/gherrin</A>
</STRONG></P><p align="center">...............</p>
</TD></TR></TABLE>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/6"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 6 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>How to kill a process in uninterruptible sleep state?</H3>
<p><strong>From Carlos Garada
</strong></p>
<p align="right"><strong>Answered By John Karns, Ben Okopnik, Karl-Heinz Herrmann, Jay R. Ashworth, Robos,
Jim Dennis, Ashwin N
</strong></p>
<P><STRONG>
Dear answer gang:
</STRONG></P>
<P><STRONG><BLOCKQuote>
Sometimes when I mount a CD, mount hangs. ps shows it is
in an "uninterruptible sleep", and kill won't kill it. As a
result, I can not access my CD drive until I restart my computer.
</BLOCKQuote></STRONG></P>
<P><STRONG>
Is there a way to kill a process in uninterruptible sleep?
</STRONG></P>
<P><STRONG>
Thanks!
</STRONG></P>
<P><STRONG>
C. Garada
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
What I usually do is to kill the parent process, which is usually a bash
shell. In many <TT>/</TT> most cases this allows killing of the errant process.
However, you may run into the situation where the driver or a port is
hung. In those cases, you may have no choice but to reboot.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Sometimes the parent process is apt-get. I kill it, but the spawned
mount remains in state "D" and I can not kill it.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Have you tried "kill -9"? This is not a good thing to do by default. but
if you've already tried a plain "kill" (which issues a "-15"), that's
what's left. See "man kill" for more details.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Yes, I tried kill -9 and fuser -k <TT>/cdrom/...</TT> Nothing works.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
Nope, they won't. They only work on processes sleeping above priority
PZERO (if I remember the terminology correctly). The problem your
having is almost certainly coming from a process sleeping <EM>below</EM> PZERO
-- which is almost always a device driver with either bad hardware, or
a bug.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Yep, those are the correct terms; however, I believe that the only
processes below PZERO are zombies. I think what happens with fast
devices is simply a loop that's too "tight" to break into, fast and
straight to hardware without any intervening layers that would allow a
signal to "break in".
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I suppose the mount(2) syscall is having a problem... but shouldn't I
be able to interrupt a system call in some way?
</STRONG></P>
<P><STRONG>
Thank you for your answers.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
A system call, yes. But not necessarily inside a driver call.
</blockQuote>
<blockQuote>
Tape drives are famous for this... they seem to be implemented as fast
devices, even though they manifestly are not.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
And that is the one situation that comes to mind where I experienced the
problem - using a SCSI tape drive and encountering a read or write error,
the process would hang. I was unable to kill the process directly, but
was more successful in killing the parent process. But I also encountered
situations where the SCSI driver for the PCMCIA card hung, and the only
way I could clear it was a reboot.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
So reboot is the
only answer? The almighty root can not do anything?
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
Nope. There are some things even root can't do. There's fairly
extensive discussion of this in a couple of the kernel design books,
and I <EM>think</EM> in Nemeth, Snyder and Seebass: the problem stems from the
fact that there are two types of device drivers -- those for "fast"
devices and those for "slow" devices.
</blockQuote>
<blockQuote>
Slow-device drivers -- for things like terminals, and such -- are
usually split in two pieces, and can therefore be interrupted while
they're in the middle of something.
</blockQuote>
<blockQuote>
Fast-device drivers -- which service things like hard drives and
(I think) ethernet cards -- are designed to expect that when they call
out to hardware, it will respond instantly (in human terms), and that
they won't have to wait on anything. Such drivers have, as a rule,
proven extremely intolerant of hardware trouble -- if your hard drive
start having to do hardware retries to read a sector, your system
perfromance is going int he toilet, even if you have more than one
drive...
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thank you for your explanation, Jay. So I suppose I should either resign
myself to rebooting every time it happens, or rewrite the driver...
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
Have you ever tried to wait really long (in human terms
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle">, something in
the range of 30mins or so? I think I had a case when my cd hung and I simply
continued with something else and - yo and behold - after that the cd worked
again. But I'm not sure anymore.
</blockQuote>
<blockQuote>
Hope this helps.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Oh - good point, Robos. I've had things like that happen... Midnight
Commander trying to read "<TT>/dev/fd0</TT>" with a bad floppy from an LS120
drive comes to mind, but that was way back when. Took about 10 minutes
to stop generating console errors (about two per minute), even after MC
(<EM>and</EM> the parent shell!) were killed; it had to have been from the
kernel is my guess. Rare, but I've seen it.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
A day and a half... and then lost my patience
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Robos]
THAT short ? Sissy
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle">)
</blockQuote>
<blockquote><em><font color="#000066">Hunh. Robos may not be impressed, but <EM>I</EM> am.
-- Heather</font></em></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
One thing we haven't mentioned here...
</blockQuote>
<blockQuote>
Occasionally, you'll get lucky, and rmmod will permit you to remove
whichever module supports the device you're having trouble with... and
then your stuck process will go away. I've had luck with this,
particularly, on the SCSI CD-R attached to my laptop with an Adaptec
APA-1460 PCMCIA card...
</blockQuote>
<blockQuote>
Now, that <EM>could</EM> be because PCMCIA busses are natively hot-pluggable,
but...
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
A process which ends up in "D" state for any measurable length of
time is trapped in the midst of a system call (usually an I/O
operation on a device --- thus the initial in the ps output).
</blockQuote>
<blockQuote>
Such a process cannot be killed --- it would risk leaving the
kernel in an inconsistent state, leading to a panic. In general
you can consider this to be a bug in the device driver that the
process is accessing.
</blockQuote>
<blockQuote>
Once case that I can't consider to be a Linux bug occurs when
one is attempting to access a hard mounted NFS exported share
without the intr (mount(
<IMG SRC="../gx/dennis/smily.gif" ALT="8)"
height="24" width="20" align="middle">) flag. If the NFS server (or the network
connection thereto) becomes unavailable all processes that try to
access any part of that share will be set into D state. (Use intr or
soft mount options on NFS to avoid all that). I might consider that to
be a design bug in the NFS protocol --- but that might be contentious.
That particular NFS behavior can actually be a feature in some cases;
I think it should NOT be the default, though.
</blockQuote>
<blockQuote>
When it comes to scsi and similarly local device drivers --- I would
report cases of "D" state as bugs (after due diligence of checking
for prior reports, updates, and perhaps trying to troubleshoot it a
bit).
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Where? In the linux kernel mailing list?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [jra]
You're welcome. Could you recap one more time, in about a sentence,
exactly what's hanging and when? Jim's right: if this is repeatable,
the kernel wonks would like to hear about it.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Sometimes, when I mount the cdrom, mount hangs and I can not kill
it; and I can not access the cdrom either. Ah, and the door remains
closed and I can not open it.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
I'll back Carlos' report; I've seen this before, although not in the
past... erm, for sure since I've been using 2.4.18 and maybe even well
before that, but my memory refuses to pony up. Seems like it was in the
past three years, though.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
How to reproduce it: I don't know
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">. I tried hard yesterday but this
bug won't show when I want it to.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
ISTR that a damaged (boot/signature sector damage) CD would do it pretty
much every time. I've got about 50% confidence in this memory, but
there's something in the back of my brain that's hinting thataway.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Kernel 2.4.17.
</STRONG></P>
<P><STRONG>
Ah, and maybe important (I only thought of this now, sorry): I have
a binary kernel module and a binary X server (not source available) for
my nVidia graphics card. Maybe they are corrupting the memory and this
affects the driver(?)? I know these binary components are not very good
because the computer hangs on some GL screensavers... but I never
thought they could make the ide/cdrom/whatever drive go wrong.
</STRONG></P>
<P><STRONG>
Could that be the problem?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
FTR, neither of the above apply to me.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ashwin N]
Similar things used to happen to me with a faulty CDROM drive.
</blockQuote>
<blockQuote>
If this problem happens only with the CDROM drive, then <em> _maybe</em> the
drive is faulty. If you have 'the other OS' you could boot it up and put
in a CD and check for similar symptoms.
</blockQuote>
<blockquote><em><font color="#000066">I don't believe I've ever seen this sort of wedge on a CD-ROM drive but
I have seen it happen to a PCMCIA card -- a NIC interface that was too
new, and being spotted as the wrong card. Luckily I could ignore that
until I felt inclined for a reboot for some other reason.
</font></em></blockquote>
<blockquote><em><font color="#000066">Oh yeah,
since your troubles include a mountpoint -- walk through your shutdown
sequence by hand. You'll find 'umount -a' is not going to behave itself
<IMG SRC="../gx/dennis/unsmily.gif" ALT=":("
height="24" width="20" align="middle">
-- Heather</font></em></blockquote>
<HR width="10%" align="left"><P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
I have a related problem when resuming from APM suspend on my laptop.
Since I updated the BIOS it resumes without hanging as it used to do, but
the NIC (eepro100) doesn't get reset; and unloading <TT>/</TT> reloading the NIC
driver doesn't help, so I'm stuck with rebooting if I want to connect to a
LAN after suspending.
</STRONG></P>
<P><STRONG>
{{{
John, have you tried unplugging/reinserting the card (I'm assuming it's
PCMCIA)? That's what used to work for me when this happened back in the
2.2 kernel.
{{{{
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John K.]
No, unfortunately it's integrated - never thought that there would be an
advantage to PCMCIA vs integrated, but I guess that's one. I have three
PCMCIA cards that I bought to use with previous machines - two Xircom
ether <TT>/</TT> modem combos and a 3Com ether only. One of the Xircoms is 10/100
ether the other 10. Both really heat up, which exacerbates the internal
heat problem considerably especially in warmer climates. I get nervous
when the bottom of the CD/DVD drawer gets too hot to touch. OTOH the 3Com
stays pretty cool most of the time.
</blockQuote>
<blockQuote>
A while ago someone told me that there was talk of the eepro100 reset
problem on the kernel dev list, and that there may a patch or fix for it -
maybe in the 2.4 kernel. I'm still using 2.2 kernel, mainly because of
VMWare - will have to re-install the MSW I have setup in virtual
partitions - something that I've been putting off until I have enough time
to deal with it all.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [K.-H.]
If Vmware is what's keeping you from going to 2.4 and you would like to
switch -- there is at least a patch for vmware 2.x to make it work beyond
kernel 2.4.6.
</blockQuote>
<blockQuote>
<A HREF="http://volker.orcon.net.nz/linux/vmware/vmware2.0.4-SuSE7.3.txt"
>http://volker.orcon.net.nz/linux/vmware/vmware2.0.4-SuSE7.3.txt</A>
</blockQuote>
<!-- end 6 -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright © 2002
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">News Bytes</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/conry.html">Michael Conry</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<center>
<table cellpadding=7><tr><td>
<IMG SRC="../gx/bytes.gif" border=1 ALT="News Bytes">
</td><td>
<H3>Contents:</H3>
<ul>
<li><a HREF="#leg">Legislation and More Legislation</a>
<li><a HREF="#links">Linux Links</a>
<li><a HREF="#conferences">Conferences and Events</a>
<li><a HREF="#general">News in General</a>
<li><a HREF="#distro">Distro News</A>
<li><a HREF="#commercial">Software and Product News</a>
</ul>
</td></tr></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>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<font color="green">
October 2002 <I>Linux Journal</I>
</font>
</H3>
<IMG ALT="[issue 102 cover image]" SRC="misc/bytes/lj-cover102.png" WIDTH=200 HEIGHT=268
ALIGN="left" HSPACE="20">
The October issue of <A HREF="http://www.linuxjournal.com/"><I>Linux
Journal</I></A> is on newsstands now.
This issue focuses on Security. Click
<A HREF="http://www.linuxjournal.com/modules.php?op=modload&name=NS-lj-issues/issue100&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">Venezuela and Other Government News
</FONT>
</H3>
<P>
The Register
<a href="http://www.theregister.co.uk/content/4/26928.html">
reported</a> that
Venezuela has adopted a pro-GPL policy for government software.
All software developed for the government must be GPL, and GPL is preferred
for off-the-shelf software. As described in
<a href="http://linuxtoday.com/news_story.php3?ltsn=2002-08-30-011-26-NW-LL-PB">
LinuxToday's coverage</a>, it would appear that Dr. Felipe Pérez-Martí,
Venezuelan Planning and Development Minister is well acquainted with
open-source, free software and the ideas behind these buzz words.
<P>
Use of Open Source has also been
<a href="http://www.itweb.co.za/sections/computing/2002/0209091122.asp?A=">
recommended by a South African Government Advisory body</a>. The
Ukrainian government is also considering
<a href="http://newsvac.newsforge.com/article.pl?sid=02/09/02/1226244&mode=thread&tid=51">
expressing legal preferences for open source solutions</a>.
<P>
On a third front,
the UK Commission on Intellectual Property Rights, has
<a href="http://www.iprcommission.org/papers/text/final_report/reportwebfinal.htm">
concluded</a>
that open source and avoidance of restrictive licensing conditions is
<a href="http://news.zdnet.co.uk/story/0,,t269-s2122219,00.html">
essential to developing countries future progress</a>.
This report was also covered
<a href="http://lwn.net/Articles/10278/">
by Linux Weekly News</a>
and
<a href="http://economist.com/science/displayStory.cfm?story_id=1325219">
by the Economist</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">FSF changes focus
</FONT>
</H3>
<P>
NewsForge
<a href="http://newsforge.com/newsforge/02/09/24/182213.shtml?tid=51">
has reported</a> that
<a href="http://www.fsf.org/">
The Free Software Foundation</a>
is changing its priorities to focus less on development, and to concentrate
more on fighting digital rights management and enforcing the GPL. At the
same time, Richard Stallman is planning to take a lower profile role in the
organization.
<P>
Richard Stallman has
<a href="http://www.theregister.co.uk/content/4/27121.html">
recently written</a>
on the issues of open-source, free software, and security.
The article takes the form of an open letter responding to an earlier
contribution by SecurityFocus' Jon Lasser. He asserts the importance of
being mindful of the very political underpinnings of free software, and
<a href="http://www.gnu.org/philosophy/free-software-for-freedom.html">
the differences</a>
between what is meant by the terms <em>free software</em>
and <em>open source software</em>.
Now, if only we could all
<a href="http://www.gnu.org/gnu/gnu-linux-faq.html">
remember to say</a> GNU/Linux!
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Palladium
</FONT>
</H3>
<P>
Two documents worth reading regarding Microsoft's Palladium project, and
potential future ramifications are
the guides written
<a href="http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html">
by Ross Anderson</a>
and
<a href="http://vitanuova.loyalty.org/2002-07-05.html">
by Seth Schoen</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Adobe Bitten by DMCA
</FONT>
</H3>
<P>
Linux Weekly News
<a href="http://lwn.net/Articles/8776/">
have a commentary</a> on an ironic development whereby Adobe is being
attacked using the DMCA for a feature included in Acrobat which could be
construed. Meanwhile, Wired report that Elcomsoft have not allowed their
DMCA difficulties to cramp their style and are continuing to
<a href="http://www.wired.com/news/business/0,1367,54712,00.html">
sail perilously close to the wind</a> in their software development.
<P>
While on the topic of the DMCA, Robert Cringely
<a href="http://www.pbs.org/cringely/pulpit/pulpit20020919.html">
has published an interview</a> with
Mark Ishikawa, a prominent enforcer of the DMCA.
Also of interest is LawMeme's
<a href="http://research.yale.edu/lawmeme/modules.php?name=News&file=article&sid=319">
dissection</a>
of Cornell's DMCA Policy (<a href="http://newsvac.newsforge.com/article.pl?sid=02/09/05/0326222&mode=thread&tid=19">courtesy NewsForge</a>).
<a name="links"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Linux Links</font></H3></center>
<p>
Some links of particular interest from the O'Reilly stable of websites:
<ul>
<li>
Configuring sound for
<a href="http://linux.oreillynet.com/pub/a/linux/2002/09/19/linuxlaptop.html">
Linux on a Laptop</a>.
</li>
<li>
<a href="http://www.oreillynet.com/pub/wlg/1982">
Interesting quotes</a>
from experts on the issues of copyright law and fair use.
</li>
<li>
<a href="http://linux.oreillynet.com/pub/a/linux/2002/08/29/howardwen.html">
Roll Your Own Digital Video Recorder</a>:
Video Disk Recorder, or VDR, is a user interface for building a
digital satellite TV receiver and recorder box running under
Linux.
</li>
<li>
<a href="http://www.oreillynet.com/pub/a/mozilla/2002/09/12/mozilla_browsers.html">
Let One Hundred Browsers Bloom</a>, and a sample chapter from
<a href="http://www.oreilly.com/catalog/mozilla/chapter/index.html">
Creating Applications with Mozilla</a>.
</li>
<li>
Michael Lucas
<a href="http://www.onlamp.com/pub/a/bsd/2002/09/12/Big_Scary_Daemons.html">
shows how to simplify sudo maintenance</a>
and clean up your sudo configuration using aliases. Also of interest
is the
<a href="http://www.onlamp.com/pub/a/bsd/2002/08/29/Big_Scary_Daemons.html">
preceding article</a>.
</li>
<li>
<a href="http://www.oreillynet.com/pub/a/network/2002/09/24/essentialsysadmin.html">
Top Five Open Source Packages for System Administrators</a>.
</li>
</ul>
<P>
Some links from <a href="http://lwn.net/">Linux Weekly News</a>:
<ul>
<li>
The LWN subscription department
<a href="http://lwn.net/Articles/10688/">
is now open for business</a>.
</li>
<li>
<a href="http://lwn.net/Articles/8284/">
LWN defends Red Hat</a>
against accusations that it's becoming "the Microsoft of Linux".
</li>
<li>
LWN's John Corbet
<a href="http://lwn.net/Articles/9185/">
runs SpamAssassin and bogofilter on 8000 e-mail messages</a>
to see which program is faster, easier, and more correct. Also looks
at open source and public election systems.
</li>
<li>
<a href="http://www.newsalert.com/bin/story?StoryId=CpxBwWaicu0qTq09nufvurvjt&Print=1">
Microtel/Lindows computer for $199</a> without monitor at Wal-Mart.
</li>
</ul>
<P>
Some links from <a href="http://slashdot.org/">Slashdot</a> which might be
of interest:
<ul>
<li>
<a href="http://ask.slashdot.org/article.pl?sid=02/09/10/2028215&mode=nested&tid=158">
Review of liberties lost in the United States</a> in recent months.
</li>
<li>
<a href="http://slashdot.org/article.pl?sid=02/09/05/1457245&mode=nested&tid=106">
Slashdot reported</a>
that
<a href="http://www.bcg.com">
The Boston Consulting Group</a>
with
<a href="http://www.osdn.com">OSDN</a>
have been
<a href="http://kernelmapper.osdn.com">
working on a visual representation</a>
of the Linux Kernel, and have now made it available online
</li>
<li>
<a href="http://slashdot.org/article.pl?sid=02/09/09/0045223&mode=nested&tid=141">
Slashdot story</a> on the
<a
href="http://www.heise.de/newsticker/data/anw-08.09.02-000/">success</a>
[in German]
of the
<a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a>
audio codec in a blind test of 6000 users.
</li>
<li>
<a href="http://yro.slashdot.org/yro/02/09/26/145220.shtml?tid">
Slashdot thread</a> discussing
a two part
(<a href="http://www.desktoplinux.com/articles/AT3341468184.html">I</a>
and
<a href="http://www.desktoplinux.com/articles/AT7966076367.html">II</a>)
Introduction to
<a href="http://www.gnupg.org/">GnuPG</a>
(Gnu Privacy Guard).
</li>
<li>
Pedal-powered Linux-based wireless network
<a href="http://www.80211-planet.com/columns/article/0,4000,1781_1454991,00.html">
bring Internet access to Laotian villages</a> that have no electricity or phones
</li>
<li>
<a href="http://developers.slashdot.org/developers/02/09/12/236213.shtml?tid6">
Linux 2.5.34 includes User Mode Linux (UML)</a>.
<a href="http://user-mode-linux.sourceforge.net/">UML</a> is a way
to run an instance of Linux in a virtual machine. It enables
<a href="http://linux.oreillynet.com/pub/a/linux/2001/11/29/UserModeLinux.html">
cutting-edge experimentation without hosing your host system</a>.
</li>
<li>
<a href="http://slashdot.org/articles/02/09/04/1328209.shtml?tid9">
A Linux set-top box by Sony</a>
with a broadband Internet connection.
It's available only in Japan, but you can
<a href="http://www.watch.impress.co.jp/av/docs/20020904/sony.htm">
see pictures here</a> (and read more about it too, if you can read
Japanese).
This story was also
<a href="http://www.reuters.com/news_article.jhtml?type=technologynews&StoryID=1407280">
reported by Reuters</a>.
Another company which has been
<a href="http://newsvac.newsforge.com/article.pl?sid=02/09/05/175221&mode=thread&tid=23">
pushing Linux for consumer electronics applications</a>
is <a href="http://www.philips.com/">Philips</a>.
</li>
<li>
Andy's legion of Lego men
<a href="http://lego.dave.dk/">
assemble a computer</a>.
</li>
</ul>
<P>
<a href="http://rpm.pbone.net/">
RPM PBone</a> is a
searchable index of RPMs, and an alternative to <a
href="http://rpmfind.net">Rpmfind</a>.
<P>
Salon report on how recycled PC's can be a tool of
<a href="http://www.salon.com/tech/feature/2002/09/23/antiglobal_geeks/">
anti-globalization and empowerment</a>.
<P>
Moblix.org have released a
<a href="http://mobilix.org/Infrared-HOWTO/Infrared-HOWTO.html">
Linux Infrared-HOWTO</a>,
providing an introduction to Linux and infrared devices and to the software
from the Linux/IrDA project.
<P>
OSNews
<a href="http://www.osnews.com/story.php?news_id=1733">
article on Gentoo Linux</a>.
<P>
Some links from
<a href="http://www.linuxjournal.com/">
<em>Linux Journal</em></a>
<ul>
<li>
Using Gnu Emacs and Calc for
<a href="http://www.linuxjournal.com/article.php?sid=5873">
engineering and mathematical reports</a>
</li>
<li>
<a href="http://www.linuxjournal.com/article.php?sid=5653">
RAID-1 HOWTO, Part 1</a> and
<a href="http://www.linuxjournal.com/article.php?sid=5898">
Part 2</a>:
What it is, when to use it, how to make a RAID-1 device for an ext2 partition.
</li>
<li>
Philip Streck
<a href="http://www.linuxjournal.com/article.php?sid=6035">
explains how to use devfs</a>, written as a virtual filesystem
driver, to manage and administer access to /dev.
</li>
<li>
A look at
<a href="http://www.linuxjournal.com/article.php?sid=6153">
running Microsoft Office 97 and 2000</a> on Linux using Codeweaver's
Crossover Office product.
</li>
<li>
And from the commercial end of things: SSC's new 16-page reference
card on MySQL, written by database specialist Dan Wilder, is for
sale for $4.95 on-line
<a href="http://store.linuxjournal.com/">
at the Linux Journal Store</a>.
</li>
</ul>
<P>
Some links from <a href="http://www.theregister.co.uk/">The Register</a>:
<ul>
<li>
Xbox Linux Project
<a href="http://www.theregister.co.uk/content/4/26932.html">
gets SuSE 8.0 running</a>.
and
<a href="http://www.theregister.co.uk/content/4/26995.html">
releases SuSE 8.0 howto</a>.
</li>
<li>
PGP creator
<a href="http://www.theregister.co.uk/content/6/27078.html">
joins UK privacy watchdog</a>.
</li>
<li>
EU data protection chiefs
<a href="http://www.theregister.co.uk/content/6/27155.html">
oppose data retention moves</a> on grounds of cost, practicality,
and invasiveness.
</li>
<li>
The Register
<a href="http://www.theregister.co.uk/content/4/26788.html">
comments</a>
on the UK's implementation of the "European DMCA", the European Union
Copyright Directive (EUCD).
</li>
</ul>
<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.
<!-- *** BEGIN events table [this line needed by Linux Gazette events.py *** -->
<table cellpadding=5 border=0 width=100%>
<tr><td valign=top>
<b>O'Reilly Mac OS X Conference</b><BR>
<td valign=top>September 30 - October 3, 2002<BR>Santa Clara, CA<BR>
<a href="http://conferences.oreillynet.com/macosx2002/" target="_blank">
http://conferences.oreillynet.com/macosx2002/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>IBM eServer pSeries (RS/6000) and Linux Technical University</b><BR>
<td valign=top>October 14-18, 2002<BR>Dallas, TX<BR>
<a href="http://www-3.ibm.com/services/learning/conf/us/pseries/"
target="_blank">
http://www-3.ibm.com/services/learning/conf/us/pseries/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>SANS Network Security</b><BR>
<td valign=top>October 18-25, 2002<BR>Washington, DC<BR>
<a href="http://www.sans.org/" target="_blank">
http://www.sans.org/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Strictly Business Solutions Expo</b><BR>
<td valign=top>October 23-24, 2002<BR>Houston, TX<BR>
<a href="http://www.strictlyebusiness.net/" target="_blank">
http://www.strictlyebusiness.net/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Third LCI International Conference on Linux Clusters: The
Linux HPC Revolution</b><BR>
<td valign=top>October 23-25, 2002<BR>St. Petersburg, FL<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>USENIX 16th Systems Administration Conference (LISA)</b><BR>
<td valign=top>November 3-8, 2002<BR>Philadelphia, PA<BR>
<a href="http://www.usenix.org" target="_blank">
http://www.usenix.org/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>SuperComputing 2002</b><BR>
<td valign=top>November 16-22, 2002<BR>Baltimore, MD<BR>
<a href="http://www.sc2002.org/" target="_blank">
http://www.sc2002.org/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX</b><BR>
<td valign=top>November 18-22, 2002<BR>Las Vegas, NV<BR>
<a href="http://www.comdex.com/fall/" target="_blank">
http://www.comdex.com/fall/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>SD East</b><BR>
<td valign=top>November 18-22, 2002<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>USENIX 5th Symposium on Operating Systems Design
and Implementation (OSDI)</b><BR>
<td valign=top>December 9-11, 2002<BR>Boston, MA<BR>
<a href="http://www.usenix.org" target="_blank">
http://www.usenix.org/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Consumer Electronics Show</b><BR>
<td valign=top>January 9-12, 2003<BR>Las Vegas, NV<BR>
<a href="http://www.cesweb.org/" target="_blank">
http://www.cesweb.org/</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>January 21-24, 2003<BR>New York, NY<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>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>Game Developers Conferenc</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>COMDEX Canada</b><BR>
<td valign=top>March 11-13, 2003<BR>Vancouver, BC<BR>
<a href="http://www.comdex.com/vancouver/" target="_blank">
http://www.comdex.com/vancouver/</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>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>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>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>SD West</b><BR>
<td valign=top>April 8-10, 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>COMDEX Chicago</b><BR>
<td valign=top>April 15-17, 2003<BR>Chicago, IL<BR>
<a href="http://www.comdex.com/chicago/" target="_blank">
http://www.comdex.com/chicago/</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>O'Reilly Open Source Convention</b><BR>
<td valign=top>July 7-11, 2003<BR>Location: TBD<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>
</table>
<!-- *** END events table [this line needed by Linux Gazette events.py *** -->
<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">XVID and GPL
</FONT>
</H3>
<P>
The
<a href="http://www.xvid.org/">
XVID</a> project scored a GPL win by persuading Sigma Designs to
<a href="http://www.xvid.org/press/press-20020822-en.html">
cease infringing</a> on GPL'ed code developed by the group.
24 hours after the XVID team announced they would
cease all future development of the project, Sigma Designs
<a href="http://biz.yahoo.com/bw/020822/220286_1.html">
relented</a>
and made their sources available.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Slapper
</FONT>
</H3>
<P>
<a href="http://slashdot.org/articles/02/09/25/1210247.shtml?tid8">
Slashdot noted the emergence</a>
of two new Linux worms, Slapper.B and Slapper.C, which exploit a buffer
overrun in OpenSSL. If you haven't upgraded to OpenSSL 0.9.6g (or at least
e), now is a good time.
A guy suspected of being the original Slapper
<a href="http://www.vnunet.com/News/1135274">
author has been arrested</a>.
<p>
Noel Davis at O'Reilly has recently
<a href="http://linux.oreillynet.com/pub/a/linux/2002/09/23/insecurities.html">
looked at the Linux Slapper worm and other vulnerabilities</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Bruce Perens
</FONT>
</H3>
<P>
As mentioned last month,
<a href="http://perens.com/">
Bruce Perens</a>
has left <a href="http://www.hp.com/">HP</a>. As
<a href="http://www.theregister.co.uk/content/4/27027.html">reported by The
Register</a> this split was quite amicable, but it stemmed from Bruce's
policy of openly confronting and "baiting" Microsoft.
Taking advantage of his new freedom, Perens has launched
<a href="http://sincerechoice.com/">
the Sincere Choice initiative</a>, a reaction to Microsoft's
<a href="http://www.softwarechoice.org/">
Software Choice</a>, which he
<a href="http://www.theregister.co.uk/content/4/26616.html">
earlier denounced</a> as a sham.
Newsforge have an interview with Perens where he expands on the ideas
<a href="http://newsforge.com/newsforge/02/09/12/2040246.shtml?tid=19">
behind his new project</a>.
<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">Debian
</FONT>
</H3>
<P>
Debian Weekly News
<a href="http://www.debian.org/News/weekly/2002/34/">
reported</a>
on a
<a href="http://www.robster.org.uk/files/security-update-check.py">
Security Notification Script</a>
<a href="http://lists.debian.org/debian-devel-0208/msg01644.html">
announced</a> by
Rob Bradford.
The script compares locally installed packages with those on
<a href="http://security.debian.org/">
security.debian.org</a>, and
provides a description of the problem and the name of the Debian advisory
if the package is mentioned in the
<a href="http://www.debian.org/security/dsa.rdf">
DSA RDF file</a>.
<P>
<hr width="20%" noshade>
<P>
Those who own an X-Box,
<a href="http://xbox-linux.sourceforge.net/articles.php?aid02248060056">
may want to try running Debian on it</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Linux From Scratch
</FONT>
</H3>
<P>
The first test release of the upcoming LFS-4.0 book is uploaded and available
for download now. Head over to
<a href="http://www.linuxfromscratch.org">
http://www.linuxfromscratch.org</a>
to view and/or download it.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SuSE
</FONT>
</H3>
<P> the latest
<a href="http://www.suse.de/en">SuSE Linux</a> version, SuSE Linux 8.1,
will be available
by the beginning of October.
<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>, founded by Linux
industry leaders Conectiva S.A., The SCO Group, SuSE Linux AG, and
Turbolinux, Inc., have announced the appointment of Paula Hunter,
an experienced technology executive and consortium leader, as its
worldwide general manager. Hunter's appointment is effective
immediately. The group also announced the open availability of the
beta version of its UnitedLinux product on Sept. 23. The open beta
source code is available for download at no charge from
<a href="http://download.unitedlinux.com/">
download.unitedlinux.com</a>.
<P>
Unfortunately, UnitedLinux has lost some goodwill among the open-source
development community, and in particular the
<a href="http://www.fsf.org/">
Free Software Foundation</a> which published
<a href="http://lwn.net/Articles/10257/">
an open letter</a> expressing concerns about UnitedLinux's closed beta and
the manner in which it was distributed.
UnitedLinux member Connective has
<a href="http://newsforge.com/article.pl?sid=02/09/22/1526208&mode=thread&tid=17">
responded</a>
to these concerns.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">WinLinux
</FONT>
</H3>
<P>
WinLinux 2003 is a major upgrade of the
<a href="http://www.winlinux.net/">
WinLinux</a>
system. WinLinux is claimed to be fully compatible with Windows
95/98/Millennium. WinLinux is also compatible with Red Hat Linux on the
Linux side offering the benefits of both systems.
WinLinux 2003 full version on CD with online support can be ordered
from
<a href="http://www.winlinux.net/2003/order/">
the website</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Xandros
</FONT>
</H3>
<P>
Slashdot
<a href="http://slashdot.org/articles/02/09/18/0252255.shtml?tid2">
linked</a>
to
<a href="http://www.osnews.com/story.php?news_id=1762">
the story on OSNews</a>
previewing beta 3b of
<a href="http://www.xandros.com/">
Xandros Desktop</a>. Xandros is the current custodian of what once was
<a href="http://linux.corel.com/">
Corel Linux</a>.
<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">Linux Game Publishing News Mailing List
</FONT>
</H3>
<P> Linux Game Publishing has announced a partnership with
<a href="http://www.pyrogon.com">Pyrogon Inc.</a>
to bring their latest games to the Linux market. This process will begin
with Candy Cruncher, a fast paced puzzle game.
Please see the
<a href="http://www.linuxgamepublishing.com/press_releases/200209100.txt">
press release</a> for details.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">TinyTERM 4.3
</FONT>
</H3>
<P>
<a href="http://www.centurysoftware.com/">
Century Software</a> has announced the release of
<a href="http://www.centurysoftware.com/products/tinyterm_plus.php?src5">
TinyTERM Version 4.3</a>.
TinyTERM lets you use your Windows PC to easily and accurately
access character based data and applications hosted on UNIX, Linux and IBM
servers. It includes 20 emulations, network utilities, secure
file transfer and free technical support.
TinyTERM is
<a href="http://www.centurysoftware.com/download/index.php?PartNum=TTPL-1&src5">
available for download</a>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Kerio MailServer with integrated McAfee anti-virus program
</FONT>
</H3>
<P>
<a href="http://www.kerio.com/us/kerio.html">
Kerio Technologies</a>
are offering a Linux based mail server product, the Kerio MailServer 5.1.6.
It has an integrated McAfee anti-virus program, and runs on Linux RedHat.
KMS offers a broad range of features and a user-friendly interface in one
package. Kerio claim that no other comparable solution has the McAfee
Anti-Virus program integrated.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">IBM alphaWorks posts porting manager
</FONT>
</H3>
<P>
<a href="http://www.ibm.com/alphaWorks">
AlphaWorks</a>
has posted a free
"porting manager" that enables the porting of C and C++ applications from
Solaris to zSeries Linux, ensuring fast deployment of applications to the
Linux platform.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Ximian Offers Customized Opera for Linux with Red Carpet
</FONT>
</H3>
<P>
<a href="http://www.opera.com">Opera</a>
has announced that its sales referral partner
<a href="http://www.ximian.com">
Ximian</a>
will include a customized version of the Opera Web browser as a download
option in its Red Carpet software management program for Linux users.
Red Carpet is a software management solution used by many Ximian
Desktop users, which keeps Linux systems up to date efficiently and
securely. The program allows users to install, update and maintain software
over the Internet from Ximian, leading Linux distribution providers, and
other independent software vendors.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ActiveState Unveils Komodo 2.0
</FONT>
</H3>
<P>
<a href="http://www.ActiveState.com">
ActiveState Corp.</a>,
has announced a new IDE that provides a powerful
workspace for cross-platform, open source language programming.
Komodo 2.0
affords greater power, flexibility and automation, including the
ActiveState GUI Builder, Visual Package Manager, Source Code Control,
Project Manager, Macros, Web services generation, and more. The only
unified open source programming language IDE, Komodo enables editing,
debugging, and testing in a single workspace.
<P>
Komodo is optimized for Perl, Python, PHP, Tcl, XML, XSLT, and supports
numerous other languages, including Ruby and JavaScript.
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Michael Conry.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Saving Users From Themselves<BR>
-or-<BR>
Dealing with User Input in Python</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/evans.html">Paul Evans</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p>You probably won't be using <a href="http://python.org/">Python</a> long
before writing a program which needs user input. As a wide-eyed, innocent new
Python programmer, you may naively expect that you can simply ask users for
input and they will just give it to you....</p>
<BLOCKQUOTE><EM>
WARNING: Showing the preceding sentence to veteran programmers may
cause them to collapse on the floor giggling helplessly.
</EM></BLOCKQUOTE>
<p>Users don't work that way.</p>
<p>For example, if you ask for a simple 'y or n' response, your user may
cheerfully type in their name - or their lunch order, or nothing at all - and
your program will break. They don't do this on purpose (well, <i>mostly</i>). It's
just that the poor dears are easily distracted, totally ignore your carefully
worded input prompts and often type complete gibberish as far as your program
is concerned. Next, oddly enough, they will blame you, the programmer. Then you will look
foolish and feel Unhappy.</p>
<p>To avoid this misery, the very first thing you need to do is make sure that
whatever comes back from the user is checked to see if it's even vaguely
close to what you expected. Python has heaps of functions to help you with
this and we'll begin by going through some of them together below.</p>
<p>Another thing you can do is use <i>validators</i> on your input widgets. The way
these work is they simply throw away any keystrokes that are not what you are
after. As an example, if you set a numeric validator on a string widget,
users can press 'ABC' etc. as much as they like and nothing will even show up
in the widget. The only keys they can press that will have any effect are 0-9
and, perhaps, a decimal or dollar symbol. We'll play with these too later on.</p>
<p>Finally, even if you are lucky enough to find yourself in possession of a
particularly well-trained and obedient user who always types what you ask,
the input is unlikely to be <i>formatted</i> exactly the way you want it. Careless
typing often produces strings like 'jOHN sMith' (caps lock) or phone numbers
resembling '604555-1212'.</p>
<p>All kidding aside, it's actually <i>your job</i> as a programmer to make it as
easy and fast as possible for the user to input data and that it be presented
and stored in a consistent format. Plus, you can get a great deal of personal
satisfaction and <i>even</i>, dare I say it? <i>gratitude</i> from users if you can save
them from the hell of properly typing something like a Canadian postal code.</p>
<h2>Acquiring Input</h2>
<p>First your program will need to acquire some user input. From the console
Python offers two methods for this 'raw_input("Prompt")' and 'input("Prompt")'.
(Don't use 'input', see below.) You can also get input from good ol' command
line arguments or environment variables.</p>
<p>Other, more graphical methods are available, without getting too carried away, such as
<a href="http://xdialog.free.fr">Xdialog</a>, Gdialog
(part of gnome-utils) or <a href="http://kaptain.sourceforge.net/">Kaptain</a>.</p>
<p>Access to full-blown GUI toolkits is available from Python using
<a href="http://www.riverbankcomputing.co.uk/pyqt/">PyQT</a>
, <a href="http://pmw.sourceforge.net">TKinter</a>,
<a href="http://wxpython.org">WxPython</a> and <a href="http://www.daa.com.au/~james/pygtk/">PyGTK</a>
among others.</p>
<p>This is probably a good time to provide a few words of caution. Most users
are contented, docile creatures who like to have their belly rubbed, but you
<i>will</i> encounter rogue types bent on destruction.</p>
<p>For this reason you must never allow user input to leak into your command space:</p>
<ul>
<li><STRONG>Use 'raw_input()' instead of 'input()'.</STRONG> 'input()' is
fed to 'eval()' before your program gets it. This automatically converts
types, which is convenient if you want an integer <EM>and</EM> the user accidentally
gives you one. But the user would have to quote strings. Worse, a rogue user
might type 'os.system("rm -r *")', which would give you a bad day.
'raw_input()' returns whatever the user entered as a string. This makes
validation easier, because you know what type it will be and thus which
operations you can apply to it.<p></li>
<li><STRONG>Always check input to os.system(), os.popen() or os.exec*() calls.</STRONG>
<p></li>
<li><STRONG>Always escape user input before printing it to a web page or using it in a
SQL query.</STRONG> This is in addition to input checking. Unescaped special
characters can cause invalid HTML, screw up your page formatting, and allow the user
to exploit Javascript "features" against another user. Unescaped special characters in
a SQL query may cause a SQL syntax error or cause the query to do more
than intended. Use 'cgi.escape()' to escape HTML. See your database documentation
to escape SQL queries.
<p></li>
</ul>
<p>O.K. Relax. The spooky part is over.</p>
<p>Open an xterm and type 'python' to enter the interpreter. Note: Many of these
examples <i>require</i> that you be using a version of Python greater than or
equal to version '2'. Redhat still ships with version 1.5x as
default, so if you are a Redhat user you will need to type 'python2' instead
(and possibly install the rpm first from 'add-ons'). For the record, version
'1.5' was released in a year which began with the digits '1' and '9'.</p>
<h2>Checking the Content of String Objects</h2>
<p>Programming languages usually include methods for checking of this kind and
Python is no exception. Consider one of our first challenges as stated above:
making sure the user gives us a valid number when we ask for one.</p>
<p>It happens that all string objects in Python have built-in <i>methods</i> which
make this quite painless. Type these lines in at the '>>>' prompt:</p>
<pre>
>>>input = '9'
>>>input.isdigit()
1
</pre>
<p>This will return a '1' (true), so you can easily use it in an 'if' statement
as a condition. Some other handy attributes of this kind are:</p>
<pre>
s.isalnum() returns true if all characters in s are alphanumeric, false otherwise.
s.isalpha() returns true if all characters in s are alphabetic, false otherwise.
</pre>
<p>For a complete list of these and much more, I highly recommend the
<a href="http://www.brunningonline.net/simon/python/PQR2.1.html">Python 2.1 Quick Reference</a>. I use this all the time and even have an
older text version stuffed into <a href="http://hnb.sourceforge.net">HNB</a> for speed.</p>
<p>This will get us through simple cases like menu choices, but what if we
wanted a float or a real number?</p>
<p>Consider:</p>
<pre>
input = '9.9' or
input = '-9'
</pre>
<p>Both of these are valid numbers, but input.isdigit() will return '0' (false),
because the negative sign and the decimal point are not 'digits'. Our
poor user will be very confused when we spit back an error message if these
entries are valid.</p>
<p>So, let's <i>assume</i> that they are what we want and try to convert
them explicitly. For this we'll use the Python <i>try/except</i> construction.
Python raises <i>exceptions</i> of different kinds on errors and we can trap these
errors individually by name.</p>
<p>Say we wanted an integer like '-9', we can use the numeric operator 'int()'
to explicitly attempt the conversion for us.</p>
<pre>
try:
someVar = int(input)
print 'Is an integer'
except (TypeError, ValueError):
print 'Not an integer'
</pre>
<p>Two things to notice here. The first is that we are checking for two
different exceptions, Type and Value. This way we not only handle the user
entering a float (like '9.9'), but we also allow for the possibility that they
didn't even enter a number of any kind - perhaps they entered 'Ham on rye'.
The second thing to notice is that <i>we actually entered the kinds of
exceptions we were interested in trapping.</i> It's very easy to just type in
open ended exceptions without bothering to look up which errors you are
trapping like this:</p>
<pre>
try:
someVar = int(input)
print 'Is an integer'
except:
print 'Not an integer'
</pre>
<p>DO NOT DO THIS. Python will let you, but since you are now trapping <i>all</i>
exceptions debugging will be a nightmare for you if anything breaks. Just
trust me on this one; look up the errors you mean to trap and you'll save
time in the long run.</p>
<p>Other operators you'll find useful are long() and float(). On the flip side,
str() can convert anything to a string.</p>
<p>Don't forget to range check - it's no good congratulating yourself on
ensuring your program always gets an integer from a user if it blithely
accepts the integer '42' as a valid month day... Make sure the number falls
into the expected range using the comparison operators '>, <, >=' etc.</p>
<h2>Validating Input</h2>
<p>As we've seen, we can validate input <i>after</i> we get it, but wouldn't it be
nice if we could prevent the user from entering mistakes in the first place?</p>
<p>Enter widget validators.</p>
<p>These are things built into graphical user interface toolkits that prevent
unwanted keystrokes from even <i>appearing</i> in the string widget. Toolkits usually
come with some built-in validators for numeric, alpha, and alphanumeric etc.
and are quite easy to use. I'm currently using mostly <a href="http://www.riverbankcomputing.co.uk/pyqt/">PyQT</a>
for gui's, but <a href="http://pmw.sourceforge.net">TKinter</a>,
<a href="http://wxpython.org">WxPython</a> and even <a href="http://kaptain.sourceforge.net/">Kaptain</a>
all have validators. I could be wrong, but <a href="http://www.daa.com.au/~james/pygtk/">PyGTK</a>
seems not to have them - yet. Perhaps you could hook up a signal and roll your own if you happen to
use a toolkit that doesn't have them.</p>
<p>If the built-in validators don't suit you then PyQt, for example, allows you
to specify your own, custom validators.</p>
<p>Clearly, I can't go into detail for every toolkit out there, but here's an
example of how to attach a numeric validator to a widget in PyQT. The
widget's name is 'self.rate', we're attaching the 'QDoubleValidator' and
telling it to accept numbers between 0.0 and 999.0 up to 2 decimal places:</p>
<pre>
self.rate.setValidator(QDoubleValidator(0.0, 999.0, 2, self.rate) )
</pre>
<p>Nice eh? Notice it took care of range checking for us too!</p>
<p>Other ways to help users enter information include spinners, pick-lists and
combo-boxes, but you already knew that.</p>
<h2>Formatting Input</h2>
<p>Remember the 'jOHN sMith' example from the introduction? Here's the fix:</p>
<pre>
>>>'jOHN sMith'.title()
'John Smith'
</pre>
<p>Yes, yet another attribute of all string objects in Python is the 'title()'
attribute which will helpfully capitalize each word for you. 'capitalize()'
is similar, but only does the first character:</p>
<pre>
>>> 'jOHN sMith'.capitalize()
'John smith'
</pre>
<p>Go ahead and try 'upper()', 'lower()' and 'swapcase()' on your own if you
like. I think you can guess their behaviour.</p>
<p>But how about 'rjust(n)'? This is only one of some really handy attributes
you can use to layout reports. Watch:</p>
<pre>
>>> 'John Smith'.rjust(15)
' John Smith'
</pre>
<p>Our string has been right justified for us in a string 15 characters long.
Sweet. As you've probably guessed, there are also 'center(n)' and 'ljust(n)'.
Again, have a look at the
<a href="http://www.brunningonline.net/simon/python/PQR2.1.html">Python 2.1 Quick Reference</a>
to see them all.</p>
<p>Another, very important operator in Python is the '%' (per cent) operator.
The description of this in combination with list objects and printf-style
formatting codes could easily consume several pages, so I'm just going to gloss
over it with a few examples to pique your interest today.</p>
<p>In it's simplest form, the '%' operator lets you write, say, a proper sentence that includes variables which can change
at runtime:</p>
<pre>
>>> 'This is a %s example of its %s.' % ('good', 'use')
'This is a good example of its use.'
</pre>
<p>At least, I hope it is. This is only the beginning of its power. In addition to just string object substitution with
'%s' there is also '%r' and the printf friends from the 'C' language:
c, d, i, u, o, x, X, e, E, f, g, G.</p>
<p>Here's an example from <a href="http://www.brunningonline.net/simon/python/PQR2.1.html">Python 2.1 Quick Reference</a>:</p>
<pre>
>>> '%s has %03d quote types.' % ('Python', 2)
'Python has 002 quote types.'
</pre>
<p>The right hand side may also be a mapping, which allows you to refer to fields by name.
</p>
<p>Let's move on to something a little more challenging, but common enough.</p>
<h3>Phone Numbers</h3>
<p>Phone numbers are variable in length. Sometimes they are only 2 or 3 digits
long if you are behind a corporate PBX system. Other times they might stretch
out to 15 digits or more for international calling. They <i>might</i> even contain
'#' symbols or asterisks. Maybe even commas. Worse, the user may attempt to
impose a format on it as they enter it. Or a partial format. Or not.</p>
<p>Now, it will only frustrate your user if you don't let them at least try to
enter it properly, so your validator had better accept all of #, *, 'comma',
-, ), ( as well as the digits 0-9. Of course, you could still end up with:</p>
<pre>
'250-(555)-12-12'
</pre>
<p>instead of the string:</p>
<pre>
'(250) 555-1212'
</pre>
<p>that we actually want (for a North American phone number anyhow). Don't
worry, we'll make the solution generic enough to handle just about anything.</p>
<p>My first instinct when I need something like this is to copy someone else's
work by mining <a href="http://www.google.com">Google</a> - especially <a href="http://www.google.com">Google Groups</a>. This turns out to
be a good instinct for me to have since the code snippet I usually find will
be far better than I could do on my own. Unfortunately, this time I turned up
an email from Guido van Rossum (the inventor of Python) explaining to someone
that Python did not have such a thing and perhaps they could use something
like:</p>
<pre>
import string
def fmtstr(fmt, str):
res = [] i = 0
for c in fmt:
if c == '#':
res.append(str[i:i+1]) i = i+1
else:
res.append(c)
res.append(str[i:])
return string.join(res)
</pre>
<p>This is a darn good start of course and you can't argue with the credentials of
its author, but it doesn't handle all the cases without a lot of 'if/then'
constructs to count how many digits you were given in order to choose a format
string of the correct length. Go ahead and paste it
into your xterm and then call it like this:</p>
<pre>
>>> fmtstr('###-####', '5551212')
'5 5 5 - 1 2 1 2 '
</pre>
<p>In fact, I did copy and paste it into my editor and then constructed a long sequence of
'if/thens' for phone numbers, dates and other types of entries, but I still wasn't
handling everything. Plus, I had dozens and dozens of lines doing self-similar
things. They have since passed on to their reward.</p>
<p>O.K., here we go... First, let's filter any "extra" formatting characters we
let the user type in:</p>
<pre>
def filter(inStr, allowed):
outStr = ''
for c in inStr:
if c in allowed:
outStr += c
return outStr
</pre>
<p>We could call it like this:</p>
<pre>
>>>filter('250-(555)-12-12', string.digits)
'2505551212'
</pre>
<p>Or we could define the second argument ourselves as '0123456789#*,' to
include all the allowable characters possible.</p>
<p>Now we just take Guido's code snippet and (this is the good bit) <i>reverse</i>
both the input arguments. This way we can specify just one long format string
and it will be matched until we run out of input. Any extra input will just
get tacked on, so we will never lose any characters.</p>
<pre>
# import the regular expression module
import re
def formatStr(inStr, fmtStr, p = '^'):
inList = [x for x in inStr] #list from strings..
fmtList = [x for x in fmtStr]
# the good bit
inList.reverse(); fmtList.reverse()
outList = []
i = 0
for c in fmtList:
if c == p:
try:
outList.append(inList[i])
i += 1
# break if fmtStr longer than inStr
except IndexError:
break
else:
outList.append(c)
# handle inStr longer than fmtStr
while i < len(inList):
outList.append(inList[i])
i += 1
# put it back the way we found it
outList.reverse()
outStr = ''.join(outList)
# remove stray parens/- etc
while re.match('[)|-| ]', outStr[0]):
outStr = outStr[1:]
# close any legit parens
while outStr.count(')') > outStr.count('('):
outStr = '(' + outStr
return outStr
</pre>
<p><a href="misc/evans/fmtstr.py.txt">[Text version of this listing.]</a></p>
<p>It's basically the same as Guido's except the default placeholder character is now
a '^' (caret), because we may need to use the '#'. Alternatively, this may be
specified as an, optional, third argument if we ever need real carets in the output.</p>
<p>Here's some sample output:</p>
<pre>
>>> formatStr('51212', ' ^^^ ^^ (^^^) ^^^-^^^^')
'5-1212'
>>> formatStr('045551212', ' ^^^ ^^ (^^^) ^^^-^^^^')
'(04) 555-1212'
>>> formatStr('16045551212', ' ^^^ ^^ (^^^) ^^^-^^^^')
'1 (604) 555-1212'
>>> formatStr('1011446045551212', ' ^^^ ^^ (^^^) ^^^-^^^^')
'1 011 44 (604) 555-1212'
</pre>
<p>In practice, you'll probably want to simply define your phone formatting
string early on e.g.:</p>
<pre>
phone_format_str = ' ^^^ ^^ (^^^) ^^^-^^^^'
</pre>
<p>There's a space at the beginning of the string so that any additional characters won't get smooshed onto it. You'd likely call it thus:</p>
<pre>
formatStr(input, phone_format_str)
</pre>
<p>... after you clean up your 'input' with something like the 'filter()' function.</p>
<h3>Postal Codes</h3>
<p>In case you are (blessedly) unfamiliar with Canadian postal codes, they look like
this:</p>
<pre>
'V8G 4L2'
</pre>
<p>Which <i>appears</i> innocuous enough until you attempt to type it. Especially
for non-typists (like me). You can turn on the caps lock - and then forget
to turn it off - or you have to type [shift]+alpha, number, [shift]+alpha
etc. and quite often end up with: 'v*g $l@' when you get out of sequence.
Needless to say, users <i>hate</i> typing them in and they hardly ever
look right. Mostly your application won't even capture postal codes, because
users simply won't bother. Some other countries have similar post codes. Shame.</p>
<p>Now, with our new formatting function, they're a piece of cake. First, we either
validate or filter whatever they give us, then we simply use Python's
built-in string attribute 'upper()' to set the case of the alpha characters
properly, finally:</p>
<pre>
>>>formatStr('V8G4L2', ' ^^^ ^^^')
'V8G 4L2'
</pre>
<p>If accurate postal codes are critical to your application, you will need to do
more verification by way of counting the characters and verifying the pattern. For
general use though, you need to allow for the postal codes of other countries. I
think I normally format only if the number of characters == 6 after clean up.</p>
<p>How about Social Insurance Numbers? Same deal:</p>
<pre>
>>> formatStr('716555123', '^^^-^^^-^^^')
'716-555-123'
</pre>
<p>You should run a check digit routine over Social Insurance Numbers first to
ensure they are valid. Ditto for credit cards.</p>
<p>I hope these examples will save you some time in coding user interfaces. I'd
very much like to <a href="mailto:pevans@catholic.org?subject=LG article on User Input">hear back</a>
with examples or improvements of your own. Particularly ways of dealing with dates<SUP><A HREF="#foot1">1</A></SUP> with users. They're always fun.</p>
<p>By the way, it's very important that you not keep these formatting aids a secret from your users. Put it in the 'help', use
'tooltips' or 'whatis' to let them know the facility is there for them. If they find out after months of typing things the long way,
they are liable to pout and you'll end up wasting afternoon coffee scratching them behind the ears (morning coffee is a given).</p>
<p>Have fun with it!</p>
<A name="foot1">1</A> That's <i>calendar</i> dates...
<!-- *** BEGIN bio *** -->
<SPACER TYPE="vertical" SIZE="30">
<P>
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Paul Evans</H4>
<EM>Paul Evans loves everything about electronics and computers in particular. He
is old enough to remember drooling over an Altair 8080A in his adolescence.
He and his two children live in the Wilds of Northern British Columbia;
they're not lumberjacks, but they're OK.</EM>
<!-- *** END bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Paul Evans.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 82 of <i>Linux Gazette</i>, September 2002</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">Creating Makefiles: A Mini Tutorial</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/heriyanto.html">Tedi Heriyanto</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<DIV>
This article will provide a guidance to create your own Makefile. The article will
explain why we need a Makefile and will also list several things we
should consider in creating a Makefile.
</DIV>
<P>
<P>
<H1><A NAME="SECTION00010000000000000000">
Introduction</A>
</H1>
<P>
Imagine you are developing a program called <TT>foo</TT>, which consists
of five headers, that is <TT>1.h</TT>, <TT>2.h</TT>, <TT>3.h</TT>,
<TT>4.h</TT>, and <TT>5.h</TT>, six C-language source code files
named <TT>1.cpp</TT> to <TT>5.cpp</TT>, and a <TT>main.cpp</TT> file
(Remember: we do not recommend to use such file naming scheme in the real
life).
<P>
Suppose you find a bug in <TT>2.cpp</TT> and has fix it.
In order to get a new <TT>foo</TT> program, you have to recompile
all files, header and source code, even though you just change one
file. This is not a fun job, waiting for the computer to finished its
process compiling your program. Particularly if you don't have fast computer.
<P>
What can you do then? Is there any solution for this problem ?
<P>
Please do not worry my friends. That kind of problem has already been
experienced by our fellow computer hackers years ago. To tackle this
problem, they have developed a program called <TT>make</TT>. Instead
of build all of the source codes, this program will only build
source code that has been changed. If you change file <TT>2.cpp</TT>, then <TT>make</TT>
will only build it. Isn't it fun?
<P>
The followings are several other reasons why we need <TT>make</TT> [<A
HREF="#lpu">2</A>] :
<UL>
<LI>A software project which consists of many source codes, can have
complex and long compiler commands. Using <TT>make</TT>, it can be reduced.
</LI>
<LI>Programming project sometimes need specialized compiler options
that are so rarely used they are hard to remember; with <TT>make</TT>
this can be reduced.
</LI>
<LI>Maintaining a consistent development environment.
</LI>
<LI>Automating the build process, because <TT>make</TT> can be
called easily from a shell script or a cron job.
</LI>
</UL>
<P>
<H1><A NAME="SECTION00020000000000000000">
Why Do We Need a Makefile?</A>
</H1>
<P>
Although <TT>make</TT> is very useful, it cannot do its job
without the instructions given by us, the programmer. <TT>make</TT>
instructions is stored in a text file. This file is usually called
<B>makefile</B> and contains commands that must be processed by
<TT>make</TT>.
<P>
This file is normally named <TT>makefile</TT> or <TT>Makefile</TT>. As a
convention, GNU programs named their makefile, <TT>Makefile</TT>, because
it is easy to see (if you do "ls" then this file is usually always on
the top of the list). If you give it another name, just make
sure you include option <TT>-f</TT> to <TT>make</TT> command in order
to let it know that you use it.
<P>
For example, if we have a makefile named <TT>bejo</TT>, then the
command we use to instruct <TT>make</TT> to process that file is :
<PRE>
make -f bejo
</PRE>
<P>
<H1><A NAME="SECTION00030000000000000000">
Makefile Structure</A>
</H1>
<P>
A makefile consists of <I>target</I>, <I>dependencies</I> and <I>rules</I>
section. Dependecies are things or source code needed to make a target;
target is usually an executable or object file name. Rules are commands needed to make
the target.
<P>
Following is a simple description of a makefile :
<PRE>
target: dependencies
command
command
...
</PRE>
<P>
<H1><A NAME="SECTION00040000000000000000">
An Example of Makefile</A>
</H1>
<P>
The following is a simple makefile example (line numbers added for the article):
<P>
<PRE>
1 client: conn.o
2 g++ client.cpp conn.o -o client
3 conn.o: conn.cpp conn.h
4 g++ -c conn.cpp -o conn.o
</PRE>
<P>
In the makefile above, dependencies is line contained <TT>client:
conn.o</TT>, while rules is line contained <TT>g++ client.cpp conn.o -o
client</TT>. Note that <EM>every rule line begins with a tab, not
spaces</EM>. Forgetting to insert a tab at the beginning
of the rule line is the most common mistakes in constructing
makefiles. Fortunately, this kind of error is very easy to be
spotted, because <TT>make</TT> program will complain about it.
<P>
Detail description of the makefile depicted above are as follows :
<UL>
<LI>Create an executable file named <TT>client</TT> as a target, which
depends on file <TT>conn.o</TT>
</LI>
<LI>Rules to create the target are in line 2.
</LI>
<LI>In the third line, to make target <TT>conn.o</TT>, <TT>make</TT>
needs files <TT>conn.cpp</TT> and <TT>conn.h</TT>.
</LI>
<LI>The rules to make target <TT>conn.o</TT> are in line 4.
</LI>
</UL>
<P>
<H1><A NAME="SECTION00050000000000000000">
Comment</A>
</H1>
<P>
To give a comment in makefile, merely put '#' in the first column of each line
to be commented.
<P>
Below is an example makefile that has already been commented :
<P>
<PRE>
# Create executable file "client"
1 client: conn.o
2 g++ client.cpp conn.o -o client
# Create object file "conn.o"
3 conn.o: conn.cpp conn.h
4 g++ -c conn.cpp -o conn.o
</PRE>
<P>
<H1><A NAME="SECTION00060000000000000000">
Phony Target[<A
HREF="#gnum">1</A>]</A>
</H1>
<P>
A phony target is a fake filename. It is just a name for commands that
will be executed when you give an explicit request. There are two reasons
for using phony target : to avoid conflicts with a file with the same
name, and to enhance the makefile performance.
<P>
If you write a rule whose command will not create a target file,
those commands will be executed every time the target is remade. For example:
<P>
<PRE>
clean:
rm *.o temp
</PRE>
<P>
Because the command <TT>rm</TT> will not create a file named <TT>clean</TT>,
that file will never exist. Command <TT>rm</TT> will always be executed
every time you called <TT>make clean</TT>, because <TT>make</TT>
assume that the <TT>clean</TT> file is always new.
<P>
The above target will stop working if a file named
<TT>clean</TT> exists in the current directory. Because it does not require
dependencies, file <TT>clean</TT> will be considered up-to-date, and the
command 'rm *.o temp' will not be executed. To resolve this problem, you can explicitly
declare a target as phony, using special target command <TT>.PHONY</TT>. For example :
<P>
<PRE>
.PHONY : clean
</PRE>
<P>
In the makefile above, if we give instruction <TT>make clean</TT> from
the command-line, the command 'rm *.o temp' will always be run,
whether or not a file named <TT>clean</TT> exists in the current
directory.
<P>
<H1><A NAME="SECTION00070000000000000000">
Variable</A>
</H1>
To define a variable in a makefile, you can use the following command:
<PRE>
$VAR_NAME=value
</PRE>
<P>
As a convention, a variable name is given in uppercase, for example :
<PRE>
$OBJECTS=main.o test.o
</PRE>
<P>
To get a varible's value, put the symbol $ before the variable's
name, such as :
<PRE>
$(VAR_NAME)
</PRE>
<P>
In makefile, there are two kinds of variables, <I>recursively
expanded variable</I> and <I>simply expanded variable</I>.
<P>
In the recursively expanded variable, <TT>make</TT> will continue expanding
that variable until it cannot be expanded anymore, for example :
<PRE>
TOPDIR=/home/tedi/project
SRCDIR=$(TOPDIR)/src
</PRE>
<P>
SRCDIR variable will be expanded, first by expanding TOPDIR variable.
The final result is <TT>/home/tedi/project/src</TT>
<P>
But, recursively expanded variable will not be suitable for the
following command :
<PRE>
CC = gcc -o
CC = $(CC) -O2
</PRE>
<P>
Using a recursively expanded variable, those command will go to endless
loop. To overcome this problem, we use a simply expanded variable :
<PRE>
CC := gcc -o
CC += $(CC) -O2
</PRE>
The ':=' symbol creates the variable CC and given its value "gcc -o".
The '+=' symbol appends "-O2" to CC's value.
<P>
<H1><A NAME="SECTION00080000000000000000">
Closing Remarks</A>
</H1>
<P>
I hope this short tutorial will give you enough knowledge to create
makefile. Until then, happy hacking.
<P>
<H2><A NAME="SECTION00090000000000000000">
Bibliography</A>
</H2>
<ul>
<li><A NAME="gnum"><SUP>1</SUP></A>
GNU Make Documentation File, info make.
<li><A NAME="lpu"><SUP>2</SUP></A>
Kurt Wall, et.al., <I>Linux Programming Unleashed</I>, 2001.
</ul>
</DL>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Tedi Heriyanto.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Multi-Account E-mail with Mutt</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/klimkiewicz.html">Kamil Klimkiewicz</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p>About three or four months ago I switched from Windows to Linux. I had
been using Linux before but it was only my second operating
system. When it became my primary one I had to deal with several
problems. Most of them I was able to fix quickly. There was one thing
which caused many troubles - I had three e-mail accounts.</p>
<p>Windows user could say, "Download some e-mail client and configure it
to use several accounts." But there is something called the 'Unix
philosophy'. It says that programmers should write small applications
which do only one thing but do it well. What does it mean for us? It
means that there is no single tool which fetches your mail from
remote server, allows you to read and write mail and sends it to its
target.</p>
<p>In this short article I will only show you how to configure tools
called <em>fetchmail</em> and <em>mutt</em>. If you
want to go deeper into this topic you should read:</p>
<ul>
<li>Mail-Administrator-HOWTO,</li>
<li>Mail-User-HOWTO.</li>
</ul>
<p>You can get them from <a
href="http://www.linuxdoc.org">http://www.linuxdoc.org</a>.</p>
<h2>1. Environment</h2>
<p>Let's define our e-mail environment: we have three e-mail accounts,
each placed on different server. We will call them 'First', 'Second'
and 'Third.' Their addresses are: first@firstdomain.com,
second@seconddomain.com, third@thirddomain.com. Moreover the first
account uses IMAP protocol and the others POP3.</p>
<p>The local user who is going to receive all the messages is called
'john'. We need to set new value for $MAIL environment variable, since
we won't use default '/var/spool/mail/john' (this is unsafe and less
convenient.) To do this we add following lines to .bash_profile (of
course if you use different shell you have to change different
things):</p>
<pre>
MAIL=$HOME/Mail/Inbox
export MAIL
</pre>
<p>(Don't forget to create directory '$HOME/Mail'!.)
We will also use additional mailboxes for read messages (each account
has its associated box.)</p>
<h2>2. Fetchmail</h2>
<p>Before we can read our mail we have to fetch it from remote server. To
do this we will use a tool called <b>fetchmail</b>. It should be
already installed on your system.</p>
<p>Configuring fetchmail is quite easy task. Moreover we can use utility
'fetchmailconf' which makes the process even easier.
Configuration file we should edit is <em>$HOME/.fetchmailrc</em>. Simple one,
appropriate for our environment, looks like this:</p>
<pre>
set postmaster "john"
set bouncemail
set properties ""
set daemon 300
poll First via firstdomain.com
with proto IMAP
user first there with password this_is_password is john here warnings 3600
poll Second via seconddomain.com
with proto POP3
user second there with password this_is_password is john here warnings 3600
poll Second via thirddomain.com
with proto POP3
user third there with password this_is_password is john here warnings 3600
</pre>
<p>To run fetchmail you only need to type <em>fetchmail</em>. It will be
started in daemon mode and will check whether there is new mail every
5 minutes.</p>
<h2>3. Mutt</h2>
<p>Our messages are on local machine now, so we can read them using
any Mail User Agent. I assume it is <em>mutt</em> because this article
is intended to deal with mutt.</p>
<p>Mutt needs to be configured before it can work like we want. First
of all we have to put some basic definitions in its configuration file
(it is usually called <em>$HOME/.muttrc</em>.) They can look like
this:</p>
<pre>
set mbox = "~/Mail/Inbox"
set move = no
set folder = "~/Mail"
set record = +Sent
mailboxes +Inbox +First +Second +Third
</pre>
<p>This actually allows us to read the messages but every outgoing
message will have something like <em>john@localhost</em> in its
<em>From</em> header field. We should be able to change the sender
address so the message can look like it was sent from
<em>firstdomain.com</em> or <em>seconddomain.com</em> or whatever
machine you have account on.</p>
<p>To achieve this we use additional mailboxes (First, Second and
Third) and mutt's so called <em>hooks</em> mechanism. The latter
executes user defined commands when some action is being
performed. There is <em>folder-hook</em> which is called when user
changes mail folder (by pressing 'c' key.) To change the <em>From</em>
field we need to modify <em>from</em> and <em>realname</em> mutt
variables:</p>
<pre>
# Default action:
folder-hook . set from = first@firstdomain.com
folder-hook . set realname = First
# First account:
folder-hook First set from = first@firstdomain.com
folder-hook First set realname = First
# Second account:
folder-hook Second set from = second@seconddomain.com
folder-hook Second set realname = Second
# Third account:
folder-hook Third set from = third@thirddomain.com
folder-hook Third set realname = Third
</pre>
<p>We should also define the <em>alternates</em> variable so mutt can
recognize messages sent to and by us:</p>
<pre>
set alternates = "first@firstdomain\.com|second@seconddomain\.com|third@thirddomain\.com"
</pre>
<p><b>Note:</b> There is a web tool called <em>MuttrcBuilder</em> at
<a href="http://mutt.netliberte.org">http://mutt.netliberte.org</a>
which you can use to configure your mutt.</p>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Kamil Klimkiewicz.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Replicating a Linux System - Yet Another Method</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/okopnik.html">Ben Okopnik</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h3>
Why Replicate?</h3>
Replication - sometimes referred to as cloning - is the process of copying
an installed filesystem from one machine to another (usually to a new machine)
instead of going though the entire installation process again; a good thing
indeed. Given the speed at which computers improve, by the time you have
your system tweaked and tuned exactly the way you like it - usually at
the cost of dozens if not hundreds of hours of playing with it - the hardware
is outdated. Replication allows you to conserve all that effort by simply
transferring the entire configured system to new hardware.
<p>What makes replication a uniquely wonderful experience under Linux is
the large number of options for doing so, which implies flexibility and
the ability to adapt the method to your exact situation - just as I have
here. Other OSes are generally confined to one rather restrictive method
(in effect, "dd"ing the hard drive contents to an identical drive.) With
Linux, you can pick whatever method suits your needs. However, there is
a cost - the same one that applies to just about anything else in Linux.
As the XFree folks say, "don't set policy - provide a mechanism." What
you have to do, rather than blindly running a provided menu-driven application
(what
<b>is</b> that thing doing behind the scenes? Can you troubleshoot
the process if it goes wrong?) is a) understand the process, and b) choose
the tools that will make it happen. In the world of Unix, where "small
sharp tools" is a major tenet of the underlying philosophy, this is the
default way to work.
<h3>
A Little Insanity Goes A Long Way</h3>
Before you read any further, <STRONG>A WARNING:</STRONG>
<BLOCKQUOTE><EM>
This is <b>not</b>
the standard way to replicate a Linux system. What is described below was
an experiment just to see if it could
be done. Yes, you could probably repeat my results - you might even find
it as convenient as I did to do it this way - but if you
mess it up and end up causing clogged toilets in New Guinea, earthquakes
in Abu Dhabi, and war between Earth and the
intelligent cephalopods of Beta Cygni 4, don't blame me!
</EM></BLOCKQUOTE>
It seems that for a number of people, myself most emphatically included,
the best way to learn how something works is to take it apart and then
put it back together (usually turning a five-dollar toy into a three-day-long
project and seven gallons of sweat, but - oh well.) So... about a week
ago, I was given a computer, somebody's "outdated" box. (Wind*ws is great.
No, really. There's no way I'd run it, but I love the effect it has: it
makes people think that a P3-400/64MB machine is "outdated". There are
always going to be a lot of uninformed folks out there, so I can see a
lifetime of free computers ahead of me! Somebody else here wants to give
me a really nice 486 Gateway laptop, too...)
<p>Of course, as far as I'm concerned, new computer = Linux installation.
That's like ham and eggs, bread and butter, <i>agua caliente para chocolate</i>
(yes, I'm getting a little hungry here, but you get the idea.) It's just
natural. However, my install CDs are old enough that I have to wipe off
the Tyrannosaurus footprints - I mean, they're almost a year old! - so
I wasn't going to do that. Hmm. My Net access these days consists of walking
over to the marina office (I live on a sailboat) and plugging into a phone
jack - dragging over a desktop PC and leaving it plugged in for a week
wasn't going to be looked on favorably. Scrap <i>that</i> scenario. I could
order the latest CD set from <a href="http://www.cheapbytes.com">CheapBytes.com</a>,
but I didn't feel like waiting for several days: I had a time slot <i>now.</i>
This was going to take a little planning.
<p>My laptop has a well-polished install of Debian on it - I've had quite
a while to get it all set up exactly the way I want it. I could just "dd"
everything over, and - oh. The laptop drive is 12GB; the drive I dug up
was an old 6GB that had a 2GB partition with some historical data on it
and a
<i>really</i> ancient Debian install. I didn't want to just scrap
the data, didn't feel like messing around with my backups and tape drives,
and 12 won't fit into 6 anyway. Let's see. A fair chunk of that 12 is my
music collection; heck, I'll just leave it on the 'top. Next, there's my
"Data Dump": an FTP archive backup, a mirror of the Comprehensive Perl
Archive Network (CPAN)... yeah, all that could stay there too. A little
decision-making, and my entire kit of programs turned out to fit into about
2GB - just what the doctor ordered! All except one thing, that is - how
would I get it from <b>here</b> to <b>there</b>, keeping all the permissions,
etc. correct? And what other problems would I run into?
<p>There are a number of standard methods for installing Linux: CD or other
media, an archive or a loop-mounted image via a network, raw copying between
same-sized drives with "dd", and - closest to what I wanted - a filesystem
dump between identically laid-out systems (see Jim Dennis' tip in LG#68,
"Bulk File Transfers from Wind*ws to ???".) However, I wasn't doing any
of those, not even the last; instead, I was going to transfer bits and
pieces to a different FS layout. Would it work? In a move strongly fueled
by way too much machismo, entirely too little sense, and Mike Orr's column
in this very magazine (see his "The Foolish Things We Do With Our Computers"
[look in the <A HREF="../lg_index.html">Index of All Issues</A> to find it]
-- perhaps this whole article belongs in that category!), I said to myself:
"Self... let's do it anyway. We can
<i>always</i> restart from scratch."
<h3>
Diving Head-First Into The Dark Waters</h3>
One of my main tools for this project was the Bootable Business Card from
the <a href="http://www.lnx-bbc.org">LNX-BBC project</a>. I booted the
new machine with it and used "mke2fs" with the "-j" option (this creates
a journal on the new partition, something I needed since I use ext3 on
my laptop) to reinitialize "/dev/hda2" - this is where Linux would live.
Next, I mounted "/dev/hda2" on "/mnt/0", activated the network card by
entering "insmod dmfe" (the new desktop came with an on-board Davicom),
assigned it an IP address ("ifconfig eth0 192.168.0.5"), and I could now
"see" the laptop - which was ready and waiting at 192.168.0.3, courtesy
of a NetGear PCMCIA card and a crossover cable.
<p>I don't run any network services on my laptop by default - one of the
first things I do in almost any install is disable "inetd" - but here,
I wanted to use "sshd" for a specific reason. Therefore, Baldur (the laptop)
got a command of "su -c '/etc/init.d/ssh start'", and Ymir (the desktop)
got "rsync -e ssh -avz --exclude-from file.lst root@192.168.0.3:/ /". The
exclude list, a file called "file.lst" (files and directories that "rsync"
should ignore) was a fairly short one: "/proc/", not being a "real" filesystem,
didn't need to be copied (in fact, doing so would be a bad idea); however,
I did make an empty "/proc" directory on the new partition. I skipped "/lost+found/"
as well - one was automatically created on Ymir when I ran "mke2fs" (besides,
it's not just a simple directory; see "mklost+found" for more info). I
also most carefully did not copy the journal-related files ("/.journal"
and "/.memdump") from Baldur; they would have no relation to the disk state
on Ymir, and could probably screw things up pretty badly. Last, I added
the directories that I didn't want to copy to the new system.
<p>Once done with the copying - which took a while, even at 100Mb/s - I
did a "chroot /mnt/0 /bin/bash" on Ymir, which made this new filesystem
the root ("/") and ran a shell in it. Success! I thought of this as the
"three-quarter-way point"; most of the moving was done, and the only remaining
critical thing was making the system bootable. Of course, I had to do a
bit of system-specific setup: modifying "/etc/fstab" to reflect the correct
partitions, fixing "/etc/modules" to load the right ones, adjusting "/etc/lilo.conf"
and running "/sbin/lilo" to boot the right image... oh, whoops. Baldur
boots via "initrd"; the "initrd" image includes information about which
partition gets "pivoted to" as root, and that was different between Baldur
and Ymir. OK, then - I jumped over to Baldur and ran "mkinitrd" with the
"-r /dev/hda2" option, which built me a new "initrd" image with the correct
partition as the root. I "rsync"ed it to Ymir, and life was lookin' good.
<p>As a last step before rebooting, I ran "/sbin/lilo -v3", and... aaarrgh.
I got a message about the boot sector being made by a previous version
of LILO (remember that ancient Debian distro that had been on there?),
and the new one simply refused to rewrite it! <sigh> Clearly, this would
not normally be an issue, but this time, it was a pain. Ah - LILO's manual
mentions the "QuickInst" script that is supposed to be used for initial
installs only - perfect. (See LILO's "doc" directory.) "QuickInst" walked
me through setting up some basics, and... <laugh> it didn't work - the
"lilo.conf" that it wrote was too simple, and didn't match my setup. That
was OK, because it <i>did</i> rewrite the boot sector; I simply copied
the correct version of "lilo.conf" back into "/etc", re-ran "lilo -v3",
and All Was Cool.
<p>I then rebooted, swapped the BIOS settings back so that Ymir would boot
from the HD rather than the CDROM, watched a few errors fly by... and was
greeted with a login prompt. Hurrah! That was 90% of the way there; the
rest was just more tweaking. For the record, the things that produced the
errors were: "hdparm" disk tuning parameters had to be changed, and one
old module was still loading from "/etc/default/hotplug.usb". Other than
that, all that remained was much like setting up a new system, although
a lot less work. Let's see:
<ul>
<li>
Reconfigure X for different video card/monitor</li>
<li>
Load a different module for sound hardware</li>
<li>
Change the hostname in several "/etc" files ("grep -rl Baldur /etc")</li>
<li>
Run "ssh-keygen" for new SSH-2 "fingerprints" for Ymir</li>
<li>
Shut down "sshd" on Baldur</li>
</ul>
That was all of it. It's been more than a month now and I haven't had any
trouble at all. Sure, I've left a lot of stuff out of this description
in order to make myself look smarter - I probably rebooted, switching between
the LNX-BBC CD and the HD, about a dozen times because I'd forgotten "just
one little thing" - but the above was the critical path, the stuff that
had to happen to make it work. About two hours of work, and I had an up-to-date
Linux system that's all tuned to my preferences - setting it up from scratch
and getting it all adjusted would have taken much, much longer.
<h3>
After-Action Report</h3>
As a result of doing this, I learned a number of important things: a little
more knowledge about the "initrd" boot process, a little more experience
at fixing LILO problems, what exactly <b>is</b> affected when you move
from one system to another - and most important of all, how to do this
process and its associated pitfalls. As well, it's another tool in my "knowledge
toolbox" - and that's always a good thing. In fact, the laptop on which
I'm typing this - a brand-new Dell Inspiron - had Wind*ws XP on it just
a short while ago... :) It is now a very smoothly operating Linux 'top.
The actual time that I spent on the cloning, excluding the transfer time
(12GB takes a <b>while</b> to move across), was about 10-15 minutes; experience
is a wonderful thing.
<p>Happy Linuxing to all!
<H3>References</H3>
<UL>
<LI>man pages for "rsync", "ssh"/"sshd", "mke2fs"/"tune2fs", "chroot", "mkinitrd", "lilo"
<LI>Documentation (/usr/share/doc/lilo/Manual.txt.gz) for "lilo"
<LI>Documentation for the LNX-BBC CD
</UL>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Ben Okopnik.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Exploring Perl Modules - Part2: Creating Charts with GD::Graph</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/padala.html">Pradeep Padala</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h3>Introduction</h3>
<p>
If you have read my
<A HREF="../issue81/padala.html">previous article on GD</A>, you might have
noticed that creating charts with the GD module is cumbersome. (That article
also contains some general information about loading Perl modules.) Martien
Verbruggen has created the GD::Graph module that allows easy creation of
charts. This module has useful functions to create various types of charts such
as bar charts, pie charts, line charts etc... The module is very useful in
creating dynamic charts depicting network statistics, web page access
statistics etc...
<p>
In this article, I will describe a general way of using the module
and also show a few examples of creating various charts.
<h3>Typical Way of Using the GD::Graph Module</h3>
<p>
A perl script using GD::Graph to create charts typically contains
the following things:
<ul>
<li> Prepare your data as an array of arrays. (More about this later)
<li> Decide on the type of chart. You would use a call like
<pre>
$mygraph = GD::Graph::<b>chart</b>->new($width, $height);
</pre>
where chart can be <i>bars</i>, <i>lines</i>, <i>points</i>, <i>linespoints</i>,
<i>mixed</i> or <i>pie</i>. For example, if you wanted a bar chart, you
would use
<pre>
$mygraph = GD::Graph::bars->new($width, $height);
</pre>
<li> Set options for the graph as needed. This involves setting 'title',
'x-label' etc... You can also set chart-type specific options.
<li>Plot the graph using the plot function
<pre>
$myimage = $mygraph->plot(\@data);
</pre>
<li> Finally, you can save the image to a file or output for web. This is
similar to the way we have saved images
<a href="../issue81/padala.html">using the GD module</a>.
</ul>
<h3>A Simple Example </h3>
<p>
Let's draw a simple chart following above steps. This script uses CGI to output
the image on to a web page.
<BR><A HREF="misc/padala/simple.pl.txt">[Text version of this listing.]</A>
<pre>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::bars;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">"</font><font color="#ff00ff">Jan</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Feb</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Mar</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Apr</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">May</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Jun</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Jul</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Aug</font><font color="#ff00ff">"</font>,
<font color="#ff00ff">"</font><font color="#ff00ff">Sep</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Oct</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Nov</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Dec</font><font color="#ff00ff">"</font>],
[<font color="#ff00ff">23</font>, <font color="#ff00ff">5</font>, <font color="#ff00ff">2</font>, <font color="#ff00ff">20</font>, <font color="#ff00ff">11</font>, <font color="#ff00ff">33</font>, <font color="#ff00ff">7</font>, <font color="#ff00ff">31</font>, <font color="#ff00ff">77</font>, <font color="#ff00ff">18</font>, <font color="#ff00ff">65</font>, <font color="#ff00ff">52</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::bars-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">500</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">x_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Month</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">y_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Number of Hits</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Number of Hits in Each Month in 2002</font><font color="#ff00ff">'</font>,
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
The output of the program can be seen <a href=misc/padala/simple_output.png>here</a>
<p>
The above program is pretty much self-explanatory. The <code>@data</code>
variable
is an array of arrays. The first array represents the labels on X-axis and all
the subsequent arrays present different datasets.
<h3>Tweaking the options</h3>
<p>
As you can see, the graph produced by above program is quite bland and simple.
We can tweak various options to produce better looking and customized graphs.
There are a multitude of options to control the various aspects of the graph.
Options are divided into two types: the options common to all types of graphs,
and the options specific to each type of graph.
<p>
Options can be set while creating the graph or with
<pre>
$mygraph->set(attrib1 => value1, attrib2 => value2, ...);
</pre>
<p>
Let us write a script setting legends, a grid and few options.
<BR><A HREF="misc/padala/legend.pl.txt">[Text version of this listing.]</A>
<pre>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::bars;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">'</font><font color="#ff00ff">Fall 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Fall 02</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 02</font><font color="#ff00ff">'</font> ],
[<font color="#ff00ff">80</font>, <font color="#ff00ff">90</font>, <font color="#ff00ff">85</font>, <font color="#ff00ff">75</font>],
[<font color="#ff00ff">76</font>, <font color="#ff00ff">55</font>, <font color="#ff00ff">75</font>, <font color="#ff00ff">95</font>],
[<font color="#ff00ff">66</font>, <font color="#ff00ff">58</font>, <font color="#ff00ff">92</font>, <font color="#ff00ff">83</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::bars-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">500</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">x_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Semester</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">y_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Marks</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Grade report for a student</font><font color="#ff00ff">'</font>,
<font color="#0000ff"># Draw bars with width 3 pixels</font>
<font color="#ff00ff">bar_width </font>=> <font color="#ff00ff">3</font>,
<font color="#0000ff"># Sepearte the bars with 4 pixels</font>
<font color="#ff00ff">bar_spacing </font>=> <font color="#ff00ff">4</font>,
<font color="#0000ff"># Show the grid</font>
<font color="#ff00ff">long_ticks </font>=> <font color="#ff00ff">1</font>,
<font color="#0000ff"># Show values on top of each bar</font>
<font color="#ff00ff">show_values </font>=> <font color="#ff00ff">1</font>,
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#008b8b">$mygraph</font>->set_legend_font(GD::gdMediumBoldFont);
<font color="#008b8b">$mygraph</font>->set_legend(<font color="#ff00ff">'</font><font color="#ff00ff">Exam 1</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 2</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 3</font><font color="#ff00ff">'</font>);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
The output of above program can be seen <a href=misc/padala/legend.png>here</a>
<h3>Graph with a logo in the background</h3>
<p>
Again as you can see, GD::Graph provides a flexible to way to create
customized graphs. Let's prepare another chart with a logo.
<pre>
Text version of the file can be found <a href=misc/padala/logo.pl.txt>here</a>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use lib</b></font> <font color="#ff00ff">'</font><font color="#ff00ff">/cise/homes/ppadala/mydepot/lib/perl5/site_perl</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::bars;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">'</font><font color="#ff00ff">Fall 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Fall 02</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 02</font><font color="#ff00ff">'</font> ],
[<font color="#ff00ff">80</font>, <font color="#ff00ff">90</font>, <font color="#ff00ff">85</font>, <font color="#ff00ff">75</font>],
[<font color="#ff00ff">76</font>, <font color="#ff00ff">55</font>, <font color="#ff00ff">75</font>, <font color="#ff00ff">95</font>],
[<font color="#ff00ff">66</font>, <font color="#ff00ff">58</font>, <font color="#ff00ff">92</font>, <font color="#ff00ff">83</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::bars-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">500</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">x_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Semester</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">y_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Marks</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Grade report for a student</font><font color="#ff00ff">'</font>,
<font color="#0000ff"># Draw bars with width 3 pixels</font>
<font color="#ff00ff">bar_width </font>=> <font color="#ff00ff">3</font>,
<font color="#0000ff"># Sepearte the bars with 4 pixels</font>
<font color="#ff00ff">bar_spacing </font>=> <font color="#ff00ff">4</font>,
<font color="#0000ff"># Show the grid</font>
<font color="#ff00ff">long_ticks </font>=> <font color="#ff00ff">1</font>,
<font color="#0000ff"># Show values on top of each bar</font>
<font color="#ff00ff">show_values </font>=> <font color="#ff00ff">1</font>,
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#008b8b">$mygraph</font>->set(<font color="#ff00ff">logo </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">lglogo.png</font><font color="#ff00ff">'</font>);
<font color="#008b8b">$mygraph</font>->set(<font color="#ff00ff">logo_resize </font>=> <font color="#ff00ff">0.5</font>);
<font color="#008b8b">$mygraph</font>->set(<font color="#ff00ff">logo_position </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">LL</font><font color="#ff00ff">'</font>);
<font color="#008b8b">$mygraph</font>->set_legend_font(GD::gdMediumBoldFont);
<font color="#008b8b">$mygraph</font>->set_legend(<font color="#ff00ff">'</font><font color="#ff00ff">Exam 1</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 2</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 3</font><font color="#ff00ff">'</font>);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
Output of above program can be seen <a href=misc/padala/logo_output.png>here</a>
<P>
Here's the Linux Gazette <A HREF="misc/padala/lglogo.png">logo</A> I used.
It's in PNG format. The current version of GD::Graph doesn't recognize
any image types besides GIF (although it can write PNG, go figure). I
submitted a
<A HREF="http://www.cise.ufl.edu/~ppadala/perl/exploring/gd_graph/l
ogo_patch">patch</A> to fix this. You can either apply the patch or use
an older version of GD or GD::Graph.
<h3>Graph with Lines </h3>
<p>
Some information can be better presented with line graphs. Here's an
example showing a line graph.
<BR><A HREF="misc/padala/lines.pl.txt">[Text version of this listing.]</A>
<pre>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::lines;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">'</font><font color="#ff00ff">Fall 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 01</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Fall 02</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Spr 02</font><font color="#ff00ff">'</font> ],
[<font color="#ff00ff">80</font>, <font color="#ff00ff">90</font>, <font color="#ff00ff">85</font>, <font color="#ff00ff">75</font>],
[<font color="#ff00ff">76</font>, <font color="#ff00ff">55</font>, <font color="#ff00ff">75</font>, <font color="#ff00ff">95</font>],
[<font color="#ff00ff">66</font>, <font color="#ff00ff">58</font>, <font color="#ff00ff">92</font>, <font color="#ff00ff">83</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::lines-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">600</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">x_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Semester</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">y_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Marks</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Grade report for a student</font><font color="#ff00ff">'</font>,
<font color="#0000ff"># Draw datasets in 'solid', 'dashed' and 'dotted-dashed' lines</font>
<font color="#ff00ff">line_types </font>=> [<font color="#ff00ff">1</font>, <font color="#ff00ff">2</font>, <font color="#ff00ff">4</font>],
<font color="#0000ff"># Set the thickness of line</font>
<font color="#ff00ff">line_width </font>=> <font color="#ff00ff">2</font>,
<font color="#0000ff"># Set colors for datasets</font>
<font color="#ff00ff">dclrs </font>=> [<font color="#ff00ff">'</font><font color="#ff00ff">blue</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">green</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">cyan</font><font color="#ff00ff">'</font>],
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#008b8b">$mygraph</font>->set_legend_font(GD::gdMediumBoldFont);
<font color="#008b8b">$mygraph</font>->set_legend(<font color="#ff00ff">'</font><font color="#ff00ff">Exam 1</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 2</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Exam 3</font><font color="#ff00ff">'</font>);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
Output of above program can be seen <a href=misc/padala/linesgraph.png>here</a>
<p>
Here I have used GD::Graph::lines to create the graph handle. But for this
change, the program follows the same pattern for creating graphs.
<h3>A Pie Graph</h3>
<p>
Similarly we can create a pie chart.
<BR><A HREF="misc/padala/pie.pl.txt">[Text version of this listing.]</A>
<pre>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::pie;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">'</font><font color="#ff00ff">Project</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">HW1</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">HW2</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">HW3</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">MidTerm</font><font color="#ff00ff">'</font>, <font color="#ff00ff">'</font><font color="#ff00ff">Final</font><font color="#ff00ff">'</font>],
[<font color="#ff00ff">25</font>, <font color="#ff00ff">6</font>, <font color="#ff00ff">7</font>, <font color="#ff00ff">2</font>, <font color="#ff00ff">25</font>, <font color="#ff00ff">35</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::pie-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">300</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Grading Policy for COP5555 course</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">'</font><font color="#ff00ff">3d</font><font color="#ff00ff">'</font> => <font color="#ff00ff">1</font>,
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#008b8b">$mygraph</font>->set_value_font(GD::gdMediumBoldFont);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
The output pie chart can be seen <a href=misc/padala/piechart.png>here</a>
<p>
The '3d' option draws the pie chart in 3d.
<h3> An Area Graph</h3>
<p>
An area graph shows the data as area under a line.
<BR><A HREF="misc/padala/area.pl.txt">[Text version of this listing.]</A>
<pre>
<font color="#a020f0">#!/usr/local/bin/perl -w</font>
<font color="#0000ff"># Change above line to point to your perl binary</font>
<font color="#a52a2a"><b>use </b></font>CGI <font color="#ff00ff">'</font><font color="#ff00ff">:standard</font><font color="#ff00ff">'</font>;
<font color="#a52a2a"><b>use </b></font>GD::Graph::area;
<font color="#a52a2a"><b>use strict</b></font>;
<font color="#0000ff"># Both the arrays should same number of entries.</font>
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">@data</font> = ([<font color="#ff00ff">"</font><font color="#ff00ff">Jan</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Feb</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Mar</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Apr</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">May</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Jun</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Jul</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Aug</font><font color="#ff00ff">"</font>,
<font color="#ff00ff">"</font><font color="#ff00ff">Sep</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Oct</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Nov</font><font color="#ff00ff">"</font>, <font color="#ff00ff">"</font><font color="#ff00ff">Dec</font><font color="#ff00ff">"</font>],
[<font color="#ff00ff">23</font>, <font color="#ff00ff">5</font>, <font color="#ff00ff">2</font>, <font color="#ff00ff">20</font>, <font color="#ff00ff">11</font>, <font color="#ff00ff">33</font>, <font color="#ff00ff">7</font>, <font color="#ff00ff">31</font>, <font color="#ff00ff">77</font>, <font color="#ff00ff">18</font>, <font color="#ff00ff">65</font>, <font color="#ff00ff">52</font>]);
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$mygraph</font> = GD::Graph::area-><font color="#a52a2a"><b>new</b></font>(<font color="#ff00ff">500</font>, <font color="#ff00ff">300</font>);
<font color="#008b8b">$mygraph</font>->set(
<font color="#ff00ff">x_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Month</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">y_label </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Number of Hits</font><font color="#ff00ff">'</font>,
<font color="#ff00ff">title </font>=> <font color="#ff00ff">'</font><font color="#ff00ff">Number of Hits in Each Month in 2002</font><font color="#ff00ff">'</font>,
) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>warn</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>my</b></font> <font color="#008b8b">$myimage</font> = <font color="#008b8b">$mygraph</font>->plot(<font color="#008b8b">\@data</font>) <font color="#a52a2a"><b>or</b></font> <font color="#a52a2a"><b>die</b></font> <font color="#008b8b">$mygraph</font>->error;
<font color="#a52a2a"><b>print</b></font> <font color="#ff00ff">"</font><font color="#ff00ff">Content-type: image/png</font><font color="#6a5acd">\n\n</font><font color="#ff00ff">"</font>;
<font color="#a52a2a"><b>print</b></font> <font color="#008b8b">$myimage</font>->png;
</pre>
<p>
Output image can be seen <a href=misc/padala/areagraph.png>here</a>
<h3> Conclusion</h3>
<p>
The GD::Graph module provides a powerful and flexible way to create charts.
It's very useful for creating graphs dynamically for serving on web.
<p>
I hope you have enjoyed reading this article. Next month, we will have a look
at the PerlMagic Module.
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Pradeep Padala.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Handling Power Status Using snmptrapd</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/prasad.html">A B Prasad</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<H3>If you are new to this topic</H3>
<P>Refer the following if you are new to SNMP</P>
<UL>
<LI>net-snmp documentation
<LI>rfc1678
<LI>UPSHowto
<LI>man pages of snmptrapd(8), snmptrapd.conf(8), and snmptrap(8) </LI></UL>
<H3>Net-snmp</H3>
<P>Various tools relating to the Simple Network Management Protocol
including:</P>
<UL>
<LI>An extensible agent
<LI>An SNMP library
<LI>Tools to request or set information from SNMP agents
<LI>Tools to generate and handle SNMP traps
<LI>A version of the unix 'netstat' command using SNMP
<LI>A graphical Perl/Tk/SNMP based mib browser.... </LI></UL>
<P>See the <A href="http://www.net-snmp.org/">NET-SNMP site</A>.</P>
<H3>snmptrapd</H3>
<P>Snmptrapd is an SNMP application that receives and logs snmp trap messages
sent to the SNMP-TRAP port (162) on the local machine. It can be configured to
run a specific program on receiving a snmp trap.</P>
<H3>snmptrapd.conf</H3>
<P>snmptrapd.conf is the configuration file(s) which define how the ucd-snmp
SNMP trap receiving demon operates when it receives a trap.</P>
<H3>ups-MIB</H3>
<P>RFC1628 document defines the managed objects for Uninterruptible Power
Supplies which are to be manageable via the Simple Network Management Protocol
(SNMP).</P>
<H3>How to use snmptrapd with powerh</H3>
<P>Please Note: I renamed 'powerd' as 'powerh' as here it is not a daemon but
only a trap handling routine</P>
<P>We had the powerh to handle the Power Status of the system. powerh
communicates with the UPS through the serial port. However, in a networked
system where a number of machines are using the same UPS it is not possible for
each system to directly communicate with the UPS. Most modern high capacity UPS
support the SNMP Protocol either directly or through a proxy. To handle various
power status follow these steps</P>
<P>1. To your snmptrapd.conf add the following lines</P><PRE>traphandle 33.2.3 powerh b
traphandle 33.2.4 powerh p
</PRE>
<P>2. Compile the following C <a href="misc/prasad/code.c.txt">code</a> by entering <I>cc powerh.c -o powerh</I>and
copy <I>powerh</I> to a directory in path like /usr/local/sbin/.
<BR><A HREF="misc/prasad/code.c.txt">[Text version of this listing.]</A>
</P>
<PRE>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#define PWRSTAT "/etc/powerstatus"
void powerfail(int);
main(int argc, char* argv[]) {
char s[1000];
int i=0;
while(i<7) {
scanf("%s",s);
i++;
}
scanf("%s",s);
if (!strcmp("b",argv[1]))
if ((!strcmp(s,"33.1.6.3.3"))||(!strcmp(s,"upsMIB.upsObjects.upsAlarm.upsWellKnownAlarms.upsAlarmLowBattery")))
powerfail(1);
if (!strcmp("p",argv[1]))
if ((!strcmp(s,"33.1.6.3.3"))||(!strcmp(s,"upsMIB.upsObjects.upsAlarm.upsWellKnownAlarms.upsAlarmLowBattery")))
powerfail(0);
}
/* As the program may be activated in the event of other alarms as well, the inner 'if' are necessary */
void powerfail(int event) {
int fd;
unlink(PWRSTAT);
if ((fd = open(PWRSTAT, O_CREAT|O_WRONLY, 0644)) >= 0) {
switch (event)
{
case 0:
write(fd, "OKWAIT\n", 7);
break;
case 1:
write(fd, "FAIL\n", 5);
break;
}
close(fd);
}
kill(1, SIGPWR);
}
</PRE>
<P>3. Run snmptrapd on your system (you can configure it in the init
scripts)</P>
<P>The system will shutdown 2 minutes after receiving a 'battery low alarm' from
the UPS. Then if power is OK before the shutdown it will cancel shutdown or as
configured in the powerfail and powerokwait lines in /etc/inittab</P> <h3>Code
Explanation
<H3></H3>
<P>When received a trap 33.2.3 (upsMIB.upsTraps.upsTrapAlarmEntryAdded) the
program is executed with a 'b' option. Program checks for the 'upsAlarmId' send
by the trap and if it is 33.1.6.3.3
(upsMIB.upsObjects.upsAlarm.upsWellKnownAlarms.upsAlarmLowBattery) it notfies
init that a power failure occurred. This alarm is added to the alarm table by
the UPS agent if the remaining battery run-time is less than or equal to
upsConfigLowBattTime. It is removed when the power is back and is acknowledged
by trap 33.2.4. The program then sends init a powerokwait message.</P>
<H3>Drawbacks</H3>
<UL>
<LI>The program handles only two traps and look for only one type of alarm.
The upsMIB has a number of alarms and the program is to be extended to handle
all conditions.
<LI>The obsolete method of informing init is used. This has to be changed.
<LI>As I had no UPS that sends a snmp traps, I used the snmp trap
generator
<PRE>
snmptrap -v 2c localhost public '' 33.2.3 33.2.3.0 s "33.1.6.3.3"
snmptrap -v 2c localhost public '' 33.2.4 33.2.4.0 s "33.1.6.3.3"
</PRE>
I am not sure whether this is correct.
<LI>The snmptrapd is to be run without -f option.
<LI>Tested only on RedHat Linux 6.2.</LI></UL>
<H3>TODO</H3>
<P>I would like to see this few lines of code grow into a complete general
purpose UPS managing software capable of:</P>
<UL>
<LI>Monitoring and changing all possible MIB of the upsMIB node
<LI>Handle signals from multiple UPS
<LI>Use data from a configuration file
<LI>Handle authentication </LI></UL>
<P>All Suggestions, Criticisms,Contibutions (code and idea only - no cash please
;) ) etc. are welcome. You can contact me at <A
href="mailto://prasad_ab@yahoo.com">prasad_ab@yahoo.com</A>. See also my <a
href="www.geocities.com/prasad_ab">home page </a>.</P>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, A B Prasad.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Qubism</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/harsem.html">Jon "Sir Flakey" Harsem</A></STRONG></BIG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<EM>These cartoons are scaled down to fit into LG.
To see a panel in all its clarity, click on it.</EM>
<P>
<A HREF="misc/qubism/qb-lordof.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-lordof.jpg"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/qubism/qb-wireless.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-wireless.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 copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Jon "Sir Flakey" Harsem.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Programming in Ruby, part 2</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/ramankutty.html">Hiran Ramankutty</A></STRONG></BIG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<H2><B>Review</B></H2>
<p>
A wide variety of applications from different domains need different
levels of organization. We have seen the fundamentals of Ruby in
<A HREF="../issue81/ramankutty.html">Part 1</A>, and now we jump on to the next
level of organization.
</p>
<H2><B>Regular Expressions</B></H2>
<p>
In Ruby, a regular expression is quoted by '/' as in Perl and awk rather than
by quotation marks.
Regular expressions have an efficient expressive
power, whenever you deal with patterns (as in pattern matching). Also
some methods convert a string into a regular expression.
<p></p>
<pre>print "abcdef" =~ /de/,"\n"
print "aaaaaa" =~ /d/,"\n"
^D
3
FALSE
</pre>
</p>
<p>
The operator `=~' is a matching operator with respect to regular
expressions. It returns the position in a string where a match was
found, or nil if the pattern did not match. It is interesting to see
that regular expressions share a particular kind of vocabulary as shown
below:
</p>
<DIV class="table"><PRE>
[ ] range specification. (e.g., [a-z] means a letter in range of from a to z)
\w letter or digit. same as [0-9A-Za-z_]
\W neither letter nor digit
\s blank character. same as [ \t\n\r\f]
\S non-space character.
\d digit character. same as [0-9].
\D non digit character.
\b word boundary (outside of range specification).
\B non word boundary.
\b back space (0x08) (inside of range specification)
* zero or more times repetition of followed expression
+ one or more times repetition of followed expression
{m,n} at least n times, but not more than m times repetition
of followed expression
? at least 0 times, but not more than 1 times repetition
of followed expression
| either preceding or next expression may match
( ) grouping
</PRE></DIV>
<p>
For example, `^f[a-z]+' means "f followed by repetition of letters in
range from `a' to `z'. Now what if we want check whether a string fits a
given description say for example: "Starts with lower case `f', which
is immediately followed by exactly one upper case letter, and
optionally more junk after that, as long as there are no more lower
case characters. You will have to write a dozen lines in C, right?
Admit it; you can hardly help yourself. In Ruby you just have to
request the string to be matched with the regular expression
/^f[A-Z](^[a-z])*$/. This ability of regular expressions in string
matching is often used in UNIX environment, typical example is `grep'.
Let us get acquainted with regular expressions. Consider the program
given below:
</p>
<p></p>
<PRE> #Store this as regx.rb
st = "\033[7m"
en = "\033[m"
while TRUE
print "str> "
STDOUT.flush
str = gets
break if not str
str.chop!
print "pat> "
STDOUT.flush
re = gets
break if not re
re.chop!
str.gsub! re, "#{st}\\&#{en}"
print str, "\n"
end
print "\n"
# Now run ruby regx.rb
</PRE>
<p>The program requires inputs twice, once for a string and once for a
regular expression. The test is performed for the string against the regular
expression, and matched parts are highlighted in reverse video. Note
that this requires an ANSI terminal since it uses reverse video
escape sequences. Do not mind the details of the program.
</p>
<p></p>
<pre>str>foobar
pat>^fo+
foobar
~~~
</pre>
<p>
We see that foo is reversed. Note that ``~~~'' is just for text-based
browsers. We shall experiment with different inputs.
</p>
<p></p>
<pre>str>asd987wonew06521
pat>\d
asd987wonew06521
~~~ ~~~~~
str>foozboozer
pat>f.*z
foozboozer
~~~~~~~~
</pre>
<p>
Note that foozbooz is matched and not fooz. This is because here the
regular expression matches the longest possible substring. First
glance interpretation is difficult. Try this:
</p>
<p></p>
<pre>str> Wed Feb 7 08:58:04 JST 1996
pat> [0-9]+:[0-9]+(:[0-9]+)?
Wed Feb 7 08:58:04 JST 1996
~~~~~~~~
</pre>
<p>
Now try to represent a hexadecimal number using regular expressions.
(for example: 0x123af00c as well as 0Xbc13590ae are hexadecimal numbers)
</p>
<p></p>
<pre>def chab(s) # "contains hex in angle brackets"
(s =~ /<0(x|X)(\d|[a-f]|[A-F])+>/) != nil
end
print chab "Not this one."
print "\n",chab "Maybe this? {0x35}" # use of wrong kind of brackets
print "\n",chab "Or this? <0x38z7e>" # Is this a HEX number
print "\n",chab "Okay, this: <0xfc0004>."
print "\n"
^D
false
false
false
true
</pre>
<H2><B>Iterators</B></H2>
<p>
Iterator means "one which does the same thing many times". Consider the
C code given below:
</p>
<p></p>
<pre>char *str;
for (str = "abcdefg"; *str != '\0'; str++) {
/* process a character here */
}
</pre>
<p>
Note the abstraction provided by C's for(...) syntax to create loops,
but in fact, the programmer has to know the internal structure of a
string to test *str with the null character.
</p>
<p>
Flexible support for iteration is one of the few features that mark a
high-level language. Consider the following shell script (/bin/sh):
</p>
<p></p>
<pre>for i in *.[ch]; do
# ... something to do for each file
done
</pre>
<p>
All the C source and header files in the current directory are,
processed, and the command shell handles the details of picking up and
substituting file names one by one. Isn't this working at a higher
level than C? What do you think ?
</p>
<p>
Considering the fact that, it is fine to provide iterators in a
programming language for built-in data types, but it is a
disappointment if we have to write low-level loops to iterate our
dat types. In OOP, this can be a serious problem, since users often
define one data type after another.
</p>
<p>
To solve above matters, every OOP language has elaborate ways to make
iterations easy, for example some languages provide class controlling
iteration, etc. On the other hand, ruby allows us to define control
structures directly. In term of ruby, such user-defined control
structures are called iterators.
</p>
<p>
Let us see few examples:
</p>
<p></p>
<pre>"abc".each_byte{|c| printf "%c\n", c}
^D
a
b
c
</pre>
<p>
Here, each_byte is an iterator for each character in the string. A
local variable `c' is being used here, and each character is being
substituted into it. This can be translated into something that looks
a lot like C code ...
</p>
<p></p>
<pre>s="abc"
i=0
while i < s.length
printf "%c\n",s[i]
i+=1
end
^D
a
b
c
</pre>
<p>
... however, the each_byte iterator is simpler conceptually and is
more likely to continuously work even if the string class happens to
be radically modified in the near future. One benefit of the iterators
is their tendency of robustness in the face of such changes, and I
think that is a characteristic of a good code.
</p>
Another iterator of string is each_line.
</p><p></p>
<pre>"a\nb\nc\n".each_line{|l| print l}
^D
a
b
c
</pre>
<p>
Every irksome task like finding delimiters for lines, generating
sub strings etc. are undertaken by iterators.
</p>
<p>
Now, let's rewrite this example with for statement.
</p><p></p>
<pre>for l in "a\nb\nc\n"
print l
end
^D
a
b
c
</pre>
<p>
The for statement does iteration by way of an each iterator. String's
each works the same as each_line as seen in the previous example.
</p>
<p>
Current iteration can be done or retried again from the top, by using
a control structure `retry' in conjunction with an iterated loop.
See below:
</p><p></p>
<pre>c = 0
for i in 0..4
print i
if i==2 and c==0
c = 1
print "\n"
retry
end
end
^D
012
01234
</pre>
<p>
The definition of an iterator may have an occurrence of `yield', which
moves control to the block of code that is passed to the iterator (we
will see more of this later). The example below defines the iterator
repeat, which repeats a block of code the number of times specified in
an argument.
</p>
<p></p>
<pre>def repeat(num)
while num < num
yield
num-=1
end
end
repeat(4) {print "hello world\n"}
^D
hello world
hello world
hello world
</pre>
<p>
If it is not clear, then, print the value of num before and after the
occurrence of `yield'.
</p>
<p>
With `retry' one can define an iterator which works the same as `while',
but it is not practical due to slowness.
</p><p></p>
<pre>def MYWHILE(cond)
return if not cond
yield
retry
end
i = 0
MYWHILE(i<3) {print i,"\n" ;i+=1}
^D
0
1
2
</pre>
<p>
By now, I hope you must have got an idea about iterators. There are a
few restrictions, but you can write your original iterators; and in
fact, whenever you define a new data type, it is often convenient to
define suitable iterators to go with it. In this sense this, the above
examples `repeat() and `MYWHILE()' are not very useful. We will talk
about practical iterators after we have a better understanding of what
classes are.
</p>
<H2><B>Object Oriented Thinking</B></H2>
<p>
<B>`Object Oriented'</B> is indeed a very catchy phrase. Ruby claims to
be an object oriented scripting language; but what does 'object
oriented' exactly mean?
</p>
<p>
There have been a variety of answers to that question, all of which
probably boil down to about the same thing. Before arguing and summing
our definitions too quickly, let's think for a moment about the
traditional programming paradigm.
</p>
<p>
Traditionally, a programming problem is attacked by coming up with
some kinds of <B>data representations</B>, and <B>procedures</B> that
operate on that data. We can associate terms inert, passive,and
helpless with `data' under this model and that the data sits
completely at the mercy of a large procedural body with which we
associate terms active, logical, and all-powerful.
</p>
<p>
The problem with this approach is that programs are written by
programmers, who are only human and can only keep so much detail clear
in their heads at any one time. As a project gets larger, its
procedural core grows to the point where it is difficult to remember how
the whole thing works. Minor lapses of thinking and typographical
errors become more likely to result in well-concealed bugs. Complex
and unintended interactions begin to emerge within the procedural core,
and maintaining it becomes like trying to carry around an angry squid
without letting any tentacles touch your face. There are guidelines
for programming that can help to minimize and localize bugs within this
traditional paradigm, but there is a better solution that involves
fundamentally changing the way we work.
</p>
<p>
What object-oriented does is to let us delegate most of he mundane
and repetitive logical work <B>to the data itself</B>; we can then
change our concept of data from <B>passive</B> to <B>active</B>. Put
another way,
</p>
<ul>
<li>we stop treating each piece of data as a box with an open lid that
lets us reach in and throw things around.
<li>We start treating each piece of data as a working machine with a
closed lid and a few well marked switches and dials.
</ul>
<p>
What is described above as a "machine" may be very simple or complex
on the inside; we can't tell from the outside, and we don't allow
ourselves to open up the machine (except when we are absolutely sure
something is wrong with its design), so we are required to do things
like flip the switches and read the dials to interact with the data.
Once the machine is built, we don't want to have to think about how it
operates.
</p>
<p>
You might think we are just making more work for ourselves,but this
approach tends to do a nice job of preventing all kinds of things from
going wrong.
</p>
<p>
Let's start with an example that is to simple to be of practical value,
but should illustrate at least part of the concept. My 2-wheeler has a
trip meter. Its job is to keep track of the distance it has travelled
since the last time its reset button was pushed. How would we model
this in a programming language? In C, the trip meter would just be a
numeric variable, possibly of type float. The program would manipulate
the variable by increasing its value in small increments, with
occasional resets to zero when appropriate. What's wrong with that? A
bug in the program would assign a bogus value to the variable, for any
number of unexpected reasons. Anyone who has programmed in C knows what
it is like to spend hours or days tracking down such a bug whose cause
seems absurdly simple once it has been found. (The moment of finding the
bug is commonly indicated by the sound of a loud slap to the forehead.)
</p>
<p>
In object-oriented context, the same problem can be attacked in a
different manner. A programmer designing a trip meter is supposed not to
ask "which of the familiar data-types comes closest to resembling the
thing" but instead be interested in "how exactly is this thing supposed
to act?" The difference winds up being a profound one. It is necessary
to spend a little bit of time deciding exactly what an odometer is for,
and how the outside world expects to interact with it. We decide to
build a little machine with controls that allows us to increment it,
reset it, read its value, and nothing else.
</p>
<p>
We don't provide a way for a trip meter to be assigned arbitrary values;
why? because we all know trip meters don't work that way. There are
only a few things you should be able to do with a trip meter, and those
are all we allow. Thus, if something else in the program mistakenly
tries to place some other value (say, the target temperature of the
vehicle's climate control) into the trip meter, there is an immediate
indication of what went wrong. We are told when running the program
(or possibly while compiling, depending on the nature of the language)
that <B>we are not allowed to assign arbitrary values to Trip meter
objects</B>. The message might not be exactly that clear, but it will be
reasonably close to that. It doesn't prevent the error, does it? But
it quickly points us in the direction of the cause. This is only one
of several ways in which OO programming can save a lot of wasted time.
</p>
<p>
We commonly take one step of abstraction above this, because it turns
out to be as easy to build a factory that makes machines as it is to
make an individual machine. We aren't likely to build a single
trip meter directly; rather, we arrange for any number of trip meters to
be built from a single pattern. The pattern (or if you like, the
trip meter factory) corresponds to what we call a class, and an
factory) corresponds to an <B>object</B>. Most OO languages require
a class to be defined before we can have a new kind of object, but
ruby does not.
</p>
<p>
I would like to emphasize on the fact that the use of an OO language
will not enforce proper OO design. Indeed it is possible in any
language to write code that is unclear, sloppy, ill-conceived, buggy,
and wobbly all over. What ruby does for you (as opposed, especially, to
C++) is to make the practice of OO programming feel natural enough
that even when you are working on a small scale you don't feel a
necessity to resort to ugly code to save effort. We will be discussing
the ways in which ruby accomplishes that admirable goal as this guide
progresses; the next topic will be the "switches and dials" (object
methods) and from there we'll move on to the "factories" (classes). Are
you still with us?
</p>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Hiran Ramankutty.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Process Tracing Using Ptrace, part 2</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/sandeep.html">Sandeep S</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<HR>
<EM>The basic features of ptrace were explained in
<A HREF="../issue81/sandeep.html">Part I</A>. We saw a small example too. As I
said earlier, the main applications of ptrace are accessing memory or registers
of a process being run (either for debugging or for some evil purposes). So
first we should have some basic idea on the binary format of executables - then
only we know how and where to access them. So I shall give you a small tutorial
on ELF, the binary format used in Linux. In the last section of this article,
we find a small program which accesses the registers and memory of another one
and modifies them so as to change the output of that process, by injecting some
extra code.</EM>
<HR>
<P><B>Note:</B> Please don't get confused. Definitely this is an article about ptrace,
not about ELF. But a basic knowledge of ELF is required for accessing the core images
of processes. So it should be explained first.
<P>
<P>
<H2><A NAME="s1">1. What is ELF?</A></H2>
<P>ELF stands for Executable and Linking Format. It defines the format of
executable binaries used on Linux - and also for relocatable, shared object and
core dump files too. ELF is used by both linkers and loaders. They view ELF
from two sides, so both should have a common interface.
<P>
<P>The structure of ELF is such that it has many sections and segments.
Relocatable files have section header tables, executable files have program
header tables, and shared object files have both. In the coming sections I shall
explain what these headers are.
<P>
<H2><A NAME="s2">2. ELF Headers</A></H2>
<P>Every ELF file has an ELF header. It always starts at
offset 0 in the file. It contains the details of the binary file - should
it be interpreted, what data structures are related to the file, etc.
<P>
<P>The format of the header is given below (taken from /usr/src/include/linux/elf.h)
<BLOCKQUOTE><CODE>
<HR>
<PRE>
#define EI_NIDENT 16
typedef struct elf32_hdr{
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry; /* Entry point */
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
} Elf32_Ehdr;
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<P>A small description on the fields is as follows
<P>
<OL>
<LI><P>e_ident : Contains information about how to treat the binary. Platform dependent.
<P>
</LI>
<LI><P>e_type : Contains information on the type and how to use the binary.
Types are relocatable, executable, shared object and core file.
<P>
</LI>
<LI><P>e_machine : As you have guessed, this field specifies the architecture - Intel 386,
Alpha, Sparc etc.
<P>
</LI>
<LI><P>e_version : Gives the version of the object file.
<P>
</LI>
<LI><P>e_phoff : Offset from start to the first program header.
<P>
</LI>
<LI><P>e_shoff : Offset from start to the first section header.
<P>
</LI>
<LI><P>e_flags : Processor specific flags. Not used in i386
<P>
</LI>
<LI><P>e_ehsize : Size of the ELF header.
<P>
</LI>
<LI><P>e_phentsize & e_shentsize : Size of program header and section header
respectively.
<P>
</LI>
<LI><P>e_phnum & e_shnum : Number of program headers and section headers. Program
header table will be an array of program headers (e_phnum elements). Similar is
the case of section header table.
<P>
</LI>
<LI><P>e_shstrndx : In the section header table a section contains the name of
sections. This is the index to that section in the table. (see below)
<P>
</LI>
</OL>
<P>
<H2><A NAME="s3">3. Sections And Segments</A></H2>
<P>As said above, linkers treat the file as a set of logical sections described by a
section header table, and loaders treat the file as a set of segments described by a
program header table. The following section gives details on sections and
segments/program headers.
<P>
<H2>3.1 ELF Sections and Section Headers</H2>
<P>The binary file is viewed as a collection of sections which are arrays of bytes
of which no bytes are duplicated. Even though there will be helper information to
correctly interpret the contents of the section, the applications may interpret
in its own way.
<P>
<P>There will be a section header table which is an array of section headers.
The zeroth entry of the table is always NULL and describe no part of the
binary. Each section header has the following format:
(taken from /usr/src/include/linux/elf.h)
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
typedef struct elf32_shdr {
Elf32_Word sh_name; /* Section name, index in string tbl (yes Elf32) */
Elf32_Word sh_type; /* Type of section (yes Elf32) */
Elf32_Word sh_flags; /* Miscellaneous section attributes */
Elf32_Addr sh_addr; /* Section virtual addr at execution */
Elf32_Off sh_offset; /* Section file offset */
Elf32_Word sh_size; /* Size of section in bytes */
Elf32_Word sh_link; /* Index of another section (yes Elf32) */
Elf32_Word sh_info; /* Additional section information (yes Elf32) */
Elf32_Word sh_addralign; /* Section alignment */
Elf32_Word sh_entsize; /* Entry size if section holds table */
} Elf32_Shdr;
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<P>Now the fields in detail.
<P>
<OL>
<LI><P>sh_name : This contains an index into the section contents of the
e_shstrndx string table. This index is the start of a null terminated string
to be used as the name of the section. There are many, a few are given.
<P>
<UL>
<LI>.text This section holds executable instructions of a program</LI>
<LI>.data This section holds initialized data that contributes to the programs image.</LI>
<LI>.init: This section holds executable instructions that contribute to the process
initialization code.</LI>
</UL>
<P>
</LI>
<LI><P>sh_type : Section type such as program data, symbol table, string table etc..
<P>
</LI>
<LI><P>sh_flags : Contains information such as how to treat the contents of the section.
<P>
</LI>
<LI><P>sh_addralign : Contains the alignment requirement of section contents,
typically 0/1 (both meaning no alignment) or 4.
<P>
</LI>
</OL>
<P>
<P>The remaining fields seem to be self explaining.
<P>
<H2>3.2 ELF Segments And Program Headers</H2>
<P>The ELF segments are used during loading ie, when the image of the process
is made in the core. Each segment is described by a program header. There
will be a program header table in the file (usually near the ELF header).
The table is an array of program headers. The format of the program header
is as follows.
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
typedef struct
{
Elf32_Word p_type; /* Segment type */
Elf32_Off p_offset; /* Segment file offset */
Elf32_Addr p_vaddr; /* Segment virtual address */
Elf32_Addr p_paddr; /* Segment physical address */
Elf32_Word p_filesz; /* Segment size in file */
Elf32_Word p_memsz; /* Segment size in memory */
Elf32_Word p_flags; /* Segment flags */
Elf32_Word p_align; /* Segment alignment */
} Elf32_Phdr;
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<OL>
<LI><P>p_type : Gives information on how to treat the contents. It gives the type
of program header such as
<P>
<UL>
<LI>unused </LI>
<LI>loadable </LI>
<LI>Dynamic linking information</LI>
<LI>reserved</LI>
</UL>
<P>etc ..
<P>
</LI>
<LI><P>p_vaddr : relative virtual address the segment expects to be loaded.
<P>
</LI>
<LI><P>p_paddr : physical address of the segment expects to be loaded into the
memory.
<P>
</LI>
<LI><P>p_flags : Contains protection flags - read/write/execute permissions
<P>
</LI>
<LI><P>p_align : Contains the alignment for the segment in memory. If the
segment is of type loadable, then the alignment will be the expected page size.
<P>
</LI>
</OL>
<P>
<P>Remaining fields appear to be self explaining.
<P>
<H2><A NAME="s4">4. Loading The ELF File</A></H2>
<P>We have got some idea about the structure of ELF object files. Now we have to
know how and where these files are loaded for execution. Usually we just type
program name at the shell prompt. In fact a lot of interesting things happen
after the return key is hit.
<P>
<P>First the shell calls the
standard libc function which in turn calls the kernel routine. Now the ball is
in kernel's court. The kernel opens the file and finds out the type/format of
the executable. Then loads ELF and needed libraries, initializes the program's
stack, and finally passes control to the program code.
<P>
<P>The program gets loaded to 0x08048000 (you can see this in /proc/pid/maps)
and the stack starts from 0xBFFFFFFF (stack grows to numerically small addresses).
<P>
<H2><A NAME="s5">5. Code Injection</A></H2>
<P>We have seen the details of the programs being loaded in the memory. So when
a process is given and its memory space known, we can trace it (if we have
permission) and access the private data structures of the process. It is very
easy to say this, but not that easy to do it. Why not make a try?
<P>
<P>First of all, let's write a program to access the registers of another
program and
modify it. Here we use the following values of <CODE>request</CODE>.
<P>
<UL>
<LI>PTRACE_ATTACH : Attach to the process pid.
</LI>
<LI>PTRACE_DETACH : Detach from the process pid.
<P><B>Note :</B> Do not forget to call this, otherwise the process will
stay in stopped mode and is hard to recover.
<P>
</LI>
<LI>PTRACE_GETREGS : This copies the process' registers into the struct
pointed by data (addr is ignored). This structure is
<CODE>struct user_regs_struct</CODE> defined as this, in asm/user.h.
<BLOCKQUOTE><CODE>
<HR>
<PRE>
struct user_regs_struct {
long ebx, ecx, edx, esi, edi, ebp, eax;
unsigned short ds, __ds, es, __es;
unsigned short fs, __fs, gs, __gs;
long orig_eax, eip;
unsigned short cs, __cs;
long eflags, esp;
unsigned short ss, __ss;
};
</PRE>
<HR>
</CODE></BLOCKQUOTE>
</LI>
<LI>PTRACE_SETREGS : Does just the reverse of GETREGS.
</LI>
<LI>PTRACE_POKETEXT : This copies 32 bits from the address pointed by data
in the addr address of the traced process.</LI>
</UL>
<P>
<P>Now we are going to inject a small piece of our code to image of the process being traced and force the process to execute our code by changing its instruction pointer.
<P>
<P>What we do is very simple. First we attach the process, and then read the
register contents of the process. Now insert the code which we want to get
executed in some location of the stack and the instruction pointer of the
process is changed to that location. Finally we detach the process. Now the
process starts to execute and will be executing the injected code.
<P>
<P>We have two source files, one is the assembly code to be injected and
other is the one which traces the process. I shall provide a small program
which we may trace.
<P>
<P>The source files
<P>
<UL>
<LI>
<A HREF="./misc/sandeep/Tracer.c">Tracer.c</A></LI>
<LI>
<A HREF="./misc/sandeep/Code.S">Code.S</A></LI>
<LI>
<A HREF="./misc/sandeep/Sample.c">Sample.c</A></LI>
</UL>
<P>
<P>Now compile the files.
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
#cc Sample.c -o loop
#cc Tracer.c Code.S -o catch
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<P>Go to another console and run the sample program by typing
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
#./loop
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<P>Come back and execute the tracer to catch the looping process and change its
output. Type
<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>
#./catch `ps ax | grep "loop" | cut -f 3 -d ' '`
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<P>Now go to where the sample program 'loop' runs and watch what happens.
Definitely your play with ptrace has begun.
<P>
<H2><A NAME="s6">6. Looking Forward</A></H2>
<P>In the first part we traced a process and counted its number of instructions.
In this part we studied the ELF file structure and injected a small piece of
code into some process. In next part I would expect to access the memory space
of some process. Till then, bye from Sandeep S.
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Sandeep S.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">DVD Authoring</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/stoddard.html">Chris Stoddard</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p>
This document provides the steps necessary to make a DVD which will play in a stand alone DVD player, using Linux and a DVD+RW or DVD-RW drive.
</p>
<h2>Table of Contents</h2>
<ul TYPE="">
<li>1. Introduction
<li>2. Hardware Required
<li>3. Software Required
<li>4. Recording, encoding and burning the video
<li>5. Fixing audio sync problems
<li>6. Final Note
</ul>
<h2>Introduction</h2>
<p>
I am constantly amazed at how easy it is to accomplish things in Linux once someone works out the process. DVD Authoring is a good example of this, all the parts are in place, all the information is available and it is a relatively easy thing to do, but no where is there a single document showing how to accomplish it. Authoring DVD under Linux is still in its infancy, there are no tools for menus or any advanced features, for now all we can do is single straight DVD stream, which is enough for home videos and saving TV shows. I will not be discussing video editing here, I assume you will either be recording from TV or have a video tape you wish to transfer to a DVD.
</p>
<h2>Hardware Required:</h2>
<p>
I'm not going into much detail about installing the hardware, if you don't know how to install your hardware, I have provided links to articles for help.
</p>
<ul TYPE="">
<li>Video Capture device: I am using a Hauppauge WinTV PCI card, TV tuner cards are cheap and easy to come by, and are well supported by Linux. There are more expensive solutions which will get you better video quality, but support under Linux varies widely. <a HREF="http://www.linuxgazette.com/issue62/silva.html">Video Applications on Your Linux Box</a>
<li>DVD+RW or DVD-RW drive: I am using an old Ricoh MP5120A DVD+RW drive I purchased refurbished for $150. Luckily these drives install exactly the same way as a standard CDRW drive. You also need to be able to play DVD's on you system. Please be sure your stand alone DVD player supports the format of your burner. <a HREF="http://www.linuxgazette.com/issue81/durodola.html">Playing DVDs on Linux</a> and <a HREF="http://linuxgazette.com/issue57/stoddard.html">CD-Writing with an ATAPI CDR Mini-HOWTO</a>
<li>Fast CPU and a huge hard drive: I am personally using an Athlon 1600XP, 384 MB of RAM and a 40 GB hard Drive. I probably wouldn't even attempt this with less than 1 Ghz CPU and 20 GB of free hard drive space.
</ul>
<h2>Software Required:</h2>
<p>
Each of these packages has their own install process, please follow the instructions for each individual package.
</p>
<ul TYPE="">
<li>xawtv comes with streamer, which we will use for recording the video: <a HREF="http://bytesex.org/xawtv/">xawtv</a>
<li>mjpeg-tools is used for encoding the recorded video into a DVD compatible format: <a HREF="http://mjpeg.sourceforge.net/">mjpeg-tools</a>
<li>dvdauthor is the key piece of software, without it, we would not be able to do this. This package generates the IFO files required by DVD player. There is no automatic install for this program, simply run make, then copy the binaries to /usr/local/bin: <a HREF="http://sourceforge.net/project/showfiles.php?group_id=59028">dvdauthor</a>
<li>dvdrtools is a fork of cdrtools which we will use to build the iso and write to newer DVD-RW drives: <a HREF="http://www.freesoftware.fsf.org/dvdrtools/">dvdrtools</a>
<li>dvd+rw tools is used to burn to older DVD+RW format, this is only necessary if you have a first generation DVD+RW drive. If you have a newer DVD-RW drive this package is not needed: <a HREF="http://fy.chalmers.se/~appro/linux/DVD+RW/">dvd+rw tools</a>
</ul>
<p>
dvd+rw tools has no Makefile. You can build the binaries doing this:
</p>
<pre>
gcc dvd+rw-format.c
mv a.out dvd+rw-format
cp dvd+rw-format /usr/local/bin
gcc growisofs.c
mv a.out growisofs
cp growisofs /usr/local/bin
</pre>
<h2>Recording, encoding and burning the video:</h2>
<p>
Recording the video is the most important step, the size of the video and the frame rate must be right. The following command uses streamer, which comes with xawtv to record the video:
</p>
<pre>
streamer -n ntsc -t 60:00 -s 720x480 -r 30 -o stream.avi -f mjpeg -F stereo -c /dev/video0
</pre>
<p>
The -n switch is for format, if you use PAL, change ntsc to pal. The -t switch is record time in minutes. -s is the size of the video, in the USA, we use NTSC which requires the video to be 720x480 if you use PAL, change this to 720x576. -r is the frame rate, for NTSC use 30, for PAL use 24, -c is the video device, change it if need be. The rest of the switches should remain unchanged.
</p>
<p>
The next thing to do is to properly encode the audio and video into something a DVD player can read. The tools we need for this are from mjpeg-tools. This command line strips the audio out of our avi file and encodes it to mp2 audio. The -V switch actually is for VCD compatibility, but works for us here:
</p>
<pre>
lav2wav +p stream.avi | mp2enc -V -o audio.mp2
</pre>
<p>
Next we strip out the video and encode it to mpeg video. This part is what takes the longest, the faster your system is the better. The important switches here are -f 8, which ensures the video will be DVD compatible and -n n, which is for NTSC, if you are using PAL change it to -n p:
</p>
<pre>
lav2yuv +p stream.avi | mpeg2enc -n n -f 8 -s -r 16 -o video.m1v
</pre>
<p>
Now we need to join the two encoded files. Be sure to use the -f 8 switch for DVD compatible video:
</p>
<pre>
mplex -f 8 audio.mp2 video.m1v -o complete.mpg
</pre>
<p>
In order for our disc to be played in a stand alone DVD player, the directory structure HAS to be perfect, so please make sure you type the next several commands exactly as shown, in the order shown:
</p>
<pre>
mkdir dvd
mkdir dvd/VIDEO_TS
</pre>
<p>
Next we need an Table of Content IFO file, type:
</p>
<pre>
tocgen > dvd/VIDEO_TS/VIDEO_TS.IFO
</pre>
<p>
Now we want to copy our encoded video file into the structure and give it the correct permissions, type:
</p>
<pre>
cp complete.mpg dvd/VIDEO_TS/VTS_01_1.VOB
chmod u+w dvd/VIDEO_TS/*.VOB
</pre>
<p>
IFO and BUP files provide DVD players with information specific to the video file it is trying to play, ifogen looks at the video and extracts the information needed. To generate the needed files use this command line:
</p>
<pre>
ifogen -f dvd/VIDEO_TS/VTS_01_1.VOB > dvd/VIDEO_TS/VTS_01_0.IFO
(cd dvd/VIDEO_TS; for i in *.IFO; do cp $i `basename $i .IFO`.BUP; done)
</pre>
<p>
Now we need to generate an iso image which can be burned to a DVD disc. Be sure you are using mkisofs version from dvdrtools, which supports the DVD files system:
</p>
<pre>
mkisofs -dvd-video -udf -o dvd.iso dvd/
</pre>
<p>
And, finally, we can burn our disc. If you are using an older first generation DVD+RW drive, the disc will need to be formated before the image can be burned, use the following commands, replacing srcd0 with the device name of your drive:
</p>
<pre>
dvd+rw-format -f /dev/srcd0
growisofs -Z /dev/srcd0=dvd.iso
</pre>
<p>
If you are using a newer DVD-RW, no formating is necessary, dvdrecord will do the job:
</p>
<pre>
dvdrecord -dao speed=2 dev=0,0,0 dvd.iso
</pre>
<h2>Fixing audio sync problems</h2>
<p>
The most common problem with this process is audio sync. The first thing you should try is optimizing your hard drive with hdparm, turn on 32 bit I/O and DMA, it looks something like this:
</p>
<pre>
hdparm -c 1 -d 1 /dev/hda
</pre>
Next, load the bttv driver with the gbuffers=10 option:
<pre>
modprobe bttv gbuffers=10
</pre>
<p>
This should fix any audio sync problems, if it does not, you may need to use the -O n option when running mplex. This delays the video by n mSeconds. The problem with this is it is a trial and error process and often leaves the joined video file in a state that causes ifogen to segfault. It may also be possible to record the video at a lower size, say 352x240, then use yuvscaler from the mpjeg-tools to resize it to 720x480, but I have not tried this.
</p>
<h2>Final Notes:</h2>
<p>
This process will not give you "Buy in the Store" DVD quality video, the quality will depend largely on the quality of your capture source, so you should use the best quality settings you can when recording anything on video tape you intend to burn to DVD. This process takes several hours, I use the shell script below to do the work for me, while I am at work or in bed sleeping. 100 minutes of video will require about 11 GB to record, 2 GB to encode and 1 GB for the iso image. Your mileage will vary.
</p>
<A HREF="misc/stoddard/make-dvd.sh.txt">Text version of make-dvd.sh</A>
<pre>
-----make-dvd.sh-----
#!/bin/sh
# Cleans out any left over files and makes the necessary directories
rm -r -f dvd video dvd.iso
mkdir dvd
mkdir dvd/VIDEO_TS
mkdir video
# Changes the channel on the TV tuner card
v4lctl setstation 3
# Records the video stream
streamer -n ntsc -t 60:00 -s 720x480 -r 30 -o video/stream.avi -f mjpeg -F stereo -c /dev/video0
# Encodes the video stream
lav2wav +p video/stream.avi | mp2enc -V -o video/audio.mp2
lav2yuv +p video/stream.avi | mpeg2enc -n n -f 8 -s -r 16 -o video/video.m1v
mplex -f 8 video/audio.mp2 video/video.m1v -o video/complete.mpg
# Builds DVD image from the encoded video
# This portion of the script was lifted directly from
# the writedvd script which comes with the dvdauthor tools
tocgen > dvd/VIDEO_TS/VIDEO_TS.IFO
cp video/complete.mpg dvd/VIDEO_TS/VTS_01_1.VOB
chmod u+w dvd/VIDEO_TS/*.VOB
ifogen -f dvd/VIDEO_TS/VTS_01_1.VOB > dvd/VIDEO_TS/VTS_01_0.IFO
(cd dvd/VIDEO_TS; for i in *.IFO; do cp $i `basename $i .IFO`.BUP; done)
mkisofs -dvd-video -udf -o dvd.iso dvd/
# Burns the DVD for 1st Generation DVD+RW
# Comment out the dvd+rw-format line if the disc is already formated and
# contains no data.
# Comment these two lines out if you are using a newer drive
dvd+rw-format -f /dev/srcd0
growisofs -Z /dev/srcd0=dvd.iso
# Burns DVD for more modern DVD formats like DVD-RW
# Uncomment this line if you are using a newer drive
#dvdrecord -dao speed=2 dev=0,0,0 dvd.iso
-----make-dvd.sh-----
</pre>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Chris Stoddard.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Risk-Free Resource Allocation for I/O Memory-Mapped Device Drivers</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/thangaraju.html">Dr B Thangaraju</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<FONT color=navy><H2>Abstract</H2></FONT color=navy>
<p>A device driver is an entry point to access a device. Developing a
device driver is not as simple a task as writing application programs. Since
any dynamically-loaded driver module is attached to the existing kernel, any
error in the driver will crash the entire system. Resource allocation for a
device is one of the main concerns for device driver developers. The device
resources are I/O memory, IRQs and ports. This article presents a risk-free way
of allocating resource for an I/O memory mapped device for a dynamically loaded
Linux device driver, and is written so that less experienced Linux users can follow
along.</p>
<FONT color=navy><H2>Introduction</H2></FONT color=navy>
<p> In the rapidly developing IT field, new devices are constantly being
developed and we see an increasingly wide variety of Input and Output devices.
The I/O subsystem allows a process to communicate with peripheral devices such
as disks, floppies, CD-ROMs, terminals, printers and networks. Kernel modules
that control devices are known as device drivers. The I/O subsystem handles
the movement of data between memory and peripheral devices. The type of the
devices can be classified into character and block depending on the way the
system accesses the device. In general, the character devices like keyboard,
mouse, console and modem are accessed as a stream of bytes. However, the block
devices like Hard disk, floppy and CD-ROM move blocks of data to and from the
system. </p>
<p> The kernel interacts with these devices through device drivers. A
device driver is a collection of functions used to access any particular
device. One of the important features of Linux is that the device driver
module can be inserted dynamically into the existing kernel. Then the driver
module will become part of the kernel and can access the kernel functions.
In the same way, the loaded driver can be removed dynamically. If the driver is not explicitly removed, it will be persistent in the system until we reboot the machine.</p>
<p> The most frequent job of any driver is transferring data between
the computer and its external environment. The external environment consists
of a variety of external devices, including secondary memory devices,
communications equipment and terminals. Three techniques are possible for I/O
operations: programmed I/O, Interrupt - driver I/O and Direct Memory
Access (DMA). The programmed I/O devices pass the data from system to device
or vice versa in two different ways: I/O port and I/O memory mapped. This
article explains the basic concept of I/O memory mapped devices and the macros
used by the device driver for allocating I/O memory regions for the device and
expounds the concept with well tested device driver code. Since the driver
module is part of the kernel, any attempt to allocate existing address to your
device will crash the system. So the sample driver will first probe whether the
address range is free or not, if it is already in use by other device it will
return immediately with an error, otherwise it will allocate the given address range to
your device. </p>
<FONT color=navy><H2>Basics of I/O memory mapped device</H2></FONT color=navy>
<p> Device drivers are extremely device dependent. The driver framework
should take responsibility of how the CPU interacts with the device. PIO and
DMA are the two ways of moving data between the kernel and the device. PIO
requires the CPU to move data to or from the device as each byte is ready,
by responding to an interrupt or polling. For DMA
devices, the kernel gives the source address, the destination address and the size of
the data in memory. The device can transfer the data without CPU intervention,
and when the data is moved it will send an interrupt to notify the kernel of the
completion. Typically, slow devices like modem and line printers are PIO
devices, while disks and graphics terminals are DMA devices. </p>
<p> For PIO devices, there are two ways to pass data from the device to
system memory. Which way a system uses depends on its architecture. For instance, Intel x86
architectures supports I/O port, and Motorola 680x0 maintains memory mapped
device I/O. Moreover, most of the ISA (Industry Standard Architecture) devices
belong to the I/O support allocation and
PCI (Peripheral Component Interconnect) devices uphold I/O memory mapped
allocation. Several parameters that a driver must know are, for example, the
hardware's actual I/O addresses or memory range. Sometimes you need to pass
parameters to a driver to help it in finding its own device or to
enable/disable specific features.
In my previous article in Linux Focus
(<A HREF="http://linuxfocus.org/English/November2002/article264.meta.shtml">
http://linuxfocus.org/English/November2002/article264.meta.shtml</A>), I explained the
fundamentals of device controllers and intricacies of the fail safe port
allocation for Linux device drivers From the driver developer perspective, the
allocation of I/O memory for a device has some similarity with allocation of
I/O ports because both are based on similar internal mechanisms. So it is
redundant to explain again the basics of device controller and the functions of
status and control registers for transferring data from or to device to system
memory.</p>
<FONT color=navy><H2>Macros used for I/O memory address allocation </H2></FONT color=navy>
<p>To probe whether the address range is already in use or not, use the following
macro in driver.
</p>
<FONT color=#8281e10><h3>int check_mem_region (unsigned long start, unsigned
long length);</h3></FONT color=#8281e10>
<p>Here, the first argument <b>start</b> is the starting address of the I/O
memory and <b>length</b> is the size of the address range. The function returns
zero if the address range is available otherwise returns less than zero.
To register the given I/O memory regions, the macro is
</P>
<FONT color=#8281e10><h3> void request_mem_region (unsigned long start,
unsigned long length, char
*device_name);</h3></FONT color=#8281e10>
<p>The string argument <b>char *device_name</b> is the name of device, which
will own the I/O memory regions from start address to length size.
Before the device is unregistered, the allocated I/O memory regions
should be released for other devices.
</P>
<FONT color=#8281e10><h3>void release_mem_region (unsigned long start, unsigned
long length);</h3></FONT color=#8281e10>
<p>The above function will de-allocate the I/O memory regions.</p>
<br><br><br>
<FONT color=navy><H2>Example Driver Code for I/O memory region
allocation</H2></FONT color=navy>
<table BORDER COLS=1 WIDTH="52%" BGCOLOR="silver" >
<tr> <td>
<p>#include <linux/module.h>
<br>#include <linux/init.h>
<br>#include <linux/fs.h>
<br>#include <linux/ioport.h>
<p>static int Major, result;
<br>struct file_operations fops;
<p>unsigned long start = 0, length = 0;
<p>MODULE_PARM (start, "l");
<br>MODULE_PARM (length, "l");
<p>int Wipro_init (void) {
<br> Major = register_chrdev (0, "Wipro_device", &fops);
<br> if (Major < 0)
<br> {
<br> printk (" Major number allocation
is failed \n");
<br> return (Major);
<br> }
<br> printk (" The Major number of the device is %d \n",
Major);
<p> result = check_mem_region (start, length);
<br> if (result < 0)
<br> {
<br>
printk ("Allocation for I/O memory range is failed: Try other range\n");
<br>
return (result);
<br> }
<p> request_mem_region (start,
length, "Wipro_device");
<br> return 0;
<br>}
<p>void Wipro_cleanup (void) {
<br> release_mem_region (start, length);
<br> printk (" The I/O memory region is released successfully
\n");
<p> unregister_chrdev (Major, "Wipro_device");
<br> printk (" The Major number is released successfully
\n");
<br>}
<p>module_init (Wipro_init);
<br>module_exit (Wipro_cleanup);
</td> </tr> </table>
<p>The above program is saved as io_mem.c. First four lines are the
headers, which are included to access kernel macros and functions. Next is the
variable and file_operations structure declaration. The macro MODULE_PARM is
the driver modules parameter for assigning value of any variable during the
module loading. It will accept two arguments, first one is the variable name
and the second one is data type of the variable. In this code, "<b>l</b>"
means long int. </p>
<p>In Wipro_init and Wipro_cleanup functions are explicit
initialization and cleanup for this driver module. The modern mechanism
recommends this approach for marking init_module and cleanup_module. The
Wipro_init function first registers the Wipro_device and allocates major number
dynamically. Then it will probe the given address, <b>if the address is already
in use, the function will return an error, otherwise it will allocate the
address range for the device</b>. The Wipro_cleanup function deallocate the I/O
memory region before unregistering the device name and major number.</p>
<p>The file is compiled with 2.4 kernel and has been created io_mem.o object file.
The following <b>device</b> and <b>iomem</b> file contains part of the existing data in my computer shown below.
</p>
<table BORDER COLS=1 WIDTH="52%" BGCOLOR="silver" >
<tr> <td>
<p><b>$cat /proc/devices</b>
<br>Character devices:
<br> 1 mem
<br> 2 pty
<br>...
<br>180 usb
</p>
<p><b>$cat /proc/iomem</b>
<br>00000000-0009fbff : System RAM
<br>...
<br>e0000000-e3ffffff : Silicon Integrated Systems [SiS] 620 Host
<br>ffff0000-ffffffff : reserved </p>
</td> </tr> </table>
<p> The module is loaded by a command,
<b>$insmod ./io_mem.o start=0xeeee0000 length=0xeeee</b>.
After loading successfully, it is evident that the device is registered with
the existing devices list with major number 254 and the given memory range is
allocated and shown in devices and iomem file respectively as shown below. </p>
<table BORDER COLS=1 WIDTH="52%" BGCOLOR="silver" >
<tr> <td>
<p><b>$cat /proc/devices</b>
<br>Character devices:
<br> 1 mem
<br> 2 pty
<br>...
<br>180 usb
<br><b><FONT color=red>254 Wipro_device</b> </FONT color=red>
<br>
</P>
<p><b>$cat /proc/iomem</b>
<br>00000000-0009fbff : System RAM
<br>...
<br>e0000000-e3ffffff : Silicon Integrated Systems [SiS] 620 Host
<br><b><FONT color=red>eeee0000-eeeeeeed : Wipro_device</b> </FONT color=red>
<br>ffff0000-ffffffff : reserved </p>
</tr> </table>
<br><br><br><FONT color=navy><H2>Conclusion </H2></FONT color=navy>
<p> We discussed the importance of the risk-free resource allocation for I/O memory mapped
devices for Linux
device drivers. We examined the basics of I/O memory mapped devices, the
macros for
I/O memory address allocation. We explained the practical approach
of how to allocate resource for
I/O memory mapped devices with the well tested device driver code.
We verified the code is
explained and the device register and memory range address allocation.
</p>
<H2><FONT color=navy>Acknowledgment</H2></FONT color=navy>
I would like to acknowledge <b>Mr.V.Jayasurya and Dr. Sanjay Gupta
</b>,Talent Transformation, Wipro Technologies, India.
<H2><FONT color=navy> References </H2></FONT color=navy>
1. Linux Device Drivers (2nd Edition), by Alessandro Rubini and Jonathan Corbet.
<br> The book is available from O'Reilly : <A HREF="http://linux.oreilly.com/">http://linux.oreilly.com/</A>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Dr B Thangaraju.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Apache Log Analysis Using Python</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/tougher.html">Rob Tougher</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<dl>
<dt><a href=#1>1. Introduction</a>
<dt><a href=#2>2. The Framework</a>
<dd><a href=#2.1>2.1 First pass - Awk attempt</a>
<dd><a href=#2.2>2.2 Next pass - Python to the rescue</a>
<dt><a href=#3>3. Example Handlers</a>
<dd><a href=#3.1>3.1 Return visitors</a>
<dd><a href=#3.2>3.2 Referring domains</a>
<dt><a href=#4>4. Files</a>
<dt><a href=#5>5. Conclusion</a>
</dl>
<a name=1></a>
<h3>1. Introduction</h3>
<p>
I use the <a href="http://httpd.apache.org/">
Apache HTTP Server</a> to run my
<a href="http://www.robtougher.com">web site</a>.
When a visitor requests a page from the site, Apache
records the following information in a file named "access_log":
</p>
<ul>
<li>The IP address of the computer requesting the page
<li>The name of the page being requested
<li>The date and time of the request
<li>The page that referred the visitor to the requested page
</ul>
<p>
Until recently I used a combination of command line utilities
(grep, tail, sort, wc, less, awk) to extract
this information from the access log.
But some complex calculations were difficult and time-consuming
to perform using these tools.
I needed a more powerful solution -
a programming language to crunch the data.
</p>
<p>
Enter <a href="http://www.python.org">Python</a>. Python is
fast becoming my favorite language, and was the perfect tool
for solving this problem. I created a framework in Python for
performing generic text file analysis, and then utilized
this framework to glean information from my Apache access log.
</p>
<p>
This article first explains the framework, and
then describes two examples that use it. My hope
is that by the end of this article you will be able
to use this framework for analyzing your own text files.
</p>
<a name=2></a>
<h3>2. The Framework</h3>
<a name=2.1></a>
<h4>2.1 First pass - Awk attempt</h4>
<p>
When trying to solve this problem I initially turned to
<a href="http://www.gnu.org/software/gawk/gawk.html">Gawk</a>,
an implementation of the Awk language. Awk is primarily used
to search text files for certain pieces of data. The following is
a basic Awk script:
</p>
<p>Listing 1:
<a href="misc/tougher/count_lines.awk.txt">count_lines.awk</a></p>
<pre>
#!/usr/bin/awk -f
BEGIN {
count = 0
}
{ count++ }
END {
print count
}
</pre>
<p>
This script prints the number of lines in a file. You can
run it by typing the following at a command prompt:
</p>
<pre>
prompt$ ./count_lines.awk access_log
</pre>
<p>
Awk reads in the script, and does the following:
</p>
<ul>
<li>Runs the code in the BEGIN block.
<li>Runs the middle block of code for each line in "access_log".
<li>Runs the code in the END block.
</ul>
<p>
I liked this processing model. It made sense to me -
first run some initialization code,
next process the file line by line,
and finally run some cleanup code. It seemed perfectly
suited to the task of analyzing text files.
</p>
<p>
Awk gave me trouble, though. It was very difficult to create
complex data structures - I was jumping through hoops for
tasks that should have been much more straightforward.
So after some time I started looking for an alternative.
</p>
<a name=2.2></a>
<h4>2.2 Next pass - Python to the rescue</h4>
<p>
My situation was this: I liked the Awk processing model,
but I didn't like the language itself. And I liked Python, but
it didn't have Awk's processing model. So I decided
to combine the two, and came up with the current framework.
</p>
<p>
The framework resides in
<a href="misc/tougher/awk.py.txt">awk.py</a>.
This module contains one class, <code>controller</code>, which
implements the following methods:
</p>
<ul>
<li><code>__init__(file)</code> - the constructor, which takes a
file object to process.
<li><code>subscribe(handler)</code> - subscribes a handler to the controller.
<li><code>run()</code> - processes the file.
<li><code>print_results()</code> - prints the results of the process.
</ul>
<p>
A <i>handler</i> is a class that implements a defined set
of methods. Multiple handlers
can be subscribed to the controller at any given time. Every
handler must implement the following methods:
</p>
<ul>
<li><code>begin()</code> - gets called once before the file is processed.
<li><code>process_line(line)</code> - gets called for each line of the file.
<li><code>end()</code> - gets called after the file is processed.
<li><code>description()</code> - gets called from
<code>controller.print_results()</code>. It should
return a description of the handler.
<li><code>result()</code> - also called from
<code>controller.print_results()</code>.
It should return the results of the class' calculations.
</ul>
<p>
You create handlers, subscribe them to the controller, and then
run the controller. The following is a simple example with one handler:
</p>
<p>Listing 2: <a href="misc/tougher/count_lines.py.txt">count_lines.py</a></p>
<pre>
# Standard sys module
import sys
# Custom awk.py module
import awk
class count_lines:
def begin(self):
self.m_count = 0
def process_line(self, s):
self.m_count += 1
def end(self):
pass
def description(self):
return "# of lines in the file"
def result(self):
return self.m_count
#
# Step 1: Create the Awk controller
#
ac = awk.controller(sys.stdin)
#
# Step 2: Subscribe the handler
#
ac.subscribe(count_lines())
#
# Step 3: Run
#
ac.run()
#
# Step 4: Print the results
#
ac.print_results()
</pre>
<p>
You can run this script using the following command:
</p>
<pre>
prompt$ cat access_log | python count_lines.py
</pre>
<p>
The results of the script should be printed to the console.
</p>
<a name=3></a>
<h3>3. Example Handlers</h3>
<p>
Now that the framework was in place, I had to figure
out how I was going to use it. I came up with many ideas, but
the following two were the top priorities.
</p>
<a name=3.1></a>
<h4>3.1 Return visitors</h4>
<p>
The first question that I wanted to answer using my new framework
was the following:
</p>
<ul>
<li><i>How many people have returned to the site more than N times?</i>
</ul>
<p>
My thinking was this: if people return often, they must enjoy
the site, right? The following script answers the
above question:
</p>
<p>
Listing 3: return_visitors (can be found in
<a href="misc/tougher/handlers.py.txt">handlers.py</a>)
</p>
<pre>
class return_visitors:
def __init__(self, n):
self.m_n = n
self.m_ip_days = {}
def begin(self):
pass
def process_line(self, s):
try:
array = s.split()
ip = array[0]
day = array[3][1:7]
if self.m_ip_days.has_key(ip):
if day not in self.m_ip_days[ip]:
self.m_ip_days[ip].append(day)
else:
self.m_ip_days[ip] = []
self.m_ip_days[ip].append(day)
except IndexError:
pass
def end(self):
ips = self.m_ip_days.keys()
count = 0
for ip in ips:
if len(self.m_ip_days[ip]) > self.m_n:
count += 1
self.m_count = count
def description(self):
return "# of IP addresses that visited more than %s days" % self.m_n
def result(self):
return self.m_count
</pre>
<p>
The script stores the number of days that each IP address has visited
the site. When the file is finished processing, it returns how
many IP addresses have visited more than N times.
</p>
<a name=3.2></a>
<h4>3.2 Referring domains</h4>
<p>
Another thing I wanted to know was how people found out about the
site. I was getting a decent amount of traffic, and I wasn't sure
why. I kept asking myself:
</p>
<ul>
<li><i>Where are all these people coming from?</i>
</ul>
<p>
I guess you shouldn't argue with a site that's popular. But
I was curious to know how people were learning about my site.
So I wrote the following script:
</p>
<p>Listing 4: referring_domains (can be found in
<a href="misc/tougher/handlers.py.txt">handlers.py</a>)
</p>
<pre>
class referring_domains:
def __init__(self):
self.m_domains = {}
def begin(self):
pass
def process_line(self, line):
try:
array = line.split()
referrer = array[10]
m = re.search('//[a-zA-Z0-9\-\.]*\.[a-zA-z]{2,3}/',
referrer)
length = len(m.group(0))
domain = m.group(0)[2:length-1]
if self.m_domains.has_key(domain):
self.m_domains[domain] += 1
else:
self.m_domains[domain] = 1
except AttributeError:
pass
except IndexError:
pass
def end(self):
pass
def description(self):
return "Referring domains"
def sort(self, key1, key2):
if self.m_domains[key1] > self.m_domains[key2]:
return -1
elif self.m_domains[key1] == self.m_domains[key2]:
return 0
else:
return 1
def result(self):
s = ""
keys = self.m_domains.keys()
keys.sort(self.sort)
for domain in keys:
s += domain
s += " "
s += str(self.m_domains[domain])
s += "\n"
s += "\n\n"
return s
</pre>
<p>
This script stores the referral information
for each request, and generates a list of
referring domains, sorted by frequency.
</p>
<p>
I ran the script and found that most of the referrals came from my own site.
This makes sense - when a visitor moves from one page to another on
the site, the referring domain for the page is my web site's
domain. But I did find some interesting entries in the referral
list, and my question about site traffic was answered.
</p>
<a name=4></a>
<h3>4. Files</h3>
<p>
The following files contain the code from this article:
</p>
<ul>
<li><a href="misc/tougher/count_lines.awk.txt">count_lines.awk</a> -
a basic Awk script
<li><a href="misc/tougher/awk.py.txt">awk.py</a> -
the <code>controller</code> class
<li><a href="misc/tougher/count_lines.py.txt">count_lines.py</a> -
<code>count_lines</code> handler
<li><a href="misc/tougher/handlers.py.txt">handlers.py</a> -
<code>return_visitors</code> and <code>referring_domains</code> handlers
</ul>
<a name=5></a>
<h3>5. Conclusion</h3>
<p>
In this article I described how I use Python to process my
Apache HTTP Server access log. Hopefully I explained my techniques
clearly enough so that you can use them for your text files.
</p>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Rob Tougher.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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">Subnetting your local network with DHCP</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/ward.html">Alan Ward</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p><b>Why subnet?</b></p>
<p>As hardware prices go down and local networks grow larger, a new size of
local network is becoming common: the size in between the small office
(5-10 hosts) and the large corporate building-sized LAN (more than 50 hosts).</p>
<p>With less than 10 hosts, it is generally easy to manage the network:
all hosts get on to the same Ethernet segment, and security -- if necessary --
is implemented at host level: passwords and such. With more than 50
hosts, you can generally obtain funding for managed switches than can
define virtual networks (VLANs). The Accounting Department will go on
one VLAN, Production on another and so forth. Every host will have access
to other hosts in its VLAN and to the company servers, but not across
VLANs. Security is managed at both host and network levels.</p>
<p>On middlish-sized local networks however, we often must put all hosts
on the same segment once more. Recent cheap LAN switches are capable of
handling traffic between up to 50 hosts easily. However, switches with
VLAN capability are much more expensive. Well-known brands are selling for
upwards of US $1200 for a 24-port switch, which may be worth it -- but is
completely out of many budgets. Mine for one.</p>
<p><b>DHCP and subnetworks</b></p>
<p>One of the local networks I administer in the school I work in
is a long string of non-managed Ethernet switches. This is basically because
of how the building was initially drawn up. On this, I must handle traffic
from several different types of host; to simplify let's say I have
teacher-level traffic (group A) and student-level traffic (group B).
These must not mix: I do not want people from each group accessing the
other group's files or
printers (passwords tend to be weaker than I would like).</p>
<p>The simplest way to separate the groups at logical level is to give
each group a different IP network address. For example, group A gets
addresses on network 192.168.10.0 (e.g. 192.168.10.12), while group B
get addresses on network 192.168.20.0 (e.g. 192.168.20.34). Servers
that are present on both must have an address on each network.</p>
<p align=center><img src="misc/ward/map.jpg"><br>
<i>Our network topology</i></p>
<p>A DHCP server is a good way of doing this. This is the service you
access when using a dial-up Internet connection: you connect to
your ISP, who assigns you a temporary public IP address. Most Linux
distributions include a DHCP server, which can also be used on a
local network.</p>
<p>Initially, you can give the DHCP server a range of IP addresses
to distribute: for example 192.168.1.100 to 192.168.1.199. Any host
that starts up and asks for an address will get one of these. After the
host is switched back off, the address will be liberated and can be
re-used on another host if needed.</p>
<p>But Ethernet cards all carry a unique identification number, called
a MAC address. This is a 12-digit hexadecimal number that is assigned
by the manufacturer, and that is guaranteed to be different from any
other Ethernet card, anywhere in the world. A DHCP server can be configured
to use this MAC address to always assign the same IP address to the host.</p>
<p>Using this, we can make a list of the MAC addresses of the hosts in
our group A, and make DHCP serve them fixed IP addresses on the 192.168.10.0
subnet. The MAC addresses of hosts in group B are served addresses on
the 192.168.20.0 subnet, and hosts that are not on either list (visitors'
laptops, for example) get an address on subnet 192.168.1.0 .
<p>DHCP has an advantage over VLANs in this respect: VLANs are defined
for physical network ports, while DHCP uses card addresses. With a VLAN,
if you physically change your computer's network connection -- as in
moving from one room to another -- you may also change its VLAN. With
DHCP however, its subnet assignation will remain the same.</p>
<p><b>Setting up DHCP</b></p>
<p>On most Linux distributions, the DHCP server is called dhcpd, and
is started with the standard scripts (the same as httpd, postfix, ...).
It can be found in RPM form, as for example in <u>dhcp-3.0-3mdk.i386.rpm</u>.
If you already have it installed on your system, try the dhcpd and
dhcpd.conf man pages.</p>
<p>To begin, I used the webmin utility to set up a basic subnet DHCP
service. Notice that this service has to be on network 192.168.0.0
with netmask 255.255.0.0 . This is because it must be accessible
from al subnets.</p>
<p align=center><img src="misc/ward/main.jpg"><br></p>
<p>I then set up each specific host, specifying it's name, hardware
MAC address and the IP address I want to serve to it. Note the
IP address, now on subnet 192.168.10.0 .</p>
<p align=center><img src="misc/ward/client.jpg"><br></p>
<p>To obtain the Ethernet MAC address, most cards have it printed
on a label sticking to the card. It yours does not, you can skip this
step for the moment. Finish setting up the DHCP service and fire up
the hosts one by one. As each host obtains an IP address (on subnet
192.168.1.0 for the time being), you will see it appear in file
<u>/var/lib/dhcp/dhcpd.leases</u>. For example: </p>
<p><pre>
lease 192.168.1.198 {
hardware ethernet 00:00:b4:38:cf:6a;
client-hostname "bis";
}
</pre></p>
<p>Please note that <strong>only</strong> addresses obtained from
the general subnet will appear here; not when you have given a
host a fixed address.</p>
<p>Finish setting up the fixed addresses for hosts on the DHCP server.</p>
<p>Start or restart the DHCP server. Hosts should now be obtaining
their assigned IP addresses. You can see this on a Linux host with
the <u>ifconfig</u> utility. On a Windows box, you can use <u>winipcfg</u>
under Win95/98/ME, or <u>ipconfig</u> (in a terminal window) under WinNT/2k.</p>
<p>But network masks should now still be the default 255.255.0.0 . This is
not good, as hosts on subnets 192.168.10.0 and 192.168.20.0 can see each
others (try a ping). We should now go to each host definition for dhcpd,
and in the "edit client options" set its subnet mask as 255.255.255.0 and
its default router to 192.168.X.1 for subnet 192.168.X.0 . For example,
on subnet 192.168.10.0:</p>
<p align=center><img src="misc/ward/client1.jpg"><br></p>
<p>Remember to also set the network mask to 255.255.255.0 for the
general 192.168.0.0 subnet client options.
<p>You can edit the <u>/etc/dhcpd.conf</u> file by hand. It may even
be more clear than the webmin interface. This is what you could have:</p>
<p><pre>
#
# main subnet, accessed by default by hosts we do not know
#
subnet 192.168.0.0 netmask 255.255.0.0 {
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
range 192.168.1.101 192.168.1.199;
}
#
# host definition, one for each known host on our LAN
#
host bis {
option subnet-mask 255.255.255.0;
option routers 192.168.10.1;
hardware ethernet 00:00:b4:38:cf:6a; # 12-digit hex MAC address
fixed-address 192.168.10.34;
}
</pre></p>
<p><b>Making the server accessible</b></p>
<p>In the above example, we made 192.168.X.1 the default router for each
subnet 192.168.X.0 . But for the time being, our server has IP address
192.168.1.1 -- which means that:<br>
<ul><li>hosts on subnet 192.168.10.0 will try to
obtain an IP address</li>
<li>they will obtain such an address from server 192.168.1.1</li>
<li>this address will be on subnet 192.168.10.0, netmask 255.255.255.0</li>
<li>they are now unable to contact server 192.168.1.1 <strong>which is
on another subnet!!!</strong></li>
</ul></p>
<p>This is why our server must have an extra IP address for each
subnet: 192.168.10.1, 192.168.20.1, etc. This can easily be set up
by creating virtual network cards eth0:1, eth0:2, etc. with webmin:</p>
<p align=center><img src="misc/ward/virtual.jpg"><br></p>
<p>You can also create this by hand. On a Mandrake or Red Hat distribution,
the files are in <u>/etc/sysconfig/network-scripts</u>. You
should already have a file called <u>ifcfg-eth0</u>. Copy this as
<u>ifcfg-eth0:1</u>, <u>ifcfg-eth0:2</u>, ... changing the addresses
and netmasks as appropriate. For example, for eth0:1 :</p>
<p><pre>
BROADCAST=192.168.10.0
DEVICE=eth0:1
NETMASK=255.255.255.0
IPADDR=192.168.10.1
NETWORK=192.168.10.0
ONBOOT=yes
BOOTPROTO=none
</pre></p>
<p>This is basically all you need. You may now have to enable routing on the
server, for example if you
are using it to access Internet. But be careful to disable routing between
local subnets; 192.168.X.0 should not be able to see 192.168.Y.0 . Use
a firewalling package such as iptables to block this. You can also use
this to block or allow Internet access from any or all subnets if you wish.</p>
<hr>
<p>PS. Should anybody want to translate this article: I wrote it in
the spirit of the GPL software licence. i.e. you are free (and
indeed encouraged) to copy, post and translate it -- but please,
PLEASE, send me notice by email! I like to keep track of translations --
it's good for the curriculum :-)</p>
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Alan Ward.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</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 <FONT COLOR="red"><STRONG>SCARY!!!</STRONG></FONT></I></SMALL>
</TD><TD WIDTH="380">
<center>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Back Page</FONT></STRONG></BIG></BIG><BR>
<STRONG>By <A HREF="../authors/orr.html">Mike ("Iron") Orr</A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<ul>
<li><a HREF="#news">Gazette News</a>
<li><a HREF="#wacko">Wacko Topic of the Month #1</a>
<li><a HREF="#nottag">Not the Answer Gang</a>
<li><a HREF="#other">In Other News...</a>
</ul>
<a name="news"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">Gazette News</font></H3></center>
<P> <HR> <P>
<!--======================================================================-->
<P>
LG now has Author pages. Starting this
issue, every author gets a page with his or her contact information, bio, and
links to all the articles s/he has written. The "By <author>" link
at the top of each article will now go to the Author's page.
There's also an
<A HREF="../authors/index.html">author index</A> if you want to browse.
The former TAG Bios have also turned into Author pages, and the
<A HREF="../tag/bios.html">TAG Bios index page</A> has been turned into
a set of links.
<P> Over time, we will gradually clean up the links in the back isues
and try to eliminate symlinks from LG. Some people read LG offline on
systems without symbolic links, and find it difficult when the files
don't exist. However, we will maintain the "current/" link at least,
pointing to the current issue.
<a name="wacko"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">Wacko Topic of the Month</font></H3></center>
<p> <hr> <p>
<!--====================================================================-->
The Register <A
HREF="http://www.theregister.co.uk/content/28/27179.html">reports</A>
that if you type "go to hell" into
<A HREF="http://www.google.com/">Google</A>, the first result is
"Microsoft Corporation, Where do you want to go today?"
Number two is <A HREF="http://hell.com">hell.com</A>, "which seems to
be a very weird site we do not understand".
<P> Hell.com has now regained the #1 slot, and Microsoft is not to be
seen. Cynics might wonder if Bill Gates did a backroom deal with
Google to get their entry off the results.
<a name="nottag"></a>
<p> <hr> <p>
<!--====================================================================-->
<center><h3><font color="maroon">Not The Answer Gang</font></h3></center>
<p> <hr> <p>
<!--======================================================================-->
<p>
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Kitchen chemistry</H3>
<p align="right"><strong>Answered By Ben Okopnik, Iron, Dan Wilder and Heather Stern
<p></strong></p>
<P>
<BLOCKQUOTE><STRONG>
What hapens when bicarb is added to a week acid?
</STRONG></BLOCKQUOTE>
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Ben]
Takes two weeks to come down off the trip, dude. It's like, unreal.
<P> (Yes, I just got back from California. Why do you ask?)
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
Like totally, dude.
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Dan]
Same thing as when it is added to a month acid, but faster.
<P>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
You wanted "Cecil Adams, The Straight Dope" -- he does stuff like that.
"Women's Day" could probably answer you too.
<P> We're "The Linux Gazette Answer Gang" -- we answer Linux questions, not
chemistry matters.
<P> Please advise us where you encountered the "linux-questions-only@ssc.com" address
and what implied to you that it addressed general questions. We're
trying to chase down old references and get them updated.
<a name="other"></a>
<p> <hr> <p>
<!--====================================================================-->
<center><h3><font color="maroon">In Other News...</font></h3></center>
<p> <hr> <p>
<!--====================================================================-->
<H4>Women hurt when bullet hits computer</H4>
EVERETT, Washington -- A woman was injured in a drive-by shooting about 5:45
a.m. yesterday as she sat at the computer in her home in the 3400 block of
119th Place Southeast. A bullet hit her computer screen, causing glass to
shatter in her face, said Snohomish County Sheriff's Department spokeswoman Jan
Jorgensen.
<P> Police found seven rounds in the house, Jorgensen said.
<P> Although they did not give a motive, police said they do not believe the
shooting was random.
<P> Only the woman and her husband, who are both in their 40s, live at the
home, Jorgensen said.
<P> -- <A HREF="http://seattlepi.nwsource.com/local/89150_filler30.shtml">
http://seattlepi.nwsource.com/local/89150_filler30.shtml</A>
<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 copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright © 2002, Mike ("Iron") Orr.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 83 of <i>Linux Gazette</i>, October 2002</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
</BODY></HTML>
|