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
|
<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.3D.f">
<TITLE>The Linux Gazette 53: The Answer Guy (TWDT)</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.jpg"
WIDTH="600" HEIGHT="124" border="0"></H1></A>
<!-- *** BEGIN navbar *** -->
<A HREF="lg_bytes53.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<IMG ALT=""
SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom" >
<A HREF="lg_toc53.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A>
<A HREF="../lg_frontpage.html"><IMG ALT="[ Front Page ]"
SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]"
SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<IMG ALT=""
SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom" >
<A HREF="lg_tips53.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A>
<!-- *** END navbar *** -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Guy</font>
<img src="../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By James T. Dennis,
<a href="mailto:answerguy@ssc.com">answerguy@ssc.com</a><BR>
LinuxCare,
<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<H3>Contents:</H3>
<dl>
<!-- dt><a href="#tag/greeting"
><img src="../gx/dennis/bbub.gif" alt="(!)" border="0"
align="middle"><strong>Greetings From Jim Dennis</strong></A>
<dd>plus <a href="#tag/hgreeting"
><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"
></a>Win4Lin and www.linuxdoc.org/LDP/LG/issue50/tag/26.html --or--
<dd><A HREF="#tag/1"
><strong>Win4Lin eMERGEs</strong></a>
<dt><A HREF="#tag/2"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Extracting a block of text from a file</strong></a>
<dt><A HREF="#tag/3"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>Please can you help ? --or--
<dd><A HREF="#tag/3"
><strong>Zipping Across the LAN</strong></a>
<dt><A HREF="#tag/4"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>accessing windows files --or--
<dd><A HREF="#tag/4"
><strong>Accessing Local MS-DOS/Windows '9x Drives/Disks from Linux</strong></a>
<dt><A HREF="#tag/5"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>co-processes --or--
<dd><A HREF="#tag/5"
><strong>More on >> zsh Co-processes</strong></a>
<dt><A HREF="#tag/6"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>Linux - AMD? --or--
<dd><A HREF="#tag/6"
><strong>Linux for AMD, Cyrix, etc</strong></a>
<dt><A HREF="#tag/7"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>rcp question --or--
<dd><A HREF="#tag/7"
><strong>UNIX User Tries Linux 'rsh'</strong></a>
<dt><A HREF="#tag/8"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Telnet</strong></a>
<dt><A HREF="#tag/9"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>unix system admin --or--
<dd><A HREF="#tag/9"
><strong>Getting Familiar with a UNIX System</strong></a>
<dt><A HREF="#tag/10"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>NT OS/2 --or--
<dd><A HREF="#tag/10"
><strong>Connecting NT and OS/2</strong></a>
<dt><A HREF="#tag/11"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>control another VT? --or--
<dd><A HREF="#tag/11"
><strong>"Temporarily Controlling a VT"</strong></a>
<dt><A HREF="#tag/12"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>question regarding adding pty's to my sunos environment --or--
<dd><A HREF="#tag/12"
><strong>Running out of Pseudo-tty's</strong></a>
<dt><A HREF="#tag/13"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>xdm wont start a session --or--
<dd><A HREF="#tag/13"
><strong>XFree 4.0 and ":0.0 refused by server" Errors</strong></a>
<dt><A HREF="#tag/14"
><img src="../gx/dennis/bbub.gif" height="28" width="50"
alt="(!)" border="0"
><strong>FW: Linux</strong></a>
<dt><A HREF="#tag/15"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>Which filesystem? --or--
<dd><A HREF="#tag/15"
><strong>Determining the Type of Each Filesystem</strong></a>
<dt><A HREF="#tag/16"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>4 questions --or--
<dd><A HREF="#tag/16"
><strong>Four Questions</strong></a>
<dt><A HREF="#tag/17"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>Kermit protocol --or--
<dd><A HREF="#tag/17"
><strong>G-Kermit: The GPL Kermit Transfer Package</strong></a>
<dt><A HREF="#tag/18"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>shell cannot see an existing file --or--
<dd><A HREF="#tag/18"
><strong><TT>./script:</TT> No such file or directory</strong></a>
<dt><A HREF="#tag/19"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>hello</strong></a>
<dt><A HREF="#tag/20"
><img src="../gx/dennis/bbub.gif" height="28" width="50"
alt="(!)" border="0"
></a>Shutting Down the "ping Daemon" --or--
<dd><A HREF="#tag/20"
><strong>Shutting Down the Ping Daemon: Revised</strong></a>
<dt><A HREF="#tag/21"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>run any remote X server at host box --or--
<dd><A HREF="#tag/21"
><strong>Remotely Executing Graphic Apps</strong></a>
<!-- index_text ends -->
</DL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<!-- A NAME="tag/greeting"><HR WIDTH="75%" ALIGN="center"></A>
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>Greetings from Jim Dennis</H3 -->
<!-- begin greeting -->
<!-- end greeting -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<!-- A NAME="tag/hgreeting"><HR WIDTH="40%" 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 -->
<!-- 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"
>Win4Lin eMERGEs</H3>
<p><strong>From J. David Peet on Thu, 30 Mar 2000
</strong></p>
<!-- ::
Win4Lin eMERGEs
~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
I just ran across your article
</STRONG></P>
<P><STRONG>
www.linuxdoc.org/LDP/LG/issue50/tag/26.html
that talks a (tiny) bit about Win4Lin.
</STRONG></P>
<P><STRONG>
FYI, Win4Lin is now available. And if you are interested,
the full documentation is on-line on the TreLOS web site.
www.trelos.com. You can also order it via this web site.
</STRONG></P>
<P><STRONG>
In case you did not know, the Win4Lin technology has a long
history as "Merge" for SCO Unix. SCO has been an OEM of
our Merge technology for years.
Win4Lin is the Linux version of the existing current technology.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I didn't know that. I thought DOS/MERGE was from a
company called "Locus" or something like that.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
One minor point <TT>--</TT> Win4Lin is not a "clone" of VMWare as
such. They both provide a virtual machine to run Windows in on
Linux, but there are significant differences.
Refer to the new "white-paper" document:
<A HREF="http://www.trelos.com/trelos/Trelos/Products/Win4Lin_Whitepaper.htm"
>http://www.trelos.com/trelos/Trelos/Products/Win4Lin_Whitepaper.htm</A>
Near then end are two paragraphs that compare and contrast
Win4Lin <A HREF="http://www.winehq.com/">WINE</A> and VMWare.
</STRONG></P>
<P><STRONG>
-Thanks
<TT>-David</TT> Peet
<A HREF="mailto:david.peet@trelos.com"
>david.peet@trelos.com</A>
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I probably shouldn't have used the word "clone" <TT>---</TT> though
it isn't all that precise. Obviously, in light of Win4Lin's
heritage it might be more appropriate to say that VMWare is a
"clone" of Win4Lin's predecessor. MERGE is the grandaddy of
MS-DOS emulators for UNIX.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, I'll let people make up their own mind based on their
own reading and experience.
</BLOCKQUOTE>
<BLOCKQUOTE>
I haven't actually used any DOS or MS Windows software in years
(only the occasional, blessedly brief trifle to help someone out
here or there). So even if you were to send a copy to me for my
evaluation I can't promise that I'd ever get around to trying
it. (I think I have a VMWare CD around here somewhere <TT>--</TT> an eval
copy or some such). Heather, my editor and wife, still uses
MS-Windows occasionally. I know she's installed <A HREF="http://www.dosemu.org/">DOSEMU</A>, and WINE
and used them a bit (DOSemu extensively). I've installed and
played with DOSemu (helped someone with it at an installfest a
couple weeks ago, too). However, I've never even tried WINE!
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, good luck on you're new release.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 1 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>Win4Lin eMERGEs</H3>
<p><strong>Answered By J. David Peet on Thu, 30 Mar 2000
</strong></p>
<BLOCKQUOTE>
Jim Dennis wrote:
</BLOCKQUOTE>
<!-- ::<BLOCKQuote>
Win4Lin eMERGEs
~~~~~~~~~~~~~~~
</BLOCKQuote>:: -->
<P><STRONG><FONT COLOR="#000066"><EM>
In case you did not know, the Win4Lin technology has a long
history as "Merge" for SCO Unix. SCO has been an OEM of
our Merge technology for years.
Win4Lin is the Linux version of the existing current technology.
</EM></FONT></STRONG></P>
<P><STRONG>
I didn't know that. I thought DOS/MERGE was from a
company called "Locus" or something like that.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Yes, I was there at Locus at the very start of Merge.
It's been a long path since then with some odd twists.
First Locus merged with Platinum, and Merge continued to
be developed, including the current SCO Merge 4 version
with win95 support. Then right before CA digested Platinum,
a company in Santa Cruz, DASCOM, bought (rescued!) the Merge
technology out from Platinum and hired some of us old-time Merge
developers to form a company named "TreLOS" to take the technology
forward including porting it to Linux. (Insert danger music here.)
Then before TreLOS could be spun off as it's own company, IBM bought
DASCOM, for reasons having nothing at all to do with Merge/TreLOS.
Then in February IBM finished spinning TreLOS off as it's own company.
We are currently a (very small) privately held company with NO
affiliation with IBM and NO IBM technology. (IBM for some reasons
wanted that to be clear.) Once we escaped from IBM it took a
bit more than a month to set up the infrastructure to be able to
release the product. It was getting caught up in the IBM acqusition
of DASCOM that prevented us from releasing the product last fall
as we had originally planned.
The Win4Lin 1.0 product has actually been ready for months now.
All that time was not completely wasted because IBM let us have an
extended semi-secret beta program so it's actually been in real use
for quite a while for a "1.0" version product.
</BLOCKQUOTE>
<BLOCKQUOTE>
So that's the history to this point. Perhaps more than you
wanted to know.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
...
Anyway, good luck on your new release.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
-Thanks
-David
</BLOCKQUOTE>
<BLOCKQUOTE>
P.S. Now that we are launching Win4Lin 1.0, having reviews done is
a Good Thing. So if you or Heather would like to do a review of it
that is extremely easy to arrange.
</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"
>Extracting a block of text from a file</H3>
<p><strong>From Tim Moss on Thu, 30 Mar 2000
</strong></p>
<P><STRONG>
I'm trying to extract a block of text from a file using just bash and
standard shell utilities (no perl, awk, sed, etc). I have a definitive
pattern that can denote the start and end or I can easily get the line
numbers that denote the start and end of the block of text I'm
interested in (which, by the way, I don't know ahead of time. I only
know where it is in the file). I can't find a utility or command that
will extract everything that falls between those points. Does such a
thing exist?
</STRONG></P>
<P><STRONG>
Thanks
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
awk and sed are considered to be "standard shell utilities."
(They are part of the POSIX specification).
</BLOCKQUOTE>
<BLOCKQUOTE>
The sed expression is simply:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
sed -n "$begin,${end}p" ...
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... if begin and end are line numbers.
</BLOCKQUOTE>
<BLOCKQUOTE>
For patterns it's easier to use awk:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
awk "/$begin/,/$end/" ...
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... Note: begin and end are regexes and should be
chosen carefully!
</BLOCKQUOTE>
<BLOCKQUOTE>
However, since you don't want to do it the
easy way, here are some alternatives:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<TT>------------------</TT> WARNING: very long <TT>-------------------------</TT>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
If it is a text file and you just want some lines out of
it try something like:
</BLOCKQUOTE>
<blockquote><pre> #!/bin/sh
# shextract.sh
# extract part of a file between a
# pair of globbing patterns
[ "$#" -eq "2" ] || {
echo "Must supply begin and end patterns" >&2
exit 1
}
begin=$1
end=$2
of="" ## output flag
while read a; do
case "$a" in
"$begin") of="true";;
"$end") of="";;
esac
[ -n "$of" ] && echo $a
done
exit 0
</pre></blockquote>
<BLOCKQUOTE>
... this uses no external utilities except for the
test command ('[') and possibly the 'echo' command from
VERY old versions of Bourne sh. It should be supported
under any Bourne shell derivative. Under bash these
are builtin commands.
</BLOCKQUOTE>
<BLOCKQUOTE>
It takes two parameters. These are "globbing" patterns
NOT regular expressions. They should be quoted, especially
if they contain shell wildcards (?, *, and [...]
expressions).
</BLOCKQUOTE>
<BLOCKQUOTE>
Read any good shell programming reference (or even the
rather weak 'case...esac' section of the bash man page)
for details on the acceptable pattern syntax. Note
because of the way I'm using this you could invoke
this program (let's call it shextract, for "shell
extraction") like so:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
shextract "[bB]egin|[Ss]tart" "[Ee]nd|[Ss]top"
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... to extract the lines between the any occurrence
of the term "begin" or "Begin" or "start" or "Start" and
the any subsequent occurence of "end" or "End" or "stop"
or "Stop."
</BLOCKQUOTE>
<BLOCKQUOTE>
Notice that I can use the (quoted) pipe symbol in this
context to show "alternation" (similar to the egrep use
of the same token).
</BLOCKQUOTE>
<BLOCKQUOTE>
This script could be easily modified to use regex's
instead of glob patterns (though we'd either have to
use 'grep' for that or rely on a much newer shell
such as ksh '93 or bash v. 2.x to do so).
</BLOCKQUOTE>
<BLOCKQUOTE>
This particular version will extract <EM>all</EM> regions
of the file that lie between our begin and end tokens.
</BLOCKQUOTE>
<BLOCKQUOTE>
To stop after the first we have to insert a "break"
statement into our "$end") ...;;; case. To support
an "nth" occurence of the pattern we'd have to use
an additional argument. To cope with degenerate
input (cases where the begin and end tokens might be
out of order, nested or overlapped) we'd have to
do considerably more work.
</BLOCKQUOTE>
<BLOCKQUOTE>
As written this example requires exactly two arguments.
It will only process input from stdin and only write
to stdout. We could easily add code to handle
more arguments (first two are patterns, 'shift'ed out
rest are input file names) and some options switches
(for output file, only one extraction per file,
emit errors if end pattern is found before start
pattern, emit warnings if no begin or subsequent end
pattern is found on any input file, stop processing on
any error/warning, etc).
</BLOCKQUOTE>
<BLOCKQUOTE>
Note: my exit 0 may seem superfluous here. However,
it does prevent the shell from noting that the
program "exited with non-zero return value" or
warnings to that effect. That's due to my use of
test ('[') on my output flag in my loop. In the
normal case that will have left a non-zero return value
since my of flag will be zero length for the part of
the file AFTER the end pattern was found.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note: this program is SLOW. (That's what you get for
asking for it in sh). Running it on my 38,000 line
<TT>/usr/share/games/hangman-words</TT> (this laptop doesn't
have <TT>/usr/dict/words</TT>) it takes about 30 seconds or
roughly only 1000 lines per second on a P166 with 16Mb
of RAM. A binary can do better than that under MS-DOS
on a 4Mhz XT!
</BLOCKQUOTE>
<BLOCKQUOTE>
BUG: If any lines begin with <TT>-</TT> (dashes) then your version
of echo <EM>might</EM> try to treat the beginnings of your lines
as arguments. This <EM>might</EM> cause the echo command to
parse the rest of the line for escape sequences. If you
have printf(1) evailable (as a built-in to your shell or
as an external command) then you might want to use that
instead of echo.
</BLOCKQUOTE>
<BLOCKQUOTE>
To do this based on line numbers rather than patterns
we could use something more like:
</BLOCKQUOTE>
<blockquote><pre>#!/bin/sh
# lnextract.sh
# extract part of a file between a
# line numbers $1 and $2
function isnum () {
case "$1" in
*[^0-9]*)
return 1;;
esac
}
[ "$#" -gt "2" ] || {
echo "Must supply begin and end line numbers" >&2
exit 1
}
isnum "$1" || {
echo "first argument (first line) must be a whole number" >&2
exit 1
}
isnum "$2" || {
echo "second argument (last line) must be a whole number" >&2
exit 1
}
begin=$1
end=$2
[ "$begin" -le "$end" ] || {
echo "begin must be less than or equal to end" >&2
exit 1
}
shift 2
for i; do
[ -r "$i" -a -f "$i" ] || {
echo "$i should be an existing regular file" >&2
continue
}
ln=0
while read a ; do
let ln+=1
[ "$ln" -ge "$begin" ] && echo $a
[ "$ln" -lt "$end" ] || break
done < "$i"
done
exit 0
</pre></blockquote>
<BLOCKQUOTE>
This rather ugly little example does do quite a
bit more checking than my previous one.
</BLOCKQUOTE>
<BLOCKQUOTE>
It checks that its first two arguments are
numbers (your shell must support negated character
class globs for this, ksh '88 and later, bash 1.x and 2.x,
and zsh all qualify), and that the first is less than or
equal to the latter. Then it shifts those out of
the way so it can iterate over the rest of the
arguments, extracting our interval of line from
each. It checks that each file is "regular"
(not a directory, socket, or device node) and
readable before it tries to extract a portion of
it. It will follow symlinks.
</BLOCKQUOTE>
<BLOCKQUOTE>
It has some of the same limitations we saw before.
</BLOCKQUOTE>
<BLOCKQUOTE>
In addition it won't accept it's input from stdin
(although we could add that by putting the main loop
into a shell function and invoking it one way if
our arg count was exactly two, and differently
(within our for loop) if $# is greater than two.
I don't feel like doing that here <TT>---</TT> as this message
is already way too long and that example is complicated
enough.
</BLOCKQUOTE>
<BLOCKQUOTE>
It's also possible to use a combination of 'head' and
'tail' to do this. (That's a common exercise in
shell programming classes). You just use something
like:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
head -$end $file | tail -$(( $end - $begin ))
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... note that the 'tail' command on many versions
of UNIX can't handle arbitrary offsets. It can
only handle the lines that fit into a fixed block size.
GNU tail is somewhat more robust (and correspondingly
larger and more complicated). A classic way to
work around limitations on tail was to use tac (cat
a file backwards, from last line to first) and
head (and tac again). This might use prodigous
amounts of memory or disk space (might use temporary
files).
</BLOCKQUOTE>
<BLOCKQUOTE>
If you don't want line oriented output <TT>---</TT> and your
patterns are regular expressions, and you're willing
to use grep and dd then here's a different approach:
</BLOCKQUOTE>
<blockquote><pre> start=$(grep -b "$begin" ... )
stop=$(( $( grep -b "$end" ... ) - $begin ))
dd if="$file" skip=$begin count=$stop bs=1b
</pre></blockquote>
<BLOCKQUOTE>
This is not a shell script, just an example.
Obviously you'd have to initialize $begin, $end, and $file
or use $1, $2, and $3 for them to make this into a
script. Also you have to modify those grep <TT>-b</TT> commands
a little bit (note my ellipses). This is because grep
will be giving us too much information. It will be
giving a byte offset to the beginning of each pattern
match, and it will be printing the matching line, too.
</BLOCKQUOTE>
<BLOCKQUOTE>
We can fix this with a little work. Let's assume that
we want the first occurrence of "$begin" and the last
occurence of "$end" Here's the commands that will
just give us the raw numbers:
</BLOCKQUOTE>
<blockquote><pre> grep -b "$begin" "$file" | head -1 {
IFS=:
read b x
echo b
}
grep -b "$end" "$file" | tail -1 | {
IFS=:
read e x
echo e
}
</pre></blockquote>
<BLOCKQUOTE>
... notice I just grep through head or
tail to get the first or last matching line,
and I use IFS to change my field separator
to a ":" (which grep uses to separate the offset
value from the rest of the line). I read the
line into two variables (separated by the
IFS character(s)), and throw away the extraneous
data by simply echoing the part I wanted
(the byte offset) back out of my subshell.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note: whenever you use or see a pipe operator
in a shell command or script <TT>---</TT> you should
realize that you've created an implicit subshell
to handle that.
</BLOCKQUOTE>
<BLOCKQUOTE>
Incidentally, if your patterns <EM>might</EM> have a
leading <TT>-</TT> (dash) then you'll have problems
passing them to grep. You can massage the
pattern a little bit by wrapping the first
character with square brackets. Thus "foo"
becomes "[f]oo" and "<TT>-bar</TT>" becomes "[-]bar".
(grep won't consider an argument starting
with [ to be a command line switch, but it
will try to parse <TT>-bar</TT> as one).
</BLOCKQUOTE>
<BLOCKQUOTE>
This is easily done with printf and sed:
</BLOCKQUOTE>
<blockquote><pre> printf "%s" "$pattern" | sed -e 's/./[&]/'
</pre></blockquote>
<BLOCKQUOTE>
... note my previous warning about 'echo' <TT>---</TT>
it's pretty permissive about arguments that
start with dashes that it doesn't recognize, it'll
just echo those without error. But if your pattern
starts with "<TT>-e</TT> " or <TT>-n</TT> it can effect out the rest
of the string is represented.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note that GNU grep and echo DON'T seem to take the
<TT>--</TT> option that is included with some GNU utilities.
This would avoid the whole issue of leading dashes
since this conventionally marks the end of all
switch/option parsing for them.
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course you said you didn't want to use sed,
so you've made the job harder. Not impossible,
but harder. With newer shells like ksh '93 and
bash 2.x we can use something like:
</BLOCKQUOTE>
<blockquote><pre> [${pattern:0:1}]${pattern:1}
</pre></blockquote>
<BLOCKQUOTE>
(read any recent good book on shell programming
to learn about parameter expansion).
</BLOCKQUOTE>
<BLOCKQUOTE>
You can use the old 'cut' utility, or 'dd' to
get these substrings. Of course those are just
as external to the shell as perl, awk, sed,
test, expr and printf.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you really wanted to do this last sort of
thing (getting a specific size substring from
a variable's value, starting from an offset
in the string, using only the bash 1.x parameter
expansion primitives) it could be done with a whole
lot of fussing. I'd use ${#varname} to get the
size, a loop to build temporary strings of
? (question mark) characters to of the right
length and the ${foo#} and ${foo%} operators
(stripping patterns from the left and right of
variable's value respectively)
to isolate my substring.
</BLOCKQUOTE>
<BLOCKQUOTE>
Yuck! That really is as ugly as it sounds.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway. I think I've said enough on the subject
for now.
</BLOCKQUOTE>
<BLOCKQUOTE>
I'm sure you can do what you need to. Alot of
it depends on which shell you're using (not just
csh vs. Bourne, but ksh '88 vs. '93 and bash v1.14
vs. 2.x, etc) and just how rigit you are about that
constraint about "standard utilities"
</BLOCKQUOTE>
<BLOCKQUOTE>
All of the examples here (except for the ${foo:}
parameter expansion) are compatible with bash 1.14.
</BLOCKQUOTE>
<BLOCKQUOTE>
(BTW: now that I'm really learning C <TT>---</TT> y'all can
either rest easy that I'll be laying off the sh
syntax for awhile, or lay awake in fear of what I'll
be writing about next month).
</BLOCKQUOTE>
<BLOCKQUOTE>
Here's a short GNU C program to print a set of
lines between one number and another:
</BLOCKQUOTE>
<blockquote><pre>/* extract a portion of a file from some beginning line, to
* some ending line
* this functions as a filter --- it doesn't take a list
* of file name arguments.
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
int
main (int argc, char * argv[] )
{
char * linestr;
long begin, end, current=0;
ssize_t * linelen;
linelen = 0;
linestr=NULL;
if ( argc < 3 ) {
fprintf(stderr, "Usage: %s begin end\n", argv[0]);
exit(1);
}
begin=atol(argv[1]);
if ( begin < 1 ) {
fprintf(stderr, "Argument error: %s should be a number "
"greater than zero\n", argv[1]);
exit(1);
}
end=atol(argv[2]);
if ( end < begin ) {
fprintf(stderr, "Argument error: %s should be a number "
"greater than arg[1]\n", argv[1]);
exit(1);
}
while ( getline(&linestr, &linelen, stdin ) > -1
&& (++current < end ) ) {
if (current >= begin) {
printf("%s", linestr);
}
}
exit(0);
return 0;
}
</pre></blockquote>
<BLOCKQUOTE>
This is about the same length as my shell version.
It uses<TT> atol()</TT> rather than<TT> strtol()</TT> for the
argument to number conversion.<TT> atol()</TT> (ASCII to long)
is simpler, but can't convey errors back to us.
However, I require values greater than zero, and GNU
glibc<TT> atol()</TT> returns 0 for strings that can't be
converted to longs. I also use the GNU<TT> getline()</TT>
function <TT>---</TT> which is non-standard, but much more
convenient and robust than fussing with<TT> scanf()</TT>,
<TT>fgets()</TT> and<TT> sscanf()</TT>, and<TT> getc()</TT> stuff.
</BLOCKQUOTE>
<BLOCKQUOTE>
Tim, I've copied this my Linux Gazette editor, since
it's a pretty general question and a way detailed
answer. Unless you have any objection it will
go into my column in the next issue. The sender's
e-mail address and organizational affiliation are
always removed from answer guy articles unless
they request otherwise.
</BLOCKQUOTE>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Zipping Across the LAN</H3>
<p><strong>From jashby on Sun, 02 Apr 2000
</strong></p>
<!-- ::
Zipping Across the LAN
~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hello ,
</STRONG></P>
<P><STRONG>
My name is Jason Ashby i work for a computer company and am really new
to Linux i have been given the task to make a zip drive visible accross
a network, it is loaded on a linux machine and i can get the AIX machine
to mount it but we can not copy files to or from the zip drive on AIX
could you see it within your power to tell me why .
</STRONG></P>
<P><STRONG>
Thanks
Jason Ashby
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Unfortunately your question is unclear.
You don't tell me which system is supposed to be the server, what
sorts systems are intended to be the clients, nor what type of
filesystems will be contained on the Zip media.
</BLOCKQUOTE>
<BLOCKQUOTE>
"make a zip drive visible accross [sic] a network"
</BLOCKQUOTE>
<BLOCKQUOTE>
... presumably you mean via NFS or Samba. If the client systems
are UNIX or Linux you'd use NFS, if they are MS-Windows or OS/2
you'd use Samba. (If they were Apple Macs running MacOS you'd
look at the netatalk or CAP packages, and if they were old MS-DOS
machines you might try installing Netware client drivers on those
and mars_nwe or a commercial copy of Netware on the Linux box).
</BLOCKQUOTE>
<BLOCKQUOTE>
Let's assume you mean to mount the Zip disks on your Linux box,
and "export" them (NFS terminology) to your AIX systems. Then
you'd modify your <TT>/etc/fstab</TT> to contain an entry appropriate to
mount the Zip media into your file hierarchy. Maybe you'd mount
it under <TT>/mnt/zip</TT> or under <TT>/zip.</TT> (You might have multiple fstab
entries to support different filesystems that you might have
stored on your Zip media. In most cases you'd use msdos, or one
of the other variants of Linux' MS-DOS filesystem: umsdos, vfat,
or uvfat).
</BLOCKQUOTE>
<BLOCKQUOTE>
Then you'd edit your <TT>/etc/exports</TT> file to export that to your
LAN (or to specific hosts or IP address/network patterns).
</BLOCKQUOTE>
<BLOCKQUOTE>
Try reading the man pages for <TT>/etc/fstab</TT> and <TT>/etc/exports</TT> and
perusing the following HOWTOs:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Zip Drive Mini-HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/mini/ZIP-Drive.html"
>http://www.linuxdoc.org/HOWTO/mini/ZIP-Drive.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
NFS HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/NFS-HOWTO.html"
>http://www.linuxdoc.org/HOWTO/NFS-HOWTO.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
And the excellent new:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Filesystems HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/Filesystems-HOWTO.html"
>http://www.linuxdoc.org/HOWTO/Filesystems-HOWTO.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
by Martin Hinner.
</BLOCKQUOTE>
<BLOCKQUOTE>
If that doesn't do the trick, try clarifying your question. It
often helps to draw a little map (ASCII art is good!).
</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"
>Accessing Local MS-DOS/Windows '9x Drives/Disks from Linux</H3>
<p><strong>From David Buckley on Wed, 05 Apr 2000
</strong></p>
<!-- ::
Accessing Local MS-DOS/Windows '9x Drives/Disks from Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I am new to linux and am wondering if there is an easy way to access my
Win98 disk from within linux. i have lots of files (mp3s, etc.) that i
would like to use in linux. what is the easiest way to get them?
</STRONG></P>
<P><STRONG>
Thanks,
David Buckley
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I'm guessing you're talking about accessing files that are on
you local system (that you have a dual-boot installation).
</BLOCKQUOTE>
<BLOCKQUOTE>
In that case use the 'mount' command. For example the first
partition on your first IDE drive is <TT>/dev/hda1</TT> (under Linux). If
that's your C: drive under MS-DOS/Windows then you can use a
command like:
</BLOCKQUOTE>
<blockquote><pre> mkdir /mnt/c && mount -t vfat /dev/hda1 /mnt/c
</pre></blockquote>
<BLOCKQUOTE>
... (as the 'root' user) to make the C: directory tree appear
under <TT>/mnt/c.</TT>
</BLOCKQUOTE>
<BLOCKQUOTE>
Once you've done that you can use normal Linux commands and
programs to access those files.
</BLOCKQUOTE>
<BLOCKQUOTE>
That will only mount the filesystem for that duration of that
session (until your reboot or unmount it with the 'umount'
command). However, you can make this process automatic by adding
an entry to your <TT>/etc/fstab</TT> (filesystem table).
</BLOCKQUOTE>
<BLOCKQUOTE>
For more info on this read the appropriate sections of the Linux
Installation & Getting Started Guide (*), the System
Administrator's Guide (*) (both part of the <A HREF="http://www.linuxdoc.org/">LDP</A> at
<A HREF="http://www.linuxdoc.org"
>http://www.linuxdoc.org</A>) and the mount(8), and fstab(5) man pages
with the following command:
</BLOCKQUOTE>
<blockquote><pre> man 8 mount; man 5 fstab
</pre></blockquote>
<BLOCKQUOTE>
(Note, in the first case you do need to specify the
manual chapter/section number, 8, since there is a<TT> mount()</TT>
system call which is used by programmers, particularly for
writing programs like the 'mount' command itself). When you
see references to keywords in this form foo(1), it's a hint
that foo is documented in that chapter of the man pages: 1
is user commands, 2 is system calls, 3 is library functions,
4 is for devices, 5 is for file formats, etc).
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
*( LIGS: Chapter 4 System Administration
<DD><A HREF="http://www.linuxdoc.org/LDP/gs/node6.html#SECTION00640000000000000000"
>http://www.linuxdoc.org/LDP/gs/node6.html#SECTION00640000000000000000</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
LSAG: Filesystems
<A HREF="http://www.linuxdoc.org/LDP/sag/x1038.html"
>http://www.linuxdoc.org/LDP/sag/x1038.html</A> )
</BLOCKQUOTE>
<BLOCKQUOTE>
To access your MS-DOS formatted floppies it's often easier to use
the mtools commands. Look at the mtools(1) man pages for details
on that.
</BLOCKQUOTE>
<BLOCKQUOTE>
Here are a couple of other HOWTOs to read through:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
From DOS/Windows to Linux HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/DOS-Win-to-Linux-HOWTO.html"
>http://www.linuxdoc.org/HOWTO/DOS-Win-to-Linux-HOWTO.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Filesystems HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/Filesystems-HOWTO.html"
>http://www.linuxdoc.org/HOWTO/Filesystems-HOWTO.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
In general you want to look through these to find answer to
most common Linux questions. As you might imagine, you've asked
a very common one here). In fact it's number 4.2 in the FAQ
<A HREF="http://www.linuxdoc.org/FAQ/Linux-FAQ-4.html#ss4.2"
>http://www.linuxdoc.org/FAQ/Linux-FAQ-4.html#ss4.2</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
You can also search the Linux Gazette at:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Full search on archive Linux Gazette Search
<DD><A HREF="http://www.linuxgazette.com/wgindex.html"
>http://www.linuxgazette.com/wgindex.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
Although I can see how you might not know what terms to search on
until you've covered some of the basics in the LDP guides, or any
good book on Linux.
</BLOCKQUOTE>
<BLOCKQUOTE>
There are also ways to access your Win '9x "shares" (network
accessible files, or "exported" directories) from Linux using
smbfs.
</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"
>More on >> zsh Co-processes</H3>
<p><strong>From Paul Ackersviller on Wed, 05 Apr 2000
</strong></p>
<!-- ::
More on >> zsh Co-processes
~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Jim,
</STRONG></P>
<P><STRONG>
I believe I forgot to say thanks for having written the original answer as
it was. I've programmed shells for ages, but have never had occasion to use
co-processes. Seeing examples of how it's done are alway a good thing.
</STRONG></P>
<P><STRONG>
--
Paul Ackersviller
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
You're welcome. I've never actually used them myself.
However, I was jazzed to learn how they actually work when
someone I was working with showed me an example.
</BLOCKQUOTE>
<BLOCKQUOTE>
Sometimes I take advantage of being "The Answer Guy" and
grab any pretense to show of some need trick that I've
discovered or been shown (I usually try to give credit
where credit is due <TT>---</TT> but sometimes that's pretty ambiguous and
doesn't fit into the flow of what I'm typing).
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, I'm a firm believer in having a full toolbox. You
often won't know what tool <EM>would</EM> do the trick unless you've
seen a wide enough variety of tools to recognize a nail vs.
a screw and can associate one with a hammer and the other with
a screwdriver.
</BLOCKQUOTE>
<!-- sig -->
<!-- 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"
>Linux for AMD, Cyrix, etc</H3>
<p><strong>From Ranone7 on Wed, 05 Apr 2000
</strong></p>
<!-- ::
Linux for AMD, Cyrix, etc
~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
At this web site <A HREF="http://www.linuxmall.com/product/01462.html"
>http://www.linuxmall.com/product/01462.html</A> I see
the title "<A HREF="http://www.redhat.com/">Red Hat</A> Linux Deluxe for Intel" Is there a Linux for
AMD out there? or can I use the above linux version with an
AMD-Athlon.
</STRONG></P>
<P><STRONG>
Thank you
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
The packaging is suffering from a compromise. It's trying
not to sound too technical. Red Hat Linux <EM>for Intel</EM>
should work on any x86 and compatible CPUs. Note that
Mandrake requires at least a Pentium (it won't work on
old 486 and 386 systems).
</BLOCKQUOTE>
<BLOCKQUOTE>
What Red Hat Inc was trying to do which this verbiage
is distiguish that box from the versions that they have
available for SPARC and Alpha based systems. Eventually they'll
also probably have a PowerPC package available as well.
</BLOCKQUOTE>
<BLOCKQUOTE>
Many other distributions are similarly available on several
platforms.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 6 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 6 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>Linux - AMD?</H3>
<p><strong>Answered By Martin Pool on Thu, 06 Apr 2000
</strong></p>
<P><STRONG>
On Wed, 5 Apr 2000, Jim Dennis wrote:
</STRONG></P>
<P><STRONG><FONT COLOR="#000099"><EM><BLOCKQuote>
<BR>>At this web site <A HREF="http://www.linuxmall.com/product/01462.html"
<BR>> >http://www.linuxmall.com/product/01462.html</A> I see
<BR>>the title "<A HREF="http://www.redhat.com/">Red Hat</A> Linux Deluxe for Intel" Is there a Linux for
<BR>>AMD out there? or can I use the above linux version with an
<BR>>AMD-Athlon.
</BLOCKQuote></EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000099"><EM>
<BR>>Thank you
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
The packaging is suffering from a compromise. It's trying
not to sound too technical. Red Hat Linux <EM>for Intel</EM>
should work on any x86 and compatible CPUs. Note that
Mandrake requires at least a Pentium (it won't work on
old 486 and 386 systems).
</EM></FONT></STRONG></P>
<P><STRONG>
Good explanation. IIRC Athlons are only supported in 2.2.something, so
they'll also need a recent distribution. I guess any RedHat version on
sale these days will be OK, but notably <A HREF="http://www.debian.org/">Debian</A> slink/stable will <EM>not</EM>
boot.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks for that note [from one of the guys on the
<A HREF="http://www.linuxcare.com/">Linuxcare</A> list that now receives answerguy responses].
</BLOCKQUOTE>
<BLOCKQUOTE>
I remember hearing about Athlon problems, but I didn't ever get the
full story. I was spoiled by the fact that most x86 compatible
chips really are <EM>x86 COMPATIBLE</EM>. I still don't know what the
whole deal with that Athlon chip is. I'll BCC someone on this
to see if he can clue me in.
</BLOCKQUOTE>
<!-- end 6 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 6 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>Linux - AMD?</H3>
<p><strong>Answered By David Benfell on Thu, 6 Apr 2000
</strong></p>
<BLOCKQUOTE>
The story, as I was able to piece it together, is that the problem was
found and fixed in the 2.3.19 kernel. The correction had to do with
Memory Type Range Register (MTRR) code. This patch was backported to,
possibly the 2.2.12 kernel, and, almost certainly, the 2.2.13 kernel.
</BLOCKQUOTE>
<BLOCKQUOTE>
However, it still seems to have been an issue with the Mandrake 6.5
distribution, which had a 2.2.12 kernel. On the other hand, my
neighbor just installed <A HREF="http://www.redhat.com/">Red Hat</A> 6.2, with, I think, a 2.2.12 kernel
(but the site won't tell), on an Athlon. So I'm confused.
</BLOCKQUOTE>
<BLOCKQUOTE>
David Benfell
</BLOCKQUOTE>
<EM>[ <BLOCKQUOTE>
So, if you know more about the Athlon MTRR mystery, enlighten us please!
</BLOCKQUOTE><P>-- Heather. ]</P></EM>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/7"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 7 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>UNIX User Tries Linux 'rsh'</H3>
<p><strong>From Le, Dong, ALNTK on Fri, 07 Apr 2000
</strong></p>
<!-- ::
UNIX User Tries Linux 'rsh'
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hello "The Answer Guy",
</STRONG></P>
<P><STRONG>
My name is Dong Le. I'm quite new to Linux. Since I come from Unix world, I
try to use Unix concepts to apply on Linux. Some times it works, most of the
time does not.
</STRONG></P>
<P><STRONG>
Anyway, I have Redhat 6.1 installed on my 2 PC intel-based. I tried to use
rcp to remote copy files from one PC to another. I got the error:
"permission denied" from other PC. I have a file ".rhosts" setup to give
permission to other PC. I use "octet format" in all of files/commands so
DNS/NIS are not involved at all.
</STRONG></P>
<P><STRONG>
My questions are:
</STRONG></P>
<P><STRONG><BLOCKQuote>
<TT>-</TT> Why do I have this error?
</BLOCKQuote></STRONG></P>
<P><STRONG>
<TT>-</TT> Later on I found out that Linux is using PAM to do authentication. For
rcp, it is using <TT>/etc/pam.d/rsh.conf</TT> to authenticate. However, I can not
find any information about PAM modules (pam_rhosts_auth.so, for example)
regarding how it works. Do you know where I can obtain information about
particular PAM module?
</STRONG></P>
<P><STRONG>
Thanks a lot,
Dong Le,
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Short answer: Use ssh!
</BLOCKQUOTE>
<BLOCKQUOTE>
There are a few problems here. First, I've seen versions of rshd
(the rsh daemon) that would not seem to accept octet addresses.
More importantly many Linux distributions are configured not to
respect your ~/.rhosts files.
</BLOCKQUOTE>
<BLOCKQUOTE>
You are correct that you have to co-ordinate your policy using the
PAM if your system has the "Pluggable Authentication Modules"
suite of programs installed. The configuration file would be
<TT>/etc/pam.d/rsh.</TT> Here's the default that would be installed by
<A HREF="http://www.debian.org/">Debian</A>:
</BLOCKQUOTE>
<blockquote><pre>#%PAM-1.0
auth required pam_rhosts_auth.so
auth required pam_nologin.so
auth required pam_env.so
account required pam_unix_acct.so
session required pam_unix_session.so
</pre></blockquote>
<BLOCKQUOTE>
Yours would be pretty similar.
</BLOCKQUOTE>
<BLOCKQUOTE>
In addition you might find that you need to also modify the
arguments on the in.rshd line in your <TT>/etc/inetd.conf</TT> file. For
example if there's a <TT>-l</TT> option it may be causing your copy of
in.rshd to ignore user ~/.rhosts files. A <TT>-h</TT> option will force it
to ignore the contents of any <TT>/etc/hosts.equiv</TT> file.
</BLOCKQUOTE>
<BLOCKQUOTE>
(The new Debian rshd package ignores these additional options and
requires that you configure your policy through the <TT>/etc/pam.d/</TT>
files. I don't know if <A HREF="http://www.redhat.com/">Red Hat</A> has modified it's packages in this
way for versions 6.1 or 6.2. In 6.0 I'm pretty sure that I was
still able to use the command line arguments on the in.rshd entry
in the <TT>/etc/inet.conf</TT> file for this.)
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course you can use ssh as a resplacement to rsh, and have
much better security as well.
</BLOCKQUOTE>
<!-- end 7 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/8"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 8 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Telnet</H3>
<p><strong>From Cleary, James R. on Fri, 07 Apr 2000
</strong></p>
<P><STRONG>
Jim,
</STRONG></P>
<P><STRONG>
I just clean installed Redhat 6.0 on my box. I can ping the
</STRONG></P>
<P><STRONG>
box from another machine, but I can't telnet to it, the default
configuration should provide for that, shouldn't it? Any help
you'd have would be great.
</STRONG></P>
<P><STRONG>
Sincerely,
"J.C."
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
When you say "you can't telnet to it" what do you mean?
Does the telnet client seem to just sit there for a long time? Do
you get an error message that says something like "connection
refused?" Does that come back immediately, or does it take a
minute or two? Are you trying to telnet to it by name, or by IP
address? (That basically doesn't matter as long as you're using
the same form for your ping command).
</BLOCKQUOTE>
<BLOCKQUOTE>
I disagree with your assertion that the "default configuration
should provide for that?" Linux appeals to a much broader range
of users than traditional, professionally managed UNIX systems.
It is not appropriate to assume that all of your users what to be
"telnet hosts" (servers or multi-user workstations). In addtional
telnet is an old and basically depracated means of remote access.
</BLOCKQUOTE>
<BLOCKQUOTE>
(Well, it should be deprecated).
</BLOCKQUOTE>
<BLOCKQUOTE>
You should probably use ssh, STEL, ssltelnet, or install a
Kerberos or the <A HREF="http://www.xs4all.nl/~freeswan/">FreeS/WAN</A> IPSec infrastructure to provide you with
an encrypted, unspoofable, unsniffable connection between your
client and your server.
</BLOCKQUOTE>
<BLOCKQUOTE>
Please don't respond with "but I'm behind a firewall" or "this is
just my home system." Those are "head in the sand" attitudes that
make for a brittle infrastructure (one little crack and the whole
wall collapses).
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, if you've termined that telnet is really what you need,
that it matches your requirements and enforces your policies to
your satisfaction, then here's some pointer to troubleshooting
common failures. These also apply to ssh, STEL, etc.
</BLOCKQUOTE>
<BLOCKQUOTE>
You said that 'ping' is working. Assuming that you are using the
commands from the same host and using the same form of
addressing/naming for your 'ping' and your 'telnet' commands here
are the most likely problems:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
* You're session might not actually be failing. It might
just be taking a very long time. Search the answer guy
back issues for the phrase "double;reverse;dns" and you'll
find a number of my previous explanations about a common
cause of this delay (and some pointer on what to do about it)
Here are a couple of them:
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Issue 45: More "Can't Telnet Around My LAN" Problems
<DD><A HREF="http://www.linuxgazette.com/issue45/tag/11.html"
>http://www.linuxgazette.com/issue45/tag/11.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Issue 38: Telnetd and pausing
<DD><A HREF="http://www.linuxgazette.com/issue38/tag/32.html"
>http://www.linuxgazette.com/issue38/tag/32.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Issue 30: tv cards and dual monitor
<DD><A HREF="http://www.linuxgazette.com/issue30/tag_tvcard.html"
>http://www.linuxgazette.com/issue30/tag_tvcard.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
* You might not have the telnet daemon package installed
</BLOCKQUOTE>
<BLOCKQUOTE>
on your target host. It might be installed but not
properly configured in <TT>/etc/inetd.conf.</TT> That should
contain a line that looks something like:
</BLOCKQUOTE>
<blockquote><pre>telnet stream tcp nowait telnetd.telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd
</pre></blockquote>
<BLOCKQUOTE>
* You might not have inetd running. (It's the daemon, service
</BLOCKQUOTE>
<BLOCKQUOTE>
program, that reads the <TT>/etc/inetd.conf</TT>, listens for
connections on those ports, and dispatches the various
service programs that handle those services).
</BLOCKQUOTE>
<BLOCKQUOTE>
(An obscure possibility is that you might have something
broken in your name services handling. You system would
normally match service/protocol names to IP port numbers
and transport layer protocols (TCP, UDP, etc) using the
<TT>/etc/services</TT> file. If that's corrupted, or if your
<TT>/etc/nsswitch.conf</TT> is pointing your NSS libraries to
query some really bogus and corrupted backend it would be
possible that inetd would end up listening to the wrong
ports for many services. I've never seen anyone mess
that up <TT>--</TT> but I'm sure it's possible).
</BLOCKQUOTE>
<BLOCKQUOTE>
* There may be a firewall or packet filtering system between
</BLOCKQUOTE>
<BLOCKQUOTE>
your client and your target. That might let ICMP ('ping'
traffic) through while blocking your TCP ('telnet' on port
23) traffic.
</BLOCKQUOTE>
<BLOCKQUOTE>
* It's possible that you're telnet client program, or one
</BLOCKQUOTE>
<BLOCKQUOTE>
of the client libraries is broken, or that you have some
degenerate values in your environment or even in your
own .telnetrc file. The 'telnet' client exchanges a
number of key environment variables with the daemon
to which it connects. This is to configure your terminal
type, set your username and your DISPLAY values, your
timezone, and some other stuff. It's possibly (though
unlikely) that you could be tripping over something that
the 'in.telnetd' on your target really doesn't like).
</BLOCKQUOTE>
<BLOCKQUOTE>
Hopefully that will help.
</BLOCKQUOTE>
<BLOCKQUOTE>
When asking about these sorts of problems it's important to
be quite specific about the failure mode (the symptoms). It is
VERY important to capture and quote any error messages that you
get and to explain exactly what command(s) you issued to elicit
those symptoms.
</BLOCKQUOTE>
<BLOCKQUOTE>
Unfortunately crafting a good question is sometimes harder than
answering them. (In fact I have managed to come across answer
on many occasions while I was writing up the question I intended
to post. The process or rigorously describing the problem has
often led me to my own answers. Sometimes I post the message
with my solution anyway).
</BLOCKQUOTE>
<BLOCKQUOTE>
One tip for troubleshooting this. Staring with 'ping' is a good
idea. It basically eliminates a number of possible problems
from the low-level "is the network card configured and is a
cable plugged into it?" parts of your problem. It's also good
to do a 'traceroute' to your target. This might show that your
packets are being routed through some unexpected device that is
filtering some of your traffic.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you have console access to the target server (including a "carbon
proxy" <TT>---</TT> a person on the phone in front of it) then you can
run (or have your proxy) run the 'tcpdump' command. This can
show you the headers of every packet that comes across a given
network interface. 'tcpdump' has a small language for describing
the exact sorts of traffic that you want to see and filtering out
all the other traffic that you don't want. If you search the
LG AG archives on 'tcpdump' you should find a number of examples
of how to use it. You might go for something like:
</BLOCKQUOTE>
<blockquote><pre> tcpdump -i eth0 -n host $YOURCLIENT and port 23
</pre></blockquote>
<BLOCKQUOTE>
... for example. (TCP port 23 is the standard for telnet traffic).
</BLOCKQUOTE>
<BLOCKQUOTE>
If that doesn't work, you might consider temporarily replacing your
'in.telnetd' with an 'strace' wrapper script. Basically
you just rename the in.telnetd file to in.telnetd.real and
create a shell script (see below) to monitor it:
</BLOCKQUOTE>
<blockquote><pre>#!/bin/sh
exec strace -o /root/testing/telnet.strace /usr/sbin/in.telnetd.real
</pre></blockquote>
<BLOCKQUOTE>
I've described this process before as well. Here's a
link to one of those:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Issue 20
<DD><A HREF="http://www.linuxgazette.com/issue20/lg_answer20.html"
>http://www.linuxgazette.com/issue20/lg_answer20.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Issue 17
<DD><A HREF="http://www.linuxgazette.com/issue17/answer.html"
>http://www.linuxgazette.com/issue17/answer.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
(use your browswer's "search in page" <TT>--</TT> [Alt][F] in Netscape
and the <TT>/</TT> key in Lynx to search on 'strace' to find the
messages I'm talking about. Those older issues were back before
Heather was doing my HTML for me, and splitting each message/thread
into separately HTML pages like I should have been doing all
along).
</BLOCKQUOTE>
<BLOCKQUOTE>
That 'strace' trick is surprising handy. At <A HREF="http://www.linuxcare.com/">Linuxcare</A> we use
it all the time, and it often helps us find missing config files,
directories where files should be, files where directories should
be, mangled permissions, and all sorts of things. There's another
tools called 'ltrace' which gives similar, though slightly higher
level information.
</BLOCKQUOTE>
<BLOCKQUOTE>
Using 'tcpdump' and 'strace' you can troubleshoot almost any
problem in Linux. They are like the "X-Ray" machines and CAT/PET
scanners for Linux tech support people. However, I don't recommend
them lightly. Go through the list of common ailments that I listed
first, consider using ssh instead, and then see if you need
"surgical diagnostics."
</BLOCKQUOTE>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/9"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 9 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Getting Familiar with a UNIX System</H3>
<p><strong>From Patricia Lonergan on Fri, 07 Apr 2000
</strong></p>
<!-- ::
Getting Familiar with a UNIX System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
How would I find the following on the version of Unix I am using:,A (B OS
type and release, node name, IP address, CPU type, CPU speed, amount of
RAM, disk storage space, number of users who have ids, number of hosts
known.,A (B Thanks Answer Guy
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
The comamnd:
</BLOCKQUOTE>
<blockquote><pre> uname -a
</pre></blockquote>
<BLOCKQUOTE>
Should give you the UNIX name (Linux, SunOS, HP-UX, etc)
and the kernel version/release, architecture, and some other info.
(Might also include the kernel compilation date and host)
</BLOCKQUOTE>
<BLOCKQUOTE>
The command:
</BLOCKQUOTE>
<blockquote><pre> ifconfig -a
</pre></blockquote>
<BLOCKQUOTE>
... should give the the IP address, netmask and broadcast address of
each interface in the system.
</BLOCKQUOTE>
<BLOCKQUOTE>
The command:
</BLOCKQUOTE>
<blockquote><pre> hostname
</pre></blockquote>
<BLOCKQUOTE>
... should give you the the DNS hostname that this system
"thinks" it has. Looking that up via reverse DNS using a
command like:
</BLOCKQUOTE>
<blockquote><pre> dig -x
</pre></blockquote>
<BLOCKQUOTE>
... might be possible if you have the DNS utils package
installed.
</BLOCKQUOTE>
<BLOCKQUOTE>
From there things start to get pretty complicated depending
on which flavor of UNIX you're on, and how it's configured.
(In fact there are exceptional cases where the preceding
commands won't work):
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
I'll confine the rest of my answers to Linux.
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
You can get the CPU type and speed using the command:
</BLOCKQUOTE>
<blockquote><pre> cat /proc/cpuinfo
</pre></blockquote>
<BLOCKQUOTE>
(assuming that your kernel is compiled with the <TT>/proc</TT> filesystem
enabled and that you have <TT>/proc</TT> mounted. Those are the
common case).
</BLOCKQUOTE>
<BLOCKQUOTE>
Linux provides a 'free' command to report on your RAM and
swap availability and usage. Many UNIX systems will have the
'top' command installed. It can also provide that information
(though it defaults to interactive mode <TT>---</TT> and thus is less
useful in scripts).
</BLOCKQUOTE>
<BLOCKQUOTE>
Any UNIX system should provide the 'mount' and 'df' commands to
generate reports about what storage devices are attached and
in use (mounted) and about the amound of free space available on
each. Note you should track not only your free space (data blocks)
but your free inodes (management data) so use both of the following
commands:
</BLOCKQUOTE>
<blockquote><pre> df
df -i
</pre></blockquote>
<BLOCKQUOTE>
The 'mount' command will also report the filesystem types and any
options (readonly, synchronous, etc) that are in effect on these.
You might have to use the 'fdisk <TT>-l</TT>' command to find any
unmounted filesystems (that might not be listed in your <TT>/etc/fstab</TT>
file) under Linux. Solaris has a similar command called prvtoc
(print volume table of contents).
</BLOCKQUOTE>
<BLOCKQUOTE>
Asking about number of user accounts is straightforward on a
system that is just using local <TT>/etc/passwd</TT> and <TT>/etc/group</TT> files
(the default). You can simply using the following:
</BLOCKQUOTE>
<blockquote><pre> wc -l /etc/passwd
</pre></blockquote>
<BLOCKQUOTE>
... to get a number of local users. Note that many of these
accounts are purely system accounts, used to managed the
ownership and permissions on files and system directories.
If you read though that file a little bit it should be obvious
which ones are which. In general Linux distributions start
numbering "real" users (the ones added after the system was
installed) at 500 or 1000 so all of the names with a UID
above that number are "real" (or were added by the system
administrator).
</BLOCKQUOTE>
<BLOCKQUOTE>
However, it's possible (particularly in UNIX system that are
installed on corporate networks) that your system(s) are using
a networked account system such as NIS or NIS+. You might be
able to get some idea of the number of users on such a network
using the 'ypcat' command like so:
</BLOCKQUOTE>
<blockquote><pre> ypcat passwd | wc -l
</pre></blockquote>
<BLOCKQUOTE>
The questions of "number of hosts known" is actually a bit
silly. "Known" in what sense? Most system use DNS for
mapping host names to IP addresses. Thus any Internet connected
system "knows" about millions of hosts. It is possible for
a sysadmin to provide the system with a special list of hosts and
IP addresses using the <TT>/etc/hosts</TT> files, but this is pretty rare
these days. (It's just too likely that you'll get those files
out of sync with your DNS).
</BLOCKQUOTE>
<BLOCKQUOTE>
I suppose you should also look for commands with the letters
"stat" in their name. Read the man pages for 'vmstat', 'netstat'
'lpstat' etc. Many versions of UNIX also include a 'sar' command
though that isn't common on Linux. 'rpcinfo' and 'route'
are other useful commands.
</BLOCKQUOTE>
<BLOCKQUOTE>
This whole set of questions has a "do my homework" tone to it.
(particularly since it's common from a .edu domain). Keep
in mind that I've just barely scratched the surface of the
information that's available to a skilled sysadmin who needs to
become familiar with a new machine. There are hundreds of
other things to know about such a system.
</BLOCKQUOTE>
<BLOCKQUOTE>
Most of the information you care about it under <TT>/etc.</TT> On a
Linux system there is also quite a bit under <TT>/proc</TT> (most of
forms of UNIX that support <TT>/proc</TT> only but process information
thereunder, while the Linux kernel uses it as an abstraction to
provide for all sorts of dynamic kernel status information out to
user space).
</BLOCKQUOTE>
<!-- sig -->
<!-- end 9 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/10"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 10 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Connecting NT and OS/2</H3>
<p><strong>From Carlos Ferrer on Thu, 13 Apr 2000
</strong></p>
<!-- ::
Connecting NT and OS/2
~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Do you know how to connect an NT box with an OS/2 box using null modem?
</STRONG></P>
<P><STRONG>
Thanks,
Carlos Ferrer
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Yes. You plug one end of the null modem cable into a serial
port on one of the boxes, and the other into a serial port on the
other box. Then you install some software on each, configure and
run it.
</BLOCKQUOTE>
<BLOCKQUOTE>
Before you ask:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
NO! I don't know what NT or OS/2 native software you should use.
That's your problem. I answer Linux questions. I'm the Linux Gazette
Answer Guy.
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
So, why don't you ask the technical support from IBM and/or Microsoft.
They sold you the software. They should provide the support. The
Linux community gives us software, so I give away alot of support.
</BLOCKQUOTE>
<BLOCKQUOTE>
Meanwhile, you might have some luck with plain old MS-DOS Kermit.
NT and OS/2 are supposed to support running DOS programs, and they
should allow you to configure their DOS "boxes" (virtual machines,
whatever) to have access to their respective serial ports. You can
also get Kermit '95 which should work on Win '9x, NT, and OS/2.
This is a commercial package. It is not free.
</BLOCKQUOTE>
<BLOCKQUOTE>
The C-Kermit for UNIX and Linux is also not free; though it can be
freely downloaded and compiled. You should read its license to
determine if you can use it freely or whether you are required to
buy the C-Kermit book. (Of course you could support their project
by buying the books regardless). There is also a G-Kermit which is
GPL'd.
</BLOCKQUOTE>
<BLOCKQUOTE>
You can learn about Kermit at:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Columbia University Kermit Project Home page
<DD><A HREF="http://www.columbia.edu/kermit"
>http://www.columbia.edu/kermit</A>
</DL></BLOCKQUOTE>
<!-- sig -->
<!-- end 10 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/11"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 11 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>"Temporarily Controlling a VT"</H3>
<p><strong>From James Knight on Thu, 13 Apr 2000
</strong></p>
<!-- ::
"Temporarily Controlling a VT"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
If I have an interactive program running on a VT, say tty1, can i
temporarily "control" that VT from another, say tty2, or better yet,
through a telnet connection (pts/n)?
</STRONG></P>
<P><STRONG>
For instance, i have naim running on tty1, I've been logging in via
telnet, and killing that process, and start it again so they don't
interfere with each other. Can I just pretend I'm at the console somehow,
then when I logout, i'll still be connected to naim?
</STRONG></P>
<P><STRONG>
Thanks,
Jay Knight
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
The easiest way to do this is to run 'screen'
</BLOCKQUOTE>
<BLOCKQUOTE>
Instead of starting interactive programs directly from your VT
login shell, run 'screen' and start the program thereunder. Now
you can "detach" the whole screen session (with up to 10 interactive
programs running under it) and re-attach from any other sort of
terminal login.
</BLOCKQUOTE>
<BLOCKQUOTE>
I do this routinely. I'm doing it now. Currently I'm working in
an xterm which is 99 characters wide and 35 lines tall. Earlier
I had connected to my system via ssh, and I "yanked" my 'screen'
session over to that xterm (80 characters by 50 lines) using the
following command:
</BLOCKQUOTE>
<blockquote><pre> 'screen -r -d -e^]]'
</pre></blockquote>
<BLOCKQUOTE>
... the <TT>-d</TT> option tells my new 'screen' command to look for another
'screen' session and detach it from wherever it is, the <TT>-r</TT> is to
re-attach it to my current terminal or psuedo-terminal, and the
<TT>-e</TT> option let's me set alternative "escape" and "quote" characters
(more on that in a moment).
</BLOCKQUOTE>
<BLOCKQUOTE>
I've described 'screen' in previous LG issues. However, it is
hard to find. For one thing the desired features are difficult to
describe and the keywords that do cover it are far too general.
For example, so far the keywords we've used are:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
You: temporarily control VT
Me: attach re-attach detach screen session yank
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
... see?
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, here's the VERY short intro to 'screen':
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
First 'screen' just starts an extra shell. So, if you just type 'screen'
(most distributions include 'screen') that's pretty much all you'll get.
(You might get some sort of copyright or other notice). Now you can
run programs as usual. The only big difference is that there is one key
([Ctrl]-[A] by default) which is not captured by 'screen'. That one
"meta" key is your trigger to fire off all of 'screen"s other features.
Here are a few of them (listed below as [Meta]+(key)):
</BLOCKQuote></BLOCKQUOTE>
<blockquote><pre> [Meta] [a] -- send a literal [Meta] to the current session
[Meta] [c] -- create an a additional shell session under
this 'screen'
[Meta] [w] -- display/list current sessions (windows)
[Meta] [A] -- (upper case 'A') set this session's (window's)
title
[Meta] [Esc] -- go into "scrollback" and "copy" mode (keyboard
cut & paste)
[Meta] [Space] -- cycle to the next session
[Meta] [Meta] -- switch to most recent session
[Meta] []] -- (right square bracket) paste copy of "cut" buffer
[Meta] [?] -- Quick help page of other keystrokes
[Meta] [d] -- Detach
[Meta] [S] -- (upper case 'S') split the screen/display
(like 'splitvt')
[Meta] [Q] -- (upper case 'Q') unsplit the screen/display
[Meta] (digit) -- switch directly to session number (digit)
</pre></blockquote>
<BLOCKQUOTE>
There are many others. There are many features to 'screen.' It is
the UNIX/Linux terminal power tool. You also get the ability to
share your session(s) with another user (like the old 'kibitz'
package). That's very handy for doing online tutorial and tech
support. You get a scrollback buffer and keyboard driven cut and
paste (with 'vi' inspired keybindings, you can even search back
through the current text and backscroll buffer).
</BLOCKQUOTE>
<BLOCKQUOTE>
Most of the URLs you see in the "Answer Guy" are pasted in from
a 'lynx' session using 'screen.'
</BLOCKQUOTE>
<BLOCKQUOTE>
If you forget to detach, you can use the <TT>-d</TT> option (shown above)
to remotely detach a session. You can use other options to select
from multiple 'screen' sessions that you have detached. You can
also run 'screen' commands to start up programs in their own
screen windows.
</BLOCKQUOTE>
<BLOCKQUOTE>
Oddly enough I've even found that I occasionally start or
re-attach to one 'screen' session on a remote system from within a
local 'screen' session. When I do this I use the <TT>-e</TT> option to
give that other (remote) screen session a different meta key.
(That's what I did in the sample command up there, with the
'<TT>-e^]]</TT>' setting it up so that the [Ctrl][Right Square Bracket]
was the meta key for that session. I did that while I was at
work. Before I left there I detached it. When I got home I
re-attached it to this 'xterm' (where I'm typing right now).
At first I just re-attached it with '<TT>-r</TT>' <TT>---</TT> but then I realized
that it was using my other meta key. So a detached again and
use '<TT>-r^aa</TT>' to reset those to the defaults (to which I'm more
accustomed).
</BLOCKQUOTE>
<BLOCKQUOTE>
Since I've introduced people at <A HREF="http://www.linuxcare.com/">Linuxcare</A> to this meme, I've
found that many of them have come to view their "sessions"
in a way that's similar to me. We maintain our state for
weeks or months by detaching, logging out, going elsewhere
(into X, out of X, from work, from home, etc), and always
re-attaching to our ongoing sessions. It's a whole different
way of using your computer.
</BLOCKQUOTE>
<BLOCKQUOTE>
So, try it. See if it does the trick for you.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 11 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/12"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 12 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Running out of Pseudo-tty's</H3>
<p><strong>From FRM on Fri, 14 Apr 2000
</strong></p>
<!-- ::
Running out of Pseudo-tty's
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
hi,
</STRONG></P>
<P><STRONG>
my sunos 4.1.4 kernel is already configed for the max 256 pty's
(pseudo devices), but my users complain about running out of them
often. do i need to add files to the <TT>/dev</TT> directory or recompile the
kernel again...or????
</STRONG></P>
<P><STRONG>
any help much appreciated,
</STRONG></P>
<P><STRONG>
Randy A
Compaq Computer Corp.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
SunOS 4.1.4??? Hmm. Maybe you need an upgrade.
</BLOCKQUOTE>
<BLOCKQUOTE>
If 256 is the max for SunOS then I don't know what
you'd do to get around that. Under Linux the max is about 2048.
I suppose you could try making a bunch of additonal device nodes and
re-writing/compiling a bunch of your apps to open the new group of
nodes rather than the old ones.
</BLOCKQUOTE>
<BLOCKQUOTE>
I'd say that SunOS 4.1.4 is showing its age. You might want to
consider switching to <A HREF="http://www.openbsd.org/">OpenBSD</A>, <A HREF="http://www.netbsd.org/">NetBSD</A>, or Linux. (Note:
SunOS was a BSDish UNIX, so you might be more comfortable with
it than you would be with Linux. I don't know about binary
compatability for your existing applications).
</BLOCKQUOTE>
<BLOCKQUOTE>
(Obviously I don't know much about SunOS. I'm the <EM>LINUX</EM>
Gazette Answer Guy and my experience with other forms of UNIX
is too limited and crufty to help you more than that).
</BLOCKQUOTE>
<!-- sig -->
<!-- end 12 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/13"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 13 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>XFree 4.0 and ":0.0 refused by server" Errors</H3>
<p><strong>From Alain Toussaint on Sun, 16 Apr 2000
</strong></p>
<!-- ::
XFree 4.0 and ":0.0 refused by server" Errors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hello Answerguy,
</STRONG></P>
<P><STRONG><CODE>
last week,i installed debian (a really base installation) on a factory
</CODE></STRONG></P>
<P><STRONG>
fresh disk and then set out to compile Xfree86 4.0 (i did not have X
previously),it did compile and work fine and i've been using it daily
with the startx command but wenesday this week,the hard disk on my
mother's computer died so i set out to build a linux boot disk
containing an X server so she could log in my system and continue to do
her work,i then tried xdm tonight (locally on my box first),xdm
loaded,took my credential but it did not open a session both as a user
(alain) and as root,i looked over in the .xession-errors file but i've
came to no conclusion,here's the content of the file:
</STRONG></P>
<pre><strong>> /home/alain/.xinitrc: exec: xfwm: not found
> /home/alain/.xinitrc: xscreensaver: command not found
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> xrdb: Can't open display ':0'
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> xrdb: Can't open display ':0'
> Xlib: connection to ":0.0" refused by server
> Xlib: Client is not authorized to connect to Server
> xrdb: Can't open display ':0'
</strong></pre>
<P><STRONG>
the first 2 errors don't worry me much (i have xfce installed and for
xscreensaver,i don't want it,since i'll install kde soon,i'm not pressed
to fix the xfce script that much),but the Xlib errors worry me quite a
bit,i then downloaded debian's xdm package and uncompressed it in a
temporary directory to compare the content of both our <TT>/etc/X11/xdm</TT>
directory (mine as well as the debian one) but i didn't find the root of
the problem,could you please help me ??
</STRONG></P>
<P><STRONG>
Thanks a lot
Alain Toussaint
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Hmmm. It sounds like a problem with your .Xauthority file.
You said you were using 'startx' before, and you're now trying to
use 'xdm'. What happens if you go back and try 'startx' again?
</BLOCKQUOTE>
<BLOCKQUOTE>
'xdm' has a different way of handling the 'xauth' files (using
the 'GiveConsole' and 'TakeConsole' scripts). Do a 'ps' listing
and see if you have a X server with arguments like:
</BLOCKQUOTE>
<blockquote><pre> X :0 -auth /var/xdm/Xauthority
</pre></blockquote>
<BLOCKQUOTE>
There's supposed to be a "GiveConsole" script that does
something like:
</BLOCKQUOTE>
<blockquote><pre> xauth -f /var/xdm/Xauthority extract - :0 | xauth -f ~$USER/.Xauthority merge -
</pre></blockquote>
<BLOCKQUOTE>
(Which extracts an MIT Magic Cookie or other access token from xdm's
Xauthority file and merges it into the "cookie jar" of your user.
This can, in principle, allow multiple accounts on a host or across a
network to access the same display server).
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, there are many other tricks that you can use to troubleshoot
similar problems.
</BLOCKQUOTE>
<BLOCKQUOTE>
I sometimes will start the X server directly
(bypassing 'xinit', 'startx', and 'xdm'); then switch back to one
of my text mode consoles (usually when I'm doing this I slap the old
& on the end of the X server's command line, if I forget then I do the
old [Ctrl]+[Z], 'bg' key and command). Next I 'export DISPLAY=:0'
(or :1, or whatever), and start an 'xterm &'
</BLOCKQUOTE>
<BLOCKQUOTE>
At that point I switch back to the X virtual console, and use the
resulting 'xterm' to work more magic. I may need to run my own
'xrdb' commands to merge in my own entries into the "X resources
database" (think of that as being your X server's "environment" <TT>---</TT>
a set of name/pattern and value pairs which are used by X client
programs to determine their default appearance, behaviour, etc).
</BLOCKQUOTE>
<BLOCKQUOTE>
I might also run a number of 'xset' commands to add to my
font path and play with other settings.
</BLOCKQUOTE>
<BLOCKQUOTE>
Doing this sort of "worm's eye" inching through the labyrinthine
X initialization process will usually isolate any problems that
you're having. It's playing with X enough to realize that it's
going through all of these steps that's so difficult.
</BLOCKQUOTE>
<BLOCKQUOTE>
I presume that you already know some of that (since you've already
fetched your own XFree 4.0 sources and built them). It's clear
that you're not a novice. Anyway, trying looking for .Xauthority
files. Allegedly if you simply delete them it opens the X server
wide open. I don't know if that's still true in XFree 4.0 but
it seemed to work on XFree 3.x the one time I tried it.
</BLOCKQUOTE>
<BLOCKQUOTE>
Good luck on that new X server. I haven't grabbed it to play with
it yet. I may wait until someone has a first cut of a <A HREF="http://www.debian.org/">Debian</A>
binary posted to "woody" (the current development/experimental
branch of the Debian project).
</BLOCKQUOTE>
<!-- sig -->
<!-- end 13 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/14"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 14 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>FW: Linux</H3>
<p><strong>Answered By Carl Davis on Mon, 17 Apr 2000
</strong></p>
<BLOCKQUOTE>
Thanks Jim, but I have solved the mystery................
</BLOCKQUOTE>
<BLOCKQUOTE>
The problem was that lilo does not like multiple "append" statements in
/etc/lilo.conf.
I fixed this by putting all the statements on the one append line,
separated by commas
and of cotatement2, statement3"
You may wish to add this snippet to the list of 2cent tips.
</BLOCKQUOTE>
<BLOCKQUOTE>
Regards
</BLOCKQUOTE>
<BLOCKQUOTE>
Carl Davis
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
<TT>-----Original</TT> Message-----
From: Carl Davis
Sent: Thursday, April 13, 2000 9:12 AM
To: '<A HREF="mailto:answerguy@ssc.com"
>answerguy@ssc.com</A>'
Subject: Linux
</STRONG></P>
<P><STRONG>
Hi Jim,
</STRONG></P>
<P><STRONG>
My compliments on a great column. I am running Linux (Mandrake 7) on a
Celeron 466
with 128 Mb RAM. My problem is I cannot persuade Linux to recognise more
than 64 Mb.
I have tried adding the following to lilo.conf: append="mem=128M", to
no avail. It still
comes up with only 64 Mb. Various flavours of Windoze can see the full
128 Mb. Any ideas
on what's going on here ?
</STRONG></P>
<P><STRONG>
Carl Davis
</STRONG></P>
<!-- end 14 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/15"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 15 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Determining the Type of Each Filesystem</H3>
<p><strong>From Scott on Mon, 17 Apr 2000
</strong></p>
<!-- ::
Determining the Type of Each Filesystem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hello Answer guy,
</STRONG></P>
<P><STRONG>
The company I work for is going to start developing products for Linux soon.
Part of my preparation for this is to find out about Linux file systems.
One thing I haven't been able to find is how to find out what file system
each filesystem is using. Is there a command line utility that shows this?
How do I accomplish this programatically?
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Here's a simple shell script that will parse the output from the
'mount' command and isolate the device name and type for each mounted
filesystem:
</BLOCKQUOTE>
<blockquote><pre> mount | {
IFS=" (,)";
while read dev x mpoint x type opts; do
echo $dev $type;
done
}
</pre></blockquote>
<BLOCKQUOTE>
Notice at this is one of my common "data mill loops" <TT>---</TT> you
pipe the output of some command into a 'while read ...; do' loop
and do all your work in the subprocess. (When I'm teaching shell
scripting one of the first points I emphasize about pipes is
that a subprocess is implicitly made on one side of your pipe
operator, or the other).
</BLOCKQUOTE>
<BLOCKQUOTE>
We also see that I'm using the variable "$x" to eat extra
fields (the words "on" and "type" from 'mount"s output). Finally,
I'm using the shell-special IFS (inter-field separator) shell variable
to add the characters "(,)" to the list of field separators. This
means that each of the mount options <TT>---</TT> read-only vs read/write, nodev,
nosuid, etc <TT>---</TT> will be treated as a separate value. I could then,
within my 'while' loop, nest a 'for' loop to process each option on
each filesystem.
</BLOCKQUOTE>
<BLOCKQUOTE>
Creative use of IFS and these 'while read ...; do' loops can allow
us to do quite a bit directly in shell without resorting to 'awk'
and/or 'sed' to do simple parsing. Creative use of the 'case'
command (which uses glob patterns to match shell variable values)
is also useful and can replace many calls to 'grep'.
</BLOCKQUOTE>
<BLOCKQUOTE>
To get filesystem information from within a C program you'd
use the <TT>'statfs()</TT>' or <TT>'fstatfs()</TT>' system calls. Read the
'statfs(2)' or 'fstatfs(2)' man pages for details. Fetch
the util-linux sources and read the source code to the
'mount' and 'umount' commands for canonical examples of
the use of these and related sytem calls.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Any help is appreciated!
</STRONG></P>
<P><STRONG>
Scott C
</STRONG></P>
<!-- end 15 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 15 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Which filesystem?</H3>
<p><strong>From Andrew T. Scott on Mon, 17 Apr 2000
</strong></p>
<BLOCKQUOTE>
Jim Dennis wrote:
.....
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
and do all your work in the subprocess. (When I'm teaching shell
scripting ...
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Where can I sit in on this class?
</BLOCKQUOTE>
<BLOCKQUOTE>
-Andrew
</BLOCKQUOTE>
<EM>[ <BLOCKQUOTE>
Luckily for <A HREF="http://www.linuxcare.com/">Linuxcare</A>, its training department has a whole bunch of people
in it (wave hi, everybody!) because they've got Jim assigned to Do Cool Stuff
so he's not teaching right now. To be fair, they are only one among many
training providers for Linux; you can see a decent listing at
<A HREF="http://www.lintraining.com"
>http://www.lintraining.com</A> which redirects to Linsight's directory by
location and news on the subject.
</BLOCKQUOTE><P>-- Heather. ]</P></EM>
<!-- end 15 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/16"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 16 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Four Questions</H3>
<p><strong>From vg24 on Tue, 18 Apr 2000
</strong></p>
<!-- ::
Four Questions
~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hi Answer Guy,
</STRONG></P>
<P><STRONG>
I had a few small questions about my <A HREF="http://www.slackware.org/">Slackware</A> Linux Box...
</STRONG></P>
<pre><strong>> (1) How do I get applications (like xmms) to startup automatically when I
> start FVWM95 with a 'startx' command? I'm hoping to achieve something
> similar to the "StartUp" menu in Win98.
</strong></pre>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Normally the 'startx' command is a shell script which looks for a
~/.Xclients file. That file is normally just another shell script.
It consists of a series of command that are started in the background
(using the trailing '&' shell operator), and one command that is
'exec"d (started in the foreground, and used to replace the shell
script's interpreter itself.
</BLOCKQUOTE>
<BLOCKQUOTE>
That foreground command is usually a window manager. In any event it
becomes the "session manager" for the X server. When the program exits,
the X server takes that as an indication that it should shutdown.
</BLOCKQUOTE>
<BLOCKQUOTE>
So, the answer to your question is to add the appropriate commands to
the .Xclients script in your home directory.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you are logging in via 'xdm' (a graphical login program) then it
may be that your system is looking for an ~/.Xsession script instead.
I usually just link to two names to one file. However, you certainly
could have completely different configurations based on whether you
logged in via 'xdm' or used the 'startx' command.
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course this is just a matter of convention and local policy. As I
said, 'startx' itself is often a shell script. At some sites you use
'xinit' instead of 'startx' <TT>---</TT> and others there are different ways
to launch the X server and completely different ways to start the various
clients that run under it and control it.
</BLOCKQUOTE>
<BLOCKQUOTE>
You mentioned fvwm95. This is one of several variants of the fvwm
window manager. That's a traditional window manager. It just gives
you a set of menus (click on the "root window" which other windowing
systems call a "wallpaper" with each of your mouse buttons to see those),
and a set of window decorations (resizing bars, corners, and title bars
and buttons).
</BLOCKQUOTE>
<BLOCKQUOTE>
In recent years the open source community has created somewhat more
elaborate and "modern" graphical user environments like: <A HREF="http://www.kde.org/">KDE</A>, <A HREF="http://www.gnome.org/">GNOME</A>,
and GNUStep. These are whole suites of programs which can be combined
to provide the sort of look, feel and facilities that people have
come to expect from MacOS, MSWindows, etc.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you really want something "Like the StartMenu" in Win'9x
then you may want to look at KDE or GNOME. These have "panels" which
provide a much closer analogue to the environment that you are
used to.
</BLOCKQUOTE>
<BLOCKQUOTE>
(Note: It is also possible to make either of these environments
look completely different than MS Windows. They both support
"themes" which are collections of settings, graphics, textures,
icons, even sounds, that customize the appearance and operation of
a Linux GUI. For more information and some nice screen shots of
the possibilities, take a look at <A HREF="http://www.themes.org"
>http://www.themes.org</A>).
</BLOCKQUOTE>
<blockquote><pre>> (2) I recently upgraded my kernel and filesystem binaries from a 2.034 kernel
> to a 2.2.13 kernel. I have XFree86 3.3.5 installed. I also upgraded
> my motherboard from an Intel P75 to an AMD K6-450. I kept the 32 Megs
> of RAM the same (a SIMM). However, now I notice that Netscape (and
> others?) grind my hard drive more when I attempt to open new
> browsers. I'm pretty sure I'm low on memory, but since I'm low in
> cash, I'd rather not invest in a DIMM. I didn't have any swap space
> set up, and don't now. I actually upgraded from netscape 4.1 to 4.6.
> Could this be the problem?
</pre></blockquote>
<BLOCKQUOTE>
Hmmm. Certainly it is likely that Netscape 4.6 is taking up more
memory than 4.1. However I note an inconsistency here. You say you
didn't have any swap space. If that was true then your shortage of
memory should have caused failures when trying to launch programs
<TT>---</TT> rather than the increased disk thrashing. I think it's likely
that you actually do have some swap space. You can use the following
command to find out what swap partitions and files are active on your
system:
</BLOCKQUOTE>
<blockquote><pre> cat /proc/swaps
</pre></blockquote>
<BLOCKQUOTE>
... which should provide a list of any swap space that is in use.
Of course the 'free' command will also summarize the available and
used swap space. However, the <TT>/proc/swaps</TT> "psuedo-file" (node) will
actually tell you "where" the swap is located.
</BLOCKQUOTE>
<BLOCKQUOTE>
Get the extra memory. It's not that expensive and it is the
best performance upgrade that you can make for your system.
</BLOCKQUOTE>
<blockquote><pre>> (3) I was running GNOME/enlightenment, but the
> GNOME panel would never come up automatically. How can I get the
> GNOME panel to initialize, along with the GNOME file manager, (so
> I can have the cool desktop icons)?
</pre></blockquote>
<BLOCKQUOTE>
Hmmm. I'm not much of a GNOME or KDE person. Do you have the rest
of GNOME installed? enlightenment is a window manager. It was the
default window manager for GNOME <TT>---</TT> but they are separate projects.
So, do you have GNOME installed? Are you starting 'gnome-session'
(running it from your .Xclients/.Xsession script as described above)?
</BLOCKQUOTE>
<BLOCKQUOTE>
Try that. I think there are now a couple of window managers that
implement the GNOME hints and APIs <TT>---</TT> so you don't have to use
enlightenment.
</BLOCKQUOTE>
<blockquote><pre>> (4) Lastly, I wanted to trim my syslog and wtmp files. Is there any
> way I can do this? Can I just tail -30 the last 30 lines into a
> new file? I think the wtmp is binary, so any ideas?
</pre></blockquote>
<BLOCKQUOTE>
You are correct. the wtmp and utmp files are binary. They cannot be
trimmed with simple shell scripts and text utilities. The utmp file
shouldn't grow (by much), however the wtmp will grow without bound.
However, the usual way of dealing with wmtp is to simply rename the
current one, 'touch' a new one and forget about it.
</BLOCKQUOTE>
<BLOCKQUOTE>
That's fine for wtmp.
</BLOCKQUOTE>
<BLOCKQUOTE>
However, DON'T try that with the <TT>/var/log/messages</TT> or other
syslog files. Those are held up. If you rename them or
delete them, they continue to grow.
</BLOCKQUOTE>
<BLOCKQUOTE>
Yes! You read that correctly, if you remove a file while some
process has it open, then you haven't freed up any disk space!
That's because the 'rm' command just does an <TT>'unlink()</TT>' system call.
When the last link to a file is removed, AND THE FILE IS NOT OPEN,
then the filesystem drivers perform some housekeeping to mark the
associated inode(s) as available, and to add all the associated data
blocks to the filesystem's "free list." If the file is still open
then that housekeeping is deferred until it is closed.
</BLOCKQUOTE>
<BLOCKQUOTE>
So the usual way to trim syslog files (since syslog stays
running all the time, and keeps it's files open under normal
circumstances) is to to 'cp <TT>/dev/null</TT>' or 'echo "" > ' to
truncate them. Another common practice is to remove the
files and use the 'kill <TT>-HUP</TT> $(cat <TT>/var/run/syslog.pid</TT>)' command
to force the syslogd to re-read its configuration file,
close all its files, and re-open them.
</BLOCKQUOTE>
<BLOCKQUOTE>
However, none of that should be necessary. Every other
general purpose distribution has some sort of log rotation
scripts that are run out of 'cron.' I'm pretty sure that
Patrick (Volkerding, principle architect of Slackware) didn't
neglect that.
</BLOCKQUOTE>
<BLOCKQUOTE>
(I should point out that I haven't used Slackware in several
years. Nothing against it. I just have too few machines and
too little time).
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks for any help you can provide!
Vikas Gupta
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Well, I think this should nudge you in the right directions.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 16 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/17"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 17 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>G-Kermit: The GPL Kermit Transfer Package</H3>
<p><strong>From Deepu Chandy Thomas on Tue, 18 Apr 2000
</strong></p>
<!-- ::
G-Kermit: The GPL Kermit Transfer Package
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Sir,
</STRONG></P>
<P><STRONG>
I wanted to use the kermit protocol with minicom. I use rz sz for
zmodem. Where do I get the files for kermit?
</STRONG></P>
<P><STRONG>
Regards,
Deepu
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Look at <A HREF="http://www.columbia.edu/kermit"
>http://www.columbia.edu/kermit</A> for canonical information
about all the official Kermit packages, and at:
<A HREF="http://www.columbia.edu/kermit/gkermit.html"
>http://www.columbia.edu/kermit/gkermit.html</A> for information
specifically about the GPL kermit package (which implements
the file transfer protocol without the scripting, dialing and
other features of C-Kermit).
</BLOCKQUOTE>
<BLOCKQUOTE>
(Note: C-Kermit can also be used as a 'telnet' or 'rsh' client
with a scripting language, and many other useful features. It
is a full featured communications package. Recent versions have
even added Kerberos support!)
</BLOCKQUOTE>
<!-- sig -->
<!-- end 17 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/18"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 18 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
><TT>./script:</TT> No such file or directory</H3>
<p><strong>From Alex Brak on Fri, 14 Apr 2000
</strong></p>
<!-- ::
<TT>./script:</TT> No such file or directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I'm having a problem with my linux box, and can't for the life of me
figure out what's wrong. Here are the symptoms:
</STRONG></P>
<pre><strong>> server:~/scripts$ whoami
> alex
> server:~/scripts$ ls -al ./script
> - -rwxr----- 1 alex home 43747 Apr 10 22:31 ./script*
> server:~/scripts$ ./script
> bash: ./script: No such file or directory
</strong></pre>
<P><STRONG>
(note: the '*' at the tail end of the file listing is merely a symbol
specifying that its an executable file. this is not part of the
filename)
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Technically that "file type marker" is the result of using the
<TT>-F</TT> option to 'ls'
</BLOCKQUOTE>
<BLOCKQUOTE>
The most likely cause of this problem is the #! (shebang) line
that should be at the beginning of your script. If that is
incorrect then it is common to get this error, your shell is
telling you that it can't find the script's interpreter.
</BLOCKQUOTE>
<BLOCKQUOTE>
If '<TT>./script</TT>' was a binary executable thenI'd also suggest looking
for missing shared libraries. In fact, it's possible that your
shebang line is pointing to some interpreter (<TT>/usr/local/ksh</TT> or
something) which is present, and executable, but is missing some
shared library. It is even possible that a shared library depends
on another, and that this is what is missing.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
As you can see from the above, I'm the owner of the file in question,
and have execute permission on it. The file exists. Yet bash claims
the file is not there. I've tried with shells other than bash (every
other shell available on my system, including csh, tcsh, ash, and
zsh). I've even tried executing the command
as root, to no avail.
</STRONG></P>
<P><STRONG>
This exact same problem has arisen before with another script I
wrote. I couldn't fix it then, either.
</STRONG></P>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
Check your shebang line. It should read something like:
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<blockquote><pre>#!/bin/sh
</pre></blockquote>
<BLOCKQUOTE>
Note: there are NO SPACES in this line. Do NOT put a space
between the #! and the interpreter's name.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I'd like to also note that this problem arises intermittently: just
after finishing ~/scripts/script I created another script named
"test", did chmod u+x on it and it executed just fine.
~scripts/script still refuses to execute, though :( Please note that I've
tried renaming the file. I've also tried moving it to another location on
the directory tree. None of these have helped.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
A text file without any shebang line, which is marked as executable
will be executed through some magic that is dependent on the shell
wfrom which it is being invoked.
</BLOCKQUOTE>
<BLOCKQUOTE>
I'll probaby get this wrong in the details but the process works
something like this:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
You issue a command. The shell tries to simply<TT> exec()</TT> it (after
performing the command line parsing necessary to expand any file
"globs" and replace any shell variables, command substitution
operators, parameter expansion, etc). If that execution fails the
shell may attempt to call it with $SHELL <TT>-c</TT> (or it might do something
a bit different: that seems to be shell dependent).
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
Notice that the behaviour in the first case is well-defined. Linux
has a binfmt_script module (usually compiled/linked statically into
your kernel) which handles a properly formatted shebang line.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I have not experienced any other problems with my system that I'm
aware of. Does anyone know what could be causing this, or how to fix
the problem?
</STRONG></P>
<P><STRONG>
I'm running linux 2.2.14 on my Pentium 120, with a <A HREF="http://www.slackware.org/">Slackware</A>
distribution. The file in question exists on the root partition, in
an ext2 file system, which the kernel supports. If there's any other
relevant information I have provided, please don't hesitate to ask.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
If you were getting "operation not permitted" I'd suggest checking your
mount options to see if the filesystem was mounted 'noexec' (which
would be a very badd idea for your root fs). If you were getting
a message like "cannot execute binary" then I'd think that maybe
you had an old a.out binary and a kernel without the a.out binfmt
support.
</BLOCKQUOTE>
<BLOCKQUOTE>
But I'm pretty sure that you're having a problem with your shebang
line.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks,
Alex
</STRONG></P>
<!-- sig -->
<!-- end 18 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 18 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
><TT>./script:</TT> No such file or directory</H3>
<p><strong>From Alex Brak on Sun, 16 Apr 2000
</strong></p>
<BLOCKQUOTE>
Sport on. Many thanks.
</BLOCKQUOTE>
<BLOCKQUOTE>
Alex
</BLOCKQUOTE>
<BLOCKQUOTE>
<TT>-----Original</TT> Message-----
From: Jim Dennis [mailto:<A HREF="mailto:jimd@starshine.org"
>jimd@starshine.org</A>]
Sent: Saturday, 15 April 2000 9:07 AM
To: Alex Brak
Cc: <A HREF="mailto:star@starshine.org"
>star@starshine.org</A>; <A HREF="mailto:jdennis@<A HREF="http://www.linuxcare.com/">Linuxcare</A>.com"
>jdennis@<A HREF="http://www.linuxcare.com/">Linuxcare</A>.com</A>; <A HREF="mailto:tdavey@<A HREF="http://www.linuxcare.com/">Linuxcare</A>.com"
>tdavey@<A HREF="http://www.linuxcare.com/">Linuxcare</A>.com</A>;
<A HREF="mailto:bneely@linuxcare.com"
>bneely@linuxcare.com</A>; <A HREF="mailto:sg@linuxcare.com"
>sg@linuxcare.com</A>
Subject: Re: shell cannot see an existing file
</BLOCKQUOTE>
<!-- ::
<TT>./script:</TT> No such file or directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I'm having a problem with my linux box, and can't for the life of me
figure out what's wrong. Here are the symptoms:
</STRONG></P>
<pre><strong>> server:~/scripts$ whoami
> alex
> server:~/scripts$ ls -al ./script
> - -rwxr----- 1 alex home 43747 Apr 10 22:31 ./script*
> server:~/scripts$ ./script
> bash: ./script: No such file or directory
</strong></pre>
<P><STRONG>
(note: the '*' at the tail end of the file listing is merely a symbol
specifying that its an executable file. this is not part of the
filename)
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Technically that "file type marker" is the result of using the
<TT>-F</TT> option to 'ls'
</BLOCKQUOTE>
<BLOCKQUOTE>
The most likely cause of this problem is the #! (shebang) line
that should be at the beginning of your script. If that is
incorrect then it is common to get this error, your shell is
telling you that it can't find the script's interpreter.
</BLOCKQUOTE>
<BLOCKQUOTE>
If '<TT>./script</TT>' was a binary executable thenI'd also suggest looking
for missing shared libraries. In fact, it's possible that your
shebang line is pointing to some interpreter (<TT>/usr/local/ksh</TT> or
something) which is present, and executable, but is missing some
shared library. It is even possible that a shared library depends
on another, and that this is what is missing.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
As you can see from the above, I'm the owner of the file in question,
and have execute permission on it. The file exists. Yet bash claims
the file is not there. I've tried with shells other than bash (every
other shell available on my system, including csh, tcsh, ash, and
zsh). I've even tried executing the command
as root, to no avail.
</STRONG></P>
<P><STRONG>
This exact same problem has arisen before with another script I
wrote. I couldn't fix it then, either.
</STRONG></P>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
Check your shebang line. It should read something like:
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<blockquote><pre>#!/bin/sh
</pre></blockquote>
<BLOCKQUOTE>
Note: there are NO SPACES in this line. Do NOT put a space
between the #! and the interpreter's name.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I'd like to also note that this problem arises intermittently: just
after finishing ~/scripts/script I created another script named
"test", did chmod u+x on it and it executed just fine.
~scripts/script still refuses to execute, though :( Please note that I've
tried renaming the file. I've also tried moving it to another location on
the directory tree. None of these have helped.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
A text file without any shebang line, which is marked as executable
will be executed through some magic that is dependent on the shell
wfrom which it is being invoked.
</BLOCKQUOTE>
<BLOCKQUOTE>
I'll probaby get this wrong in the details but the process works
something like this:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
You issue a command. The shell tries to simply<TT> exec()</TT> it (after
performing the command line parsing necessary to expand any file
"globs" and replace any shell variables, command substitution
operators, parameter expansion, etc). If that execution fails the
shell may attempt to call it with $SHELL <TT>-c</TT> (or it might do something
a bit different: that seems to be shell dependent).
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
Notice that the behaviour in the first case is well-defined. Linux
has a binfmt_script module (usually compiled/linked statically into
your kernel) which handles a properly formatted shebang line.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I have not experienced any other problems with my system that I'm
aware of. Does anyone know what could be causing this, or how to fix
the problem?
</STRONG></P>
<P><STRONG>
I'm running linux 2.2.14 on my Pentium 120, with a <A HREF="http://www.slackware.org/">Slackware</A>
distribution. The file in question exists on the root partition, in
an ext2 file system, which the kernel supports. If there's any other
relevant information I have provided, please don't hesitate to ask.
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
If you were getting "operation not permitted" I'd suggest checking your
mount options to see if the filesystem was mounted 'noexec' (which
would be a very badd idea for your root fs). If you were getting
a message like "cannot execute binary" then I'd think that maybe
you had an old a.out binary and a kernel without the a.out binfmt
support.
</BLOCKQUOTE>
<BLOCKQUOTE>
But I'm pretty sure that you're having a problem with your shebang
line.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks,
Alex
</STRONG></P>
<!-- sig -->
<!-- end 18 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/19"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 19 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>hello</H3>
<p><strong>From Credit Future Commercial MACAU Company on Wed, 5 Apr 2000
</strong></p>
<BLOCKQUOTE>
Hello sir
</BLOCKQUOTE>
<BLOCKQUOTE>
I installed red hat 6.1 on my system but it does not display more =
</BLOCKQUOTE>
<BLOCKQUOTE>
then 256 colours although my vga card is a 16 MB vodoo why is that can =
you help me out here ???I have tried startx <TT>-bpp16</TT> but still my pics =
"jpegs , bmp " qualities isnt fine !!! & are displayed in dots same pic =
in windows look good .
</BLOCKQUOTE>
<BLOCKQUOTE>
thanksfaisal
</BLOCKQUOTE>
<!-- end 19 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 19 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>hello</H3>
<p><strong>From Heather on Wed, 5 Apr 2000
</strong></p>
<P><STRONG>
Hello sir
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Heather isn't a masculine name in the U.S. I'll assume this is intended
for the Answer Guy column, and give a first shot at answering it.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I installed red hat 6.1 on my system but it does not display more then
</STRONG></P>
<P><STRONG>
256 colours although my vga card is a 16 MB vodoo why is that can you help
me out here ???I have tried startx <TT>-bpp16</TT> but still my pics "jpegs , bmp "
qualities isnt fine !!! & are displayed in dots same pic in windows look
good .
thanksfaisal
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
You have not specified what resolution under MSwin had the qualities you seek.
Under X, you must run the correct video server to match your card if you want
best performance, but you can nearly always get the screen <EM>working</EM> with a
lesser server.
</BLOCKQUOTE>
<BLOCKQUOTE>
The VGA16 server only provides 256 color service. If this is what you are
stuck at, you might be using this. Or, your <TT>/etc/X11/XF86Config</TT> file may
be telling it to default to this level <TT>-</TT> the command to change the default
is
startx <TT>--</TT> <TT>-bpp</TT> 16
</BLOCKQUOTE>
<BLOCKQUOTE>
with the space. Also, startx is a shell script, and launches a particular
server... usually <TT>/usr/X11R6/bin/X</TT> which itself is a link to the real one...
and so, you may be running a server you didn't intend.
</BLOCKQUOTE>
<BLOCKQUOTE>
Good luck with your JPEGs.
</BLOCKQUOTE>
<!-- end 19 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 19 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>hello again</H3>
<p><strong>From fai, Answered By Heather Stern on Fri, 7 Apr 2000
</strong></p>
<P><STRONG>
Thanks for the help it worked Finally !!!!
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Glad to hear it worked for you. Sorry I wasn't able to reply in
email in a timely fashion <TT>-</TT> publishing deadlines, you know.
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Can you help me a bit more while telling me that i want to start this
command by default startx <TT>--</TT> <TT>-bpp</TT> 32 how can i do this ????
</STRONG></P>
<P><STRONG>
thanks
Faisal
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
One way would be to creat .xserverrc in your own home directory;
you'd have to specify your X server, but then you could pass it
parameters too:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<TT>/usr/X11R6/bin/XF86_SVGA</TT> <TT>-bpp</TT> 32
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
Assuming that's the right server for you, of course. If startx
is just plain "getting it right" except for that itty bitty detail
of colordepth, you could instead create a bash alias or put a one-liner
shell script in your path. I like to keep such personal scripts
in ~/bin (that's bin under my home directory). name it something
much shorter like myX and save some typing too.
</BLOCKQUOTE>
<EM>[ <BLOCKQUOTE>
So where was Jim on this one? Well, he liked my answer, and was
busy with other questions and stuff to do.
</BLOCKQUOTE><P>-- Heather. ]</P></EM>
<!-- end 19 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/20"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 20 -->
<H3 align="left"><img src="../gx/dennis/bbubble.gif"
height="50" width="60" alt="(!) " border="0"
>Shutting Down the Ping Daemon: Revised</H3>
<p><strong>Answered By Nadeem Hasan on Mon, 03 Apr 2000
</strong></p>
<!-- ::
Shutting Down the Ping Daemon: Revised
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
This is in reference to above question in "The answer Guy"
and its answer. The use of ipchains/ipfwadm is a bit of an
overkill to achieve this. The better way is to simply use
the following as root:
</STRONG></P>
<P><STRONG><CODE>
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
</CODE></STRONG></P>
<P><STRONG>
This should cause the kernel to ignore all the ping ICMP
requests.
</STRONG></P>
<P><STRONG>
Cheers,
--
Nadeem
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Just when you think you know everything.
</BLOCKQUOTE>
<!-- end 20 -->
<!-- . . . . . . . . . . . . . . . . . . . -->
<HR WIDTH="40%" ALIGN="center">
<!-- begin 20 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Revisionist Requests</H3>
<p><strong>From Nadeem Hasan on Tue, 11 Apr 2000
</strong></p>
<!-- ::
Revisionist Requests
~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
The Gazette still has the old description about disabling
ping echo responses. Does that mean its better than what
I suggested?
</STRONG></P>
<P><STRONG>
Nadeem
<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"
>
I don't have the power to change what I've published in previous
months. Your (better) suggestion on how to disable the Linux
kernel's ICMP echo responses (to 'ping' requests) should appear in
next month's issue.
</BLOCKQUOTE>
<BLOCKQUOTE>
Now, what was that magic <TT>/proc</TT> node again?
</BLOCKQUOTE>
<BLOCKQUOTE>
Ahh, here it is:
</BLOCKQUOTE>
<blockquote><pre> echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
</pre></blockquote>
<BLOCKQUOTE>
... I'd never remember that, but the node is there and I'd
recognize the meaining from the name. (So it's in my passive
rather than active vocabulary).
</BLOCKQUOTE>
<BLOCKQUOTE>
There are some other interesting nodes there <TT>---</TT> and I think
the one about "icmp_echo_ignore_broadcasts" looks useful.
</BLOCKQUOTE>
<BLOCKQUOTE>
It would be neat if someone wanted to write up a HOWTO on
"Useful <TT>/proc</TT> Tips and Tricks" (hint, hint). I've done some
performance tuning by tweaking and playing with some of the
entries under <TT>/proc/sys/vm</TT> (the virtual memory sysctl's), and
I know others have even done better than I could (back at
<A HREF="http://www.linuxcare.com/">Linuxcare</A>, I had to call on our <EM>real</EM> experts to help me out
awhile back for one gig).
</BLOCKQUOTE>
<BLOCKQUOTE>
I guess the tips would fall into two or three general categories:
robustness, security, and performance. For example the
<TT>/proc/sys/kernel/cap-bound</TT> (bounding capabilities set) can be
modified to secure some facilities even from a subverted 'root'
process (like the BSD securelevel features), and I guess that
<TT>/proc/sys/vm/overcommit_memory</TT> might allow one to prevent the
system from overcommit (providing for more robust operation
at the expense of reducing our capacity to run multiple
concurrent "memory hogs" that ask for more core than they actually
need).
</BLOCKQUOTE>
<BLOCKQUOTE>
A good HOWTO would be organized by objective/situation
(Increasing File Server Performance, Limiting Damage by
Subverted and Rogue Processes (Crackers), etc) and would include
notes on the tradeoffs that each setting entails. For example
one might disable ICMP response (for security?) but one should
be aware that anyone who has a legimate reason to access ANY
other service on your system might want to 'ping' it first to
ensure that it is reachable before they (or their programs) will
attempt to access any other service on it. (In other words it
makes no sense to disable ICMP responses on a web, mail, DNS,
FTP or other public server).
</BLOCKQUOTE>
<BLOCKQUOTE>
Unfortunately I don't have the time, nor nearly enough expertise
to write this. There are already some notes in the Linux kernel
source trees under <TT>/usr/src/linux/Documentation/sysctl/</TT> and I
remember that someone is working on a tool to automate some of
this PowerTweak/Linux (<A HREF="http://linux.powertweak.com/news.html"
>http://linux.powertweak.com/news.html</A>)
comes to mind.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, enough on that.
</BLOCKQUOTE>
<!-- end 20 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag/21"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 21 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Remotely Executing Graphic Apps</H3>
<p><strong>From Apichai T. on Mon, 03 Apr 2000
</strong></p>
<!-- ::
Remotely Executing Graphic Apps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Dear sir,
</STRONG></P>
<P><STRONG>
May I ask for your advice , the steps to set up linux box to be
possible to remotely execute graphical applications.
</STRONG></P>
<P><STRONG>
Thanks and Best regards,
Jing
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Here's a couple of HOWTO and mini-HOWTO links:
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
Remote X Apps mini-HOWTO
<DD><A HREF="http://www.linuxdoc.org/HOWTO/mini/Remote-X-Apps.html"
>http://www.linuxdoc.org/HOWTO/mini/Remote-X-Apps.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
(I've copied it's author, Vincent Zweije, on this reply).
</BLOCKQUOTE>
<BLOCKQUOTE>
I don't recommend using his example shell script from section 6.2:
</BLOCKQUOTE>
<blockquote><pre>!/bin/sh
cookie=`mcookie`
xauth add :0 . $cookie
xauth add "$HOST:0" . $cookie
exec /usr/X11R6/bin/X "$@" -auth "$HOME/.Xauthority"
</pre></blockquote>
<BLOCKQUOTE>
The problem here is that the cookie variable is exposed on these
command lines (which is world readable via <TT>/proc</TT> and the 'ps'
command). It may also be exposed if it is exported to the
environment. Safe handling must be done through pipes or files
(or file descriptors). Note that the window of exposure is small
<TT>---</TT> but unnecessary. Read the 'xauth' man page for more details.
</BLOCKQUOTE>
<BLOCKQUOTE>
Better yet: Use ssh! (Read Vincent's HOWTO for more on that).
</BLOCKQUOTE>
<BLOCKQUOTE>
I also notice that Vincent doesn't distinguish between the session
manager and the window manager. In practice they are almost
always the same program. However here's the difference:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
The session manager is the one program that is started in the
foreground during the startx or xinit process. The X server
tracks this one process ID. When it dies, the X server takes
that as a signal to shutdown. Any program (an 'xterm', a copy
of 'xclock' or whatever) can be the session manager.
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
The window manager is the program that receives events for the
"root window" (the X Windows System term for what other
windowing systems call the "wall paper" or "desktop" or
"backdrop"). There's also quite a bit more to what the window
manager does. You can only run one window manager on any X
server at any time. Window managers (can?) implement a number
of APIs that are unique to them <TT>---</TT> so you can just use "any"
X program as your window manager.
</BLOCKQUOTE>
<BLOCKQUOTE>
It's a subtle distinction since almost everybody uses their window
manager as their session manager.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note: If you're troubleshooting X connections keep in mind that
the client must be able to connect to the server via the
appropriate socket. For example, to connect to the server on :0
(localhost/unix:0) the program must be able to access the UNIX
domain socket (usually in sockets that are located in <TT>/tmp/.X11-unix/</TT>)
Obviously<TT> chroot()</TT> jails could interfere with that (though
localhost:0, which is the same as localhost/tcp:0 should still
work).
</BLOCKQUOTE>
<BLOCKQUOTE>
A subtle and rare problem might be if someone were to try running
X after building a kernel without support for UNIX domain sockets.
It's possible to build a Linux kernel with full support for TCP/IP
and yet leave out the support for UNIX domain sockets.
</BLOCKQUOTE>
<BLOCKQUOTE>
Obviously when looking at Internet domain sockets (TCP/IP) any of
the usual routing, addressing, and packet filtering issues can
interfere with your clients attempts to connect to port 6000
(or 6001, 6002, etc) on the X server host.
</BLOCKQUOTE>
<BLOCKQUOTE>
For a little more on remote access to X server look at VNC
(Virtual Network Computing from AT&T Laboratories Cambridge:
<A HREF="http://www.uk.research.att.com/vnc"
>http://www.uk.research.att.com/vnc</A>) (VNC was originally
developed at the Olivetti Research Laboratory, which was later
acquired by AT&T).
</BLOCKQUOTE>
<BLOCKQUOTE>
You don't need this to just run X clients on your X server.
However, it's useful to learn about VNC in case you need some of
the special features that it provides.
</BLOCKQUOTE>
<BLOCKQUOTE>
Another good site for finding links to lots of information about
X is at Kenton Lee's "X Sites" (<A HREF="http://www.rahul.net/kenton/xsites.html"
>http://www.rahul.net/kenton/xsites.html</A>)
There are about 700 links located there!
</BLOCKQUOTE>
<BLOCKQUOTE>
Note that while X is currently the dominant windowing system for
Linux there are other efforts out there including "Berlin"
(<A HREF="http://www.berlin-consortium.org"
>http://www.berlin-consortium.org</A>) and the "Y Window System"
(<A HREF="http://www.hungry.com/products/Ywindows"
>http://www.hungry.com/products/Ywindows</A>). I don't know how
these projects are going. I see that the Berlin home pages have
been updated recently while the Y Window System pages seem to
have been stale since March of 1998.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, good luck.
</BLOCKQUOTE>
<!-- sig -->
<!-- end 21 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/ssc.copying.html"
>Copyright ©</a> 2000, James T. Dennis
<BR>Published in <I>The Linux Gazette</I> Issue 53 May 2000</H5>
<H6 ALIGN="center">HTML transformation by
<A HREF="mailto:star@tuxtops.com">Heather Stern</a> of
Tuxtops, Inc.,
<A HREF="http://www.tuxtops.com/">http://www.tuxtops.com/</A>
</H6>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- *** BEGIN navbar *** -->
<A HREF="lg_bytes53.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<IMG ALT=""
SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom" >
<A HREF="lg_toc53.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A>
<A HREF="../lg_frontpage.html"><IMG ALT="[ Front Page ]"
SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]"
SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A>
<IMG ALT=""
SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom" >
<A HREF="lg_tips53.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A>
<!-- *** END navbar *** -->
</BODY></HTML>
<!--endcut ========================================================= -->
|