In eWeek, Hardening the OpenHack App, checkout the Web Application Security Best Practices.
Category Archives: Systems Administration
shell script to automate the Lucene search
Wrote my first shell script to automate the Lucene search that handles searching for this blog. Got the goods here on shell scripting and stuff here on Cron. End result: a shell script that updates the Lucene index for this blog and pipes the output of the index script to an email:
#!/bin/bash
# Script that indexes the appropriate directories
# using Lucence & Java
cd /usr/hosts/cephas.net/wwwroot/blog/
java -cp /usr/hosts/cephas.net/wwwroot/WEB-INF/lib/lucene-demos-1.2.jar:
/usr/hosts/cephas.net/wwwroot/WEB-INF/lib/lucene-1.2.jar org.apache.lucene.demo.IndexHTML
-create -index /usr/hosts/cephas.net/wwwroot/blog/index/ .. | mail -s “LUCENE[cephas.net/blog]” aaron.s.johnson@gmail.com
Swiff Chart
Really really cool charting software: Swiff Chart
mod rewrite
Old news for Apache/Linux folks, but I’ve spent way more time with IIS than Apache. Mod_rewrite is very cool. So a combination of search engine friendly urls, wget, and Lucene could allow for full text search of a dynamic site without spidering. Nice.
hosting news
Found on Doc’s site, the latest Netcraft survey is out showing a close to 6% gain in share for Apache and a corresponding 6%+ loss for IIS. Interesting reading about the have’s and the have not’s in the hosting industry at the bottom of that survey.
wsh for windows automation
Follow up to last night’s post on wget. The wget app (in my case) needs to run every couple hours during the day. Windows 2000 and higher has a built task scheduler which I could (and will) use to schedule the execution of the task, but to do this I’d have to type some kludgy command line arguments AND I’d have to have administrator access to the machine in order to change any of the properties of the task. There must be a better way… enter Windows Script files(.wsf), which is “.. a text document containing Extensible Markup Language (XML) code, incorporates several features that offer you increased scripting flexibility. (from MSDN). It’s kinda like ANT, except Windows specific.
My download wget script eventually looks like this:
http://someserver.com/myxmlpacket2.xml.gz
FileName.xml.gz
http://someserver.com/myxmlpacket.xml.gz
theNameofMyFile.xml.gz
Couple things to notice: a) a wsf is valid xml, b) you can run multiple jobs in one file, and c) you can reuse your existing VBS scripts. So now, seeing my wsf file, how would I call that using the Windows Task Scheduler? You want to run cscript.exe, which is in c:\$winnt$\system32\, so you’re run command would look like this:
C:\WINNT\system32\cscript.exe //Job:daypart c:\wget\wget.wsf
where ‘daypart’ is the name of the job within your wget.wsf file. Using WSF as a wrapper for the wget executable allows you to easily tasks to a specific jobs. Even better, you can access almost anything on a Windows system or network using VBScript/WSH, including accessing network connections, creating local applications, and managing the system registry.