Introduction: IRC Laptop for Hackerspace

A very generous person donated a laptop to our hackerspace. Both the power cord and the power socket were damaged, some hardware modifications were required to get it working. The power cord is now hard wired and does not come out!

We had the need for an Internet Chat Relay (IRC) client we could send messages to people on the IRC server that the hackerspace uses (#tymkrs @ AfterNET). There are plenty of IRC clients out all with slightly different features.

We installed a Linux operating system, specifically Ubuntu Server 14.04 on this laptop. The server edition does not come with a Graphical User Interface (GUI), which has the advantage of using less resources (memory and processor), but adds the challenge of using the terminal for all the things you want to do.

We had several very specific requirements for the laptop which we wanted to configure. It took us a few hours to search the Internet, combined with trial and error. We eventually got it working and wanted to document this for two reasons. First we may have to do this again and wanted all the information in one location. Secondly we wanted to publish this information for anyone else who may want to set up something similar.

The following pages are technical details that are only useful for very specific requirements. Follow at your own risk of peril. These instructions may or may not work for your situation and I can not help diagnose your problem if something goes wrong.

Step 1: Configure Automatic Login

The laptop used at the hackerspace will be used by several different people and we did not want everyone to have to log in. We made the (very insecure) decision of configuring the Ubuntu Server 14.04 to automatically log in.

Edit the file:

/etc/init/tty1.conf

Added the # symbol to comment out the line:

 # exec /sbin/getty -8 38400 tty1

Added the following line to the end of the file to automatically log in:

exec /bin/login -f USERNAME < /dev/tty1 > /dev/tty1 2>&1

Where USERNAME is replaced with the name of the desired user on the system.

Step 2: Connect to a Hidden Wireless Access Point From the Command Line

As it turned out this was one of the most difficult requirements to solve. There were plenty of examples of using the Graphical User Interface (GUI) to connect to hidden wireless networks, but very few documented examples of doing this exclusively from the command line on a modern Ubuntu Server install.

We spent a significant amount of time on this step and used several different wireless commands. The command that we wound up using was wpa_supplicant. All the on-line documentation we could find on this program was a bit out of date listing a directory that did not exist.

Create the file:

/etc/wpa_supplicant/wpa_supplicant.conf

Add the following information to this wpa_supplicant.conf file:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br>update_config=1<br>network={<br>  ssid=”ESSID”<br>  scan_ssid=1 # This is required for hidden networks<br>  psk=”PASSWORD”<br>}

Where ESSID (Extended Service Set Identifier) is replaced with the hidden wireless access point name. And PASSWORD is replaced with the WPA2 password for the router.

Other helpful wireless commands:

iwlist to scan for access points

$ sudo iwlist wlan0 scan

iwconfig to configure the wireless adapter to a

$ sudo iwconfig wlan0 essid "ESSID"

dhclient to obtain an IP address from the DHCP server.

$ sudo dhclient wlan0 -v

Step 3: Configure the Wireless Interface to Automatically Connect

We were able to get the laptop to connect to the hidden wireless access point using the wpa_supplicant command and the configuration file we created. Now we wanted to make the laptop automatically connect on boot up.

Again this was challenging to find information for Ubuntu Server 14.04 but he is what we found. Edit the file:

/etc/network/interfaces

Adding the wpa-conf line:

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

This was all that was needed to automatically connect to a hidden wireless access point at system startup!

Step 4: Install the IRC Client

We wanted to install a text based IRC client that could be run from the terminal. There are several text based IRC clients to choose from. The one that we had experience with was Irssi.

This IRC client is very configurable, which is both a good thing and a bad thing. Too many configuration options makes it hard to find the ones you want to configure.

Install Irssi:

$ sudo apt-get install -y irssi

Run irssi and configure the network, server, channel and save.

$ irssi
/NETWORK ADD -nick USERNAME Afternet
/SERVER ADD -auto -network Afternet irc.afternet.org 6667
/CHANNEL ADD -auto #tymkrs Afternet
/SAVE
/quit

Configure Irssi to start in a screen session after logging in (automatically).

$ echo "screen -S irc -U irssi" >> ~/.bashrc

Step 5: Restart and Enjoy!

That covers the changes we made to the hackerspace laptop. We reboot and the network connects, automatic login and a text based IRC client runs! Shiney!

If you want to hang out with us in #tymkrs on AfterNET come on over! We have some very smart people talk about their electronics projects there and on Friday nights the hackerspace will be using the laptop.

Thanks for reading.