Tunneling socks via http/s

Nowadays many govermental authorities or network administrators think that blocking all the network traffic for security reasons is a good idea. One common approach is to block everything, but allow some traffic that is whitelisted. Thus it is not possible to do all the interesting stuff that the firewall prevents to do. But by blocking http or https no webserver would be available any more. So normally these ports are open and thus this is the way to go. Continue reading

Determining content type with Apache Tika

About Apache Tika

The project is hosted by the Apache Software Foundation. It supports detecting various file and content types. There is a full list of supported formats. When having a look at the list that displays the supported formats, many document formats are listed in there. E.g. text/plain, text/xml, the propritary Microsoft OOXML or the office standard Open Document. Furthermore images (image/gif, image/jpeg, image/bmp or image/tiff), videos (video/avi, video/mpgeg or video/mp4) and audios (audi/ogg, audio/x-wav or audio/mpeg) can be recognized by Tika. Even feeds (application/rss+xml, application/atom+xml) may be recognized. And many, many more … Continue reading

How to debug encrypted HTTP traffic

When developing software, sometime it’s necessary to sniff the traffic that is transmitted between two computer systems. For that purpose tools like wireshark or tcpdump may be useful. Wireshark is a great tool, but when handling encrypted connections it is not possible to decrypt the traffic without having the key used for encryption. When sniffing http traffic the private key of the certificate is required to decrypt the information. But when talking to a foreign server, without having its private key another approach is necessary. Continue reading

Different modes for H2 Database Engine for testing

When testing software that requires a database for persisting data there are different ways to do this. One way is to use a real database engine instance for testing purpose only. Setting up a full scale database server is totally oversized for testing purpose. So using a dedicated simply to use database is a good way. Furthermore the data may not persisted as after the test the data is not necessary anymore. For performance reasons a non-persistent database engine would be great. There are many solutions for in-memory database testing. One of them is H2. Let’s have a look how H2 can be configured for this purpose. Continue reading

How to use regex groups in Java with ease

When searching for a pattern or a group of data while processing text in Java, regular expressions are a useful instrument to work with. Using regular expressions in Java, it is possible to identify data in a subset of other data. E.g. when having a number of groups or when developing a regular expression it might be helpful in case you don’t have to know the position of the group in context of the regular expression. For this purpose there is a feature called named capturing group. Continue reading

Redirecting embedded jetty log to log4j2

When using embedded jetty within an application, per default there is no support for log4j2. Using slf4j it is possible to redirect the logging to log4j2. But without this redirection there is no way to directly use it. But of course there is a way to use it. Only a piece of simple adapter code is required. Continue reading

Adding new resolution to the X window server

When running Debian Linux with VirtualBox there is limited support for high display resolutions. Per default a maximum resolution of 1024x768 is possible. For a modern operating system this resolution is definately not state of the art.

But there is a way to support a higher resolution than 1024x768. It is possible to switch to a resolution like 1920x1080 or more. Even more than one display is possible. Continue reading