Windows Notepad is a pretty crummy text editor. Here is the best replacement I've found:
Free, with lots of handy goodies.
Windows Notepad is a pretty crummy text editor. Here is the best replacement I've found:
Free, with lots of handy goodies.
Posted by mike hoover on May 22, 2005 at 01:18 AM in Web/Tech | Permalink | Comments (10)
for automating jsp/resin/oracle dev evironments at listen--this was run on solaris. It also used several supporting files, but this was the meaty, useful, part. This file is a good reference for shell scripting in general.--Mike
#!/bin/bash
#environment build script
#Mike Hoover 3/14/2000
#ver 1.6
#build location variables
PATH=/usr/local/gnu/bin:/usr/local/bin:/usr/ccs/bin:/usr/ccs:/usr/local/netscape:/bin:/usr/bin:/sbin:/usr/ccs/bin:/usr/sbin:/usr/ucb
GZIP=/usr/local/bin/gzip
GUNZIP=/usr/local/bin/gunzip
CUT=/usr/local/bin/cut
COMMON=/pool/common/
CONTROL=/pool/control/
WD=`pwd`"/"
ASOURCE='/pool/src/apache_1.3.9.tar .'
RSOURCE='/pool/src/resin-1.1.1.tar .'
NUMBER=`pwd| $CUT --delimiter=/ --fields 3`
LOG=/pool/$NUMBER/install.log
DOIT=""
GO=""
USERNAME="${LOGNAME}"
clear
echo ""
echo ""
echo " Environment"
echo " Build "
echo ""
echo " SERVER: $HOSTNAME "
echo " POOL: $NUMBER "
echo " "
echo ""
echo ""
echo "`date`"
echo ""
echo ""
echo "Hello, ${LOGNAME}"
echo ""
echo ""
echo "*this script was produced by chimps*"
echo ""
echo ""
echo "Instructions:"
echo ""
echo " This script will build an evironment in this directory."
echo "When the script is complete, you should have apache, resin,"
echo "listen.properties, config files, and cvs all complete and "
echo "functional. The script starts apache and resin for you, so "
echo "just go to the specified apache port to see your environment."
echo ""
echo " You can access the document root via the command line OR samba."
echo "To access your environment via samba, browse to $HOSTNAME in your "
echo "network neighborhood, and go to the appropriate numbered environment"
echo "(for this environment, goto ${HOSTNAME} ${NUMBER}). You will then"
echo "be placed into the document root for the environment."
echo " IF YOU WOULD LIKE TO USE HOMESITE etc.."
echo " TO MODIFY YOUR FILES, YOU HAVE TO MAP A"
echo " DRIVE TO ${HOSTNAME} ${NUMBER} !!"
echo " Once the drive is mapped, you can open, save, delete files in the "
echo "document root. If you want to use cvs commit, add, etc..you will need to use "
echo "the command line (for the time being)."
echo " If your environment becomes a mess, just run this build script again."
echo "Running the build script essentially 'cleans' the environment. It also blows"
echo "away the cvs tree, so be careful to update your files before running this script."
echo ""
echo ""
echo ""
echo "if you have any problems or questions, please contact the"
echo "guilty monkey at mhoover@listen.com or 415-934-2046"
echo ""
echo ""
#get ports from pools file
A_PORT=`cat ${COMMON}pools | sed -n /^${NUMBER}/p | $CUT --delimiter=/ --fields 2`
R_PORT=`cat ${COMMON}pools | sed -n /^${NUMBER}/p | $CUT --delimiter=/ --fields 3`
#Check out the username for cvs checkout
if [ -d ${WD}docs ]
then
echo ""
echo "Do you want to keep your docs/cvs directory? (y or n)"
read DOIT
else
DOIT="n"
fi
#if [ ${DOIT} != "y" ]
# then
echo ""
echo "username?"
read USERNAME
#fi
#set the cvs root with the username variable
CVSROOT=:pserver:${USERNAME}@dr-dre:/export/listen/scc
STATS=${WD}${USERNAME}.log
#are you sure section
clear
echo ""
echo ""
echo ""
echo " You are about to blow away ${HOSTNAME} ${NUMBER} "
echo " and everything under ${WD}"
echo ""
echo " The Apache port will be ${A_PORT}"
echo ""
echo " The Resin port will be ${R_PORT}"
if [ ${DOIT} != "y" ]
then
echo ""
echo " cvs will be checked out under the user ${USERNAME}"
echo ""
else
echo ""
echo "Document root will not be blown away"
echo ""
fi
echo ""
echo ""
echo ""
echo "oooooo....this is scary!"
echo ""
echo ""
echo " Is this what you want to do?? (y or n)"
read GO
if [ ${GO} != "y" ]
then
exit 1
fi
clear
#if directories already exist, blow them away
echo " cleaning up $HOSTNAME $NUMBER..."
${ROOT}control/stop
if [ -d ${WD}resin1.1 ]
then
rm -rf ${WD}resin1.1
echo " resin gone ..."
fi
if [ -d ${WD}apache ]
then
rm -rf ${WD}apache
echo " apache gone ..."
fi
if [ -d ${WD}tmp ]
then
rm -rf ${WD}tmp
echo " tmp gone ..."
fi
if [ -d ${WD}docs -a ${DOIT} != "y" ]
then
rm -rf ${WD}docs
echo " docs gone ..."
fi
if [ -d ${WD}classes ]
then
rm -rf ${WD}classes
echo " classes gone ..."
fi
if [ -f ${WD}listen.properties ]
then
rm -rf ${WD}listen.properties
echo " listen.properties gone ..."
fi
if [ -f ${WD}install.log ]
then
rm -rf install.log
fi
#make required directories
mkdir ${WD}tmp 2>>$LOG
mkdir ${WD}classes 2>>$LOG
mkdir ${WD}docs 2>>$LOG
echo ""
echo " made directories ..."
DOOBY=${ASOURCE}
SCOOBY=${RSOURCE}
cp ${DOOBY}
cp ${SCOOBY}
tar xf ${WD}apache_1.3.9.tar 2>>$LOG
ROOT=${WD}
APACHE_CONF=${ROOT}apache/conf/
APACHE_BIN=${ROOT}apache/bin/
echo " apache install"
echo "ROOT directory is now: ${ROOT}" >>$LOG
INSTALL=${WD}"apache_1.3.9"
cd $INSTALL 2>>$LOG
./configure --prefix=${ROOT}apache --enable-module=so >>$LOG
cd $INSTALL
make >>$LOG 2>>$LOG
make install >>$LOG 2>>$LOG
cd $ROOT
rm -rf ./apache_1.3.9 || or die"can't remove apache directory" 2>>$LOG
rm apache_1.3.9.tar 2>>$LOG
echo " now making httpd.conf and apachectl"
cd $APACHE_CONF
A_CONFIG_COPY=$COMMON'httpd.conf .'
cp $A_CONFIG_COPY 2>>$LOG
echo " running sed's on apache files"
echo " apache_conf: $APACHE_CONF"
sed "s/\/CHANGEME\//\/${NUMBER}\//g" httpd.conf > m 2>>$LOG
sed "s/1.lock/${NUMBER}.lock/g" m > n 2>>$LOG
sed "s/1.pid/${NUMBER}.pid/g" n > o 2>>$LOG
sed "s/blammo/$A_PORT/g" o > p 2>>$LOG
mv p httpd.conf 2>>$LOG
rm ${APACHE_CONF}m 2>>$LOG
rm ${APACHE_CONF}n 2>>$LOG
rm ${APACHE_CONF}o 2>>$LOG
rm ${APACHE_CONF}p 2>>$LOG
echo " done with apache httpd.conf sed"
echo " apache_bin is: $APACHE_BIN"
cd $APACHE_BIN 2>>$LOG
sed "s/PIDFILE=\/pool\/${NUMBER}\/apache\/logs\/httpd.pid/PIDFILE=\/tmp\/${NUMBER}.pid/g" apachectl > taco 2>>$LOG
mv ${APACHE_BIN}taco ${APACHE_BIN}apachectl 2>>$LOG
chmod 755 ${APACHE_BIN}apachectl
echo " done with httpd.conf and apachectl" 2>>$LOG
#RESIN SECTION
echo ""
echo " beginning resin section...root is: $ROOT "
cd $ROOT
tar xf resin-*.tar
rm resin-1.*.tar
cd ${ROOT}resin1.1/
./configure --with-apache=${ROOT}apache --with-java-home=/usr/java
make
make install
#sed "s/6802/${R_PORT}/g" mod_caucho.c > x; mv x mod_caucho.c
#sed "s/6802/${R_PORT}/g" config.c > y; mv y config.c
#sed "s/\/bin\/sh/\/bin\/bash/g" install.sh > z
#sed "s/\/usr\/local\/apache/\/pool\/${NUMBER}\/apache/g" z > w; mv w install.sh
#chmod 755 ${ROOT}resin1.1/srun/install.sh >>$LOG
#${ROOT}resin1.1/srun/install.sh >>$LOG 2>>$LOG
cd ${ROOT}resin1.1/bin
cp ${COMMON}wrapper.pl .
sed "s/\/CHANGEME\//\/${NUMBER}\//g" wrapper.pl > q; mv q wrapper.pl
sed "s/bin\/sh/bin\/bash/g" srun.sh > t; mv t srun.sh
chmod 755 ${ROOT}resin1.1/bin/srun.sh
chmod 755 ${ROOT}resin1.1/bin/wrapper.pl
cd ${ROOT}resin1.1/conf
cp ${COMMON}resin.conf .
sed "s/\/CHANGEME\//\/${NUMBER}\//g" resin.conf > r
sed "s/CHANGEPORT/${R_PORT}/g" r > s; mv s resin.conf; rm r
#CVS SECTION
if [ ${DOIT} != "y" ]
then
echo " here goes the cvs stuff..."
cd ${ROOT}docs
mkdir trunk branch partners muze
echo " site/server..."
cvs -d ${CVSROOT} co site/server >>$LOG 2>>$LOG
#cd ${ROOT}docs/trunk
echo " trunk..."
cvs -d ${CVSROOT} co site/webroot.new >>$LOG 2>>$LOG
mv ${ROOT}docs/site/webroot.new ${ROOT}docs/trunk
#rm -rf ${ROOT}docs/trunk/site
echo " muze..."
cd ${ROOT}docs/muze
cvs -d ${CVSROOT} co -r muze-05082000 site/webroot >>$LOG 2>>$LOG
mv ${ROOT}docs/muze/site/webroot ${ROOT}docs/muze
rm -rf ${ROOT}docs/muze/site
echo " partners..."
cd ${ROOT}docs/partners
cvs -d ${CVSROOT} co partners >>$LOG 2>>$LOG
mv ${ROOT}docs/partners/ ${ROOT}docs/partners
chmod -R 777 ${ROOT}docs
fi
#cd ${ROOT}docs/site/server
echo " copy listen.jar, third party.jar and classes12.zip...root is : $ROOT"
cp ${ROOT}docs/site/server/listen.jar ${ROOT}resin1.1/lib/ 2>>$LOG
cp ${ROOT}docs/site/server/thirdparty.jar ${ROOT}resin1.1/lib/ 2>>$LOG
cp ${ROOT}docs/site/server/classes12.zip ${ROOT}classes 2>>$LOG
#END
cp ${COMMON}listen.properties ${ROOT}
sed "s/CHANGEME/${NUMBER}/g" ${ROOT}listen.properties > ${ROOT}lis; mv ${ROOT}lis ${ROOT}listen.properties
#START
#CONTROL SECTION
N="${NUMBER}"
C="/pool/${N}/control/"
cp /pool/common/control/* ${C}
#chmod -R 777 /pool/${N}/control
sed "s/CHANGEME/${N}/g" ${C}start > ${C}m ; mv ${C}m ${C}start
sed "s/CHANGEME/${N}/g" ${C}stop > ${C}m ; mv ${C}m ${C}stop
sed "s/CHANGEME/${N}/g" ${C}restart > ${C}m ; mv ${C}m ${C}restart
#START
chmod -R 777 ${C}*
${C}start
#END START
clear
echo ""
echo ""
echo " all done"
echo ""
echo " have a nice goddamn day!"
echo ""
#show parameters again
DB=`cat ${ROOT}listen.properties | grep -i dbanonusername_defaultdb | cut --delimiter== --fields 2`
DOOBY=`cat /pool/${NUMBER}/docs/site/server/CVS/* | grep listen.jar | cut --delimiter="/" --fields 3`
echo ""
echo ""
echo " Your environment:"
echo ""
echo " Your username: ${USERNAME}"
echo ""
echo " Your Apache port is: ${A_PORT} "
echo ""
echo " Your database is: $DB"
echo ""
echo " Listen.jar version is: $DOOBY"
echo ""
echo " Your Document root is: ${ROOT}docs "
echo ""
echo " Your Environment is on the server: $HOSTNAME "
echo ""
echo " To access your environment, go here: http://${HOSTNAME}.sf.listen.com:${A_PORT}"
echo ""
echo ""
echo " To control your environment, go to ${ROOT}control, there you will"
echo " find start, stop, and restart scripts (just do the ./filename thing). Make sure "
echo " to stop your environment when you are done working for the day."
#make environment stats
echo "" >${STATS}
echo "" >>${STATS}
echo " Your environment:" >>${STATS}
echo ""
echo " Your username: ${USERNAME}" >>${STATS}
echo ""
echo " Your Apache port is: ${A_PORT} ">>${STATS}
echo ""
echo " Your database is: $DB" >>${STATS}
echo ""
echo " Listen.jar version is: $DOOBY" >>${STATS}
echo ""
echo " Your Document root is: ${ROOT}docs " >>${STATS}
echo ""
echo " Your Environment is on the server: $HOSTNAME " >>${STATS}
echo ""
echo " To access your environment, go here: http://${HOSTNAME}.sf.listen.com:${A_PORT}" >>${STATS}
echo ""
echo ""
echo " To control your environment, go to ${ROOT}control, there you will" >>${STATS}
echo " find start, stop, and restart scripts (just do the ./filename thing). Make sure " >>${STATS}
echo " to stop your environment when you are done working for the day." >>${STATS}
if [ ${USERNAME} = "mike" ]
then
USERNAME="mhoover"
fi
echo ""
echo " Mailing env junk to: ${USERNAME}@listen.com"
echo ""
#MAIL SECTION
cat ${STATS} | mailx -c mhoover@listen.com -s "Your environment on ${HOSTNAME}" ${USERNAME}@listen.com
#END MAIL SECTION
#CREATE WHO FILE
touch ${ROOT}${USERNAME}
echo `date` >${ROOT}${USERNAME}
Posted by mike hoover on February 02, 2005 at 05:54 PM in Open Source | Permalink | Comments (0) | TrackBack (0)
More Google puzzle madness, like this one, only now in the form of the Google Labs Aptitude Test.
Posted by mike hoover on September 30, 2004 at 11:50 PM in Web/Tech | Permalink | Comments (74) | TrackBack (0)
Just added 512 M of memory to my $100 iMac (thanks joey!), for a grand total of 768 M. AHHHHHH, That's better.
also:
got 10 servers up at the ol' hoover shack, plus a redundant network of speakasy DSL and Comcast cable. YEAH, WATCH THAT POWER METER SPIN LIKE A 15K SCSI DRIVE!.
umm, that's it for now.
KissMyGrits
Posted by mike hoover on September 19, 2004 at 03:46 PM in Hacking | Permalink | Comments (3) | TrackBack (0)
Hey Gaza,
Got khtml2png working on a red hat 9 box:
download.
./configure
make
make install
mv kcookiejarrc-accept ~/.kde/share/config/kcookiejarrc
vncserver -depth 32 -geometry 1000x1000
(enter password)
then
./khtml2png/khtml2png -display :1 --width 1200 --height 1600 --scaled-width 220 --scaled-height 260 http://www.google.com/googleblog/2004/07/warning-we-brake-for-number-theory.html e-commerce.png
and it makes a png of the URL.
Then, I made a php script where you send the parameters $_REQUEST - style, call the script, and dump back the png to the calling server(still working out the delivery format of this). This makes for hot feedbag/bookmarks action in Rage Against The MachineSpeak.



You are now kissing my grits.
Hoover
Posted by mike hoover on July 17, 2004 at 01:15 AM in Web/Tech | Permalink | Comments (34)
Posted by mike hoover on July 08, 2004 at 09:09 PM in Osono Ventures, LLC | Permalink | Comments (14)
I'm working on weblog/whatever input software, in PHP. This is old gnu's, but a nice refresher:
Posted by mike hoover on July 08, 2004 at 09:03 PM in Hacking | Permalink | Comments (0)
A compact (if cryptic) shorthand is useful:
echo "var is ".($var < 0 ? "negative" : "positive");
is equivalent to:
echo "var is ";
if ($var < 0)
echo "negative";
else
echo "positive";
The shorthand can be considered (expression ? true_value : false_value) where 'expression' is evaluated and, if true, the 'true_value' is returned, otherwise the 'false_value' is returned.
Posted by mike hoover on July 08, 2004 at 05:45 PM in Hacking | Permalink | Comments (3)
We installed Firefox on all users machines, used a standard security config, and told them to stop using IE except for certain sites, such as microsoft.com and various, stupidly designed, internal applications. I expect to see a drastic decrease in spyware on the "Usual User Suspects" machines. The same usual suspects that always have something like "420 objects found" when you run spyware cleaning tools on their machines. I'll let you know how it works out.
Posted by mike hoover on July 05, 2004 at 04:17 PM in Web/Tech | Permalink | Comments (0) | TrackBack (0)
I've been using XP pro for like two years, and just found this today. What a chump.
Start > Control Panel > Add/Remove Programs > Set Program Access and Defaults > Custom
Change defaults for browser, email, media player, AND SO ON.
I guess I never needed it before. Eh.
Posted by mike hoover on June 25, 2004 at 04:53 PM in Microsoft | Permalink | Comments (0)
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Recent Comments