You are currently browsing the post archives for July 2008.

The all powerful find command

Posted on July 5, 2008 at 8:46 pm in

find <starting point> <search criteria> <action> The starting point is the name of the directory where find should start looking for files. The find command examines all files in this directory (and any subdirectories) to see if they meet the specified search criteria. If any do, find performs the specified action on each found file.…

The all powerful find command - continue reading

Comment on The all powerful find command


Another Linux Web MySQL Backup Script

Posted on July 5, 2008 at 8:45 pm in

I found this on on the nixcraft craft. Looks pretty good to me. Similar in functionality to my other script posted here. I’m going to poach some concepts from here to make a script that will auto-optimize all tables in all databases on the mysql server. #!/bin/sh ################## ## jcz 17-feb-2007 ## copied from http://www.cyberciti.biz/tips/…

Another Linux Web MySQL Backup Script - continue reading

Comment on Another Linux Web MySQL Backup Script


gzip all directories in a directory

Posted on July 5, 2008 at 8:44 pm in

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


Postgis data loader from shapefile bash shell script

Posted on July 5, 2008 at 8:43 pm in

Run this script in a directory of shp files to create STDOUT that will load them all into postgis —————————————————— #!/bin/sh # jcz aug 24, 2005 # clip off the “.shp” file extensions before use # drops existing shapes if they are the same name for z in `ls *.shp do echo “shp2pgsql $z $z…

Postgis data loader from shapefile bash shell script - continue reading

Comment on Postgis data loader from shapefile bash shell script


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

Posted on July 5, 2008 at 8:42 pm in

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

Posted on July 5, 2008 at 8:40 pm in

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

Posted on July 5, 2008 at 8:39 pm in

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

Posted on July 5, 2008 at 8:38 pm in

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

Posted on July 5, 2008 at 8:37 pm in

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

Posted on July 5, 2008 at 8:36 pm in

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


Top