Google+ Test
Seeing if this will let me post to my Google+ profile directly.
The personal blog of Erik Harmon
I posted this as an answer to a question on "site-ripping" on another site, but I figured I'd mirror it here since I wrote it.
wget -erobots=off --no-parent --wait=3 --limit-rate=20K -r -p \
-U "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" \
-A htm,html,css,js,json,gif,jpeg,jpg,bmp http://example.com
-D domain1.com,domain2.comto indicate a series of domains you want to download if they have another server or whatever for hosting different kinds of files. There's no safe way to automate that for all cases, so you just have to try it and keep an eye on it.
Labels: UNIX
This is how to set up the Oracle standalone OC4J server that comes with JDeveloper. There's no good quickstart guide, so I wrote one.
<property name="oc4j.deploy.ormi" value="ormi://localhost:23791" />
<property name="oc4j.deploy.username" value="admin"/>
<property name="oc4j.deploy.password" value="admin"/>
<target name="deploy">
<java jar="${jdev.home}/j2ee/home/admin.jar" fork="yes">
<arg value="${oc4j.deploy.ormi}"/>
<arg value="${oc4j.deploy.username}"/>
<arg value="${oc4j.deploy.password}"/>
<arg value="-deploy"/>
<arg value="-file"/>
<arg value="whatever.ear"/>
<arg value="-deploymentName"/>
<arg value="whatever"/>
</java>
</target>
Labels: howto, Java, Oracle, programming
So, at work I sometimes have to run Java code on both AIX and on Windows. If I want to test things, I have found it beneficial to run the entire thing under Cygwin. Unfortunately because of the difference in how paths are handled, stuff usually doesn't work right. So I created the script below. It doesn't work on everything, in particular it doesn't work for referencing your Log4J config from the command line. But, it works for my purposes.
#!/bin/ksh
#fix java programs to run correctly with cygwin
export CLASSPATH="$(cygpath -wp "$CLASSPATH")"
x=0
lastvar=
for p in "$@"
do
#get path of the parameter if it has one
ppath="$(dirname "$p")" > /dev/null 2>&1
#exclude current dir
if [[ "$ppath" = "." ]]; then ppath=""; fi
#exclude if its not a directory already
if ! test -d "$ppath"; then ppath=""; fi
if [[ "$lastvar" = "-cp" ]]
then
parms[x]="$(cygpath -wp "$p")"
elif [[ "$lastvar" = "-classpath" ]]
then
parms[x]="$(cygpath -wp "$p")"
elif test -e "$p"
then
parms[x]="$(cygpath -wp "$p")"
elif [[ "$ppath" != "" ]]
then
parms[x]="$(cygpath -wp "$p")"
else
parms[x]="$p"
fi
lastvar="$p"
x=$(( $x + 1 ))
done
"$JAVA_HOME/bin/java" "${parms[@]}"
Labels: Java, programming, shell scripting, UNIX