[RSS Feed]

Run an ad-hoc container

last change: 2018-11-06
From the book "Istio in Action":

kubectl run -i --rm --restart=Never dummy \
--image=dockerqa/curl:ubuntu-trusty --command \
-- sh -c 'curl -s catalog:8080/api/catalog'

permlink: _.at: Run an ad-hoc container

Kubernetes cluster status

last change: 2018-07-11
A simple status of the cluster:

$ kubectl top nodes

With scheduled pods:

$ kubectl describe nodes

permlink: _.at: Kubernetes cluster status

Check SSL server certificate contents

last change: 2018-06-15
echo | openssl s_client -showcerts -servername <server name> -connect <host name>:443 2>/dev/null | openssl x509 -inform pem -noout -text

server name is used to add SNI compatible headers to the request. host name is the name of the machine and can be the same as server name.

permlink: _.at: Check SSL server certificate contents

Manage multiple Kubernetes cluster configurations for kubectl

last change: 2018-06-14
List available configurations/contexts:
kubectl config get-contexts

Switch to another context:
kubectl config use-context docker-for-desktop

permlink: _.at: Manage multiple Kubernetes cluster configurations for kubectl

Git changes in branch

last change: 2018-06-14
See the changes in a branch since branching:
git checkout <branch name>
base=`git merge-base master HEAD`
git diff --name-only $base HEAD

permlink: _.at: Git changes in branch

Git branch cleanup

last change: 2018-07-04
List branches:
git branches

Delete branch from remote 'origin':
git push -d origin <branch name>

Delete local branch:
git branch -d <branch name>

Rename current local branch:
git branch -n <new name>

Rename some local branch:
git branch -m <old name> <new name>

Rename remote branch after renaming local branch:
git push origin :<old name>
git push --set-upstream origin <new name>

permlink: _.at: Git branch cleanup

Postfix TLS

last change: 2016-08-09
/etc/postfix/main.cf:
# TLS parameters
smtp_tls_security_level = encrypt
smtpd_tls_security_level = encrypt
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file=/etc/ssl/private/smtpd.key
smtpd_tls_cert_file=/etc/ssl/certs/smtpd.crt
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_exclude_ciphers = aNULL, MD5
smtpd_tls_mandatory_protocols = TLSv1
# Also available with Postfix >= 2.5:
#smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3


Test:
openssl s_client -starttls smtp -CApath /etc/ssl/certs/cacert.pem -connect localhost:25 -ssl3
openssl s_client -starttls smtp -CApath /etc/ssl/certs/cacert.pem -connect localhost:25 -ssl2

permlink: _.at: Postfix TLS

Get the GIT commit ID

last change: 2015-12-04
This command gives the commit id of the currently checked out revision:

git rev-parse HEAD

permlink: _.at: Get the GIT commit ID

Doing XSL and FOP transformations on the commandline using Saxon and Apache FOP

last change: 2014-11-28
Transfomation using Saxon:
# java -jar saxon9.jar -s:<inputfilename> -xsl:<xsl filename> -o:<outputfilename>

Classpath must include all jars necessary for FOP:
# for name in fop-1.1/lib/*.jar; do export CLASSPATH=$name:$CLASSPATH; done;

Use output from another transformation, i.e. an FO-File:
# java -classpath $CLASSPATH org.apache.fop.cli.Main -fo <fo filename> -pdf <pdf outputfilename>

Use internal transformation mechanism, i.e. input is xml, xsl file transforms to fo:
# java -classpath $CLASSPATH org.apache.fop.cli.Main -xml <xml input filename> -xsl <xsl filename> -pdf <pdf outputfilename>

A complete step from XML to PDF might look like this, using input.xml, transform2fo.xsl and output.pdf als filenames:

Using Saxon:
# java -jar saxon9.jar -s:input.xml -xsl:transform2fo.xsl -o:intermediate.fo
# java -classpath $CLASSPATH org.apache.fop.cli.Main -fo intermediate.fo -pdf output.pdf

Using only Apache FOP:
# java -classpath $CLASSPATH org.apache.fop.cli.Main -xml input.xml -xsl transform2fo.xsl -pdf output.pdf

permlink: _.at: Doing XSL and FOP transformations on the commandline using Saxon and Apache FOP

Force-Delete locked files

last change: 2014-10-27
If trying to remove a file with 'rm' on the command line gives you the error 'operation not permitted' you might want to take a look at the containing folder whether its set to protected. If it is not you might want to install the Developer Tools and unlock it:

/Developer/Tools/SetFile -a l <filename or wildcard>

permlink: _.at: Force-Delete locked files

Cleanup Oracle FRA

last change: 2014-08-05
Get rid of everything in the FRA: use RMAN

rman target /
RMAN> DELETE ARCHIVELOG ALL;

Or delete just expired logs:
RMAN>crosscheck archivelog all';
RMAN>delete noprompt expired archivelog all;

Use only if you know what you're doing...

permlink: _.at: Cleanup Oracle FRA

Unix Timestamp

last change: 2014-10-06
Need the Unix timestamp for an arbitrary date? Try this:

date -j -f "%Y-%M-%d" "2014-07-02" +"%s"

Adapt the -f format string as needed. In this case it parses yyyy-MM-dd.
+"%s" gives output in seconds since the epoch

Convert a unix timestamp back to a date:
date -jf "%s" 1394146800

permlink: _.at: Unix Timestamp

Oracle Object Source

last change: 2014-07-01
Looking for the source of triggers and stored procedures?

SELECT * FROM user_source;
SELECT * FROM dba_source;
SELECT * FROM all_source;

permlink: _.at: Oracle Object Source

Setup a DBCP datasource for H2 Database connections

last change: 2014-06-02
package whatever;

import org.apache.commons.dbcp.BasicDataSource;
import javax.sql.DataSource;
import java.util.Properties;

public class SetupDataSource {

public static final String DRIVER_CLASS_NAME = "org.h2.Driver";

public static DataSource setup(Properties dbProperties) {
// load driver class -- just to be sure...
try {
Class.forName(DRIVER_CLASS_NAME);
} catch (ClassNotFoundException e) {
Logger.getLogger(AppConfigurator.class).warn(e);
}

// seehttp://commons.apache.org/dbcp/configuration.html
BasicDataSource dataSource = new BasicDataSource();
dataSource.setUsername(dbProperties.getProperty("dbuser"));
//dataSource.setPassword(password);
dataSource.setDriverClassName(DRIVER_CLASS_NAME);
dataSource.setUrl("jdbc:h2:file:" + dbProperties.getProperty("dbfile"));
final int maxConnections = Integer.parseInt(dbProperties.getProperty("maxConnections"));
dataSource.setMaxActive(maxConnections);
dataSource.setMinIdle(1);
if(maxConnections>20)
dataSource.setMaxIdle(20);
dataSource.setMaxWait(20);
// dataSource.setValidationQuery("SELECT 1 FROM dual");
// dataSource.setTestOnBorrow(true);
dataSource.setTimeBetweenEvictionRunsMillis(5 * 60 * 1000);

return dataSource;
}

public static void main(String[] args) {

Properties dbProperties = new Properties();
dbProperties.setProperty("dbuser", "sa");
dbProperties.setProperty("dbfile", "/location/of/your/datafile");
dbProperties.setProperty("maxConnections", "100");

DataSource dataSource = setup(dbProperties);
}
}

