http://piratebox.cc/

This is a tutorial I wrote for the PirateBox Project to help people get PirateBox working on their RPi2. It assumes you have a fresh install of Rasbian working on your RPi2, with a working internet connection and a supported Wifi card.

Prepare Rasbian
1)  At the terminal enter the command sudo rasps-config to configure the system.

pi@raspberrypi:~$ sudo raspi-config

2)  Choose the following options:-
  1) Expand Filesystem 

  2) (optional) At this point you may also want to choose option 2 Change User Password.
  3) Internationalization Options, choose your settings as UTF-8 
  8) Advance Options, A4 SSH (Enable)
3)  Finish and allow the system to reboot.


Installing Dependencies
1) Next we need to install and prepare dependencies using the following terminal commands:-
  sudo apt-get update 
  sudo apt-get -y install lighttpd 
  sudo /etc/init.d/lighttpd stop 
  sudo update-rc.d lighttpd remove 
  sudo apt-get -y install dnsmasq 
  sudo /etc/init.d/dnsmasq stop 
  sudo update-rc.d dnsmasq remove 
  sudo apt-get -y install hostapd 
  sudo /etc/init.d/hostapd stop 
  sudo update-rc.d hostapd remove  
  sudo apt-get -y install iw 
  sudo rm /bin/sh 
  sudo ln /bin/bash /bin/sh 
  sudo chmod a+rw /bin/sh

Install PirateBox
1) Now we install the Piratebox code and configure.
  wget http://downloads.piratebox.de/piratebox-ws_current.tar.gz 

  tar xzf piratebox-ws_current.tar.gz cd piratebox 
  sudo mkdir -p /opt sudo cp -rv piratebox /opt cd /opt/piratebox 
  sudo sed 's:DROOPY_USE_USER="no":DROOPY_USE_USER="yes":' -i /opt/piratebox/conf/piratebox.conf 
  sudo ln -s /opt/piratebox/init.d/piratebox /etc/init.d/piratebox 
  sudo update-rc.d piratebox defaults 
  sudo /etc/init.d/piratebox start

Fetch the Imageboard
1)  Time to fetch the image-board and configure.
  sudo /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard 
2)  Edit the config.pl file with vi, and edit the ADMIN_PASS and SECRET. Remove the # from the start of the line. 
  sudo vi /opt/piratebox/www/board/config.pl
   # System config
   # use constant ADMIN_PASS => ‘CHANGEME’; # Admin password. For fucks's sake, change this.
   # use constant SECRET => ‘CHANGEME’; # Cryptographic secret. CHANGE THIS to something totally random, and long.


Activate Timesave Functionality
   sudo /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install

   
Install Minidlna
  sudo apt-get install minidlna 

  sudo cp /etc/minidlna.conf /etc/minidlna.conf.bkp 
  sudo cp /opt/piratebox/src/linux.example.minidlna.conf /etc/minidlna.conf sudo update-rc.d minidlna defaults 
  sudo service minidlna start

Edit Network Configuration
1)  Edit the network configuration.
  sudo nano /etc/network/interfaces
(delete the contents of the file and paste in the following)
  
  auto lo iface lo inet
  loopback iface eth0 inet dhcp 
  iface wlan0 inet manual ### disalbed for PirateBox 
  #allow-hotplug wlan0 
  #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf 
  #iface default inet dhcp

2)  (save and exit by pressing [Control]+x then press [Enter] to update the config file.

3)  Reboot.  sudo reboot
4)  When you logon to the PirateBox, click on Forum and then click Kareha.pl to activate.

Download the Image

Alternatively you can download the image I created with a torrent client, like UTorrent.

I have recently acquired a RPi2 single board computer for the purpose of developing open-source technological solutions. As such I thought it beneficial to share my experiences in an attempt to give a little back to the community.

This first post is simply about preparing your MicroSD Card for the operating system (OS).  In this tutorial I will be installing the Raspbian OS from a MacBook computer.


1) Open a terminal window and type df -h take a note of what disks are available.


2) Insert your MicroSD Card into your Macbook and run df -h .You can see that my MicroSD card is located at /dev/disk2s1 
(note: your path may be different).


3)  Open Mac Diskutils and erase the disk as ExFat.  Application, Utilities, DiskUtility
4) Go back to your terminal, type diskutil umountdisk /dev/disk2s1 (substituting for your own disk).

5)  Know the location of your Raspian .img file. Mine is located in a sub-folder of downloads named rpi2.
We will mount the image onto the SDCard using the dd command:-
sudo dd bs=1m if=~/downloads/rpi2/2015-05-05-raspbian-wheezy.img of=/dev/rdisk2
This will take some time, you can press [Control] + [T] to check the status.
-----------------------------------------------------------------------------
if=(the source of your image file) - ~/downloads/rpi2/2015-05-05-raspbian-wheezy.img 
of=(the SD card) - /dev/rdisk2 (notice how we have omitted the partitions and used only the disk location.  
/dev/rdisk2 - We have changed disk to rdisk.
-----------------------------------------------------------------------------

6)  Unmount the disk diskutil unmountdisk /dev/disk .   Remove the card, insert into your Raspberry Pi.