Screen shot 2011-02-14 at 12.49.04 PM

This feels window-ish to me

I know Umbraco is supposed to be simple and hassle free, but althought I configured a database use with this script (because the SQL Management Studio doesn’t run …..):


CREATE DATABASE shop_db COLLATE SQL_Latin1_General_CP1_CI_AS;
CREATE LOGIN shop_u WITH PASSWORD = 'Password';
CREATE USER shop_u FOR LOGIN shop_u;
USE shop_db;
GRANT ALL ON shop_db To shop_u;

It doesn’t accept it as login credential in the umbraco installer. Propably the GUis does a bit more, than there is documents in the Reference manual….

But there is the nice link ‘instructions’ pointing to Microsoft SQLite equivalent: SQL Server 4 CE:

But somehow no one cared to fill it with content

But hen, hey, its beta. So you can’t blame them. SO I just google and search for the download:

Oh cool, its the top link! Lets click it:

And I land on a bing-ternal search result page and whenever I click the ‘Download details:….’ …. it just gives the same page again.

This little image story sums up pretty well, what I experience when I work with microsoft technologies.

Screen shot 2011-02-14 at 9.16.42 AM

Passwordless ssh logins from your OS X Box

From my Linux time, I know that ssh-copy-id is extremely handy. Sadly its not available on OS X.

But nonetheless, thats how you can setup a password less login to another host from OS X:

# Generate your local public/private key (if not already done)
# (you can press enter to accept the defaults)
ssh-keygen
# Create the remote directory (especially for Windows hosts)
ssh user@host.com mkdir "~/.ssh/"
# Copy the public key to your remote host
scp .ssh/id_rsa.pub user@host.com:"~/.ssh/"
# Add it to the authorized_keys File
ssh user@host.com "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys"

And your done!

Screen shot 2011-02-02 at 10.24.43 AM

Transfer Files with Remote Desktop Connection for Mac

Since I work for airbit.ch, which is a Mac friendly company, I started to like Macs. Yes, its true.

From time to time I use RDC for Mac to administer some Windows boxes and this is how I transfer files to them:

Share Mac Directories as Windows Drives

  • go to the Preferences
  • choose Drives (it should be called Shares, but anyway)
  • choose the Mac Directory you want to share

and this is how it will look like on My Computer

(gosh, Windows looks ugly)

Screen shot 2011-02-01 at 12.09.41 PM

Restrict a Socket Server to specific IP adresses

Just as some kind of promotional code, I implemented a Webservice based on Axis and its SimpleAxisServer. It turned out, that the SimpleAxisServer was to simple:

  • it only filled certain fields of the MessageContext and particularly not anything to see the Remote IP Adresse.

After some thinking I decided to fully copy the SimpleAxisServer and Worker to my ow classes (because the are not made to be extended….) and changed some minor stuff.

First of all, I use Commons Configurations to load me a list of IP Adresses and Hostnames. Like:

allowed_ips = google.com, mydomain.com, 127.0.0.1

I convert these into a List of Java InetAdresses with that:

	public void setAllowedHosts(String[] hosts) {
		for (String host : hosts) {
			try {
				this.allowedIPs.addAll(Arrays.asList(InetAddress.getAllByName(host)));
			} catch (UnknownHostException e) {
				log.error(String.format("Allowed IP could not be set successfully.", e));
			}
		}
	}

and in the run() Method of my SimpleAxisServer I added some lines:

	public void run() {
		log.info(Messages.getMessage("start01", "SimpleAxisServer", new Integer(getServerSocket().getLocalPort()).toString(),
				getCurrentDirectory()));
		if (allowedIPs.size() == 0) {
			log.warn("No IP Restrictin inplace. Service is exposed to everyone.");
		} else {
			log.info(String.format("Service Call are allowed from IP: %s", allowedIPs));
		}
		// Accept and process requests from the socket
		while (!stopped) {
			Socket socket = null;
			try {
				socket = serverSocket.accept();
				if (allowedIPs.size() > 0) {
					if (!allowedIPs.contains(socket.getInetAddress())) {
						log.debug(String.format("Discarding connection from: %s, because it isn't in the list of supported IP's: %s",
								socket.getInetAddress(), allowedIPs));
						socket.close();
						socket = null;
					}
				}
			} catch (java.io.InterruptedIOException iie) {
			} catch (Exception e) {
				log.debug(Messages.getMessage("exception00"), e);
				break;
			}
			if (socket != null) {
				MPAxisWorker worker = new MPAxisWorker(this, socket);
				if (doThreads) {
					pool.addWorker(worker);
				} else {
					worker.run();
				}
			}
		}
		log.info(Messages.getMessage("quit00", "SimpleAxisServer"));
	}
final ui

Making a Java UI for editing Properties

Java Properties suck. But Apache Confoigurations sucks a bit less, so I’m using it to have a small configuration framework.

It consists of

  • Constant values, like the Application title, version, and so on.
  • Default values, like database url, username, …
  • User Properties, which are generated based on the default values

Then I have a JFrame which takes the user properties and iterates and displays them in a gui.

The final UI looks like this:

Continue reading