permlink: _.at: Setup a DBCP datasource for H2 Database connections

smbfs mount ignoring file_mode / dir_mode

last change: 2014-05-09
In case a mount using smbfs to mount a SAMBA share ignores the file_mode and dir_mode settings try adding the option 'nounix':

//samba-server.local.domain/home /remote-home smbfs username=sambauser,password=sambapassword,uid=localusermapping,gid=localgroupmapping,file_mode=0775,dir_mode=0775,rw,nounix 1 2

of course substituting the correct values for your configuration:
username: the remote SAMBA user account
password: the remote SAMBA password
uid: the local user to map the files to (i.e. local owner)
gid: local group to map to
file_mode, dir_mode: the modes for files resp. directories to use locally

permlink: _.at: smbfs mount ignoring file_mode / dir_mode

Creating SSL Keys and CSRs

last change: 2014-04-15
Create new private key and CSR:
openssl req -new -nodes -keyout server.key -out server.csr -newkey rsa:4096

Show contents of CSR:
openssl req -in server.csr -text

permlink: _.at: Creating SSL Keys and CSRs

Bash: argument list too long

last change: 2014-04-07
That moment of truth when you want to clean out a filled up directory and bash reassuringly tells you:

/bin/rm: cannot execute [Argument list too long]

Use find and xargs:
find . -name "*.log" -print0 | xargs -0 rm

but beware that this works recursively. Try "-maxdepth 1" to limit to the current directory.

permlink: _.at: Bash: argument list too long

Manual SMTP Relay Check

last change: 2014-03-19
Have a simple conversation with your SMTP server using telnet to port 25:

--> HELO youthostname
<-- 250 smtpservername
--> MAIL FROM: xx@xyz.xx
<-- 250 Ok
--> RCPT TO: <xx@xyz.xx> (place recipient address here)
<-- 554 <xx@xyz.xx>: Relay access denied

permlink: _.at: Manual SMTP Relay Check

Failed Index

last change: 2014-03-19
Find an index in the 'failed' state:

select index_name, status, domidx_status, domidx_opstatus
from dba_indexes
where index_type = 'DOMAIN'
and domidx_opstatus = 'FAILED';

permlink: _.at: Failed Index

Maven Dependencies

last change: 2014-02-10
Using Maven to download dependencies when a project offers no direct downloads:

1. In an empty directory create a pom.xml outlining the dependencies to download, e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<name>Download</name>
<groupId>at.compass</groupId>
<artifactId>Download</artifactId>
<version>1.0.0</version>
<description>Download Maven dependencies</description>
<dependencies>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>

2. Use Maven to download the JARs including transitive dependencies:
mvn dependency:copy-dependencies

This will put the JARs into the subdirectory target/dependencies

permlink: _.at: Maven Dependencies

Oracle Shutdown / Restart

last change: 2014-02-10
Start SQL*Plus:
sqlplus /nolog

And use the following commands to shut an instance down:
SQL> connect system as sysdba;
SQL> shutdown immediate;

Use 'shutdown abort;' in case there are hanging connections/processes, but keep in mind that this kills those processes (i.e. use at your own risk).

Shutdown + Start:
sqlplus /nolog

SQL> connect system as sysdba;
SQL> startup force;

permlink: _.at: Oracle Shutdown / Restart

Unix Timstamps in SQL

last change: 2014-01-27
Convert a Unix timestamp to a Date in Oracle 11g:

SELECT to_date('1970-01-01','YYYY-MM-DD') + numtodsinterval(1390828626,'SECOND') FROM dual;

Be careful: this seems to be off by 1h.


And on Postgres:
SELECT (TIMESTAMP WITH TIME ZONE 'epoch' + unix_tstamp * INTERVAL '1 second')::date

permlink: _.at: Unix Timstamps in SQL

OS X Terminal Commands

last change: 2014-01-20
Very nice collection of ways to interact with the OS X terminal. My favourite so far: pbcopy/pbpaste to interact with the clipboard.

permlink: _.at: OS X Terminal Commands

OS X Terminal

last change: 2014-01-16
To nice to not post it here:

"OSX Terminal: hold option and click a position in the current line to move your cursor to that position."

permlink: _.at: OS X Terminal

HTML5 <video> tag in IE9

