Posts for August, 2005

How to find out what your wayward app is really doing

My friend has shown my the most awesome linux debugging tool. It’s a little tool called strace that shows you what function calls your wayward application is actually doing. In my case, I couldn’t get Apache to see any directories that weren’t under DocumentRoot. So I started httpd using the strace program like this: strace […]
Published in Sysadmin on Saturday, August 27th, 2005

Shell script: find files with a filename containing keywords

I just wanted to save a little shell script I wrote that searches a directory for files with a certain filename that contain a certain text string. if [ $# -ne 3 ] then echo "Usuage: exit fi directory=$1 filename=$2 keywords=$3 for file in $( find $directory -name $filename ) do matches=`cat $file | […]
Published in Sysadmin on Saturday, August 27th, 2005

Advanced shell scripting guide

I found a really great guide to shell scripting. It’s about the best reference document to shell scripting that I’ve seen. It has all the things you need to get around a new language like control structures, creating functions and using variables. It also explains the things you need to understand to understand shell scripting […]
Published in Sysadmin on Saturday, August 27th, 2005

JSLint: neat javascript script verifier tool

I found a useful little utility called Lint that checks for things in your javascript code that’s likely to introduce errors. I really like that it checks for undeclared variables because I always, always, always want to declare my variables before I use them. Considering that forgetting to declare the variable sets it global for […]
Published in Javascript, Tools on Monday, August 15th, 2005

Is there javascript debugging in VS.NET 2005?

I might just be dense, but I can’t find out how to do javascript debugging in VS.NET 2005. It cheerfully informs me that “object is null or not an object” but there’s no script listing or running documents or even line information so I can’t really do much with the information. Does anyone know if […]
Published in ASP.NET on Friday, August 12th, 2005

Measuring element dimensions and placement in javascript

I found a really useful page on the MSN site that explains how measuring element dimensions and locations work in javascript. There’s a great image that shows you how to measure any of the different areas using the different javsacript width, height and placement properties.
Published in Javascript on Thursday, August 11th, 2005

Wiping the boot sector of a drive

A nifty trick (thanks to Vadim) if you need to wipe the boot sector of your drive: 1. Boot machine off Knoppix CD 2. Open terminal and type the following command to write 512 bytes worth of zeros to the beginning of the disk dd if=/dev/zero of=/dev/hda1 count=1 bs=512 3. Remind Vadim he *is* a […]
Published in Sysadmin on Tuesday, August 9th, 2005

How to burn a CD in linux on the command line

1. Create an iso to burn to your CD. In my case I already had one, but there’s a nice HOW-TO in the tutorial I was reading. mkisofs -r -o myiso mydirectory/ 2. Make sure that linux knows there’s a CD drive connected to your box. If nothing comes up, then you’ll have to install […]
Published in Sysadmin on Tuesday, August 9th, 2005