Skip to content
accelerando

Category Archives: Shortcuts

Using SQL*Plus without tnsnames.ora

29-Mar-10

As often, a quick reminder for me. I’m using the Oracle Instaclient on my Mac without a tnsnames.ora and i keep forgetting the connectstring syntax:

sqlplus USER/PASS@//HOST:PORT/SID

Extra bonus points: Through in rlwrap to get a nice commandline history and completion as used to in a standard shell:

rlwrap sqlplus USER/PASS@//HOST:PORT/SID

SVN: Revert to previous version

09-Sep-09

Just a quick reminder:

To revert a complete working copy or a single file use:

svn merge -rHEAD:PREV .
# or
svn merge -rHEAD:PREV path/to/file
svn commit -m "reverted"

Batchconvert ascii to utf8

12-May-09

Next time i see umlauts in source, I’ll scream. Loud.

In the mean time I try this:

find . -iname "*.java" -exec sh -c 'iconv -f cp1252 -t utf-8 {} > {}.utf8' \;
for i in `(find . -name "*.utf8")`; do mv $i ${i/.utf8/}; done

Before you try this, make a backup of your files. It worked for me but i don’t guaranty that your files won’t vanish.

XML / XSD Schema validation on Mac OS X

16-Jan-09

I found no fancy graphical xml validator on OS X, but this isn’t a problem.

OS X includes libxml which comes with xmllint.

To validate a xml file against a schema:

xmllint --noout --schema sitemap.xsd sitemap.xml

Recursively md5sum all files in a directory tree

25-Oct-08

After a server crash a wanted to compare all actual files with the backuped data. An easy way is to compare the md5 hashes like that:

First create recursively md5 hashes from all files in that directory:

find ./backup -type f -print0 | xargs -0 md5sum > /checksums_backup.md5

Then check the actual data:

md5sum -c checksums_backup.md5

I was lucky, no files where damaged.

Close
E-mail It