last change: 2013-11-27
If IE9 shows a warning that it does not support the <video> tag within an HTML5 document (with the correct DOCTYPE add this to the <head>:

<meta http-equiv="X-UA-Compatible" content="IE=9"/>

permlink: _.at: HTML5 <video> tag in IE9

OpenSSH / Ubuntu PAM Headers missing

last change: 2013-11-22
When compiling OpenSSH on Ubuntu you might get the error message "PAM headers not found". Try installing the missing header files:

sudo apt-get install libpam0g-dev

and retry
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam

permlink: _.at: OpenSSH / Ubuntu PAM Headers missing

Expiration Date of a PKCS#12 certificate

last change: 2013-11-19
Via the source linked to below...

openssl pkcs12 -in certificate.p12 -out tempcrt.pem
openssl x509 -in tempcrt.pem -noout -enddate

permlink: _.at: Expiration Date of a PKCS#12 certificate

Encrypt An External Disk Volume

last change: 2013-11-12
Convert to CoreStorage volume and encrypt in one step:
# diskutil cs convert /Volumes/Spare -passphrase

Or split into two steps:
# diskutil cs convert /Volumes/Spare
# diskutil cs encryptVolume /Volumes/Spare -passphrase

To check the status of the encryption process:
# diskutil cs info /Volumes/Spare

Obviously the volumename 'Spare' should be replaced by your volume in question...

permlink: _.at: Encrypt An External Disk Volume

Oracle: Slow connections

last change: 2013-07-18
If connecting to an Oracle instance is slow but queries themselves are OK try tnsping. If that takes more than 100ms take a look at your DNS configuration.

Check if name resolution works with all DNS servers configured in /etc/resolv.conf. Check for redundant domain entries as well.

Another possible cause may be a large listener log file. Location can be found with 'lsnrctl status'

permlink: _.at: Oracle: Slow connections

Disable a MacOS X service

last change: 2016-05-20
launchctl unload -w <path to plist file>

The plist files are located in the following directories:
/Library/LaunchDaemons
/System/Library/LaunchDaemons
/System/Library/LaunchAgents

permlink: _.at: Disable a MacOS X service

Commons Logging

last change: 2013-06-18
Configure Commons Logging to use Log4J: create the file commons-logging.properties with the following content:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

and put it in the CLASSPATH

permlink: _.at: Commons Logging

Extend TEMP tablespace

last change: 2013-05-29
Add a new file to the temporary tablespace:

ALTER TABLESPACE TEMP ADD TEMPFILE '/path/to/datadir/tempXX.dbf' SIZE 500M AUTOEXTEND ON MAXSIZE 4G;

permlink: _.at: Extend TEMP tablespace

Compile Apache 2.4

last change: 2013-05-17
Install packages libpcre3 and libpcre3-dev

mkdir download compile
cd compile
tar xzvf ../download/httpd-2.4.4.tar.gz
cd httpd-2.4.4/srclib
tar xzvf ../../../download/apr-util-1.5.2.tar.gz
mv apr-util-1.5.2/ apr-util
tar xzvf ../../../download/apr-1.4.6.tar.gz
mv apr-1.4.6/ apr
cd ..
./configure '--enable-so' \
'--enable-ssl' \
'--enable-rewrite=shared' \
'--enable-headers=shared' \
'--enable-proxy=shared' \
'--enable-proxy-balancer=shared' \
--with-included-apr

permlink: _.at: Compile Apache 2.4

Problems with configure

last change: 2013-05-17
When configure exits with the message "configure: error: cannot run C compiled programs." under Ubuntu reinstallation of libc-dev might help:

aptitude update
apt-get install --reinstall libc6-dev
apt-get install libc6-dev-i386

permlink: _.at: Problems with configure

Installing pdsh on MacOS X

last change: 2013-05-14
How to compile pdsh, the distributed parallel shell, on MacOS X

Download and compile readline:
cd readline-6.2
MACOSX_DEPLOYMENT_TARGET=10.8 ARCHFLAGS="-arch x86_64" \
./configure --prefix=/usr/local --enable-shared
# regardign error about -dynamiclib: seehttp://www.iamseree.com/application-development/readline-6-2-make-error-in-mac-os-x-lion
cd shlib
sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.osx
mv Makefile.osx Makefile
cd ..
#
make
make && sudo make install

Download and compile pdsh:
cd pdsh-2.29
./configure --with-ssh --with-readline --without-rsh
make && sudo make install

permlink: _.at: Installing pdsh on MacOS X

Extend an Oracle tablespace

last change: 2013-05-14
Add a datafile to an existing Oracle tablespace tb_name:

ALTER TABLESPACE tb_name ADD DATAFILE '/path/to/new/datafile.dbf' SIZE 200M AUTOEXTEND ON NEXT 100M MAXSIZE 4000M;

Show all datafiles associated with a tablespace tb_name:
SELECT * FROM dba_data_files WHERE tablespace_name='tb_name';

permlink: _.at: Extend an Oracle tablespace

Create Schema / User manually in Oracle

last change: 2013-04-09
How to create a user TESTUSER with a tablespace TESTUSERTABLESPACE per SQL:
DATABASENAME is the name of the containing database.

-- Here 2 datafiles are used. Adjust as needed:
CREATE SMALLFILE TABLESPACE "TESTUSERTABLESPACE" DATAFILE '/oracle/oradata2/DATABASENAME/testuser.dbf' SIZE 300M REUSE, '/oracle/oradata3/DATABASENAME/testuser.dbf' SIZE 300M REUSE LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE USER testuser IDENTIFIED BY testpassword DEFAULT TABLESPACE TESTUSERTABLESPACE;
ALTER USER testuser QUOTA UNLIMITED ON TESTUSERTABLESPACE;

GRANT CONNECT, CREATE SESSION, CREATE TABLE TO testuser;
GRANT select, insert, update, delete, alter ON testuser.tabellenname TO testuser;
GRANT select, alter ON testuser.tabellenname_id_seq TO testuser;

-- extend if needed:
ALTER DATABASE DATAFILE '/oracle/oradata2/DATABASENAME/testuser.dbf' RESIZE 500M;
ALTER DATABASE DATAFILE '/oracle/oradata3/DATABASENAME/testuser.dbf' RESIZE 500M;

-- or set auto-extend:
ALTER DATABASE DATAFILE '/oracle/oradata2/DATABASENAME/testuser.dbf' AUTOEXTEND ON;
ALTER DATABASE DATAFILE '/oracle/oradata3/DATABASENAME/testuser.dbf' AUTOEXTEND ON;

permlink: _.at: Create Schema / User manually in Oracle

Changing the senders hostname for Java Mail

last change: 2013-03-27
Add the following property to your mail configuration, substituting the correct name for my.mail.hostname.com:

properties.put("mail.smtp.localhost", "my.mail.hostname.com");

permlink: _.at: Changing the senders hostname for Java Mail

Rails with JRuby on MacOS X

last change: 2012-07-25
Install Rails Gem:
$ sudo jruby -S gem install rails

If using a proxy either add the corresponding command line flag or edit ~/.gemrc (see below):
$ sudo jruby -S gem install rails --http-proxyhttp://proxy.company.com:8080

Install JRuby SSL support:
$ sudo jruby -S gem install jruby-openssl

Create a dummy project to install the missing gems:
$ sudo jruby -S rails new RailsTest

When using a proxy you can add the hostname to ~/.gemrc like this:
gem: --http-proxyhttp://proxy.company.com:8080
bundle: --http-proxyhttp://proxy.company.com:8080
bundler: --http-proxy http://proxy.company.com:8080

permlink: _.at: Rails with JRuby on MacOS X

Import PKCS#12 certificates into a Java Keystore

last change: 2012-06-04
keytool -importkeystore \
-deststorepass KEYSTORE_PASSWORD \
-destkeypass KEYSTORE_PASSWORD \
-destkeystore KEYSTORE_FILENAME \
-srckeystore INPUTFILE \
-srcstoretype PKCS12 \
-srcstorepass INPUTFILE_PASSWORD \
-alias 1

permlink: _.at: Import PKCS#12 certificates into a Java Keystore

MacOS X Download History

last change: 2012-02-14
OS X obviously keeps a list of downloads (not only for Safari) to enable those protective popups 'XXX was downloaded from the internet. Are you shure you want to open it?'

Under Lion this information can be found in the file
~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2
which is an SQLite database. Contents can be dumped using this command:

sqlite3 -header -line ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 \
'SELECT LSQuarantineAgentName AS Browser, LSQuarantineDataURLString AS File FROM LSQuarantineEvent WHERE LSQuarantineAgentName <> "PubSubAgent"'

Brushed up SQL inspired by the script found in the linked article below.

permlink: _.at: MacOS X Download History

Ho to install SHA-1 support for PostgreSQL

last change: 2012-01-17
In the PostgreSQL source directory:
cd contrib/pgcrypto
make; make install

start psql and create a utility function:

psql -Upostgres template1

-- for Postgres < 9.1:
template1=# \i contrib/pgcrypto/pgcrypto.sql
-- for Postgres >= 9.1:
template1=# CREATE EXTENSION pgcrypto;

-- common part:
template1=# CREATE OR REPLACE FUNCTION sha1(varchar) returns text AS '
SELECT encode(digest($1::bytea, ''sha1''), ''hex'')
' LANGUAGE SQL STRICT IMMUTABLE;

permlink: _.at: Ho to install SHA-1 support for PostgreSQL

Importing certificates into a Java keystore

last change: 2011-12-06
First convert the certificate to X509 format using OpenSSL. Starting e.g. with a certificate in PKCS12 format convert it to PEM:
openssl pkcs12 -in certificate.cer -out certificate.crt -clcerts

Optionally: export public key:
openssl pkcs12 -in certificate.cer -out certificate.public -nokeys -clcerts

And then to X509:
openssl x509 -inform pem -in certificate.crt -outform der -out certificate.cer

This can finally be imported into a Java keystore:
/usr/local/jdk1.6/bin/keytool -import -keystore keystore.jks -trustcacerts -alias key-alias -file certificate.cer

permlink: _.at: Importing certificates into a Java keystore

Scala problems

last change: 2011-11-30
In a quite long message which seems to be written as private conversation that became public someone who worked with Scala for some time really points to its weaknesses. It is one thing to like or dislike the often symbol-heavy syntax, but that post mentions several problems they encountered as a team which should not be dismissed as simple preferences, such as problematic code structures loosing performance (for-loops) or the penalty of using Scalas collection library (both mutable and immutable), which is more or less imposed as mandatory when using the standard library.

My short encounter with Scala reflects several of the points made, but the really bad part that finally convinced me to look for another take on next-gen JVM-languages is summed up in this quote:
"(...) but at some point a best practice emerged: ignore the community entirely."

The Scala community, while quite large, always seemed quite hostile to me, with lots of talent and time wasted on waging war over preferences of style. I do not want to spend my time on figuring out, who is 'right' in the sense of which preference gets adopted by the Scala community at large... So I stopped investing time in Scala at all.

permlink: _.at: Scala problems

Convert secsh Public Key format

last change: 2011-11-14
Convert a file in secsh-format (e.g. coming out of Putty) to a format usable with OpenSSH:

ssh-keygen -i -f putty-key.pub >openssh-key.pub

permlink: _.at: Convert secsh Public Key format

Preprocess Apache Logs for Evaluation

last change: 2011-11-09
This simple shellscript converts standard Apache common logfiles to a CSV format (note the tabs in the replacement pattern between each column):


#!/bin/sh
echo "IP\tTag\tMonat\tJahr\tUhrzeit\tURL\tStatus\tTransfer"
# 1: IP
# 2: day
# 3: month
# 4: year
# 5: time
# 6: url
# 7: protocol
# 8: status code
# 9: transfer in bytes

cat $1 | \
sed -E 's/(.*) \- \- \[([0-9]*)\/([A-Z][a-z]*)\/([0-9]*):(.*) \+[0-9]*\] "GET (.*) HTTP\/(.*)" +([0-9]*) ([0-9]*) "(.*)" .*/\1 \2 \3 \4 \5 \6 \7 \9/g'

permlink: _.at: Preprocess Apache Logs for Evaluation

Create a Unix User / Group from the command line on MacOS X

last change: 2013-02-08
% sudo dscl . -create /Users/luser
% sudo dscl . -create /Users/luser UserShell /bin/bash
% sudo dscl . -create /Users/luser RealName "Realname for user"
% sudo dscl . -create /Users/luser UniqueID "1010"
% sudo dscl . -create /Users/luser PrimaryGroupID 80
% sudo dscl . -create /Users/luser NFSHomeDirectory /Users/luser

Create a group:
% sudo dscl . -create /groups/tomcat
% sudo dscl . -append /groups/tomcat gid 230
% sudo dscl . -append /groups/tomcat passwd "*"

Add a user to this group (replace username with the correct value):
% sudo dscl . -append /groups/tomcat GroupMembership luser

in part derived from an answer at Serverstack: http://serverfault.com/a/20706

permlink: _.at: Create a Unix User / Group from the command line on MacOS X

Start MacOS X Screen Sharing

last change: 2015-06-13
To start the Screen Sharing application directly open Terminal and type the following command:
# open /System/Library/CoreServices/Screen\ Sharing.app/

Under OS X 10.10 this moved application was moved:
# open /System//Library/CoreServices/Applications/Screen\ Sharing.app

permlink: _.at: Start MacOS X Screen Sharing

Change Networksettings on MacOS X on the commandline

last change: 2011-09-22
First determine the installed services / interfaces:
# networksetup -listallnetworkservices

Read the current configuration for a service (name as listed in the output above):
# networksetup -getinfo Ethernet

Change e.g. the DNS server:
# networksetup -setdnsservers "Ethernet" 8.8.8.8

permlink: _.at: Change Networksettings on MacOS X on the commandline

Node Package Manager via Squid

last change: 2011-09-20
In some configurations the Squid HTTP Proxy seems to deny NPM requests when using the HTTPS protocol. In this case the error message returned by npm will contin a phrase like this:

"Unsupported Request Method and Protocol"

Try to reconfigure npm to use HTTP instead with this command:

$ npm config set registryhttp://registry.npmjs.org/

The currently used configuration can be read by issuing

$ npm config get registry

permlink: _.at: Node Package Manager via Squid

Servlets with Clojure

last change: 2011-08-04
A simplistic servlet implemented in Clojure
more...

Disable Lion Window Animations and other minor annoyances

last change: 2011-08-01
Disable generic window open animation use the following command in a Terminal window:
# defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool NO
Replace 'NO' with 'YES' to re-enable them.

Disable animations in Mail:
# defaults write com.apple.Mail DisableReplyAnimations -bool YES
Quit Mail before changing this setting. Replace 'YES' with 'NO' to re-enable animations.

Restore key autorepeat:
# defaults write -g ApplePressAndHoldEnabled -bool false

Make Library folder visible:
# chflags nohidden ~/Library/

Disable Spelling correction:
# defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool NO

Disable local Timemachine:
# sudo tmutil disablelocal

permlink: _.at: Disable Lion Window Animations and other minor annoyances

FOP Font installation

last change: 2011-06-30
Put Font files (TTF or OTF) in same directory as the XSL file, create a file called fop-config.xml with this content:

<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>

Alternatively put font files under <JAVA_HOME>/jre/lib/fonts/

permlink: _.at: FOP Font installation

XSL-FO hyphenation library

last change: 2011-06-30
To enable hyphenation when using Apache FOP 1.x use

<fo:block margin-left="0mm" font-size="10pt" text-align="justify" language="de" hyphenate="true">
<xsl:value-of select="."/>
</fo:block>

after installing the OFFO hyphenation library.

permlink: _.at: XSL-FO hyphenation library

Image format conversion

last change: 2011-06-30
From (CMYC) EPS or Adobe Illustrator etc. to JPG using ImageMagick:
convert -density 300 -colorspace RGB inputfile.ai -trim outputfile.jpg

Or using transparency:
convert -density 300 -colorspace RGB inputfile.ai -trim +repage -background transparent -alpha background PNG32:outputfile.png

From EPS to SVG using pstoedit:
pstoedit -f plot-svg inputfile.eps outputfile.svg
This uses a shareware plugin for pstoedit to enable SVG output.

permlink: _.at: Image format conversion

Android ports

last change: 2011-05-18
Complaining why the client in question was first developed for iOS a user writes:

"Ya, just read in the news Android is seeing 400000 new activations PER DAY, don’t waste your time with iOS! And make it free with ads, no way I’m paying, sorry"

I guess he still doesn't get it why they are 'wasting their time' with iOS ;-) Hint: it might have something to do with this exact mentality...

permlink: _.at: Android ports

HTTP Date format in Java

last change: 2011-05-17
To format a date according to the HTTP standard (needed in the Last Modified header):

public static String formatHttpDate(Date date)
{
SimpleDateFormat httpDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
httpDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));

