Restricting Solr with Jetty to localhost

If you want to try Apache Solr, the easiest way to get started is to use the example the comes with the download. Just run java -jar start.jar and you can start searching like a pro.

However, the integrated Jetty server is configured to bind to port 8983 on all IP adresses by default. This configuration is unsafe: anyone could clear your whole Solr index!

It is a good idea to let the server listen only on localhost, unless your server is in a private network. A quick solution is to set the system properties jetty.host and jetty.port on startup, e.g. like that:

java -Djetty.host=127.0.0.1 -Djetty.port=1337 -jar start.jar

Alternatively, you can edit the configuration at example/etc/jetty.xml. Look for these lines:

<Set name="host"><SystemProperty name="jetty.host" /></Set>¬
<Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>

It’s waiting, not sleeping – how I became a Mac user

I never was a fan of Apple products. Sure, they looked slick, but in my opinion, they were toys, for designers, not for hackers. And they were expensive. A good friend of mine had bought a MacBook Pro and after the initial excitement faded, he became more and more disappointed until he finally switched back to his Linux desktop and sold his Mac with a big loss. My prejudice against Macs seemed to be confirmed. Little did I know that I would join the cult of the Mac soon. Continue reading

Easy Django management commands with autogenerated aliases

Recently, I got sick of typing django-admin.py <command> to run Django management commands and decided that something must be done about it. This is what I came up with:

This little script creates short aliases for all available Django management commands. Typing this every time you want to work on your project obviously defeats the point, so I added it to bin/activate which is created by virtualenv (you do use virtualenv, don’t you?). I actually do this in a bootstrap script, using this snippet:

If you use virtualenvwrapper, you can append the script to the bin/postactivate script instead.

I know there is bash completion for Django management commands. The advantage of my solution is that it is available for every developer on the project after running the bootstrap script. And it is one character less to type.

To run django-admin.py syncdb, just type djsy<TAB> instead of dj<TAB>sy<TAB>.

What’s in a name? A MPMoviePlayerController pitfall

I was struggeling playing a movie file on iOS with MPMoviePlayerController. The file was just recorded with AVCaptureMovieFileOutput and was called file.avi, located in the Document directory of the app.

The movie player was presented and then immediately disappeared. The URL was correct, the file played without problems on the Mac. Apparently, MPMoviePlayerController expects the file ending to match the file type. Once I renamed the file to file.mov, everything worked as expected.

Hacker News Aftermath

After I submitted my review of Hacker News iPad Apps to Hacker News, it shortly made it to the frontpage, with the result that the thundering horde quickly exhausted the tiny traffic quota I had at my hoster. I’ve decided to migrate to another hoster and if you read this, the DNS change has reached your corner of the Intertubes.

If you notice broken links or anything else that is flaky, please let me know on Twitter (@danielhepper) or drop me a mail at daniel [at] hepper [dot] net. Thanks!

A review of all available Hacker News iPad Apps

Browsing Hacker News on the iPad is okay, but far from perfect. As of this writing, there are five Hacker News iPad Apps available on the App Store that promise a more comfortable experience:

I took the time (and money) to try them all, this are my findings.
Continue reading

How to make a Pac-Man ghost lamp

In this post, I will show you how to make a Pac-Man ghost lamp. You can also find it on Instructables.

To be precise, we will create small ghost lamp shades to turn a boring spotlight system into a great looking Pac-Man themed lamp.

You will need:

  • plastic bottles with the right shape
  • a lamp, preferably a halogen spotlight system
  • some white and black plastic
  • spray paint in red, pink, cyan and orange

Once you found the right bottles and a nice lamp, this project will take about 2 x 2 hours.
Continue reading

Fixing a messed up Vagrant installation

I’m currently struggling with what seems like a bug in Virtualbox that affects the new Core i7 MacBooks. While trying to fix it by building Virtualbox from source, uninstalling and reinstalling, I managed to mess up a box managed with Vagrant, rendering it inaccessible.

If you find yourself in a similar situation, you can try to fix it with the VBoxManage command.

$ VBoxManage list vms
"" {b68ed7a7-6e72-4f16-a438-8775cd80d9b3}
$ VBoxManage unregistervm {b68ed7a7-6e72-4f16-a438-8775cd80d9b3} --delete
VBoxManage: error: The object is not ready
VBoxManage: error: Details: code E_ACCESSDENIED (0x80070005), component Machine, interface IMachine, callee nsISupports
Context: "Delete(ComSafeArrayAsInParam(aMedia), pProgress.asOutParam())" at line 175 of file VBoxManageMisc.cpp
Segmentation fault

As you can see, it died with a segmentation fault, but the broken box was now gone and I could restart it with vagrant up.
Continue reading