Hacking just for Fun: using Bookmarklets
Hacking . Javascript . Play! Framework . SnippetsSo there are a handful of webtools using Bookmarklets for their services. The first i know was del.icio.us for saving a Webpage to your del.icio.us bookmarks. Another famous service is Instapaper (it uses internally read it later pocket, but that is another Story). I have a special service in mind, i want to create using
Hacking just for Fun: Get Mails from IMAP with Java
Hacking . JavaI have the feeling, that i might need this someday :-). Collecting Mails from an IMAP Server with Java is pretty easy: package de.javastream.imapcollector; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Properties; import javax.mail.Folder; import javax.mail.Message; import javax.mail.Multipart; import javax.mail.Part; import javax.mail.Session; import javax.mail.Store; import javax.mail.internet.MimeBodyPart; import javax.swing.JOptionPane; public class App { public static void getMail(String host,
Hacking just for Fun: Raid5 in Java
Hacking . Java . SnippetsI was just curious how easy it might be to write a RAID5 compatible Outputstream in Java? Just a few Lines. For sure it is not the most elegante solution. Especially if you see the nice possibility to integrate one Outputstream within another… so maybe two Raid5s into one Raid0 Stream? (would be RAID50) then.
Run local/remote terminal commands with java using ssh
Java . Network . Play! Framework . SnippetsSometimes you need to use some CLI-Tools before you want to create or search for a native JNI Binding. So there is a common way, using the Java Process-Class. But then you might meet two problems i had to face in the past during several problems: There are (a really small) number of CLI-Tools, that
Counter Update
DB . Java . Play! FrameworkI just finished my latest improvements to the legacy version of my counter script. I just added the lookup for ISPs and added dynamic scaling for the axis legend. I will now going forward to change the whole system to a more sophisticated software, e.g. using a Datawarehouse approach. The first version of the Data-Model
Counter Update
Personal . PHPBefore i will do the great update of my counter script (i plan to switch to Java/Play with some basic DWH Features), i just added some dynamic webpage screen rendering based on thumbalizr (have a look here)
Running a Rails 3 Application in a Sub-URI Enviroment
Hacking . ruby . Ruby on RailsSometimes you need to run your Rails (3) Application on a Sub-URI (e.g. examle.com/prod, example.com/dev). In my current Project there was a Problem with that Configuration and the Rails url-helpers (link_for, url_for, usw.) becourse the app wasn’t aware of the necessary prefix (in our example “/dev”, “/prod”). There is always the possibility to set the
Testing Play! Applications with HTTP Basic Auth
Java . Play! FrameworkUm eine Play!-Anwendung zu testen, welche HTTP-Basic-Auth verlangt ist es notwendig, die Standard-Datei ApplicationTest.java anzupassen: Verändert werden muss die Test-Methode testThatIndexPageWorks(): Aus @Test public void testThatIndexPageWorks() { Response response = GET(“/”); assertIsOk(response); assertContentType(“text/html”, response); assertCharset(play.Play.defaultWebEncoding, response); } Wird: @Test public void testThatIndexPageWorks() { Request request = FunctionalTest.newRequest(); request.user = “test”; request.password = “test”; request.url =
Play! Applications und der App-Context
Java . Play! FrameworkEs ist möglich, eine Play!-Anwendung sehr einfach in eine WAR-Struktur zu übertragen und in einen Application-Server zu deployen. Dies ist recht gut unter Deployment options in der Play!-Dokumentation recht gut erklärt. Was hier allerdings verschwiegen wird ist, wie man den notwendigen Context beim Routing konfiguriert. (Der Context ist der Pfad der Anwendung, welcher standardmäßig vom