return httpDateFormat.format(date);
}

permlink: _.at: HTTP Date format in Java

Querying MongoDB from Clojure using regex Prefix matches

last change: 2011-04-15
Turns out to be quite simple... Assuming a collection with an indexed attribute called 'index' the code would look something like this:

(ns test
(:use somnium.congomongo))

(def mongo-server "mongo.test")
(def mongo-db "testdb")
(def mongo-collection "indexedtestcollection")

(defn find-test [input]
(mongo!
:host mongo-server
:db mongo-db )
(let [rx (. Pattern compile (str "^" (first input)))]
(println (.getName (.getClass rx)))
(take 3
(fetch mongo-collection
:where {:index rx}
)
)
)
)

The main point being that the value for rx must be a Regex instance. In this sample code the regex is dynamically created, using a static #"^regex" works as well.

MongoDB can only use the index on the column if the regex is a prefix match (i.e. uses the '^' anchor).

permlink: _.at: Querying MongoDB from Clojure using regex Prefix matches

Print a stacktrace in Clojure REPL

last change: 2011-04-06
To print a stracktrace after an exception occurred use these commands:

user=> (use 'clojure.stacktrace)
user=> (print-stack-trace *e 10)

permlink: _.at: Print a stacktrace in Clojure REPL

MySQL: JDBC Connect String with UTF-8 encoding

last change: 2011-04-04
jdbc:mysql://localhost/some_db?useUnicode=yes&characterEncoding=UTF-8

permlink: _.at: MySQL: JDBC Connect String with UTF-8 encoding

Look up details by index / constraint name

last change: 2011-03-25
select * from "SYS"."ALL_INDEXES" where index_name like 'constraintname%'

Replace constraintname by the name of your specific piece of interest.

permlink: _.at: Look up details by index / constraint name

Installing ImageMagick PHP extension on Ubuntu

last change: 2011-03-18
# apt-get install libmagickwand-dev libmagickcore-dev

# pecl install imagick

permlink: _.at: Installing ImageMagick PHP extension on Ubuntu

Installing mcrypt PHP extension on Ubuntu

last change: 2011-03-18
# apt-get install libmcrypt-dev

# cd php-5.x.x/ext/mcrypt
# phpize
# aclocal
# ./configure
# make && make install

Add 'extension=mcrypt.so' to php.ini.

permlink: _.at: Installing mcrypt PHP extension on Ubuntu

HowTo: Resize an EXT4-formatted Linux LVM Volume in a virtual machine

last change: 2011-02-17
1. Resize the volume using VMWare VM-Manager. The size field is greyed out if there are any snapshots defined... you'll have to delete them.

2. Start the virtual machine.

3. Use cfdisk to create a new logical partition in the free space of the virtual disk. Use type 8e - Linux LVM. Note: fdisk did not see the free space on the device. The new partition is /deb/sda6 in this example.

4. REBOOT the virtual machine. In our tests the change to the partition table was not visible after exiting cfdisk.
# reboot

5. Create a physical volume:
# pvcreate /dev/sda6
  Physical volume "/dev/sda6" successfully created

6. Use lvdisplay to look up the name of the volume group currently in use:
# lvdisplay
  --- Logical volume ---
  LV Name                /dev/mongo1/root
  VG Name                mongo1
  LV UUID                wi9dRo-fS0C-xSCd-fbei-el9R-vpVi-0QEiIR
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                9,29 GiB
  Current LE             2379
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           251:0

7. Add the physical volume to the volume group found in the field 'VG Name':
# vgextend mongo1 /dev/sda6
  Volume group "mongo1" successfully extended

8. Now you can try to extend the existing logical volume (as named in field 'LV Name' above). If the given size increase (20GB in this example) is more than is available in the disk group, the error message will indicate the number of blocks available:
# lvextend -L +20G /dev/mapper/mongo1-root
  Extending logical volume root to 29,29 GiB
  Insufficient free space: 5120 extents needed, but only 5119 available

Retry with the number of blocks taken from this error message:
# lvextend -l +5119 /dev/mapper/mongo1-root
  Extending logical volume root to 29,00 GiB
  Logical volume root successfully resized

9. Resize the filesystem (sorry for the german output -- this is the only command that used the locale setting...):
# resize2fs /dev/mapper/mongo1-root
resize2fs 1.41.11 (14-Mar-2010)
Das Dateisystem auf /dev/mapper/mongo1-root ist auf / eingehängt; Online-Grössenveränderung nötig
old desc_blocks = 1, new_desc_blocks = 2
Führe eine Online-Grössenänderung von /dev/mapper/mongo1-root auf 5241856 (4k) Blöcke durch.
Das Dateisystem auf /dev/mapper/mongo1-root ist nun 5241856 Blöcke gross.

permlink: _.at: HowTo: Resize an EXT4-formatted Linux LVM Volume in a virtual machine

Trivia: Adding Linux Swapspace

last change: 2011-02-13
dd if=/dev/zero of=/swapfile bs=1M count=2048
mkswap /swapfile
swapon /swapfile

Don't forget to also add the last command (swapon) to the system startup scripts (e.g. in /etc/rc.local).

permlink: _.at: Trivia: Adding Linux Swapspace

ORA-00603: ORACLE server session terminated by fatal error

last change: 2010-08-13
If you keep getting ORA-00603 or ORA-00600 errors on commit, watch out for any materialized views and change them from 'refresh on commit' to 'refresh on demand'.

The error messages look like this:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [4080], [1], [131], [], [], [], [], []

permlink: _.at: ORA-00603: ORACLE server session terminated by fatal error

Fileupload in Servlets

last change: 2010-08-10
Due to a problem with UTF-8 encoded data I recently switched from the old (in my case *very* old) com.oreilly.servlet.MultiPartRequest to Apache Commons FileUpload. Big mistake.

As often the commons package promises everything and the kitchen sink but in truth simply is not up to the job. In this case there are several things that annoyed me:

*) The interface to the parsed request data. Why can't I access parameters by name? Why do I have to collect them into a ServletRequest-like structure myself? I will upload the resulting helper class here soon... in case someone else can't do the obvious: switch to another library.

