Copyright (C) 2000-2013 by Steve Litt, All rights reserved. Material provided as-is, use at your own risk.
perl -e 'foreach $x (32..126){print "_" . chr($x) . " " . $x . "\n"}' | grep '_\$'
To find the ascii code for a specific character (other than the space character,
use $ in this example), do this:
perl -e 'foreach $x (32..126){print "_" . chr($x) . " " . $x . "\n"}' | grep '_\$'
Normal characters don't need and can't use the backslash, so to find the
asci value of 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 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 page to myfile.txt, without backspaces (the -b) and with spaces substituted for tabs (-x).
#!/usr/bin/perl -w |
if [ -e $file ]; then
./myUtil $file
fi
| 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 id. |
| [ -G $file ] | True if file exists and is owned by the effective group id. |
du -sm $(find $1 -type d -maxdepth 1 -xdev) | sort -g |
The preceding shellscript prints every directory below the one called as an argument, together with its size, sorted with the largest at the bottom. We sort largest at bottom so there's no necessity to pipe it toless. Instead, you can see the largest 24 on the screen after the command.
If you find a large tree, but can't delete the whole thing, you can explore just that tree by using its directory as the argument, and you'll see all its subtrees and how much space they take.
But let's say you want to see ALL directories in the tree, instantly zeroing
in on big diskspace directories. Make the following shellscript, which I call
alldirsizes:
find $1 -type d | xargs du -sm | sort -g |
Both these scripts do more than just add filesizes. They take into account inodes, so they reveal the space that would be recovered if the directories were deleted.
Both of these scripts are most accurate when run as root, but they're pretty informative run as just a normal user.
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 <Steve Litt's email address>
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 fast enough, but requires you to move the mouse quickly to traverse large distances, then slowly to zero in on the exact target. With an overly large (like 5) acceleration, mousing resembles golf -- one or two drives followed by a couple of putts. Not good for productivity.
The problem isn't accelleration. The problem is that the pointer moves
too few pixels per inch of mouse travel. You should be able to move a good
600 pixels per inch of mouse travel, not the ~200 provided by a default Linux
box. The solution is to add a resolution option to the pointer section
of /etc/XFConfig86-4 file, as shown below:
# ************************************************** |
You'll notice I use 1600 for the resolution. That's above the maximum, so it produces the maximum resolution. The preceding is for my Logitech optical mouse, but the Option "Resolution" "1600" line is appropriate for pretty much any mouse, although it's conceivable that for some mice you might want to go higher or lower than 1600.
After making the preceding addition, you must restart X to see the result.
Once you've upped the resolution, you can tweak the accelleration. Once I've fixed the resolution, I like an acceleration value of 2. Here's the command to 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 covered mouse pad. It's well worth the extra money.
Although technically trivial, the human-mouse interaction plays a major role in the perceived quality of the computer experience. Don't shortchange yourself. Tweak your mouse to your liking.
To record a song from the microphone, just do this:
$ rec mysong.auIf you want to change the volume, use -v, which is a float where >1.0 amplifies, and <1.0 attenuates. Note our hearing is 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, echo, and various other effects. See man sox.
[slitt@mydesk slitt]$ /sbin/fuser -mu /dYou get the owner and the process ID. From there you can research usingps ax.
/d: 1693(slitt) 1891c(slitt) 1894 1894c(slitt)
1907 1907c(slitt) 1908 1908c(slitt) 1909 1909c(slitt)
1910 1910c(slitt) 1912 1912c(slitt) 1913 1913c(slitt)
[slitt@mydesk slitt]$
Be sure to look at the fuser man page for details on other info
you can obtain. You can even kill all processes accessing a file, though I
highly recommend against such a heavy handed move.
S6=4Register S6 determines the delay before checking for dialtone. By instituting a 4 second delay, by the time you check for a dialtone all the beeps will be gone. If 4 seconds isn't enough, try 10, and then trim it down from there.
| Code |
Function |
| M0 |
Modem speaker always off |
| M1 |
Modem speaker on during dial and handshake |
| M2 |
Modem speaker on always |
| M3 |
Modem speaker on during handshake |
| L codes, if present, should follow M codes |
|
| L1 |
Modem speaker soft |
| L2 |
Modem speaker moderate |
| L3 |
Modem speaker loud |
ssh slitt@source 'tar -cz /home/slitt/mytree' | tar -xzpThe p on the end of the extraction tar means "preserve permissions". The preceding places the home/slitt/mytree into the current directory, so you'll need to move mytree where you need it and delete the rest of the tree. To avoid that hassle and put mytree right into the current directory, use the -C option:
ssh slitt@source 'tar -C /home/slitt -cz mytree' | tar -xzpNotice that everything within the singlequotes is performed on the remote computer, and everything after the last quote is performed on the local computer. The ssh program, when running a command, outputs the remote command's stdout on the local computer, so that data can be piped to local processes, which is what we're doing here.
ssh slitt@source 'tar -C /home/slitt -cz mytree' | tar -xzp --same-ownerIn my opinion, unless space is too tight to maintain both the .tgz and the extracted tree on the destination computer, this is better done as a three stage process:
ssh slitt@source 'tar -C /home/slitt -cz mytree' > /spare_directory/mytree.tgzThe first command creates a tarball, on the local computer, from the tree on the remote computer. The second command checks what's in the tarball, so if there's something wrong you can quit rather than possibly overwriting something valuable. The third command extracts the tarball to the current directory. Once again, the only real disadvantage of this is that you must have room for both the tarball and the extracted tree.
tar -tzp --same-owner -f /spare_directory/mytree.tgz
tar -xzp --same-owner -f /spare_directory/mytree.tgz
rxvt -fn font_aliasThe only trouble is, how do you find the font alias? That's contained in a file called fonts.alias. You find that file with locate command:
locate fonts.aliasWhen you look inside that file, each line has an alias followed by a space followed by a complete file specification, as shown in the following example from my computer:
lucidasanstypewriter-12 -b&h-lucidatypewriter-medium-r-normal-sans-12-120-75-75-m-70-iso8859-1So in the preceding, the alias is lucidasanstypewriter-12. So your rxvt command would be as follows for this font:
rxvt -fn lucidasanstypewriter-12
start on runlevel 2Be very, very careful to get the right directory for the svscanboot command or it will silently fail and give you all sorts of trouble.
start on runlevel 3
start on runlevel 4
start on runlevel 5
stop on shutdown
respawn
exec /command/svscanboot
slitt@mydesk:~$ perl -MMIME::Base64 -e 'print encode_base64("myname\@mydomain.com")'
bXluYW1lQG15ZG9tYWluLmNvbQ==
slitt@mydesk:~$ perl -MMIME::Base64 -e 'print encode_base64("mypassword")'
bXlwYXNzd29yZA==
slitt@mydesk:~$
I'm going to use on port 26 as per the webhost.slitt@mydesk:~$ telnet mail.myisp.com 26
Trying 69.189.108.200...
Connected to myisp.com.
Escape character is '^]'.
220-mail2.myisp.com ESMTP Exim 4.76 #1 Wed, 11 Jan 2012 03:10:32 -0700
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
ehlo
250-mail2.myisp.com Hello [97.100.37.206]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
auth login
334 VXNlcm5hbWU6
bXluYW1lQG15ZG9tYWluLmNvbQ==
334 UGFzc3dvcmQ6
bXlwYXNzd29yZA==
235 Authentication succeeded
mail from: myusername@mydomain.com
250 OK
rcpt to: myusername@mydomain.com
250 Accepted
data
354 Enter message, ending with "." on a line by itself
Here I stand.
.
550 Administrative prohibition
/set irc_conf_mode 1
This can be put in $HOME/.xchat2/xchat.conf:irc_conf_mode = 1There's probably already a value for irc_conf_mode in the config file, so be sure to find it and change its value -- don't put in a second key.