- Firefox - A couple of tips for Firefox.
- Multiple concurrent downloads. You need to open
about:config and look for this property
network.http.max-persistent-connections-per-server. Change
the value from 2 to 6, for example.
- puttycyg - Use PuTTy as a Cygwin terminal.
- Go to get the latest release here.
- Unzip the archive and put the directory anywhere you want.
- In that directory, right click putty.exe and click "Create
Shortcut".
- Rename shortcut to something like "Cygwin".
- Right click the shortcut and click "Properties".
- Change value of "Start in:" to where you installed cygwin, usually
"C:\cygwin\bin"
- Add " -cygterm -" (ignore quotes) to the end of "Target:"
- Move shortcut to where ever you want.
- sed examples - Here are some examples of sed that I like to use.
-
Finds all the files with scinew in it and replaces scinew with sci creating a
backup file with .scinew-bak on the tail
find . -type f | xargs grep -Il scinew | xargs sed 's/scinew/sci/' -i.scinew-bak
-
Same as above, but BSD sed (found on the Mac) has a couple of differences. The
command needs to be prefaced by -e and the inplace extension is
separated with a space from -i.
find . -type f | xargs grep -Il scinew | xargs sed -e 's/scinew/sci/' -i .scinew-bak
-
This will delete any line that contains a certain regular expression (in this
case the regular expression is pretty boring).
# BSD style
sed -e '/SCIRUN_INSTALL_LIBRARY/d' -i.bak CMakeLists.txt
- Disk usage (du) and grep - When you are on a unix like system,
du can provide a nice way to see disk usage. Unfortunately, it can
take a long time to run and then it's hard to drill down to where the data is.
Using the following command can be helpful.
du -ka > diskusage
grepdu() { grep --color '^[0-9][0-9]*[[:blank:]]*'$1'[[:alnum:]\.\_]*$' $2 | \
--sort -n ;}
grepdu ./ diskusage
grepdu ./directory/ diskusage
Be sure to end your directories with "/".
- Passwordless SSH logins - Some help
for me to remember how to set up ssh keys for passwordless ssh logins.
- Links between Mozilla Firefox and Thunderbird - Linux doesn't seem to
be too great when it comes to having links from Firefox and Thunderbird open up in each
other. This is some information that I found useful for setting it up properly
under linux.
- Install AboutConfig for Thunderbird (http://aboutconfig.mozdev.org/).
- In firefox type about:config in address bar.
- Right click and add string.
- Use network.protocol-handler.app.mailto as preference name.
- Use thunderbird (or full path) as the value.
- In Thunderbird go to Menu->Tools->about:config.
- Right click and add string.
- Use network.protocol-handler.app.http as preference name.
- Use firefox (or full path) as the value.
- Repeat for network.protocol-handler.app.https.
- Enjoy links that open in respective programs.
This information was based on this web site: http://weblogs.mozillazine.org/gerv/archives/007221.html
- C++ Ifstream - Some help for
me to remember how to do various things in loding data from iostream files.
- cygstart - In windows explorer, double clicking on a file
will usually open it in the default application based on the file
association built into Windows. If you run Cygwin, you can accomplish
the same thing by using cygstart.
cygstart [file]
- Spell Check in WinNT Emacs - On most Linux systems the
spell checker for emacs works right out of the box. However on
Windows, you will find a different story. I use the Windows
version of
GNU Emacs
instead of the one that comes with cygwin. I find it works better, and
I don't need to be running an X server. Anyway, I needed a spell
checker for emacs, because I am a horrible speller. I saw some info
on the internet, but it required downloading a bunch of stuff and
setting the PATH variable and what not. I didn't want to have to do
that. I had a perfectly good cygwin installation sitting on my
computer. How could I use it? I decided to put the C:\cygwin\bin
path in my PATH variable, and that worked like a charm until I tried
running Gaim. Gaim got
confused with some conflicting dlls which were in both the Gaim
directory and the cygwin bin directory. DRAT! What I ended up doing
is copying the following files to where emacs is run from.
aspell.exe -> change to ispell.exe to make emacs happy.
cygwin1.dll
cygaspell-15.dll
cygncurses7.dll
For future reference, I determined the list of dlls by trying to run
ispell from the NT console (cmd) from within the emacs/bin directory.
If there was a missing dll, windows was kind enough to tell me which
one. I just went back to the cygwin/bin directory and stole it.
- Corrupt RPM database - This
is a document that describes how to fix your RPM database when it's
broken for whatever reason. I used this to fix a problem when any rpm
command would hang. This is a cached
version of the text just to make sure that I can always get to it.
- Free PDF document generation - This is a document
which describes how to make PDF documents on a windows machine using
free software. The essence of the article is to add a post script
printer, use that printer to print to a file, and use a post script to
pdf conversion tool. It's really slick, and you don't have to use
Adobe Distiller.
PDFCreator - Based
at SourceForge this will install a
printer you can print to and create PDF files. There are many options to
change the size of the file or embed the fonts.
- libedit or editline - libedit is a replacement or alternative
to the GNU readline
commandline editing functionality. libedit is released under a BSD
style licence, so you can use it in your proprietary code.
- Keyboard Repeat Rate - It turns out that KDE does not come
with a utility to change the keyboard repeat rate and the delay time.
Well, thank goodness for use linux has one. kbdrate is a handy
function to use to change it. Just man kbdrate to find the acceptable
rates, then run this command (change the values to suit yourself):
kbdrate -r 30.0 -d 250
Alternatively you could add it to your /etc/rc.local script to execute
at startup. I've seen places were kbdrate doesn't work or is broken.
You could alternatively use "xset r rate 660 25" which looks
nice to me. I haven't done any research to find where to place it to
make sure it happens when you long in.
- Figure out your IP address - In Windows if you want to
figure out your IP address you can open up any shell and call
ipconfig. On unix or Linux type systems this handy dandy set of
commands should isolate the IP address for you.
ifconfig | grep inet | awk '{print $2}' | awk -F":" '{print $2}' | grep -v 127.0.0.1
/sbin/ifconfig | grep inet | awk '{print $2}' | awk -F":" '{print $2}' | grep -v 127.0.0.1
- Linux e-mails DHCP address when booting - The first thing
you need to do it to make sure you can send mail. You have to have
some kind of mail sending program. I use Postfix. I decided to use the smtp
server from my ISP (smtp.comcast.net) rather than trying
to establish direct connections to the receiving computers. I
followed the direction I found at mail-abuse.org. This is what I added
to /etc/postfix/main.cf.
mydomain = comcast.net
myorigin = $mydomain
relayhost = smtp.comcast.net
You can then use this command to send a mail message.
/sbin/ifconfig eth0 | grep inet | awk '{print $2}' | awk -F":" '{print $2}' \
| Mail joe@nowhere.com -s myIPaddress
So that will mail the IP address. Now to get Linux to send it when it
boots up. You could do something fancy, or do what I did. Add the
above command to your /etc/rc.local file. This file is run at the end
of each init sequence.
- No linux boot disk - I like to run Mandrake as my distribution of
choice. I also like to run Windows 2000, so I have a dual boot
machine (I actually also boot Windows 98SE, so I guess that makes it a
triple boot machine...anyway). My system is setup so that the front
three partitions are FAT32 partitions (they are FAT32, so that I can
boot properly into Win98), and the last few partitions are linux.
Whenever I reinstalled windows it would fry the linux boot loader
which was a pain. I therefor decided to use a method
for booting into linux with the windows boot loader. This works
great! The only problem I have had since is when I reinstall
Mandrake. During the upgrade process I ask it to make a boot disk and
it promptly breaks the install. Now I don't fault the good folks at
Mandrake (well...actually I should since it is their software, but it
was free), so I decided to figure out a way to get past this annoying
problem.
The instructions to dual boot consist of copying 512 bytes from where
the linux boot loader was installed to a file on the main windows
drive. From here you can edit your boot.ini to boot the linux
partition. My problem was that I couldn't boot into linux after the
upgrade. Rescue disk to the rescue! Here is what I did:
- Boot from Mandrake installation disk
- Press F1 for advanced options
- Typed rescue to get to a rescue prompt
- Logged in as root (just type root - no password required)
- Typed the following
mkdir /mnt/linuxdisk /mnt/win_c
mount /dev/hda8 /mnt/linuxdisk
mount /dev/hda1 /mnt/win_c
dd if=/mnt/linuxdisk/dev/hda8 bs=512 count=1 of=/mnt/win_c/mandrake.bin
- Reboot
Now my boot.ini already looked like this, so I was ready to reboot.
[Boot Loader]
timeout=15
Default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[Operating Systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000
Professional" /fastdetect
C:\mandrake.bin="Mandrake 9.1"
C:\="Microsoft Windows 98"
There are a couple of things to note. I tried to specify the mount
type with -t FAT32, but mount complained about it. Trying to do the
mount without the type specifier worked just fine. I did specify the
type for a ReiserFS file system (-t reiserfs) for my linux drive, but
in retrospect I may not have needed to. The locations of your root
windows directory and linux partition that had the bootloader
installed may different for your system. Mine was hda1:Windows2000
and hda8:linux boot loader.
- Alpha blending - I'm putting this information here, because
I can't seem to find it when I need it. After deriving the
back-to-front equastion I realized that I don't want to have to do
that everytime I want the equastion, so here it is.
Bact to Front
Cout = Asrc * Csrc + (1 - Asrc) * Cin
*** You don't need to keep track of the running alpha because Ain
is composited in Cin. I won't go into the derivision here,
*** but this is it.
Front to Back
Cout = Asrc * Csrc * (1 - Ain) + Cin
Aout = Ain + Asrc * (1 - Ain)
- My first use of awk - I had a problem with the
dependencies of certain source code files not being up to date. I wanted to
remove the dependencies for only those files, so I didn't want to
make clean. Using grep and find I located
the files that needed to be updated. I couldn't just delete
the dependancy files without removing the object files, because that would
risk the dependancies not being up to date. I had to find a way to
transform the names of the dependency files from
path_and_name.d to path_and_name.o. I decided to try
and learn awk enought to do the trick. This is what I ended up
using:
prompt> find . -name "*.d" | xargs grep -l GLTexture3D
./Dataflow/Modules/Visualization/GLTextureBuilder.d
...many more...
prompt> find . -name "*.d" | xargs grep -l GLTexture3D | awk -F"." '{ print "." $2 ".o" }'
./Dataflow/Modules/Visualization/GLTextureBuilder.o
...many more...
prompt> find . -name "*.d" | xargs grep -l GLTexture3D | awk -F"." '{ print "." $2 ".o" }'
| xargs rm
prompt> find . -name "*.d" | xargs grep -l GLTexture3D | xargs rm
This probably wasn't the best way to do this, especially if there were
periods in the middle, but it worked for me. :)
- arg list too long - This error is caused by having
ARG_MAX too small. When a command is invoked the environment and
the arguments (string length) must be less than ARG_MAX. To check
the size, type
promp# getconf ARG_MAX
Set this environment variable larger to stop this error.
REFERENCE
If this doesn't help then you need to change a system parameter. To
do this you must have administrator rights. Execute the following
code.
su -
systune -i
ncargs 262144
quit