Apache httpd + mod_jk Configuration for a 503 “Down for Maintenance” Page

This is a configuration I used to create a “Down for Maintenance” page with a 503 HTTP response code in httpd while I redeploy a Tomcat war file. 1. JkUnMount a static resource Since I have a dedicated server, my mod_jk configuration directs all traffic to Tomcat. In order to have Apache serve a static [...]

Live template in IntelliJ IDEA to generate static class-level Logger variable

This reduces the keystrokes needed to introduce a logger variable in your class to simply typing ‘log’ and pressing [Tab] in the declaration block of your class. Head over to Project Settings > Live Templates and then add a new template to the ‘plain’ group. Assign the following values: abbreviation: log description: private static final [...]

Python + peewee and OperationalError ‘MySQL server has gone away’

It took hours to figure out why my python script using peewee yielded OperationalError(2006, ‘MySQL server has gone away’), but I found the problem. This error is very misleading and also results when MySQL responds with a Packet Too Large response on an INSERT statement. In my case, I’m inserting a very large 15-20 MB [...]

Configuring Eclipse for IntelliJ users

There are a few things I’ve gotten used to in IntelliJ that require some customizations in Eclipse. The following steps will make Eclipse feel more familiar and ease the transition. Key Bindings You can get close to IntelliJ’s key bindings by installing the ideakeyscheme plugin. Place the downloaded JAR in eclipse/dropins and unzip it into [...]

MacOS Application Installation List

This is a list of applications I find useful on a Mac. KeePassX Chrome Firefox iTerm Flux: I use 3000K for the sunset setting. smcFanControl Degrees Sublime Text PyCharm FileZilla Android File Transfer LibreOffice Google Drive JDK 7 JDK 8 Maven Git Homebrew IntelliJ PyCharm Xcode Also developer command-line tools via xcode-select –install Chmox VirtualBox

Sublime Text Key Mappings for MacOS

This is my Sublime Text custom key configuration on MacOS, which makes it a bit more consistent with other text editors. Open Preferences > Key Bindings – User and paste the following. [ // Reference: // http://docs.sublimetext.info/en/sublime-text-2/reference/commands.html {"keys": ["end"], “command”: “move_to”, “args”: {“to”: “eol”}}, {“keys”: ["home"], “command”: “move_to”, “args”: {“to”: “bol”}}, {“keys”: ["super+home"], “command”: “move_to”, [...]

IntelliJ Keymap Customizations on MacOS

A few useful IntelliJ customizations on MacOS. Tab Navigation Some of the tab navigation would be better if it’s consistent with other text editors on MacOS. Go to: Project Settings > Keymap > Main menu > Window > Editor Tabs Under this list, add the following keyboard shortcuts. The existing shortcuts should also be kept. [...]

Configuring Python on MacOS

This post goes through the steps to add the necessary modules in Python that I use. Install pip $ sudo easy_install pip Set up MySQL prerequisites to install the Python MySQLdb module mysql_config must be on the path in order to install the MySQL-python module. I install MySQL in /usr/local and then create a symlink [...]

Save drafts of form textarea inputs in Apache Wicket automatically

This article documents an Apache Wicket solution to automatically save drafts of user input in the background using ajax POST requests to the server. The stateless nature of <textarea> form inputs introduces usability and reliability problems when users require a long time to fill them in. Consider some common scenarios, such as a user’s web [...]

Install python MySQLdb module

MacOS This Stack Overflow article perfectly documents the necessary steps and works with python 2.7. I have also saved these instructions in PDF format.