Aug 232013

After making an Access Point out of a Raspberry Pi, I decided to see what else I could do with it.

One of the things I had noticed on the forums was a captive portal function. When someone connects to the Access Point, no matter where they point their web browser it will always direct them to the page hosted on the Pi.

In order to do that, we’ll need to install a web server on the Pi to host the page.
I’ve used lighttpd for this setup, so it’s a simple apt-get install lighttpd

The default directory for lighttpd is /var/www, so you can place your splash page in there.

Once lighttpd is installed, we need to make a slight change to the dnsmasq configuration.
Add the extra line below into /etc/dnsmasq.conf, replace with the IP address of the AP if you have not followed the guide above.


Once the file has been updated, restart dnsmasq

/etc/init.d/dnsmasq restart

Now, whenever someone connects to the access point and points their web browser to anything, it will be directed to the splash page that you have created !

Aug 182013

I recently had to create a whole bunch of directories for my XBMC HTPC so that it could parse the directory contents correctly, so I made a little script to help me do it

This script takes a file extension as an argument, and then creates directories for all the files that have that extension. The directory name is the same as the original file name, minus the extension.

Example Usage: ./ avi
The example will get all avi files in the current directory and create directories for the files, and then move the files into those directories.

shopt -s nullglob
for x in *.$1; do
mkdir ${x:0:(-4)}
mv $x ${x:0:(-4)}

Aug 032013

A few people have asked for the scripts that I use to generate Raspbian Server Edition.

So here they are !

The package list is just a dump from dpkg of all the packages that have been removed.
The script is a very rough script, so there’s no error checking.
The syntax is pkgs.txt