*) UTF-8 data does not work. The only position FileUpload accepts an encoding string is via setHeaderEncoding() -- which definitly does not influence parsing of request data... So every string read from a request field must be converted to UTF-8 by hand:

String value = new String (fileItem.getString().getBytes("iso-8859-1"), "UTF-8");

Today I downloaded a fresh copy of the com.oreilly.servlets package, added the encoding parameter to the constructor call of MultiPartRequest and it just works. The lesson is: avoid Apache commons wherever possible. Note: please read the licensing info of the com.oreilly.servlet package, which boils down to the fact that each member of the development team should own a copy of the corresponding O'Reilly book 'Java Servlet Programming', which is excellent but was not updated quite a while.

permlink: _.at: Fileupload in Servlets

Blackberry Protect

last change: 2010-07-13
Nice service from Blackberry: features which were only available on BES now come to BIS users as well: remote backup, lock and sweep. Service is in closed beta right now, open beta is expected for fall 2010. Said to be free except for mobile data charges.

permlink: _.at: Blackberry Protect

Amazon

last change: 2010-07-09
Amazon seems to try to act as a Copyright Cop recently: the large view of book covers is protected by futile measures to prevent saving these images. A simple look into the local browser cache (assisted by Firefox through means Page Info -> Media) reveals everything needed...

