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
|
<html>
<head>
<link href="../lg.css" rel="stylesheet" type="text/css" media="screen, projection" />
<title>More 2 Cent Tips LG #98</title>
<style type="text/css" media="screen, projection">
<!--
.articlecontent {
position:absolute;
top:143px;
}
-->
</style>
</head>
<body>
<img src="../gx/2003/newlogo-blank-200-gold2.jpg" id="logo" alt="Linux Gazette"/>
<p id="fun">...making Linux just a little more fun!</p>
<div class="content articlecontent">
<div id="previousnexttop">
<A HREF="lg_mail.html" ><-- prev</A> | <A HREF="lg_answer.html" >next --></A>
</div>
<h1>More 2¢ Tips</h1>
<p>
<center><STRONG>See also: The Answer Gang's
<a href="../tag/kb.html">Knowledge Base</a>
and the <i>LG</i>
<a href="http://www.linuxgazette.net/search.html">Search Engine</a></STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#tips.1"
><strong>About crypt function in Linux -- Easy Encryption</strong></a>
<li><A HREF="#tips.2"
><strong>Adding PHP to apache on Redhat 9.0</strong></a>
<li><A HREF="#tips.3"
><strong>automatic backup in debian</strong></a>
<li><A HREF="#tips.4"
><strong>Bash Scripting</strong></a>
<li><A HREF="#tips.5"
><strong>I need help, PLEASE!</strong></a>
<li><A HREF="#tips.6"
><strong>Help (Networking)</strong></a>
<li><A HREF="#tips.7"
><strong>Linux Hotplug for Dummies</strong></a>
<li><A HREF="#tips.9"
><strong>Covert HTML attachments to PDF at mail server</strong></a>
<li><A HREF="#tips.10"
><strong>Securing a dial in?</strong></a>
<li><A HREF="#tips.11"
><strong>linux printing</strong></a>
<li><A HREF="#tips.12"
><strong>Loads of Linux Links</strong></a>
<li><A HREF="#tips.13"
><strong>How can you find the correct /dev/hd?? for the C: drive</strong></a>
<li><A HREF="#tips.14"
><strong>Combining multiple PDFs into one</strong></a>
<li><A HREF="#tips.15"
><strong>what is "no"? (missing prog for binutils compile)</strong></a>
<li><A HREF="#tips.16"
><strong>Odd Behavior When First Launching Netscape Version 4.80</strong></a>
<li><A HREF="#tips.17"
><strong>searching PDFs made from faxes</strong></a>
<li><A HREF="#tips.18"
><strong>PerlHoo rocks</strong></a>
<li><A HREF="#tips.19"
><strong>previewing and printing text files</strong></a>
<li><A HREF="#tips.20"
></a>Sandisk 256Mb USB drive and Linux Kernel panics --or--
<br><A HREF="#tips.20"
><strong>If you can scare your OS tell someone who can fix it</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">About crypt function in Linux -- Easy Encryption</FONT></H3>
Tue, 7 May 2002 15:52:47 -0400
<BR>Marko Cehaja (<a href="mailto:tag@linuxgazette.net?cc=star@starshine.org&cc=internut@thetaworld.org&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%231">internut from thetaworld.org</a>)
<P>
(with minor editing by Ben Okopnik)
</P>
<P>
I have many files on my hard disk which are important and need to be
encrypted. Once, I left my computer at a client's location while
working on their database, and they tried to crack into it. They got in
with a <A HREF="http://www.suse.com/">SuSE</A> boot disk and installed FTPD so they could grab my files.
The only reason they failed was because they didn't know how to crack a
plain PostgreSQL database (which should be simple when you're logged in
as root). Since then, I don't leave any important data un-encrypted in
order to be ready for such incidents.
</P>
<P>
Since I often use Midnight Commander, I have automated this by creating
a menu item in its menu file (~/.mc/menu) [ Note: This can also be done
via MC's pull-down menu system - press "F9", select "Command", then
"Menu File edit". ] The following entry will pack the entire current
directory and encrypt the result with GnuPG.
</P>
<p align="center">See attached <tt><a href="misc/tips/encryptdir-gpg.midnight-commander.txt">encryptdir-gpg.midnight-commander.txt</a></tt></p>
<P>
I've also added an entry for single file encryption:
</P>
<p align="center">See attached <tt><a href="misc/tips/encrypt1file-gpg.midnight-commander.txt">encrypt1file-gpg.midnight-commander.txt</a></tt></p>
<P>
What if the files are already encrypted? In order to save some time, I
have put following into the extension file located at ~/.mc/bindings
[ Note: 'F9', "Command", "Extension File edit" via the pull-down menu. ]
</P>
<p align="center">See attached <tt><a href="misc/tips/view-gpg.midnight-commander.txt">view-gpg.midnight-commander.txt</a></tt></p>
<P>
Now, when you press F3 (view) on the file with extension *.gpg, it asks
you for the passphrase and shows the contents of the file. Beware,
however: if you are on the network or on a multi-user system, your
memory and swap file (which contain the decrypted text) could be exposed
to attackers.
</P>
<P>
One good use for this is to put all your passwords into a single file,
and simply remember one passphrase. Be sure to remove the original plain
text files with "wipe" or "shred" rather than "rm" to delete data in a
secure manner.
</P>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Adding PHP to apache on Redhat 9.0</FONT></H3>
Sun, 30 Nov 2003 16:45:31 +0200
<BR>Raj (<a
href="mailto:tag@linuxgazette.net?cc=fmatsika@zdb.co.zw&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%232">The
<em>LG</em>
Answer Gang</a>)
<BR>Question by Francis Matsika (fmatsika from zdb.co.zw)
<P><STRONG>
I have just installed redhat 9.0 and i am wondering how to configure or
build php
as an apache module
</STRONG></P>
<P><STRONG>
I installed apache and php using rpm's that come with redhat 9.0
</STRONG></P>
<BLOCKQUOTE>
[Raj]
If you used RPMs it has already been installed. Create a file in your
<TT>/var/www/html/</TT> directory (say self.php), and put this lines into it
</BLOCKQUOTE>
<blockquote><pre><?
phpinfo()
?>
</pre></blockquote>
<BLOCKQUOTE>
Point your browser to it, (usually by saying <A HREF="http://127.0.0.1/self.php"
>http://127.0.0.1/self.php</A>
in your browser) and you will have everything you never wanted to know
about your PHP module in front of your eyes.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Thomas]
You miss the point completely here. The question was not "how can I test
php"; it was "how can I get apache to utilise it". The answer to that
question is that the RPMs should have already sorted that out for you,
Francis. You'll just have to enure that you:
</BLOCKQUOTE>
<blockquote><pre>apachectl restart
</pre></blockquote>
<BLOCKQUOTE>
[Raj]
Just another example why speed reading is bad for health
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">. Francis, as
Thomas pointed out, if you have used RPMs for installation, then
everything has already been taken care of. However, if you want to be
sure that good old rpm has not cheated you out what is rightfully yours,
then check for the following files.
</BLOCKQUOTE>
<BLOCKQUOTE>
The main workhorse for translating the php code into html:
/etc/httpd/modules/libphp4.so
</BLOCKQUOTE>
<BLOCKQUOTE>
The file which controls how PHP behaves while interpreting php files:
/etc/httpd/conf.d/php.conf
</BLOCKQUOTE>
<BLOCKQUOTE>
Controls quite a few other PHP features, like security, language options etc. Very well commented:
/etc/php.ini
</BLOCKQUOTE>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">automatic backup in debian</FONT></H3>
Sat, 06 Dec 2003 13:53:41 +0530
<BR>Thomas Adam (<a
href="mailto:tag@linuxgazette.net?cc=joy12@vsnl.net&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%233">The <em>LG</em> Weekend Mechanic</a>)
<BR>
<P><STRONG>
I am a newbie debian user (switched from RH).
I have faced a strange prob. in woody. whenever I modified any file the
previous contents is backedup with a *~* sign and the modified one is saved
with the actual name. like *test.kwd* will be *test.kwd* after modification,
but there will be an extra *test.kwd~* also.
</STRONG></P>
<P><STRONG>
plz suggest me how to stop the generation of this second back-up file.
</STRONG></P>
<P><STRONG>
thanks in advanced
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
Well, yet again Joydeep, I am being poisoned with LOIS (Lack Of
Information Syndrome) --
</BLOCKQUOTE>
<BLOCKQUOTE>
I am going to make an intelligent guess and assume that you are using vi (or in your case vim).
</BLOCKQUOTE>
<BLOCKQUOTE>
Vim will save backup files, using the caret (~) notation. You can add
the following to your ~/.vimrc file:
</BLOCKQUOTE>
<blockquote><pre>:set nobackup
</pre></blockquote>
<BLOCKQUOTE>
to disable it (in the configuration file the leading ':' is optional).
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course, if you are not using vi[m] then that means we need to find an
alternative solution -- something drastic I think, like:
</BLOCKQUOTE>
<blockquote><pre>cd / && find . -name '*~' -exec rm -f {} \;
</pre></blockquote>
<BLOCKQUOTE>
You can then add this as a cron entry to run say every 20 minutes?
</BLOCKQUOTE>
<blockquote><pre>0-59/20 * * * * some_user cd / && find . -name '*~' -exec rm -f {} \;
</pre></blockquote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Bash Scripting</FONT></H3>
Sat, 7 Jun 2003 11:45:35 -0400
<BR>Faber Fedor (<a
href="mailto:tag@linuxgazette.net?cc=robinchhetri@fastmail.fm&cc=faber@linuxnj.com&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%234">The
<em>LG</em>
Answer Gang</a>)
<BR>Question by Robin Chhetri (robinchhetri from fastmail.fm)
<P><STRONG>
Hi Gang,
</STRONG></P>
<P><STRONG>
I asked another question around one month ago and even though I could not
come up with a answer I decided to come up here again.(Incidentally I
tried it also in linuxquestions.org).
</STRONG></P>
<P><STRONG>
What would be the equivalent to the zsh script given below in bash
</STRONG></P>
<pre><strong>$echo ${${(z) $(whereis libcrypto)}[2]}
</strong></pre>
<P><STRONG>
if the output of $(whereis libcrypto) is
</STRONG></P>
<pre><strong>libcrypto: libcrypto.so libcryto.a
</strong></pre>
<P><STRONG>
it returns libcrypto.so only.
Now I could come up with
</STRONG></P>
<pre><strong>$robin=($(whereis libcrypto)); echo ${robin[1]}
</strong></pre>
<P><STRONG>
But can it be done in one go using some construct?
I am not a shell guru so I wonder if it can be done!
</STRONG></P>
<BLOCKQUOTE>
[Faber]
I must be missing something. If you simply want to print to STDOUT,
try this:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
$( whereis libcrypto | awk '{print $3}' )
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
which will print to STDOUT. If you simply must put it into a variable, then:
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
$robin=$(whereis libcrypto | awk '{print $3}') ; echo $robin
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
is the shortest way <EM>I</EM> know of, but that isn't saying much.
</BLOCKQUOTE>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">I need help, PLEASE!</FONT></H3>
31 May 2003 08:43:04 +0530
<BR>supreet (<a href="mailto:tag@linuxgazette.net?cc=supreet@linux-delhi.org&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%235">supreet from linux-delhi.org</a>)
<BR>With comments by Heather Stern (the Answer Gang's Editor Gal)
<P>
Well if you need dos boot disks. visit www.bootdisk.com.
</P>
<blockquote><font color="#000066">It has nice pointers to many flavors of boot or install disks for the
various mswin, a notable floppy-linux or two, and the correct HOWTO out
of TLDP for finding the major distros' floppy images.
-- Heather</font></blockquote>
<P>
<A HREF="http://www.debian.org/">Debian</A>'s first installer CD can allow access to a prompt, as can several
other distros.
</P>
<blockquote><font color="#000066">Expect to need to press ALT-CTRL-F2 or another F key to
leave the curses or GUI installer page and find a shell, then poke
around mounting up your partition and chroot'ing in.
</font></blockquote>
<blockquote><font color="#000066">Some even allow starting a "rescue shell" tho beware this claimed
feature does not work in all red hat flavors.
-- Heather</font></blockquote>
<P>
Then you can load your boot-loader.
</P>
<P>
Supreet
</P>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Help (Networking)</FONT></H3>
Wed, 9 Jul 2003 13:49:25 +0100 (BST)
<BR>Thomas Adam (<a href="mailto:tag@linuxgazette.net?cc=searchsiva@rediffmail.com&cc=thomas_adam16@yahoo.com&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%236">The <em>LG</em> Weekend Mechanic</a>)
<BR>Question by sivagnanam munusamy (searchsiva from rediffmail.com)
<P><STRONG>
hello sir,
</STRONG></P>
<P><STRONG>
i am sivagnanam and i completed B.E.,(Computer science)in
University of Madras at tamilnadu in India.
</STRONG></P>
<P><STRONG>
i did some projects in Linux platform. i would like to know
about GRUB loader details ,NFS and DHCP.
</STRONG></P>
<P><STRONG>
please help me.
</STRONG></P>
<P><STRONG>
with regards,
<BR>sivagnanam
</STRONG></P>
<P>
Hello Sivgananam,
</P>
<P>
I've forwarded this reply to the Linux Gazette...
</P>
<P>
You have supplied me with VERY little information to go on, but I will try
and help you...
</P>
<P>
GRUB (GRand Unified Bootloader), is a GNU bootloader. It offers an
interactive shell in which to configure it. I actually dislike GRUB
immensly and prefer the defacto "LILO" loader, although many distributions
now use GRUB as their default, alas.
</P>
<P>
The FAQ can be found here:
</P>
<P><BLOCKQuote>
<A HREF="http://www.gnu.org/software/grub/#TOCfaq"
>http://www.gnu.org/software/grub/#TOCfaq</A>
</BLOCKQuote></P>
<P>
I find the config file confusing, and terse (cf: "man tar" - perhaps <EM>the</EM>
heaviest man page of them all).
</P>
<P>
NFS is Network FileSystem, and I use this extensively via PLIP (which is a
Paralell Line IP), which allows you to mount another computer's FS over a
network.
</P>
<P>
DHCP is a means of automagically having a machine assigned an IP address.
</P>
<P>
All of these can be found in the LG KB, at:
</P>
<P><BLOCKQuote>
<A HREF="../tag/kb.html"
>http://www.linuxgazette.net/tag/kb.html</A>
</BLOCKQuote></P>
<P>
-- Thomas Adam
</P>
<blockquote><font color="#000066">By far the most popular reason, in my opinion, is that GRUB takes nice
high resolution pictures, while LILO only handles cruddy resolution of
640x480. Which probably means that its graphics work on more systems,
but gosh, it'd be nice to have the option. If the code costs too much
space though... maybe grub is bigger.
-- Heather</font></blockquote>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Linux Hotplug for Dummies</FONT></H3>
Mon, 12 May 2003 18:57:17 -0400
<BR>Robos (<a href="mailto:tag@linuxgazette.net?cc=dokhebi@earthlink.net&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%238">the <em>LG</em> Answer Gang</a>)
<BR>Question by dokhebi (dokhebi from earthlink.net)
<P><STRONG>
I've tried reading all of the documentation for Linux Hotplug that I can
find, and none of it seems to answer my questions; A lot of it referes
to other documentation that goes off the main topic, and there is nothing that
describes the format of the usb *mapfiles, or how to set up the
auto-mounting of a specific device (in my case a SanDisk Cruzer) What
I really want is a step-by-step configuration guide or a "Linux Hotplug for
Dummies" type of book
</STRONG></P>
<P><STRONG>
Thanks,
</STRONG></P>
<P><STRONG>
Edward Hooper
</STRONG></P>
<!-- sig -->
<P>
Well, can't give you that but you reminded me that I wanted to look into
this myself. Here is what I've found so far:
</P>
<P><BLOCKQuote>
If you plug something into the usb port (that is what most of the time
hotplug is for, in the future firewire and maybe pci hotplug will also come
into the game) the kernel does something and then something else does
something (in the flux, 2.5 is different than 2.4 and I really didn't get it
since it didn't interest me) and then hotplug comes into the game. There are
config files under <TT>/etc/hotplug</TT> (at least thats the place with debian):
usbusb.distmap, usb.rc, usb.agent and usb.handmap.
usb.agent and usb.rc are for hotplug itself and the interesting parts are
distmap and handmap. Dunno for sure what handmap is for (devices where
modprobe doesn't know what to do?), but in distmap are the devices and their
name equivalents in the form idVendor idProduct and so forth. I have a usb
memory stick which gets handled like this:
scsi emulation needs to be there (sd_mod)
usb-core needs to be there (obviously)
usb-storage needs to be loaded (since the stick is storage)
and maybe the right fs modules like vfat, msdos or whatever
then the thing gets mounted like this
mount -t auto <TT>/dev/sda1</TT> <TT>/mnt/usbstick</TT>
</BLOCKQuote></P>
<P>
OK, now to put this into the scripts hotplug can handle:
I searched google and found some german LUG that had written some scripts
already. I adapted this for my use. Here it is.
Save the file as <TT>/etc/hotplug/usb/usb-storage:</TT>
</P>
<p align="center">See attached <tt><a href="misc/tips/usb-storage.sh.txt">usb-storage.sh.txt</a></tt></p>
<P>
Now for a little (newbie-ish) explanation. The set >> thing writes the
variables that get set by the kernel thingy to <TT>/tmp/usb-storage-variables.</TT>
Take a look into that,
</P>
<blockquote><pre>PRODUCT=c76/5/100
</pre></blockquote>
<P>
and
</P>
<blockquote><pre>ACTION=add
</pre></blockquote>
<P>
are important and maybe
</P>
<blockquote><pre>DEVFS=/proc/bus/usb
DEVICE=/proc/bus/usb/001/007
</pre></blockquote>
<P>
too.
</P>
<P>
The echo marks simply where one insert ends and the next starts.
If the variable ACTION is add the next case is triggered which checks if the
product id is c76/5/100. This is my usbstick. Since I want to have this
script also for my girlfriends stick I need to destinguish between them.
If it is my stick ($PRODUCT is c76/5/100) then it gets mounted.
</P>
<P>
If you unplug it the script <EM>should</EM> be run again if I understand it
correctly, but this doesn't seem to happen. ACTION=remove never appears.
</P>
<P>
I want to make it like this later on: a usb-hub connected to our server (in
my apartment-sharing community) where you plug in your usb stick upon
entrance. Then this gets mounted and the other computer you turn on mounts
that from the server and loads e.g. mozillas bookmarks from the stick. If
you trigger a serial mouse button (very handy that they have 3 buttons
mostly - 3 ppl in the community) the corresponding usb stick should then get
unmounted and you can leave the house.
</P>
<P>
Not a book Edward, but I hope sufficient for the beginning.
</P>
<P>
Cheers
Robos
</P>
<HR width="10%" align="center"><P>
He did write me this back. I keep it in the TAG for now, maybe someone knows
something here (although I think most of the ppl here rather like doing
things by hand)
Quote Edward:
</P>
<P><STRONG><BLOCKQuote>
I've been able to scope this much out, but I don't like the idea of hard
coding the device (<TT>/dev/sda1</TT>) because I can't be sure that it will
always be that device. What if this is the second usb-storage device I
plug in? What if I decide to add more SCSI devices (my main system has
an Adaptec AHA-2940UW with 7 devices already) and I don't change the
script? Is there a way to get the device node from the known info? In
other words, is it encoded in <TT>/proc/bus/usb/xxx/yyy</TT> and I can extract
it?
</BLOCKQuote></STRONG></P>
<P>
Well, it says in the docs (linux-hotplug.sf.net or something) that device
info (in $DEVICE) is in 2.5....
</P>
<blockquote><font color="#000066">Now that 2.6 has released, <A
HREF="pranevich.html">The Wonderful World of Linux 2.6</A> in this issue
mentions how hotplug has been improved.
-- Heather</font></blockquote>
<P>
I <EM>think</EM> the <TT>/proc/</TT> stuff can be used for assigning to the right device,
but sort of hard to do with only one stick. Later my flat mate comes back
and I can test with his stick too, then I can tell you more.
</P>
<P><STRONG>
I don't want to say this, but for all of Microsofts many faults, they
can at least auto mount without having to go through all of this shit.
I think it's time for the kernal hackers to wake up and smell the
coffee, because Linux will not be ready for the desktop until it can do
want M$ can do, but better, faster, and cheaper.
</STRONG></P>
<P>
If you rely on the kernel hackers there you are sort of lost. They are
already having fun hacking the kernel, they don't need anything more. And
this is no longer a kernel-space thing: the kernel informs you already where
and what (if we think <TT>/proc</TT> is the right thing) but there are simply not the
userspace tools. The usb-stick phenomenon is just coming up <EM>really</EM> fast
right now ...
</P>
<blockquote><font color="#000066">Actually, this tip escaped proper mention a few months ago, and I dug it
out of storage. However it seems he is correct; flash chips, memory
sticks, and "thumb drives" have become amazingly popular.
-- Heather</font></blockquote>
<P>
...and up to now this wasn't necessary. As for scsi hotplug, this is
simply rare.
</P>
<P>
I will mail later if I figured something out.
</P>
<P>
Cheers
Robos
</P>
<P><STRONG>
Thanks for the info so far,
</STRONG></P>
<P><STRONG>
Edward Hooper
</STRONG></P>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Covert HTML attachments to PDF at mail server</FONT></H3>
Wed, 03 Dec 2003 16:54:38 +0800
<BR>Thomas Adam (<a
href="mailto:tag@linuxgazette.net?cc=linuxoz@yahoo.com.au&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%239">The
<em>LG</em> Weekend Mechanic</a>)
<BR>Question by Steven Lockhart (linuxoz from yahoo.com.au)
<P><STRONG>
For security reasons I would like to convert all incoming mail
attachments from htm/html to pdf.
( a procmail, ghostscript, ripmime, altermime ) or whatever it takes
solution.
</STRONG></P>
<P><STRONG>
I am sure a lot off mail server sysops would love to do this.
</STRONG></P>
<P><STRONG>
Any ideas would be appreciated
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
For security reasons (and sanity reasons for that matter), you should
really be sending all MIME-encoded e-mail to <TT>/dev/null.</TT> It is more likely
that if you were to do a conversion that you'd only be translating spam
into Yet Another Medium (tm), so why bother?
</BLOCKQUOTE>
<blockquote><font color="#000066">Doesn't mean we won't answer him, mind you. I chime in here to warn
that just because HTML to PDF tranlators currently ditch javascript bugs
and various browser-bug exploits, that someday the PDF internal
scripting language may grow fancy enough to do some pretty strange
things. Luckily at the moment, PDF's a pretty nice "destination = paper"
kind of format.
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Thomas]
Yep -- again this depends on which filtering tool you would like to use.
Personally, I find procmail the easiest, but that might not necessarily
suit your needs.
</BLOCKQUOTE>
<P><STRONG>
I am sure a lot off mail server sysops would love to do this.
</STRONG></P>
<BLOCKQUOTE>
Nope, not me. Here's one possible solution (note: not tested).
</BLOCKQUOTE>
<blockquote><pre># Is it html?
:0:
* ^Content-Type:.*html
| html2pdf /some_location/yum.pdf
</pre></blockquote>
<blockquote><font color="#000066">Probably you want to use some tricks to create a reasonable filename
that won't be overwritten constantly (if there's only one, message ID
ought to do, with .pdf tacked on the end) and you might need to use a
MIME decoder to pull off the portion which is the actual HTML portion.
After that, the trick should be usable for other "readable" attachment
types you feel like converting for sanity, e.g. quoted-printable to
your local character set, etc. You'll need to handle each file format
seperately, unless you have a converter that's smart enough to figure
out the filetype on its own.
-- Heather</font></blockquote>
<!-- end 9 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.10"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Securing a dial in?</FONT></H3>
Sat, 28 Jun 2003 22:15:44 -0500 (COT)
<BR>John Karns (<a href="mailto:tag@linuxgazette.net?cc=George_Morgan@sra.com&cc=jkarns@csd.net&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2310">the <em>LG</em> Answer Gang</a>)
<BR>Question by George Morgan (George_Morgan from sra.com)
<P><STRONG>
Hello answer guy,
</STRONG></P>
<P><STRONG>
I need to be able to secure an external modem that has been connect to a
Solaris box to protect against unauthorized calls.. What I mean is that I
want to be able to allow people to connect to the box based purely on the
phone number they are calling from. Is there a way on the modem to only
allow certain calls to go through while rejecting all other calls?
</STRONG></P>
<P>
See the "mgetty" open source pkg (<A HREF="http://alpha.greenie.net/mgetty"
>http://alpha.greenie.net/mgetty</A>).
It offers this capability, provided that your modem line has caller id.
The pkg includes pretty good documentation as well as good example cfg
files.
</P>
<!-- end 10 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.11"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">linux printing</FONT></H3>
Mon, 15 Dec 2003 01:22:56 -0800 (PST)
<BR>Heather Stern (<a
href="mailto:tag@linuxgazette.net?cc=sanjoy_cal@yahoo.com&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2311">The
Answer Gang's Editor Gal</a>)
<BR>sanjoy patra (<a href="mailto:tag@linuxgazette.net?cc=&cc=sanjoy_cal@yahoo.com&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2311">sanjoy_cal from yahoo.com</a>)
<P><STRONG>
i have one redhat 8.0 linux server and hp1200 laser
printer is attached with this.i want print from other
linux box on same network.printer is printing from
server ok and also it is printing from windows m/c on
same lan but it is not printing from any linux box
</STRONG></P>
<BLOCKQUOTE>
[Heather]
First thing, thanks for writing to The Answer Gang.
</BLOCKQUOTE>
<BLOCKQUOTE>
Secondly, you may not be aware of the resource, but there's this great
site about printing support for Linux called linuxprinting.org. You've
gotten you printer working for at least a couple of machines though, so
perhaps you've already been by there. If not, check it out
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
So that leaves the nitty gritty good stuff. I'm guessing the topology
is like this, but if it's different, please describe how things are
really connected:
</BLOCKQUOTE>
<blockquote><pre> printer[hp1200] ==/parallel/== RH8 --------- other linux boxes
samba
|
windows box
</pre></blockquote>
<BLOCKQUOTE>
Usually in order to be a printer client, Linux boxes have to be running
something small to make the connection. lpr with their only printer
pointed at the big RH box as a remote printer, for example.
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
rlpr might be a fast thing to try on one of them.
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
Please advise if you're using CUPS or lprng. While the general answer
(make sure the clients know who the printer is and have the protocol
loaded) is the same, the details of the answer are quite different. And
the docs at <a href="http://linuxprinting.org/">linuxprinting.org</a>
may be handy indeed.
</BLOCKQUOTE>
<!-- end 11 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.12"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Loads of Linux Links</FONT></H3>
Mon, 29 Dec 2003 11:41:25 -0800 (PST)
<BR>Barbara E. Irwin (<a href="mailto:tag@linuxgazette.net?cc=mso@oz.net&cc=beirwin@shaw.ca&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2312">beirwin from shaw.ca</a>)
<P>
I am one of the contributors for the Loads of Linux Links project
(<A HREF="http://loll.sourceforge.net/linux/links/index.html"
>http://loll.sourceforge.net/linux/links/index.html</A>).
</P>
<P>
FYI, this is a GPLed database of 4000+ subject-classified, searchable, and
important Linux and Open Source links for all levels of Linux users. It was
originally a project started for the Victoria Linux Users' Group and is now
hosted by SourceForge.
</P>
<P>
Barbara
</P>
<!-- end 12 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.13"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">How can you find the correct /dev/hd?? for the C: drive</FONT></H3>
Thu, 04 Dec 2003 17:18:39 -0500
<BR>Neil Youngman (<a
href="mailto:tag@linuxgazette.net?cc=michael@commsoftware.net&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2313">The
<em>LG</em> Answer Gang</a>)
<BR>Question by Michael Brusnahan (michael from commsoftware.net)
<P>
Hello
</P>
<P>
The install for mulinux cannot find the download files.
After the boot command there is a message about <TT>/dev/hda?.</TT> My pc has
two hard drives with 4 drive letters C, D, E, F
C, E, F are 2 gig partitions on 1 drive
D is a 4 gig drive
</P>
<P>
The boot command cannot find the C:\mulinux directory with the install
files. It seems the C drive is not <TT>/dev/hda1.</TT> I have tried hda2, hdb1,
hdb2 etc.
</P>
<P>
Would you know how I can find out the correct <TT>/dev/hd??</TT> for the PC?
</P>
<P>
Thanks
</P>
<P>
--
mb
</P>
<BLOCKQUOTE>
[Neil]
Normally it would be <TT>/dev/hda1</TT>, however if it is a scsi disk, it could
be <TT>/dev/sda1.</TT>
</BLOCKQUOTE>
<BLOCKQUOTE><DL><DT>
You may also find an answer at
<DD><A HREF="http://www.tux.org/pub/distributions/tinylinux/mulinux/faq/faq.html"
>http://www.tux.org/pub/distributions/tinylinux/mulinux/faq/faq.html</A>
</DL></BLOCKQUOTE>
<BLOCKQUOTE>
We don't have enough information to give a really helpful answer, see
<A HREF="http://linuxgazette.net/tag/ask-the-gang.html"
>http://linuxgazette.net/tag/ask-the-gang.html</A> for hints on how to help
us help you.
</BLOCKQUOTE>
<!-- end 13 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.14"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Combining multiple PDFs into one</FONT></H3>
Thu, 5 Jun 2003 21:41:52 -0600
<BR>Jason Creighton (<a
href="mailto:tag@linuxgazette.net?cc=androflux@softhome.net&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2314">The
<em>LG</em> Answer Gang</a>)
<P><STRONG><CODE>
#convert ps files to a pdf file
<BR>system $GS, $GS_ARGS, $filelist
<BR>and die "Problem combining files!\n";
</CODE></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
This did not work no way, no how. I kept getting "<TT>/undefinedfilename</TT>"
from GS no matter how I quoted it (and I used every method I found in
the Perl Bookshelf).
</EM></FONT></STRONG></P>
<P><STRONG>
Hm. I didn't try it, but -
</STRONG></P>
<P><STRONG><CODE>
perl -we'$a="ls"; $b="-l"; $c="Docs"; system $a, $b, $c and die "Fooey!\n"'
</CODE></STRONG></P>
<P><STRONG>
That works fine. I wonder what "gs"s hangup was. Oh, well - you got it
going, anyway. I guess there's not much of a security issue in handing
it to "sh -c" instead of execvp()ing it in this case: the perms will
take care of all that.
</STRONG></P>
<P>
The problem is probably that $GS_ARGS and $filelist are both strings with
multiple arguments in them: Since you're calling <TT> system()</TT> with more that one
arg, (bypassing <TT>/bin/sh</TT>) splitting the command line into words is your
responsibility.
</P>
<P><STRONG><FONT COLOR="#000066"><EM>
Oh, <EM>duh</EM>. Thanks, Jason; my brain musta been out on loan that day.
You're right, of course.
</EM></FONT></STRONG></P>
<pre><strong># Convert string to list - TMTOWTDI, of course...
@a = split / /, "$GS -whatever -long -argument -string -follows";
system @a and die "Famine, sword, and fire! - $?\n";
</strong></pre>
<BLOCKQUOTE>
If this isn't quite clear, some help from a handy script might
work:
</BLOCKQUOTE>
<blockquote><pre>#! /usr/bin/env ruby
puts ARGV.inspect
</pre></blockquote>
<BLOCKQUOTE>
(Actually, I could have witten this as "p ARGV", with does the same thing that
I wrote here.)
</BLOCKQUOTE>
<BLOCKQUOTE>
Or, for those of you watching at home who haven't installed Ruby yet:
</BLOCKQUOTE>
<blockquote><pre>#! /usr/bin/env python
import sys
print sys.argv
</pre></blockquote>
<BLOCKQUOTE>
Anyway, here's the script in action: (Actually, this isn't either of those
scripts in action: It's a C version I wrote as a programming exercise. But it
does the same thing.)
</BLOCKQUOTE>
<blockquote><pre>~$ putargs $(date)
[ "putargs", "Thu", "Jun", "5", "21:23:14", "MDT", "2003" ]
~$ putargs "$(date)"
[ "putargs", "Thu Jun 5 21:23:17 MDT 2003" ]
~$ putargs ls filename with spaces
[ "putargs", "ls", "filename", "with", "spaces" ]
~$ putargs ls 'filename with spaces'
[ "putargs", "ls", "filename with spaces" ]
~$ ls filename with spaces
ls: filename: No such file or directory
ls: with: No such file or directory
ls: spaces: No such file or directory
~$ ls 'filename with spaces'
ls: filename with spaces: No such file or directory
</pre></blockquote>
<BLOCKQUOTE>
You see? The caller of a program does the splitting. And that means that if
you want to call other programs, you have to do it too, or else your script
will crash if somebody tries to use it on a filename with a character in it
that the shell considers special, like a space or a star, because <TT> system()</TT>
with one arg is calling <TT>/bin/sh</TT> behind your back.
</BLOCKQUOTE>
<BLOCKQUOTE>
So that's the main reason for bypassing <TT>/bin/sh:</TT> It gives you more flexibility
with filenames: The "security risk" Ben keeps warning everyone about isn't,
IMO, really the issue. It's just good style not to leave that sort of thing to
the shell. <EM>Especially</EM> if your program is setuid/setgid.
</BLOCKQUOTE>
<BLOCKQUOTE>
Jason Creighton
</BLOCKQUOTE>
<!-- end 14 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">what is "no"? (missing prog for binutils compile)</FONT></H3>
Thu, 29 May 2003 15:53:14 -0700
<BR>Faber Fedor, Karl-Heinz Herrmann (<a
href="mailto:tag@linuxgazette.net?subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2315">the
<em>LG</em> Answer Gang</a>)
<BR>Question by Jim Dennis (the <em>LG</em> Answer Guy)
<br>with note by Alan Modra (binutils developer)
<P><STRONG>
[K.-H.]
Now -- it's an unbearable situation that my Linux doesn't know "no".... But
I've no idea what it is and you can imagine that a google for "no" even with
linux and some other keywords around are not very helpful.
</STRONG></P>
<P><STRONG>
Any ideas?
</STRONG></P>
<BLOCKQUOTE>
[Faber]
Maybe it's called "nein" on your computer? <grvf>
</BLOCKQUOTE>
<BLOCKQUOTE>
I can't find a "no" on my <A HREF="http://www.redhat.com/">Red Hat</A> 8 box either.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
I think <TT>/usr/bin/no</TT> was (would be) a counterpart to the old
<TT>/usr/bin/yes</TT> command:
</BLOCKQUOTE>
<p align="center">See attached <tt><a href="misc/tips/no.sh.txt">no.sh.txt</a></tt></p>
<BLOCKQUOTE>
... so "no" could just be an alias or script that calls <TT>/usr/bin/yes</TT>
with the "no" argument:
</BLOCKQUOTE>
<blockquote><pre> /usr/bin/yes no
</pre></blockquote>
<BLOCKQUOTE>
I realize this sounds silly and stupid, and April 1st is long past for
this year. But I'm not kidding. That Makefile (or whatever) seems to
actually want to pipe an endless stream of "n" or "no" lines into some
other process. (<TT>/usr/bin/yes</TT> was traditionally used in a pipeline with
fsck to automate the process of repairing a filesystem that need lots
of work -- then they just added the -y option to the GNU/Linux versions
of fsck.
</BLOCKQUOTE>
<P><STRONG>
[K.-H.]
I put the question up with bugreports for binutils and got:
</STRONG></P>
<BLOCKQUOTE><BLOCKQuote>
[Alan Modra]
<TT>/bin/sh:</TT> no: command not found
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
This is a result of binutils being stuck on using old buggy autoconf.
Install a new version of GNU gettext, or configure with --disable-nls.
</BLOCKQUOTE>
<BLOCKQUOTE>
[K.-H.]
Got a new gettext which includes some "no"'s
</BLOCKQUOTE>
<blockquote><pre>khh > find ./ -name "no*"
./gettext-runtime/po/no.po
./gettext-runtime/po/no.gmo
./gettext-tools/po/no.po
./gettext-tools/po/no.gmo
</pre></blockquote>
<BLOCKQUOTE>
unfortunately with a new gettext (gettext-0.12.1.tar.gz) and nls enabled I
get a linker error for some gettext symbol. The solution without nls works
for getting binutils compiled.
</BLOCKQUOTE>
<BLOCKQUOTE>
K.-H.
</BLOCKQUOTE>
<blockquote><font color="#000066">He said he'd try it on the new kernels too, but we're not sure what his
results were.
-- Heather</font></blockquote>
<!-- end 15 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.16"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Odd Behavior When First Launching Netscape Version 4.80</FONT></H3>
Sat, 7 Jun 2003 15:33:49 -0500
<BR>Chris Gianakopoulos (<a
href="mailto:tag@linuxgazette.net?subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2316">The
<em>LG</em> Answer Gang</a>)
<P>
Hello Gang,
</P>
<P>
I am now running the <A HREF="http://www.suse.com/">SuSE</A> 8.2 Linux distribution on my main system. I
use Netscape 4.80 for browsing my machine (locally) using <A HREF="http://www.apache.org/">Apache</A> 1.3.27.
</P>
<P>
When first launching Netscape, followed by pressing the "Home" button, I
would get a message indicating that a connection was being established to
localhost. I would wait for a long time, cancel the connection attempt,
try connecting to my host name (saturn in this case), and then connect to
local host. Then the connection occurred immediately.
</P>
<P>
I searched the Web and found that something called asyncronous domain
lookups are automatically enabled in Netscape 4.80 by default. Disabling
this feature fixes my problem. Here is what I did.
</P>
<P>
edit the file, <TT>/usr/X11R6/bin/communicator</TT>, and place the following line
in the file:
</P>
<blockquote><pre>export MOZILLA_NO_ASYNC_DNS=True
</pre></blockquote>
<P>
I changed the environment variable in the above file rather than my .bashrc
because I wanted this to take effect systemwide (and via the various tool
buttons associated with my window manager).
</P>
<P>
So, this might be taken as a 2 cent tip.
</P>
<P>
Regards,
<BR>Chris Gianakopoulos
</P>
<!-- end 16 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.17"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">searching PDFs made from faxes</FONT></H3>
Tue, 01 Jul 2003 22:25:52 +0200 (CEST)
<BR>Karl-Heinz Herrmann (<a
href="mailto:tag@linuxgazette.net?subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2317">The
<em>LG</em> Answer Gang</a>)
<P><STRONG>
Is anyone aware of a way to search PDF files that were created from
faxes, e.g. tiff files?
</STRONG></P>
<P><STRONG>
I'm guessing that OCR has to be utilized here, right? I've come across
things like pdftotext, but the fact that the PDF started life as a TIFF
is, I think, a complication.
</STRONG></P>
<P><STRONG>
For the record, I'm putting together a fax server solution for a client.
The ability to search the faxes for text strings would be killer.
</STRONG></P>
<P>
your guess is quite right -- if the pdf contains only a large graphic and no
actual text you would need ocr. gocr:
<A HREF="http://jOCR.sourceforge.net"
>http://jOCR.sourceforge.net</A>
</P>
<P><DL><DT>
or claraocr:
<DD><A HREF="http://www.claraocr.org"
>http://www.claraocr.org</A>
</DL></P>
<P>
...might come in handy (gocr
seems already trained while clara ocr is a quite different method). gocr
produced reasonable results for me already 1 or 2 years back. BUT: I had
clean 300dpi scans. From a jagged looking Fax..... I guess you are facing
serious problems.
</P>
<P>
K.-H.
</P>
<!-- end 17 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.18"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">PerlHoo rocks</FONT></H3>
Thu, 11 Dec 2003 15:07:49 -0800
<BR>Rick Moen (<a href="mailto:tag@linuxgazette.net?cc=rick@linuxmafia.com&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2318">the <em>LG</em> Answer Gang</a>)
<P><STRONG>
Some folks will have noticed me referring people to flat ASCII files
I've squirreled away over the years on my Web server, usually inside
<A HREF="http://linuxmafia.com/~rick/linux-info"
>http://linuxmafia.com/~rick/linux-info</A> . While useful, this collection
has always been (1) butt-ugly and (2) disorganised.
</STRONG></P>
<P><STRONG>
I've long realised I needed some sort of proper Web framework for all
that material, and Rob Tougher's work updating the Gazette's HTML showed
me how much improvement the addition of cascading stylesheets (CSS) can
bring with only modest effort[1]. All of these thoughts came together
when I ran across PerlHoo, a Yahoo-like Web directory system implemented
in two simple Perl CGI scripts.
</STRONG></P>
<P><STRONG>
Please see: Description by author Jonathan Eisenzopf <<A HREF="mailto:eisen@pobox.com"
>eisen@pobox.com</A>>
in his series of three articles at Mother of Perl,
<A HREF="http://www.webreference.com/perl/tutorial"
>http://www.webreference.com/perl/tutorial</A> (recommended reading).
</STRONG></P>
<P><STRONG>
PerlHoo is simple, malleable, lightweight, fast (up to some thousands of
documents per directory), and can point to URLs on or off your system.
Its design limitations are:
</STRONG></P>
<p><Strong><ul>
<LI>No database support. Scaling limited by use of system directory
trees as a data store.
<LI>No searching.
<LI>No multiuser controls or contents versioning / rollback.
</ul></Strong></p>
<P><STRONG>
If you need those things, there's a follow-on called PHPhoo.
Personally, neither wanted nor needed them, and PerlHoo's exactly right
for my needs.
</STRONG></P>
<P><STRONG>
There were two minor problems with Eisenzopf's design, as I found it
in his most-recent (v. 1.1) tarball:
</STRONG></P>
<p><Strong><ol>
<LI>Sucky URLs. PerlHoo indexes show up at CGI-synthesised virtual
directory locations, e.g., <A HREF="http://linuxmafia.com/cgi-bin/perlhoo.pl/Apps"
>http://linuxmafia.com/cgi-bin/perlhoo.pl/Apps</A>
for the Apps directory of PerlHoo's document tree. Finding a way to
substitute something shorter for the "cgi-bin/perloo.pl" portion of
those URLs would fix several things at once:
</ol></Strong></p>
<p><Strong><ul>
<LI>Simpler, easier-to-remember paths.
<LI>Security-through-obscurity benefit of not advertising your
use of a CGI script that might be attackable.
<LI>Greater Google-friendliness. (Google seems not to index as
enthusiastically trees that give signs of being CGI-generated.)
</ul></Strong></p>
<P><STRONG>
Fixing this required use of <A HREF="http://www.apache.org/">Apache</A> mod_rewrite to make the undesirable
patch element disappear, and a tiny bit of surgery on PerlHoo itself.
</STRONG></P>
<p><Strong><ol>
<LI>Outdated and somewhat broken HTML. Eisenzopf's CGI-generated
pages lack SGML DTDs, closing "body" and "html" tags, and the required
"ul" pair to go with its use of "li" elements. The page relies upon
setting specific colours by their hexadecimal identities, rather than
using CSS. It also incorrectly used a nested "p" and "h3" structure
to attempt physical markup. I've fixed all of these things, so that
pages generated by perlhoo.pl are now CSS-oriented and pass the W3C
validator as HTML 4.01 Transitional.
</ol></Strong></p>
<P><STRONG>
Just so other people don't have to reinvent those particular wheels,
I've posted my modified and documented version of PerlHoo at
<A HREF="http://linuxmafia.com/pub/linux/apps/"
>http://linuxmafia.com/pub/linux/apps/</A> .
The tarball includes
full instructions on how to configure Apache, including mod_write .
</STRONG></P>
<P><STRONG>
My PerlHoo instance, "Linuxmafia Knowledgebase", can now be found at
<A HREF="http://linuxmafia.com/kb"
>http://linuxmafia.com/kb</A> .
</STRONG></P>
<P><STRONG>
To answer the other obvious question: Why, yes, of course I've gotten
Ben Okopnik hooked. I'm no dummy! Ben says he's hacked PerlHoo
separately to support individual stylesheets for each directory of
PerlHoo's index, but I've not yet seen the results.
</STRONG></P>
<P><STRONG>
[1] One difference being that Rob has graphical design talent. I'm
certainly not trying to denigrate Rob's excellent work.
</STRONG></P>
<!-- end 18 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.19"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">previewing and printing text files</FONT></H3>
Tue, 17 Jun 2003 20:59:45 -0400
<BR>Ben Okopnik (<a href="mailto:tag@linuxgazette.net?subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2319"><em>LG</em> Answer Gang</a>)
<P>
There are lots of times when I want to print a text file but don't want
to do it in the Default Ugly Courier font, or want to shrink, say, a
page and a half down to a single page - and word processors are just too
much bother for a simple font/size tweak. Here's a script that lets you
pick font/size combinations until you're satisfied with what you see,
although the fonts are restricted to the AFM types that come with
"enscript" (40 options, more can be added.) I find them to be more than
adequate for my purposes.
</P>
<p align="center">See attached <tt><a href="misc/tips/preview.bash.txt">preview.bash.txt</a></tt></p>
<P>
Ben Okopnik
</P>
<!-- end 19 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.20"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">If you can scare your OS tell someone who can fix it</FONT></H3>
Sat, 20 Dec 2003 09:54:00 -0500
<BR>Ben Okopnik (<a href="mailto:tag@linuxgazette.net?cc=&cc=ben@callahans.org&subject=%20Re%3A%20%5BLG%2098%5D%202c%20Tips%20%2320">the <em>LG</em> Answer Gang</a>)
<!-- ::
If you can scare your OS tell someone who can fix it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
Here is a non emergency head scratcher for you.
</STRONG></P>
<P><STRONG>
I was wondering if anyone has any experience with the Sandisk 256mb
USB flash drive and Linux. I got the drive to work once, and ever
since it causes a kernel panic. This is not limited by distributions
or hardware, as I have had it work once on a gateway laptop, then ever
after it would crash any linux machine I plugged it into.
</STRONG></P>
<P>
That's pretty impressive, in a bad way.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> As you know, it's usually
pretty hard to crash Linux. On the other hand, USB is a special case -
for my money, all of its related problems come from the fact that it
brings user-space uncomfortably close to what was always a root-priv
operation (hardware usage, control over ports, etc.) One of the major
reasons for that separation has always been the security truism of
"physical access equals root access" - and with USB, all our noses are
being rubbed in that lesson. However, everybody seems to desperately
want the stuff, so...
</P>
<P>
(USB <EM>is</EM> a nifty technical hack, and serial <EM>is</EM> way outdated - but
giving the average user the ability to effectively fiddle with the guts
of the machine is Not A Good Idea, IMO. Ditto PCMCIA - and note that
there were a few years when it had pretty much the same problems that
USB is going through now. Surprise, surprise...)
</P>
<P>
Not that I don't think it's possible to get it right, mind you; it's
just going to take a bit of finer slicing and dicing than (in my
opinion) we've managed so far... USB under Linux is still highly fragile,
although it can mostly be made to work. Note that I'm talking about the
stuff out on the bleeding edge, things that most people don't use: the
more common run of things (printers, mice, keyboards, etc.) is pretty
stable at this point.
</P>
<P>
However, there are people out there trying to resolve this fragility,
and achieving measurable gains. The important part here is that they
need <EM>your</EM> help - that is, the help of anyone who runs into a problem
with USB. They particularly (I'm projecting, but with a reasonable
degree of certainty) love to hear from folks like you, who have found
what I call a "reliable problem" - this is the core of what makes Linux
work, and why it is generally as bug-free as it has a reputation for.
You have a problem, notify the maintainers about it, they fix the
problem, you give them feedback - and that problem is gone. Repeat until
the code is washed sparkling-clean, and <EM>that</EM> chunk of Linux is
bullet-proof.
</P>
<P>
<EM>SO</EM>, to wrap up this long-winded expository, <EM>please</EM> report this
problem to the appropriate maintainer. You can save a bit of time, and
ease their work tremendously, by running "ksymoops" with the copy of
"<TT>/var/log/kern.log</TT>" that contains the "Oops" from the crash and the
current copy of "<TT>/var/log/ksymoops/[whatever].ksyms</TT>", and sending them
the results - or at least including those two files in the problem
report.
</P>
<P><STRONG>
As I said, this is a general question, I recommend not using Sandisk
to my Linux using companions.
</STRONG></P>
<P>
I think it would be better all around if you were to help the
maintainers resolve the problem instead.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<!-- end 20 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>This page edited and maintained by the Editors of <I>Linux Gazette</I><br>HTML script maintained by <A HREF="mailto:star@starshine.org">Heather Stern</a> of Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A></H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
</p>
<!-- *** BEGIN author bio *** -->
<P>
<P>
<!-- *** END author bio *** -->
<div id="articlefooter">
<p>
Copyright © 2004, . Copying license
<a href="http://linuxgazette.net/copying.html">http://linuxgazette.net/copying.html</a>
</p>
<p>
Published in Issue 98 of Linux Gazette, January 2004
</p>
</div>
<div id="previousnextbottom">
<A HREF="lg_mail.html" ><-- prev</A> | <A HREF="lg_answer.html" >next --></A>
</div>
</div>
<div id="navigation">
<a href="../index.html">Home</a>
<a href="../faq/index.html">FAQ</a>
<a href="../lg_index.html">Site Map</a>
<a href="../mirrors.html">Mirrors</a>
<a href="../mirrors.html">Translations</a>
<a href="../search.html">Search</a>
<a href="../archives.html">Archives</a>
<a href="../authors/index.html">Authors</a>
<a href="../contact.html">Contact Us</a>
</div>
<div id="breadcrumbs">
<a href="../index.html">Home</a> >
<a href="index.html">January 2004 (#98)</a> >
Article
</div>
<img src="../gx/2003/sit3-shine.7-2.gif" id="tux" alt="Tux"/>
</body>
</html>
|