I don’t know why I keep having to do this, but I do. I always to create separate archives of all the directories in a directory. So, here is script from David (aka Matir aka EmptyCinema) from linuxquestions.org http://www.linuxquestions.org/questions/showthread.php?s=&postid=1839513#post1839513 to do just that (along with a sample sessions using it). #!/bin/bash for dir in */…
You are currently browsing the Linux category
Bash shell script for creating a poor man’s CD-ROM (removable media) catalog for linux
#!/bin/sh # jcz 2004-jan-12 # assumes iso9660 CD-ROM mount -t iso9660 -r /dev/cdrom /mnt/cdrom echo “Disc Mounted. Run this program, then grep keywords in the “ echo “cdcatalogs directory to find which CD-ROM some file “ echo “is on. “ # makes the directory to store the catalog files mkdir cdcatalogs # runs volname (part…
Comment on Bash shell script for creating a poor man's CD-ROM (removable media) catalog for linux
Paths on Linux
Today I’m going to do a test install of the J2EE mapserver-like facilities provided by geoserver version 1.3 Rc2. I recently installed java and the JDK on this machine, so I still need to set JAVA_HOME in the path. I do this so rarely everytime I need to do it I have to look it…
Tips for using the ls command to list files in Cygwin or Linux
Classify ls –classify or ls -F will append characters to files to show their type: * / directory * * executable Code: ls -F directory/ me.jpeg script.sh* ls –color=tty Will color the ‘ls’ output. Directories are blue, regular files stay black (or white) and executable files are green. Make an Alias of your prefered method.…
Comment on Tips for using the ls command to list files in Cygwin or Linux
Upgrade your debian sources.list
apt-spy is a program that benchmarks debian apt-get sources. Run this script when you need to find your bets local mirror for grabbing debian packages. #!/bin/sh # jcz 2005-july-13 # # This script will add the best debian servers to your sources.list file. # You should prune the file by hand when it’s done. #…
Changing run levels at boot time
As with most stories on this site, I use my stories to store notes on things that I keep needing to lookup and that might help others. This one is how to change the default startup runlevel of a debian (via knoppix distribution). In this case I want it to stop booting into graphical mode,…
Simple grep and search & replace
grep -Hn -e ” int” *.c* *.h searches for the string “int” files ending in .c* or .h in the the current directory directory Returns: ! P8.CPP:52: cerr << “cannot allocate int *p1″ << endl ; ! P8.CPP:59: } //format => int *p = new int[100]; ! P9.CPP:9:inline int sumup( int x, int y) !…
Running cygwin cron from windows as a service
2 Running cygwin cron from windows as a service Cron is a program for running scripts or programs at certain times. For cron to be able to do this, it has to be running when the machine is on. This is done by adding cron as a service. Open a bash terminal. Write: cygrunsrv -I…
X windows with Cygwin
PC XStation Configuration Download the CygWin setup.exe from http://www.cygwin.com. Install, making sure to select all the XFree86 optional packages. If you need root access add the following entry into the /etc/securettys file on each server: <client-name>:0 From the command promot on the PC do the following: set PATH=PATH;c:\cygwin\bin;c:\cygwin\usr\X11R6\bin XWin.exe :0 -query <server-name> The X environment…
Simple netstat
netstat -tln | fgrep :10000 on the box would tell you if the app is listening on port 10000. (And in particular if it is listening to port 10000 on all interfaces, or at least 127.0.0.1.