permlink: _.at: Amazon

Favourite Safari Extensions

last change: 2010-06-14
Nice to see the most welcome Safari Extension to become available within just days of the Safari 5 release: AdBlock for Safari.
Another essential tool for readers of certain german pages like DerStandard.at: Binnen-X removes the typing errors that manifest themselves in inline uppercase letter 'i'.

permlink: _.at: Favourite Safari Extensions

IDEA with Mercurial Plugin

last change: 2010-03-01
When using IntelliJ IDEA 9 with the Mercurial plugin hg4idea, I've had problems updating local repositories from the central mercurial-server, suggesting to use 'hg rebase' while mentioning MQ patches.
Turns out that this plugin needs the MQ extension enabled in the Mercurial commandline client. Configure this extension by adding the following lines to your ~/.hgrc:

[extensions]
hgext.mq =

No value is necessary as this is a standard extension and hg will find the necessary library within its installation path.

permlink: _.at: IDEA with Mercurial Plugin

Graphical Mercurial Client for MacOS X

last change: 2010-02-05
A graphical client to the DVCS Mercurial for MacOS X 10.5+, written in Objective-C. Looks quite promising.

permlink: _.at: Graphical Mercurial Client for MacOS X

Hardening Tomcat

last change: 2010-02-03
A detailed, 56-page guide to hardening Apache Tomcat. Link found via Mulesoft / Sateesh Narahari.

permlink: _.at: Hardening Tomcat

Supercookies

last change: 2010-02-01
Nice Firefox-Plugin to handle Flash-Cookies: Better Privacy. Recommended.

permlink: _.at: Supercookies

Spam-Templates

last change: 2010-01-27
Nice approach to filtering spam -- actually something I do manually right now. This filter collects multiple messages and tries to find the underlying template which is 'randomized' by words inserted from a limited-size dictionary. It reaches less than 1% false positives after gathering 100 spam-mails and gets even better with more... Might put some additional work on the spammers to evade this.

permlink: _.at: Spam-Templates

Nexus One

last change: 2010-01-07
Good balanced review by Engadget regarding the much-hyped Nexus One.
From the article:
"Industry politics aside, though, the Nexus One is at its core just another Android smartphone. It's a particularly good one, don't get us wrong -- certainly up there with the best of its breed -- but it's not in any way the Earth-shattering, paradigm-skewing device the media and community cheerleaders have built it up to be. It's a good Android phone, but not the last word -- in fact, if we had to choose between this phone or the Droid right now, we would lean towards the latter."

Thats quite to the point. And the missing keyboard is still a no go to me.

permlink: _.at: Nexus One

CSS Snowflakes

last change: 2009-12-31
Title says it all...
Note: works best in Safari or Chrome. And this is just JavaScript and CSS, not Flash. The time, CSS3 is supported by all major browsers is the time, Adobe should start worrying...

permlink: _.at: CSS Snowflakes

Daring Fireball nonsense

last change: 2009-12-14
Regarding the half-official Google Nexus One phone Gruber states:

"The big advantage over the Droid: no hardware keyboard."

There are times when this otherwise brilliant commenter simply does not get it: no keyboard means 'I won't buy it' for a whole lot of people. Me included -- mostly due to my constant fighting with the iPhones implementation of a soft-keyboard, which sure is better than most other implementations but still ridiculously inferior to e.g. the Blackberry Bold keyboard.

So I see the Droids Keyboard as its main advantage over other offerings... its the one feature that makes me consider to try it out. I definitely won't try the Nexus One which is missing this feature.

permlink: _.at: Daring Fireball nonsense

Google Chrome Beta for Mac

last change: 2009-12-09
Google finally released Chrome for Mac into Beta status. Which is generally good news, although I will not use it for general browsing due to its 'active interest' in my browsing habits. But its excellent JavaScript performance and miniscule memory footprint (at least so far) make it worthwile running it in the background just for accessing my GMail account.

Besides that at some point in the future a port of Iron, a version of Chromium without many of the (intentional) shortcommings of Google Chrome might also be ported to the Mac.

permlink: _.at: Google Chrome Beta for Mac

Android 2

last change: 2009-12-09
A nice overview of the changes Android 2.0 brings to the table. Sounds as if it will give Apple a run for its money -- and make the idiotic design decisions (read: AppStore, background processes, API limitations) even more obvious.

permlink: _.at: Android 2

Micro-Windows PDA

last change: 2009-12-07
Coming with a bit of Psion reminiscence: a kind of Atom-based PDA with a keyboard, 1GB RAM, 800x480 screen running Windows. Interesting.

permlink: _.at: Micro-Windows PDA

Helpdesk

last change: 2009-11-16
How to complain about a malfunctioning vacuum cleaner:
"This thing sucks. That is... actually it doesn't."

permlink: _.at: Helpdesk

JavaScript grows up

last change: 2009-11-09
Besides being a complete scripting language in its own right (with some actually quite interesting design decisions -- as well as some fatal ones), recent advances in interpreter technology helped JavaScript gain acceptance as a client interface scripting language.
Looking beyond what is now being done with web applications utilizing AJAX, more performance sensitive areas like gaming seem to come into reach. Displace Flash -- how nice this prospect sounds... hope it becomes real rather sooner than later.

permlink: _.at: JavaScript grows up

Apples blunder, pt. 1001

last change: 2009-11-08
Next really bad story of Apple getting it wrong with their AppStore... The just seem to not get it. Still glad my iPhone is sold already...

permlink: _.at: Apples blunder, pt. 1001

ZFS

last change: 2009-11-03
Apples lame decision to drop ZFS from its future goals or MacOS X gets special treatment by Sun: ZFS gets inline deduplication. Besides other advanced features already present in the current version such as integrated RAID support, pooled storage and snapshots, this makes me doubt that Apple can come up with something even remotely as powerful...

permlink: _.at: ZFS

Really bad...

last change: 2009-10-23
Why do Ubuntu releases have to have these really idiotic names? Like 'Karmic Koala'... I'm just waiting for a version going by 'Sterioidal Snail' or something like that...

permlink: _.at: Really bad...

SCO leaving the Past behind

last change: 2009-10-20
Seems as his last crusade is over: Darl McBride is history. At least as SCOs CEO, they kicked him in an effort to recover from bankruptcy. Good move...

permlink: _.at: SCO leaving the Past behind

Intellij IDEA goes Open Source

last change: 2009-10-16
Quite a bold move by Jetbrains, the people behind what I consider to be the best Java IDE by far: starting with Version 9 (soon to be released) they will split into two version, IDEA Community Edition and Ultimate Edition. While the latter remains a commercial offer, primarily targeting J2EE devlopers, the former will be published under the Apache 2.0 license.

