XML / HTML / XHTML document types

For document type declarations for HTML and XHTML, something like the following is needed:

For transitional XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

For strict XHTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

SpiderOak Backup

To reset the status bar in the SpiderOak OS X Client, at the command line type:

/Applications/SpiderOak.app/Contents/MacOS/SpiderOak --repair

To run SpiderOak and synchronize from the command line type:

/Applications/SpiderOak.app/Contents/MacOS/SpiderOak --batchmode

/proc/kcore and other kcore files

When doing a df / du combination to try and free up unused disk space on a Linux system, /proc/kcore or other ‘kcore’ files turn up.

/proc/kcore:

  • Is a virtual file that represents all the physical memory on a given system (as a file that can be written and read)
  • Does not actually consume physical space on the file system – even though ‘du’ reports it a regular file
  • Should never be deleted

Variants of the ‘kcore’ file may appear in other places on the file system. In every case they mirror the real ‘kcore’ file. For example, any service that uses a ‘chroot’ environment will like mount this file in its own namespace – e.g. /var/named/chroot/proc/kcore. Run the ‘mount’ command to see this.

/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/proc on /var/named/chroot/proc type none (rw,bind)

Intellij 9.0, maven and changed dependencies

I’ve sometimes experienced, that when I change. rebuild and reinstall a dependent JAR in my local maven repository, Intellij 9.0 doesn’t notice that the dependency has changed, and consequently are not included in a (rebuilt) WAR file.

The solution is to invoke the build ‘package’ target once using the Intellij Maven panel for that component. It seems then that Intellij recognizes the changed dependency.

Postfix – clearing mail queues (sendmail compatible) – OS X

With thanks to: Quick Tip: Postfix Flush the Mail Queue

On OS X running the unmodified mail environment – i.e. postfix emulating sendmail – the following commands are useful:

Under Postfix, as root, enter the following to flush the mail queue

postfix flush

or

postfix -f

To see mail queue, enter:

mailq

To remove all mail from the queue, enter:

postsuper -d ALL

To remove all mails in the deferred queue, enter:

postsuper -d ALL deferred

OS X Startup Keyboard options

From Apple Mac OS X keyboard shortcuts

Startup keyboard shortcuts

Press the key or key combination until the expected function occurs/appears (for example, hold Option during startup until Startup Manager appears, or Shift until “Safe Boot” appears). Tip: If a startup function doesn’t work and you use a third-party keyboard, connect an Apple keyboard and try again.

Key or key combination What it does

Option Display all bootable volumes (Startup Manager)
Shift Perform Safe Boot (start up in Safe Mode)
C Start from a bootable disc (DVD, CD)
T Start in FireWire target disk mode
N Start from NetBoot server
X Force Mac OS X startup (if non-Mac OS X startup volumes are present)
Command-V Start in Verbose Mode
Command-S Start in Single User Mode

MySQL – Useful commands

(All from the command line)

List all databases

show databases;


Maven – Show all dependencies

To show all dependencies managed by maven specify:

mvn dependency:tree

 

Tomcat 6, JNDI and Application contexts

From Tomcat 6.0 documentation

For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

Context elements may be explicitly defined:

  • In the $CATALINA_BASE/conf/context.xml file: the Context element information will be loaded by all webapps.
  • In the $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host.
  • In individual files (with a “.xml” extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. The default web application may be defined by using a file called ROOT.xml.
  • Only if a context file does not exist for the application in the $CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the application’s context path. Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host’s appBase.
  • Inside a Host element in the main conf/server.xml.

Create a Java Keystore

To create a Java keystore file – the minimum

keytool -genkey -alias tomcat -keyalg RSA -keystore /keystore-location -storepass password

You can answer anything to the questions if this is just for internal, development use. Keystore location is typically ~/.keystore.

Note that this merely creates the file. Doesn’t do anything about putting certificates in it.

WordPress Themes