Copyright (C) 2000-2001 by Steve Litt, All rights reserved. Material = provided=20 as-is, use at your own risk. =20
perl -e 'foreach $x =
(32..126){print "_" . chr($x) . " " . $x . "\n"}' | grep =
'_\$'To=20
find the ascii code for a specific character (other than the space =
character,=20
use $ in this example), do this: perl -e 'foreach $x =
(32..126){print "_" . chr($x) . " " . $x . "\n"}' | grep =
'_\$'Normal=20
characters don't need and can't use the backslash, so to find the asci =
value of=20
lower case 'd' you'd do this: perl -e 'foreach $x (32..126){print =
"_" . chr($x) . " " . $x . "\n"}' | grep '_d'
To find the character corresponding to an ascii value, do this =
(example=20
uses 100 as the ascii value):
perl -e 'foreach $x (32..126){print =
"_" . chr($x) . " " . $x . "\n"}' | grep ' 100'
man ls | col -bx > myfile.txtThe preceding command = writes the man=20 page to myfile.txt, without backspaces (the -b) and with spaces = substituted for=20 tabs (-x).=20
#!/usr/bin/perl -w
#PUBLIC DOMAIN, NO WARRANTEE, AUTHOR AND DISTRIBUTORS NOT RESPONSIBLE =
FOR
#ANY DAMAGE CAUSED BY THIS PROGRAM OR ITS DEFECTS. USE AT YOUR OWN RISK!
# UCITA STINKS!
use strict;
my($cmd);
sub GetData()
{
my($line);
read(STDIN,$line,$ENV{"CONTENT_LENGTH"});
if($line =~ m/Tman=(.*)&Bsub/)
{
$cmd = $1;
}
elsif($line =~ m/Tman=(.*)$/)
{
$cmd = $1;
}
else
{
$cmd = "InternalError";
}
}
sub MakePageTop()
{
print "Content-type: text/html\n\n";
print "<html><head><title>Man Page =
Displayer</title></head><body>\n";
print =
"<center><big><big><big><strong>\n";
print "Man Page Displayer<p>\n";
print =
"</strong></big></big></big></center>\n";
}
sub MakeForm()
{
print "<FORM ACTION=\"./mann.cgi\" METHOD=\"POST\">\n";
print "<b>Command to look up:\n";
print "<input type=\"text\" name=\"Tman\" size=\"24\"";
print " value=\"$cmd\"></b>\n";
print "<INPUT type=\"submit\" name=\"Bsub\" =
value=\"Submit\">\n";
print "</form>";
}
sub MakeManPage()
{
print "<pre><b>";
print `man $cmd -a | col -bx`;
print "\n</b></pre>";
}
sub MakePageBottom()
{
print "</body></html>\n";
}
sub main()
{
GetData();
MakePageTop();
MakeForm();
MakeManPage();
MakePageBottom();
}
main(); |
if [ -e $file ]; then ./myUtil $file fi=20
| TEST | MEANING |
| [ -b $file ] | True if file exists and is block special. |
| [ -c $file ] | True if file exists and is character special. |
| [ -d $file ] | True if file exists and is a directory. |
| [ -e $file ] | True if file exists. |
| [ -f $file ] | True if file exists and is a regular file. |
| [ -g $file ] | True if file exists and is set-group-id. |
| [ -k $file ] | True if file has its ``sticky'' bit set. |
| [ -L $file ] | True if file exists and is a symbolic link. |
| [ -p $file ] | True if file exists and is a named pipe. |
| [ -r $file ] | True if file exists and is readable. |
| [ -s $file ] | True if file exists and has a size greater than = zero. |
| [ -S $file ] | True if file exists and is a socket. |
| [ -t $fd ] | True if fd is opened on a terminal. |
| [ -u $file ] | True if file exists and its set-user-id bit is = set. |
| [ -w $file ] | True if file exists and is writable. |
| [ -x $file ] | True if file exists and is executable. |
| [ -O $file ] | True if file exists and is owned by the effective user=20 id. |
| [ -G $file ] | True if file exists and is owned by the effective group=20 id. |
du -sm $(find $1 -type d -maxdepth 1 -xdev) | sort = -g |
The preceding shellscript prints every directory below the one called = as an=20 argument, together with its size, sorted with the largest at the bottom. = We sort=20 largest at bottom so there's no necessity to pipe it to less. = Instead,=20 you can see the largest 24 on the screen after the command.=20
If you find a large tree, but can't delete the whole thing, you can = explore=20 just that tree by using its directory as the argument, and you'll see = all its=20 subtrees and how much space they take.=20
But let's say you want to see ALL directories in the tree, instantly =
zeroing=20
in on big diskspace directories. Make the following shellscript, which I =
call=20
alldirsizes:
=20
find $1 -type d | xargs du -sm | sort = -g |
Both these scripts do more than just add filesizes. They take into = account=20 inodes, so they reveal the space that would be recovered if the = directories were=20 deleted.=20
Both of these scripts are most accurate when run as root, but they're = pretty=20 informative run as just a normal user.=20
X-Sender: = slitt@207.171.0.150 X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Fri, 24 Nov 2000 11:59:15 -0500 To: leaplist@lists.leap-cf.org From: Steve Litt <slitt@troubleshooters.com> Subject: [LeapList] Cups tips Reply-To: leaplist@lists.leap-cf.org Sender: leaplist-admin@lists.leap-cf.org X-Mailman-Version: 1.0rc2 List-Id: General Linux Discussion List for LEAP = <leaplist.lists.leap-cf.org> X-BeenThere: leaplist@lists.leap-cf.org On my mandrake 72 I noticed that using lpr to print a text file was printing too close to the left and cutting off half the first character. This is a cups system. So I looked at http://localhost:631, which is the cups equivalent of = swat. It pointed me to a cups manual, which noted that the lpr command can be used to change margins: lpr -o page-left=24 /etc/smb.conf The preceding prints smb.conf with a left margin of 1/3 inch (24/72). = There are a smorgasbord of options for duplexing, characters per inch, page ranges (and isn't that nice when a .ps or .pcl file jams in the middle), and tons of other stuff. However, I couldn't make the brightness setting work right, as when I made the text darker, the background on the last = page turned dark. By the way, I'm sure there's some place where I can make the page-left default 24 points, but I just haven't found it yet. SteveT
Many people think the fix is to boost the acceleration. That makes = the mouse=20 fast enough, but requires you to move the mouse quickly to traverse = large=20 distances, then slowly to zero in on the exact target. With an overly = large=20 (like 5) acceleration, mousing resembles golf -- one or two drives = followed by a=20 couple of putts. Not good for productivity.=20
The problem isn't accelleration. The problem is that the pointer =
moves too=20
few pixels per inch of mouse travel. You should be able to move a good =
600=20
pixels per inch of mouse travel, not the ~200 provided by a default =
Linux box.=20
The solution is to add a resolution option to the pointer =
section of=20
/etc/XFConfig86-4 file, as shown below:
=20
# ************************************************** # Pointer section # ************************************************** Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "imps/2" Option "ZAxisMapping" "4 5" Option "Device" = "/dev/psaux" Option "Emulate3Timeout" "50" Option "Resolution" "1600" # ChordMiddle is an option for some 3-button Logitech mice # Option "ChordMiddle" EndSection |
You'll notice I use 1600 for the resolution. That's above the = maximum, so it=20 produces the maximum resolution. The preceding is for my Logitech = optical mouse,=20 but the Option "Resolution" "1600" line is appropriate for = pretty much=20 any mouse, although it's conceivable that for some mice you might want = to go=20 higher or lower than 1600.=20
After making the preceding addition, you must restart X to see the = result.=20
Once you've upped the resolution, you can tweak the accelleration. = Once I've=20 fixed the resolution, I like an acceleration value of 2. Here's the = command to=20 get it:
xset m 2 1To get a 3 to 1 acceleration, use this: =
xset m 3 1To make your mousing experience even better, use a = teflon=20 covered mouse pad. It's well worth the extra money.=20
Although technically trivial, the human-mouse interaction plays a =
major role=20
in the perceived quality of the computer experience. Don't shortchange =
yourself.=20
Tweak your mouse to your liking.
=20
/usr/bin/loadkeys = /usr/lib/kbd/keymaps/i386/qwerty/uk.kmap.gzTo this:=20
/usr/bin/loadkeys = /usr/lib/kbd/keymaps/i386/qwerty/us.kmap.gzI=20 changed uk to us, thereby enabling configuring for my keyboard.=20
Second, I use Lynx to dial and disconnect Smoothwall. Konqueror = doesn't work=20 with Smoothwall as of this writing, and Netscape is much too bloated. = But=20 Smoothwall 0.9.8 places 13 links, known as "the menu", before the dial = button,=20 meaning to get to the dial button in Lynx I need to press Tab 14 times. = I=20 removed the 13 links with the following change:=20
Change the following line of /home/httpd/cgi-bin/index.cgi: =
&openpage($tr{'main page'}, 1, $refresh);To the =
following: &openpage($tr{'main page'}, 0, $refresh);The =
second argument of=20
openpage() defines whether or not to show the "menu", which is =
the 13=20
links appearing at the top. Because these same links are reproduced =
below the=20
dial, disconnect and refresh buttons of the main page, they can safely =
be=20
removed on the main page. Of course, they must be preserved on other =
pages, as=20
they're the main form of navigation from those pages. To record a song from the microphone, just do this:
$ rec = mysong.auIf you want to change the volume, use -v, which is a=20 float where >1.0 amplifies, and <1.0 attenuates. Note our hearing = is=20 logrithmic.
$ rec -v2 mysong.auTo play it back, do this: =
$ play mysong.auTo convert it to a .wav, do this:
$ sox = mysong.au mysong.wavSox can also amplify, flanger, phaser,=20 echo, and various other effects. See man sox.=20