One might suspect the free offer to be so crippled that it will just draw potential customers to IDEA and then convert them to commercial licenses. This seems not to be the case: while having a clear focus on J2SE, the Community Edition retains all the features that made IDEA a great offer for J2SE developers (even the powerful refactoring capabilities seem to be intact) while gaining additional support features for Groovy and Scala development.

I'm really looking forward to a greatly expanded IDEA audience. Many of those choosing Eclipse just because it is free now can reconsider their choice...

permlink: _.at: Intellij IDEA goes Open Source

Internal affairs: RSS feed validated

last change: 2009-10-06
Problems with Google Reader due to an unusual timestamp format should now be resolved, the feed is now valid (some missing fields were added, too).
The RSS timestamp format can be produced with the following Java code:

SimpleDateFormat rssDateFormat = new SimpleDateFormat("E, dd MMM yyyy hh:mm:ss Z");

permlink: _.at: Internal affairs: RSS feed validated

Palm supports developers...

last change: 2009-10-06
Now this looks like developer support should be: Palm intends to share not only technical documents but even statistical data with their developers. Not to mention that there is no 'app review process' getting in the way. Just imagine what the iPhone plattform would look like without Apple dictating what their users are allowed to do -- of course having only their customers on mind... Or just their money?

permlink: _.at: Palm supports developers...

Blackberry Desktop for Mac

last change: 2009-10-02
Seems already to be available for Download...

permlink: _.at: Blackberry Desktop for Mac

Wave

last change: 2009-10-01
Besides the quite interesting new take on communication, this one quote from an ARS Technica article about Google Wave highlights one of the really interesting points the technology demo makes:

"Wave's dependence on the latest and greatest browser features are a characteristic that makes the service particularly interesting to Web developers. It sheds light on what the Web would look like without Internet Explorer and it provides an early glimpse at the next generation of Web applications—massively concurrent, highly interactive, and deeply collaborative."

Imagine a Web without the restrictions imposed by Internet Explorer... Might be worth fighting for. And Google Wave could prove to be a major milestone in this war as it seems to garner a *lot* of interest.

permlink: _.at: Wave

Linux Kernel increasingly inefficient

last change: 2009-09-22
I knew it...
OK, it *does* support numerous plattforms and gazillions of features (almost nobody actually uses btw.). But wouldn't it be better to make these parts optional? Micro-kernel anyone? Would of course collide with the current development model -- but maybe this would also be a good time to rethink that as well.

permlink: _.at: Linux Kernel increasingly inefficient

Bolts 1.0 Functional Programming Library for Java

last change: 2009-09-15
While I still prefer Scala due to its concise syntax and ingenious type inference, this is certainly helpful when making functional programming more widely accessible. And the Collections API does look much nicer when seen through Bolts...

permlink: _.at: Bolts 1.0 Functional Programming Library for Java

Blackberry Tethering for Mac and Linux

last change: 2009-09-15
Interesting solution to a not-so-uncommon problem: Tethering with a Blackberry when not running Windows. Berry4All does it -- and for free.

permlink: _.at: Blackberry Tethering for Mac and Linux

Background Apps

last change: 2009-09-05
So, background apps are bad for you which is why Apple protects you from them?
Well, it seems that paying extra might leverage the possible harm... WTF?

permlink: _.at: Background Apps

Petabytes

last change: 2009-09-03
Interesting article detailing the parts of a massive storage system at reasonable costs: 67 TB under USD 8000,-. Interesting price comparison with other storage vendors is included.

permlink: _.at: Petabytes

Is Nokia waking up?

last change: 2009-09-01
Maybe the still dominant but sleeping giant is returning to life... two new products about to be released look quite promising: for once, Nokia is entering the netbook space with a quite stylish thing offering built-in HSPA capabilities (should come as natural given Nokias heritage) and -- more interesting to me -- a smartphone with a really freshened up user interface.

Acutally I did never understand the Symbian critics as I do not consider the OS to be the culprit in Nokias cramped interfaces... nevertheless its Linux-based OS Maemo looks quite promising. Having a hardware keyboard is still the killer feature for me.

permlink: _.at: Is Nokia waking up?

Mercurial on MacOS X

last change: 2009-07-22
When installing Mercurial from source using 'make install' it copies its support files to the directory /usr/local/lib/python2.5/site-packages/
Running 'hg debuginstall' gives an error like this:
abort: couldn't find mercurial libraries in [...]

To correct this do the following:

sudo mv /usr/local/lib/python2.5/site-packages/hgext/ /Library/Python/2.5/site-packages/
sudo mv /usr/local/lib/python2.5/site-packages/mercurial-1.3-py2.5.egg-info /Library/Python/2.5/site-packages/
sudo mv /usr/local/lib/python2.5/site-packages/mercurial/ /Library/Python/2.5/site-packages/

'hg debuginstall' should now run fine.

2009/07/22:
Added link to Mercurial binaries for Mac. Version 1.3 is already present there.

permlink: _.at: Mercurial on MacOS X

Mercurial default push repository

last change: 2009-07-22
To set the default repository to push changes to open .hg/hgrc within the project and add the following section (replacing the mercurial-server and the project-name parts of the URL appropriatly):

[paths]
default = ssh://hg@<mercurial-server>/<project-name>

Note that this default entry is created for you each time you clone a remote repository.

You can add more short names to this section to use them in push and pull commands, just replace 'default' with the name like this:

ted = ssh://hg@teds-machine/teds-project

and use them:

hg push ted
hg pull ted

permlink: _.at: Mercurial default push repository

Gitosis Problem

last change: 2009-07-20
As gitosis suddenly told me the following when doing a push:

$ git push
Traceback (most recent call last):
File "/usr/bin/gitosis-serve", line 8, in <module>
load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-serve')()
File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/app.py", line 24, in run
return app.main()
File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/app.py", line 38, in main
self.handle_args(parser, cfg, options, args)
File "/usr/lib/python2.5/site-packages/gitosis-0.2-py2.5.egg/gitosis/serve.py", line 204, in handle_args
os.execvp('git', ['git', 'shell', '-c', newcmd])
File "/usr/lib/python2.5/os.py", line 354, in execvp
_execvpe(file, args)
File "/usr/lib/python2.5/os.py", line 392, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
fatal: The remote end hung up unexpectedly

The reason was taht unexplicably it somehow forgot a path (git is installed unter /usr/local on that server). Adding a symlink on the server

ln -s /usr/local/bin/git /usr/bin

solved the problem. Adding the PATH variable to the users homedirectories .bashrc (and/or .profile) did not help.

permlink: _.at: Gitosis Problem

Apache

last change: 2009-07-16
A typical state of Apache projects (except the Webserver) can be watched at the website presenting the Apache Logging / Log4J project:
Version 2 is "an experimental development branch for logging services designed for Java 5 and later." -- which in my understanding means, it was started several years ago (when Java 5 was new) and made no progress to date.
Better even the status of the 1.3 Branch: "log4j 1.3 development has been abandoned and no future releases or development is anticipated". The icing on this cake is the next sentence: "Users of log4j 1.3 are encouraged to migrate to log4j 1.2". No more questions, thank you.

permlink: _.at: Apache

Speed

last change: 2009-07-10
So much regarding the 'S' in the latest iPhone generations name representing 'Speed': its upstream bandwidth is limited to 384Kpbs... HSUPA anyone?

