You are currently browsing the Linux category

gzip all directories in a directory

July 5, 2008 - 8:44 pm

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 */…

gzip all directories in a directory - continue reading

Comment on gzip all directories in a directory

Bash shell script for creating a poor man’s CD-ROM (removable media) catalog for linux

July 5, 2008 - 8:42 pm

#!/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…

Bash shell script for creating a poor man’s CD-ROM (removable media) catalog for linux - continue reading

Comment on Bash shell script for creating a poor man's CD-ROM (removable media) catalog for linux

Paths on Linux

July 5, 2008 - 8:40 pm

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…

Paths on Linux - continue reading

Comment on Paths on Linux

Tips for using the ls command to list files in Cygwin or Linux

July 5, 2008 - 8:39 pm

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.…

Tips for using the ls command to list files in Cygwin or Linux - continue reading

Comment on Tips for using the ls command to list files in Cygwin or Linux

Upgrade your debian sources.list

July 5, 2008 - 8:38 pm

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. #…

Upgrade your debian sources.list - continue reading

Comment on Upgrade your debian sources.list

Changing run levels at boot time

July 5, 2008 - 8:37 pm

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,…

Changing run levels at boot time - continue reading

Comment on Changing run levels at boot time

Simple grep and search & replace

July 5, 2008 - 8:36 pm

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) !…

Simple grep and search & replace - continue reading

Comment on Simple grep and search & replace

Running cygwin cron from windows as a service

July 5, 2008 - 8:34 pm

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…

Running cygwin cron from windows as a service - continue reading

1 Comment on Running cygwin cron from windows as a service

X windows with Cygwin

July 5, 2008 - 8:33 pm

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…

X windows with Cygwin - continue reading

Comment on X windows with Cygwin

Simple netstat

July 5, 2008 - 8:32 pm

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.

Simple netstat - continue reading

Comment on Simple netstat

Top