permlink: _.at: Speed

Groovy Creator James Strachan on Scala

last change: 2009-07-07
The main point reflecting my own considerations on the subject Groovy vs. Scala:
"I can honestly say if someone had shown me the Programming Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy."

I really like Scala being a statically typed language. And the elegant functional extensions to the object oriented modell are well worth learning this new language...

permlink: _.at: Groovy Creator James Strachan on Scala

Blackberry RSS Reader

last change: 2009-07-07
Looking for a RSS reader that syncs with your desktop reader? This might be the right one: in addition to the well-known iPhone companion to FeedDaemon/NetNewsWire on the desktop there is a Blackberry and Windows Mobile solutions available as well. The interface is lagging behind the iPhone version but still usable.

permlink: _.at: Blackberry RSS Reader

PostgreSQL 8.4

last change: 2009-07-07
Interesting additions to the administration tool suite (from the press release):

* Parallel Database Restore, speeding up recovery from backup up to 8 times
* Per-Column Permissions, allowing more granular control of sensitive data
* Per-database Collation Support, making PostgreSQL more useful in multi-lingual environments
* In-place Upgrades through pg_migrator (beta), enabling upgrades from 8.3 to 8.4 without extensive downtime
* New Query Monitoring Tools, giving administrators more insight into query activity
* Greatly Reduced VACUUM Overhead through the Visibility Map
* New Monitoring Tools for current queries, query load and deadlocks

permlink: _.at: PostgreSQL 8.4

Database maintainance

last change: 2009-07-07
Automate Database maintainance: this tool keeps track which update scripts have already been applied to a database to help keep development and production database updates in sync.

permlink: _.at: Database maintainance

David Pollak interview

last change: 2009-06-24
David Pollak on Scala and Lift.

Interesting excerpt regarding a test by Martin Odersky on perception of code:
"...no matter whether they were looking at Scala, Ruby or Java, they spent almost exactly the same time per language token looking at code, so if you say how few language tokens can we use to express our business logic, that's how fast somebody can look at the code and perceive it, that's how fast somebody can write the code because no matter what language you are writing in you write about the same number of line of code per day."

permlink: _.at: David Pollak interview

Monospaced Fonts for Programming

last change: 2009-06-16
A nice list of Fonts for programmers... Courier might not be your best bet ;-)

Update 16.06.2009:
Tried Consolas for a while and now switched to Anonymous Pro. Consolas 'f' tends to irritate me.

permlink: _.at: Monospaced Fonts for Programming

Lift Webapplication Framework

last change: 2009-06-08
As each language needs a webapplication framework these days, here is Scalas take: Lift. Combining some ideas from Rails (such as sensible configuration defaults) with the basic abilities of the functional-objectorientied hybrid language Scala (utilizing for example the Actor library) this framework sounds quite compelling.

permlink: _.at: Lift Webapplication Framework

Optimizing massive DELETE operations

last change: 2009-06-04
Interesting article on how to get optimal performance when deleting vast amounts of data while keeping some records (i.e. no TRUNCATE). Essentially the trick is inserting data to keep into a temporary table using direct-path INSERT on a table without a primary key index.

permlink: _.at: Optimizing massive DELETE operations

Howto Add Ringtones to your Blackberry

last change: 2009-06-04
A detailed Howto-guide on adding custom ringtones to your Blackberry device by mail, by download or by PC/Mac.

permlink: _.at: Howto Add Ringtones to your Blackberry

Unix, Windows and programming language timelines

last change: 2009-05-27
As the title says: a graphical timeline of the evolution of Unix and related systems, of Windows and of sme programming languages. Interesting cubicle wallpaper...

permlink: _.at: Unix, Windows and programming language timelines

Sphinx fulltext search engine

last change: 2009-05-11
Nice article over at The Register outlining the story of Sphinx, the open source fulltext search engine powering craigs lists as well as other high profile sites.
From the article:
'... the Apache Foundation, of course, widely known as a cruel experiment to see what happens when bureaucrats do open source.'
Full ACK.

permlink: _.at: Sphinx fulltext search engine

Standards...

last change: 2009-05-11
... help you differentiate your product from other vendors by eliminating the chance of unintended compatibility: you know what to avoid...

permlink: _.at: Standards...

Will Oracle kill MySQL?

last change: 2009-05-06
The corrent answer as of the articlet linked below: who cares? Could not say this any better...

From the article:
"Years ago, it [the open source community] taught Larry Ellison hate. Now, Ellison is teaching it fear."

permlink: _.at: Will Oracle kill MySQL?

Using Intellij IDEA on windows as a client to a gitosis server

last change: 2009-05-05
Install the native Windows port msysGit from the Google Code page and follow the SSH public key setup instructions by Kyle Cordes given in the section 'Create your SSH Key'.

permlink: _.at: Using Intellij IDEA on windows as a client to a gitosis server

Comment-Spam

last change: 2009-05-04
This service sounds quite interesting... I'll try to integrate this with my own CMS XMLServ and maybe open a comments section at site. Free for personal use.

permlink: _.at: Comment-Spam

IP Subnet Calculator

last change: 2009-05-04
OK, the 10.000. instance of a solution to this minor problem. But nevertheless usable.

permlink: _.at: IP Subnet Calculator

Using Jetty with an Apache mod_proxy load balancer

last change: 2009-04-30
How to force Jetty to use a host identifier in its session cookie values to enable Apache mod_proxy load balancing.
more...

Gitosis

last change: 2009-04-28
Gitosis Error when trying to add another repository: Repository read access denied
more...

Scala

last change: 2009-04-28
Looking for a imperative/functional hybrid language running on top of the JVM? Take a look at Scala, the brainchild of Martin Odorsky.
Twitter adapted this language for their backend processing due to performance reasons (the interface still uses Ruby on Rails), IDEA supports it via a plugin, there is already some literature available...

permlink: _.at: Scala

Opera is 15

last change: 2009-04-28
A nice browser... Several features now taken for granted in every (?) modern browser originated here. While Mac support is not still ideal, I still like it for once being a really fast browser on old hardware (were using it actively when my Sun workstation showed its age...)

only real complaint is the missing AdBlock ;-)

permlink: _.at: Opera is 15

Reset Macbook/Air/Pro SMC

last change: 2009-04-27
How to reset the System Management Controller (SMC) on current Macbook, Macbook Air and Macbook Pro laptops.

permlink: _.at: Reset Macbook/Air/Pro SMC

PDF inline display

last change: 2009-04-27
How to use iframes to display PDF files inline within HTML pages.

permlink: _.at: PDF inline display

Debian: set default encoding

last change: 2009-04-27
One of the really dark corners of configuration as well as programming: encoding.

permlink: _.at: Debian: set default encoding

CSS Image techniques

last change: 2009-04-27
Some interesting stuff regarding image manipuation using CSS2

permlink: _.at: CSS Image techniques

Manually add users under MacOS X Leopard

last change: 2009-04-27
Unfortunately not as easy as editing /etc/passwd...
more...


all articles represent the sole opinion of their respective author. all content comes without any warranty for correctnes, despite due diligence.