
DonglePi set up for use from the laptop
High Res Image for detail inspection
This is a Raspberry Pi board (the $35 B type with ethernet and 2x USB connectors) set up with a TP-Link TL-WN722N type WiFi Dongle. The 722N comes in two types, one with an external antenna (shown) and one without an external antenna that looks just like this one, but without the antenna connector on the side. This one cost $5 more at Fry’s (where I paid $19.xx for it, not willing to wait for internet shipping…) Why this one? Because it is known to work as an Access Point under Debian on a Raspberry Pi and I have that as the next project. What I really wanted was the “button sized” dongle for about $9 with the RAlink chipset in it, but Fry’s didn’t have those. (It is known to work in both A.P. mode and Mesh mode at the same time, where this one is only ‘one at a time’)
So this is a little under twice as long as it needs to be for portable / pocket use. With the button type, it would also have less risk of torque on the USB connector causing some damage… The adapter comes with a USB extension cable in the box, so one could use that for more “fixed” locations. In this case I just wanted a quick field test so left it a bit long, gangly, and potentially liable to having the WiFi adapter torqued… For actual day to day use, I expect it to be on the extension cable and up on the dashboard of the car (if in a parking lot and needing the added range to reach the nearest StarBucks WiFi hotspot while sipping my coffee in the comfort and quiet of my car – I generally make it a habit to always buy something at the places where I use the hotspot from the car; but Starbucks doesn’t always have power plugs open and some are way too loud / noisy… where I come equipped with power in the car, a comfy seat, and music of my choice / loudness…)
For actual clandestine use, I’d get the button dongle on the RPi and then put the device into a small box. In use, in the Starbucks, nobody noticed me assemble it and slip it into a pants pocket. (Folks are remarkably focused on themselves, generally.) Even after I pulled it out and put it on the table, nobody seemed to notice. (With the antenna on it, I think anyone who did see it would take it for a WiFi Dongle only; and in fact that’s a decent “cover story”; just say “the WiFi in the laptop died and this is an add-on” or even “The laptop is old and slow, this is a 150 Mbps high speed I’m working on.” which is actually true in my case. ;-)
Here’s a picture of it in the cargo pants pocket. Note that with the button dongle it would not show up at all. Just two wires into a pocket…

Dongle Pi in Cargo Pants Pocket
For anyone wondering if I’m “into camo” or a wild eyed Militia Type or “whatever” just because the pants are camouflage pattern: I bought these when in Florida (they are ‘shorts’, though you can’t see that in the picture) as I desperately needed something that wasn’t “long dress pants”. I went into Target and had exactly and only one criterion: “Shorts that are damn cheap and not an offensive color, on me, like pink…” These were the cheapest ( $10 IIRC on sale / clearance). They have been very useful over the years, thanks to the pockets, but were purely an accidental pattern choice. It’s really silly to wear camo shorts for the camo effect; with Neon White / Pink legs sticking out of them anyway ;-) ( I have a full cover camo suit for any actual camo needs – such as hunting for food – that I’ve worn all of once as a Halloween costume; there not being much need for camo-survival-hunting in the Urban Jungle where a charcoal suit is more effective “camo” than is green blotch…) I don’t have anything against Militia Types either; our history says we adults ARE the militia, like it or not. It’s just a bald faced lie to use “Militia” in a derogatory put-down way. The Militia is any adult, during times of need / crisis. (Historically any male adult, but times have changed.) So while I do endorse the idea of the Militia groups, holding onto the historical root of power originating from We The People; I’m just not “into it” myself. Nor do I do the “camo thing” as any kind of statement. I just buy cheap ass clothes… So, that out of the way, back to Geek Stuff…
The laptop provides power to the RPi and WiFi dongle via the little black USB / MICRO-USB connector. ( I emphasize the micro as I thought I had lots of ‘those small USB’ cables… and found out that my cameras et. al. were using MINI not Micro… they are almost the same to visual inspection unless side by side.) Ethernet is provided by the blue ethernet cable. In practical use, a better color would be ‘wood brown’ as that’s the color of many Starbucks chairs / walls / tables, or any of: black, gray, putty, dark brown. I.e. all the ‘not a color’ colors ;-)
Why not just connect to it from the laptop via WiFi? Well, in fact, I can see a use for that. BUT: Part of the ‘design goal’ here was just to make the laptop VERY secure and private. If I’m advertizing my MAC address via the WiFi in the laptop, I’m leaving records of my laptop presence on any WiFi system that cares to record it. It is also open to various kinds of sniffing and attack on the packet stream and potentially to folks breaking in to the laptop. So while a “WiFi to the Pi” ;-) would be useful at home, it’s less useful “in the wild” where part of the goal is to eliminate records of where the laptop has been and protect it as a place were more personal stuff can be kept more private. At home, I have connected via WiFi to the Pi and used it as a web proxy surfing appliance. Works fine. In the field, by using the hard wire connection and shutting off the laptop WiFi, I can have a truly private link to my “proxy” on the internet. IFF doing anything “clandestine”, I could also just pitch a $9 button dongle when done, and not worry about some forensics tying that MAC address to me or my laptop. (Spark Plug Wires to a great job of frying electronic parts prior to pitching ;-)
Still to be done things include encrypting that laptop / RPi link (though it isn’t really needed), and putting TrueCrypt on the RPi so on powerfail there isn’t anything left open. Alternatively (and a longer term project) is to make the RPi a “boot from locked USB image” as opposed to boot from active file system image. (Think “Live CD” type instead of “From Disk” type). That way nothing is ever written to the SD card anyway. At present the Operating System is a live pseudo-disk on SD card, not a “Live CD” type. I’m sure that will change over time. I have a copy of Puppy Linux on it that I’ve not tried yet, and it has a “Live CD” type structure. So another “someday” project…
What Good Is It?
The laptop holds a locked / standard image of the RPi OS fully configured and lacking anything at all distinctive or ‘about me’. I can “flash” that image onto the SD card in a couple of minutes and it is a ‘pristine’ web appliance. Now, from the laptop, I can connect to the RPi and use it to do things like web surfing or “whatever”. IFF I land on some site that tries to put crap on my machine or “track me” with cookies or “whatever”, they do that to the RPi. At the end of my session, it gets powered down, and the SD card gets “flashed” again back to pristine. (Eventually, with a write locked SD card, even that step becomes unnecessary). In essence, it is like using a “Bootable Live CD” Linux on the laptop.
So why not just do that Live CD thing?
First off, it leaves my hard disk “available” to the Linux that is running. Even if I don’t “mount” it, someone who breaks into the system while in use could do so. Only if I’m “watching” would I see that happen. (Yes, I watch. I use “w” which is a Linux / Unix command to keep up a panel of active processes and look at it from time to time. Anything happening out of the ordinary will show up. In another panel, I have “df -ks” on a ‘once a minute’ cycle. That shows me the mounted file systems – in kB – and ought not to change…) So it’s some protection, but not full protection.
Second, and most important for me, this particular HP Laptop has a funky video driver that was not supported in Linux last time I looked ( 2 years ago?) and I just didn’t want to deal with it. Making a custom built Linux isn’t for everyone, where a generic RPi dongle is more “approachable”.
Finally, it still imprints my MAC (network hardware unique number) Address into various tracking and forensics logs. Not that I have any reason to care, I just don’t like it. This whole “excursion” in my life path came about when The Constable decided to raid Tallbloke and run off with his computers. As he had his laptop confiscated (no doubt to be scrubbed for anything that could be used to tie him to FOIA-2011 including the MAC address from any email / file upload records at WordPress or elsewhere) that was a bit “chilling”. FOIA had simply posted a message on TallBlokes blog. THAT, was enough to get him raided on suspicion he had posted to himself as a foil. OK, I run a blog. What if FOIA had posted on my blog? So time to “get defensive”. (So right off the bat I put TrueCrypt on the laptop and stuff is all inside encrypted containers; which also prevents hackers seeing it either. I only decrypt / mount a container if I need what is in it at that moment; and even then often have the WiFi NOT connected when the container is open…) But really what I wanted was a way to simply not use the laptop for anything other than a “screen server”. So any old “crap top” can be a keyboard / monitor. Then, if it “goes away”, I don’t give a damn. Similarly, if the RPi “goes away”, I don’t give a damn. All the “important stuff” will be in encrypted containers and stored off site. (Another project for some future posting). Essentially, I’m breaking the link between any particular bit of hardware and “my stuff” and “my actions”. Having a “disposable Linux Dongle” is part of that. It’s 100% disposable, from computer board to SD chip to WiFi dongle. And it’s 100% generic. Someone takes it, they get nothing (after the SD is re-flashed and WiFi dongle ditched, or once it’s write protected) and I’m back up and running in minutes off the reserve copy and spare parts.
Can it be used by Black Hats to do bad things? Certainly. They also use cars and wear clothes too. Shall we ban cars, hats, sunglasses and gloves because Bad Guys use them? How about banning airplanes? They were used to kill thousands in NYC. Banning is a lousy way to attempt crime control. It just doesn’t work worth a damn. So we now have confiscate first, prove innocence later behaviour from the cops (that also doesn’t work well / properly ) and this is simply a prudent response by a private blog operator to abusive policing actions. Essentially, too much police state behaviour causes more innocent folks to act like Bad Guys and use tools (build tools) usable by Bad Guys in response to bad policing policy. That doesn’t make the innocent citizen a Bad Guy, it means the Police are acting in a negative way, and everyone, Bad Guys and Innocents alike, find “common cause” in the methods to “dial back” the police intrusion. (This is a common issue in law enforcement, BTW. I taught a forensics class to White Hats and one of the things I did was hand out “cracking tools” CDs. Forensics often uses the very tools created by Black Hats to break into machines. It gets dressed up a “Ethical Hacking”, but the reality is that the tool knows not who uses it. Be that tool a gun, a car, or a computer.) I’ve generally worked on the White Hat side, and this tool too can be a White Hat tool. One of the “Live CDs” I downloaded and tested was a U.S. Govt. issued one for secure email reading for government employees “on the road” and connecting from hotel WiFi. They could just as easily use one of these for their email reading platform to protect their laptop from intrusion.
As a sidebar advantage: It’s just nice to have a Linux machine to play on. I’m an “Old Unix / Linux Guy” who has been using it as my dominant compute platform since the early ’80s. I find Microsoft a PITA (though more usable now, in a stupid kind of way) and the Mac a very pleasant warm fluffy safe jail… it’s possible to get ‘under the covers’ to the Unix like world under the Mac skin, but it’s just so much trouble… I like my wild and wooly Linux / Unix machine where at a couple of characters I can be SuperUser and do anything I want. I like being able to pop open a command line interface and do all those things I’ve learned to do over 35 years or so of practice and NOT have some ass telling me I can’t via some software trap. And, frankly, all the commercial software folks are larding on ever more auto-update auto-tracking auto-buggering crap that is just offensive to anyone who wants their computer to be their computer and other folks keep their damn nose out. So I just like having “my world” where I can go do what I want, how I want, and not worry that the next “auto-update” will break things, open a security hole (thanks, Java… /sarc;) or or just nag me to death. Linux is a “from the people up” world, and I like it that way.
Building Dongle Pi
I’ve got a fairly long write up on how to do it. I’ve not yet done my usual “Q.A.” on the write up. That is, to start from scratch, doing only what is on the written sheets, and prove it all works as written. (In F.D.A. terms, a “Qualified Installation”. I did those once. Any drug company must send a document to the F.D.A. stating exactly how to recreate their equipment used in any computer operation. So, for example, if you used a NetApp to store your data for your drug trials, you have to say how to set on up. If you write “Turn the red power switch to on” that will fail if the color of the switch is changed to yellow, and is ‘questionable’ due to the use of ‘turn’ for a rocker switch… yes, it’s that ‘nutty / picky’. So you write the directions as “the power switch is located and put into the ‘on’ position applying power to the system”. Yes, it pays well to be able to do “qualified installs” ;-) I’ll get back to that level of “proving up” after Mother’s Day is over…
For now, here’s a ‘rough notes’ version.
Making Dongle Pi.
Materials:
Raspberry Pi B (A to come later via USB Ethernet).
Ethernet Cable – 1 ft to 10 ft ( 1 to 3 ft preferred)
MICO – USB w/power to USB cable ( 3ft – cost 99 cents at Fry’s)
TV (composite with RCA video, or hi definition with hdmi and HDMI cable)
USB Mouse
USB Keyboard – All three only for initial ‘bring up’. Can be skipped with pre-built Pi SD card
SD Card – minimum 4 GB, preferably 8 GB. Up to 32 GB Ultra SanDisk if desired. I used the “Ultra” Sandisk and a Patriot Micro 8 GB and both worked.
Creation Station – Windows Laptop or Desktop with SD card slot or added SD / USB adapter and USB slot. Basically, a way to write the SD card and a ‘terminal server’ to control the Dongle Pi. Preferably the laptop that will be used as workstation.
Laptop / MS Windows box software needed:
PuTTY -
Purpose: To provide a relatively generic terminal session on various equipment, such as a Raspberry Pi or any other Linux / Unix machine (and many other kinds of routers, switches, whatever…) A ‘command line interface’ for configuring things and turning things on, like that nice graphical interface you really want…
Get from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
download via: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe for M.S. Windows executable
VNC -
Purpose: A remote graphical desktop interface to the target system. It lets you have a graphical desktop environment on the Puppet Pi via a screen / keyboard / mouse on your laptop.
Get from: http://www.tightvnc.com/download.html
download via:
32 Bit Machines: http://www.tightvnc.com/download/2.7.1/tightvnc-2.7.1-setup-32bit.msi
64 Bit Machines: http://www.tightvnc.com/download/2.7.1/tightvnc-2.7.1-setup-64bit.msi
Win32Disk.Imager -
This works much more easily than the manual process of card formatting on the Mac / Linux world. At some future point I’ll work out a simple / easy way from the Linux side, but as most folks do have a M.S. Windows computer (and as mine has a built in SD card slot while the Linux White Box didn’t…) this was just a lot easier on that laptop.
Purpose: To store SD Card images onto the laptop, or copy them from the laptop to SD cards.
Get from: http://sourceforge.net/projects/win32diskimager/
download via: http://sourceforge.net/projects/win32diskimager/files/latest/download
TrueCrypt - optional. Only needed if you wish to keep the contents secret / really secure.
Purpose: To encrypt files, file systems, whole disks, and generally keep your files private.
Get from: http://www.truecrypt.org/
download via: http://www.truecrypt.org/downloads
The Raspberry Pi install method:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=6225
how to use: IFF you want all the Raspberry Pi configuration files and software hidden away when not in use, so that they can not be buggered, hacked, or even just noticed, you will make a “TrueCrypt Container” and mount it as an encrypted file system. It will only be mounted when needed, and the rest of the time will look like some other innocuous file.
I’ve not installed TrueCrypt on the RPi yet, so you are on your own on that one, for now.
Basic System Install
Basic Debian Wheezy:
Download the basic system image from the Raspberry Pi site:
http://www.raspberrypi.org/downloads
Direct download: http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip
Via a Torrent: http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip.torrent
Then using Win32Disk.Imager, write it to the SD card.
Put the SD card into the Raspberry Pi board.
First Life configuration and connection to laptop ( ICS )
Configure ICS Internet Connection Sharing in your Laptop or Desktop (and have it connected to the Ethernet). Settings, network, “share” the interface to the internet (the wireless interface for my laptop). Alternatively, plug a wire from the Ethernet of the RPi into your home network router / hub as a wired connection.
This, ICS, will cause the wired interface or your laptop to become 198.168.0.1 / 255.255.255.0 and start a rather obnoxiously brain dead DHCP server on it. (It gives out near random IP numbers and can not be configured). When the Raspberry Pi is powered up, it will be given some IP number, but not one you can predict, so you need to have a keyboard, mouse, and monitor long enough to find out what it is. Alternatively, you can have an external Ethernet hub with cables and connect into your existing home network then ask your router what IP numbers are assigned to which devices (mine has a nice display in a web page).
Connect the Ethernet cable from the RPi to the laptop. Connect the keyboard, mouse, and video monitor. Then connect the MICRO – USB cable from the Raspberry Pi to the USB power source (laptop or USB Hub or other USB power source of 1000 mA.)
This will start the Pi booting up. A screen will appear on the TV set with several options. For mine, the display sometimes “rolled” and hitting return would stop it. Use the tab key to select “expand file system to use whole SD card”. Then the ‘select’ button. It is also a good time to choose the “update” option at the bottom of the panel, but we can also do that later. When done, choose “finish”. The RPi will now bring up a standard desktop. This selection panel only appears once. If you don’t do this now, you will need to use config-Pi later. IFF you want your RPi to launch a nice graphical environment on the TV ports on boot, you choose that option here as well. This will suck up about 150 MB of memory, so don’t do that on systems that will be almost always run “headless” (no need wasting that memory…)
At this point, the Raspberry Pi is up and running in a standard Debian mode. You can connect to it with a telnet server like PuTTY and get a line oriented terminal server that is sufficient for most all of the configuration. Eventually, you will want a graphical interface to it, and it is possible once the graphical interface is up, to open a ‘terminal window’ on the Raspberry Pi from inside that graphical desktop. The default user id is “pi” and the default password is “raspberry”.
Update Firmware
I didn’t do this step. I’m only putting these notes here as reference should it ever be needed.
From: http://www.megaleecher.net/Raspberry_Pi_Firmware_Update
We will be using the rpi-update tool developed by Hexxeh, to install it use the commands below at terminal.
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && chmod +x /usr/bin/rpi-update
sudo apt-get install ca-certificates
Once installed, user can use rpi-update anytime at the terminal to fetch and install the most current version of the Raspberry Pi firmware and kernel. Make sure to reboot your RasPi after every update.
Update the Debian Operating System
To get the current list of software package dependencies (so following additions work) do the following at a command prompt (in PuTTY from the laptop; or via a ‘terminal’ in the LXE windows environment on the TV screen):
sudo apt-get update
Or can be done at first boot of generic w/ bottom menu item of ‘update’.
To upgrade the kernel do:
I didn’t do this step either, as the kernel was working fine.
sudo apt-get upgrade -y
VNC Install
The Virtual Network Computer interface is used to get that graphical windows manager on your laptop screen, driving the Raspberry Pi board. The VNC Manual Page (called a ‘man page’) is at:
http://linux.die.net/man/1/xvnc
You can do this step via the Raspberry Pi keyboard, and TV Monitor, or via PuTTY from the laptop. As I find the TV an annoyance (mine is ‘composite’ – i.e. old and low resolution), I used PuTTY. In either case, open a “terminal session”.
the commands to get and install VNC on the Raspberri Pi are listed at this web site:
http://elinux.org/RPi_VNC_Server
As of now, the directions say:
Instructions
Log in to your Pi and install the Tight VNC Package
$ sudo apt-get install tightvncserver
Next Run TightVNC Server which will prompt you to enter a Password and an optional View Only Password
*(do a ‘touch .Xauthority’ first? Chmod 664? -EMS )*
$ tightvncserver
Once that is done you can start a VNC server from the shell prompt. This example starts a session on VNC display zero (:0) with full HD resolution:
$ vncserver :0 -geometry 1920×1080 -depth 24
(If fonts appear the wrong size, add ‘-dpi 96′ to the end.) Or you could create a script to save typing in the whole thing.
$ nano svnc.sh (call the file whatever you like)
*(I used vncsrv.sh and :2 1280 x 640 x 16 -EMS )*
Add the lines:
#!/bin/sh
vncserver :0 -geometry 1920×1080 -depth 24 -dpi 96
Ctrl-x y (To Exit Nano and Save)
Set the file to Execute
$ chmod +x svnc.sh
then to run
$ ./svnc.sh
Run at boot.
Start a root session
sudo bash
Create a file in /etc/init.d with a suitable name such as vncboot with the following content.
### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO
#! /bin/sh
# /etc/init.d/vncboot
USER=root
HOME=/root
export USER HOME
case “$1″ in
start)
echo “Starting VNC Server”
#Insert your favoured settings for a VNC session
/usr/bin/vncserver :0 -geometry 1280×800 -depth 16 -pixelformat rgb565
;;
stop)
echo “Stopping VNC Server”
/usr/bin/vncserver -kill :0
;;
*)
echo “Usage: /etc/init.d/vncboot {start|stop}”
exit 1
;;
esac
exit 0
Modify the file permissions so it can be executed
chmod 755 /etc/init.d/vncboot
Enable dependency based boot sequencing
update-rc.d /etc/init.d/vncboot defaults
If enabling dependency based boot sequencing was successful, it says
update-rc.d: using dependency based boot sequencing
But if it says
update-rc.d: error: unable to read /etc/init.d//etc/init.d/vncboot
then try the following command
update-rc.d vncboot defaults
Reboot your Raspberry PI and you should find a vncserver already started.
As I didn’t want a “root” VNC window just a single password away, I changed that to a different user in the script (pi). I also needed to use 1280 x 640 and 16 bit color depth to get things to fit the laptop screen and have better performance. VNC sends the whole bit map of the screen (no Graphics Processor Unit in use…) so its a big performance and network hit to be computing and sending large deep screens every time to change a bit… So I changed that ‘launch’ line to:
sudo -u pi /usr/bin/vncserver :2 -geometry 1280×640 -depth 16 -pixelformat rgb565
that gives me a “pi” VNC session instead, and cuts the size back to fit. I also put it on “2″ so I connect with (your ip range):5902 for example: 192.168.1.100:5902 if you had that IP number assigned to the RPi. (At a terminal window, type “ifconfig” and note the IP number assigned to eth0 to see what you have gotten.)
I have also put “sudo -u pi” in front of the kill command line, but that is likely optional and I’ve not tested it.
Install Tight VNC on your desktop from the link below; or most VNC clients work I believe.
http://www.tightvnc.com/download.php
These instructions are for Ubuntu and are only noted as I’m going to try putting it on a Pi later just to see how bad it get using one RPi to log onto another in a chain ;-) For most folks, it will be ‘download the M.S. Windows version and click to install”. Realize that you do NOT need the “server” on your laptop. That is to let you connect TO the laptop from some other machine and see the laptop screen. You need only the “Viewer” (that any normal software person would call a client… but X Server folks are a bit silly on that…)
Or install it using your package manager. The following works on my ubuntu 11.10 workstation
sudo apt-get install xtightvncviewer
Then use :1 (e.g. 192.168.1.2:1) as the host name when connecting.[1]
Works Great, select full screen from the tool bar and a full 1080p 24bit desktop is yours from anywhere.
1. ↑ You can put your raspberry pi in /etc/hosts on Linux systems. I think you can make such a file on windows too. Then you can refer to your raspberry pi as “rpi” or whatever you called it.
As noted above that config will give you a ‘root’ desktop, and is ‘risky business’. Better to use a user desktop. I didn’t use this method, but it’s in that link. I hacked the ‘at boot’ script instead…
Getting VNC Server to Work on a Specific User
Instead of using the script in the Raspberry Pi wiki, use this one provided by “PenguinTutor”:
#!/bin/sh
# /etc/init.d/tightvncserver
# Customised by Stewart Watkiss
#http://www.penguintutor.com/linux/tightvnc
# Set the VNCUSER variable to the name of the user to start tightvncserver under
VNCUSER=’pi’
eval cd ~$VNCUSER
case “$1″ in
start)
su $VNCUSER -c ‘/usr/bin/tightvncserver :1′
echo “Starting TightVNC server for $VNCUSER “
;;
stop)
pkill Xtightvnc
echo “Tightvncserver stopped”
;;
*)
echo “Usage: /etc/init.d/tightvncserver {start|stop}”
exit 1
;;
esac
exit 0
Now, change the VNCUSER=pi to your desired username, so for example: VNCUSER=jsmith
That’ll make it boot on the username of which you want it to boot on… but I then received the grey screen error when remotely accessing the Pi from my computer, now the way you fix this is, open up the xstartup file that was created when VNCSERVER executes on your desired username. Now the way you access it and edit it is by:
sudo nano .vnc/xstartup
.vnc is usually in the home directory.
Delete everything that is in xstartup (or not in as mine was), and add this:
!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid black
/usr/bin/lxsession -s LXDE &
Now it should work.
Desktop / Apps enhancement
To add “Iceweasel” (firefox) browser:
sudo apt-get install iceweasel
You can do the same thing for “chromium” (an open / free version of Chrome) but I don’t know why anyone would ;-)
Change the Hostname:
Open a terminal server. Set the new hostname to whatever you like by editing two files and restarting the “hostname” service. (Yes, it’s a full blown service… who knows why…)
sudo leafpad /etc/hostname
or sudo vi /etc/hostname for us old Unix guys ;-)
(In reality, I get tired of typing “sudo” all the time, so I just do “sudo bash” and get a “root shell” and just type the regular commands… CTL-C to exit the root shell when done).
change “raspberrypi” to whatever you like.
sudo leafpad /etc/hosts or sudo nano /etc/hosts for the new kids ;-)
change “raspberry pi” to the same thing everywhere.
sudo /etc/init.d/hostname.sh start
Set A Fixed IP Number
For use as a ‘plug in a DHCP world and go’ machine, the process is basically done. Other than installing “transmission”, that’s what I did for my Torrent Server. Yet for use on a laptop dongle, you really really want a fixed IP. Why? Because Brain-Dead Microsoft can’t assign the same IP number to the same computer two times in a row and doesn’t let you see the IP assignment table, that’s why. (Or buried it somewhere I couldn’t find, nor the dozen sites a web search turned up who also said to ‘give it up’…)
So since you connect via IP, and have 253 of them to search if you leave it on DHCP, “that’s a problem”. I used a single digit IP number, since MS seems to be assigning them in the 2 and 3 digit ranges, but not in the single digit range. (However, since you can not see nor change the assignment ranges, that’s a guess…) So something like 192.168.0.8 ought to work OK.
Since nothing else is on the wire, if MS assigns that number to something, it still ought to be ok. (Yes, I know that nothing ought to be asking for an assignment so no assignment ought to be done; but I’ve seen stranger things happen in M.S. Land. Like letting you see “dueling default gateways” where you can set one for each of two different interfaces, then it swaps between them about every 20 minutes. Took me most of a day to figure out that the way the ‘mail guy’ at a client site had set things up was with dueling default gateways and that was why they had sporadic 20 minute email delays. It would pick up for 20 minutes out one interface, then deliver for 20 minutes out the other. Setting ONE default gateway outbound, and fixed routing the private network inbound, fixed it. On the M.S. support site, in describing this bug, they said: “This behavior is by design”… and folks wonder why Unix / Linux guys don’t like M.S. products… too many weeks of my life wasted by them deliberately building bugs and calling them features…)
To set a fixed IP:
$ sudo nano /etc/network/interfaces
This will allow you to edit the file using nano. Personally, I use “sudo vi”… as I’m an old Unix geek. One can also use leafpad in the graphical environment if logged in to a VNC window as root.
Change the line that reads
iface eth0 inet dhcp
to
iface eth0 inet static
Below this line enter the following.
address 192.168.137.8
netmask 255.255.255.0
network 192.168.137.0
broadcast 192.168.137.255
gateway 192.168.137.1
That “gateway” line lets you get from the Dongle Pi out to the internet through your laptop wireless connection for any further software updates / testing and until you get the wireless dongle installed. Once you have the dongle working wireless, you would remove that “gateway” line from this file so you stop using the laptop as your internet gateway. At this point, you have a “Dongle Pi” that works through the laptop, but not via wireless. Useful for some things, like having a private Linux on a Dongle where you could put things or just use Linux tools.
Realize that older version of M.S. Windows used “192.168.0.x” and newer versions use “192.168.137.x” and you have no idea what M.S. will do to you in the future… so it’s best to check what the actual range is being used by your laptop prior to entering those numbers. It is possible, after ICS is turned on, to go to the network control panel and set the Windows IP to a ‘use this one’ value that you control and still have it work (though it stops doing DHCP, which is a feature IMHO given how brain dead their DHCP happens to be). That can be a ‘feature’ in that you can set it to an unusual ‘non routing’ value and anyone who DOES break into the RPi will not see “194.168.137.1″ and think “Oh, a M.S. Windows box doing ICS; attack with M.S.Windows cracking tool kit”.
The non-routing blocks are:
10.0.0.0 – 10.255.255.255
single class A network
10.0.0.0/8 (255.0.0.0)
172.16.0.0 – 172.31.255.255
16 contiguous class B networks
172.16.0.0/12 (255.240.0.0) or you can do:
172.22.4.0 mask 172.22.4.255 to break out a class C sized chunk of it that will be just a bit obscure ;-)
192.168.0.0 – 192.168.255.255
192.168.0.0/16 (255.255.0.0)
Most often seen as things like 192.168.0.0 / 192.168.0.255 or 192.168.0.0/24
FWIW, I also set mine to use a specific set of DNS servers. The WiFi dongle will tend to pick up a DHCP address and the associated DNS servers when used to connect that way, or if used with DHCP on the ICS side, it will get DNS servers there along with default route information. But using chosen DNS servers has benefits. You can use DNS services that put in blocking of offensive sites or places that are known security risks. (Norton provides those) Or you can just use a known “nice” DNS server that doesn’t track you and / or tattle on you to “agencies” or is just in another country so doesn’t “localize” you. (Google provides fast DNS from their own custom software, but given their “track everything” business model, I have to suspect they track who contacts whom on their DNS requests… So I’d avoid them for anything you wish to keep ‘private’. Also, as your ISP tends to give you their DNS services on their wire, IFF an agency tracks you down to, say, Starbucks at this ISP, they could put monitoring on that DNS server to see what you are looking up. In that case, looking elsewhere for DNS is also a feature. Finally, some, like OpenDNS, redirect failed lookups to their web site to “help” you… you might not want that…
Configuring DNS is something most folks choose to avoid, and with good cause, but it also can be made much more robust with just a little work, and can fix many problems. For example, if you are using Bell South networking and their default DNS and they come under a DNS DDS (Destributed Denial of Service attack) you will slow down as your Domain Name Service lookups fail / slow. If, instead, you had many DNS servers in your list, failed DNS would just move down the list to other servers.
This is all completely optional, but nice to do.
If you will be doing much with networking, you will want the usual networking / DNS tools:
sudo apt-get install dnsutils
Initially I put the DNS list in /etc/resolv.conf where it belongs. But network guys are a confused sort. They have had ongoing ‘turf wars’ forever. The “old” method of using “config files” didn’t appeal to some, so they added other layers. And them more layers. And then things didn’t ways work. And DHCP was supposed to be ‘no thinking required’, so having an /etc/resolve.conf file in charge was Not Acceptable, so the DHCP guys think THEY are in charge… eventually Sun added nsswitch (Name Service Switch) to let you sort out “who is in charge”… that then some other folks crowbarred their way around…
So there’s a bit game of “who is really in charge?” that gets played in Network Land on Linux machines. For the RPi it looks like nsswitch might be ignored, and /etc/resolv.conf just gets over written by DHCP in any case. (My nsswitch says ‘files’ first, so the ‘files’ ought to rule, but… back at “I’m in charge!” network wars…)
So it looks like the place to edit is:
/etc/dhcp/dhclient.conf
where you add a line like:
prepend domain-name-servers 184.169.143.224,208.67.222.222,4.2.2.4,8.8.4.4;
Listing whatever DNS servers you like. There’s lots of choices in the “Open DNS” world, and choosing one is up to you. Some pointers though:
http://pcsupport.about.com/od/tipstricks/a/free-public-dns-servers.htm
has this list:
Provider Primary DNS Server Secondary DNS Server
Level31 209.244.0.3 209.244.0.4
Google2 8.8.8.8 8.8.4.4
Securly3 184.169.143.224 184.169.161.155
omodo Secure DNS 8.26.56.26 8.20.247.20
OpenDNS Home4 208.67.222.222 208.67.220.220
DNS Advantage 156.154.70.1 156.154.71.1
Norton ConnectSafe5 198.153.192.40 198.153.194.40
ScrubIT6 (may be out of service) 67.138.54.120 207.225.209.77
SafeDNS7 195.46.39.39 195.46.39.40
DNSResolvers.com8 205.210.42.205 64.68.200.200
OpenNIC9 74.207.247.4 64.0.55.201
Public-Root10 199.5.157.131 208.71.35.137
SmartViper 208.76.50.50 208.76.51.51 Dyn 216.146.35.35 216.146.36.36
censurfridns.dk11 89.233.43.71 89.104.194.142
Hurricane Electric12 74.82.42.42
puntCAT13 109.69.8.51
Google claims innocent desire to speed things up. Yeah, sure…
https://en.wikipedia.org/wiki/Google_Public_DNS
Google Public DNS is a freely provided DNS (Domain Name System) service announced on 3 December 2009, as part of Google’s self-proclaimed effort to make the web faster. According to Google, as of 2013 Google Public DNS is the largest public DNS service in the world, handling more than 130 billion requests on an average day.
Google Public DNS provides the following recursive nameserver addresses for public use, mapped to the nearest operational server location by anycast routing:
IPv4 addresses
8.8.8.8
8.8.4.4
Think if The Govt asked for some info or to block certain IP lookups that Google would be more than glad to help in exchange for favorable business treatment? (Having your own DNS table / server lets you prevent that …)
Norton has some they claim are a value added set:
https://en.wikipedia.org/wiki/Norton_DNS
According to Symantec’s website their DNS service for home users offers the following options depending on how much filtering the user would like the DNS servers to perform for them.
Security
198.153.192.40
198.153.194.40
Security and Pornography
198.153.192.50
198.153.194.50
Security, Pornography and “Non-Family Friendly”
198.153.192.60
198.153.194.60
Open DNS offers:
208.67.222.222
208.67.220.220
and some folks don’t like their re-direct behaviour of failed lookups.
Yahoo has a DNS server at: 68.180.131.16 named ns1.yahoo.com
The Telcos usually have them. Some I know are:
dnsr1.sbcglobal.net 68.94.156.1
ns1.swbell.net 151.164.1.1
where I’d expect S.W.Bell has others named ns2, ns3, … but have not looked them up. Similarly, SBC likly has a dnsr2 and dnsr3.
I’m sure there are more, but you get the idea.
Well, enough on DNS. Just realize that most networking problems start with checking out what is the default gateway (or “route of last resort” where packets go if you don’t have a specific routing table to say “take that interface there”) and then look to DNS failures. So “ping yahoo.com” first does a DNS lookup, while “ping 206.190.36.45″ goes directly via the default route without an DNS lookup. (Yes, Yahoo! has generally been very nice about providing a ping responder. I typically have used them for diagnostics and they engender lots of good will in me by that. It’s a little thing, but much nicer than just blocking pings.)
So first try “ping yahoo.com” and if that does not work, while a direct IP ping does, you have a DNS problem…
In Conclusion
As noted, this is the ‘rough notes’. If you use them and “have issues”, please note what it was and I’ll fix it / provide consultation (on where I wrote it up badly ;-)
I have a DonglePi working as an attached Linux (via the laptop as default gateway) and as a “Wireless Dongle Pi” with the laptop as only an attached screen viewer. (that “gateway” choice and the added WiFi dongle)’)
Why no directions on installing the WiFi dongle? Because by selecting one known to work, it just plugs in and works. Open a VNC session to the ‘pi’ desktop and click on the WiFi Config application. “Scan” for networks, enter any security options needed (for public hot spots, that’s none) and go.
With that, I’ve got a BBQ to start for today’s “burnt offering” and it’s time for me to take a break from hacking Pi. It’s been a fun couple of days, but I tend to go “down the rabbit hole” and everything else stops for a while ;-)
Hopefully this “cookbook” is helpful to folks and it will save someone some time. I’m also willing to “flash” an SD card with an image, test it in my RPi, and drop one in the mail to anyone who needs it done for them. For now, $20 + SD card cost ($5 for 4 GB, $8 for 8 GB at Best Buy near me) to the tip jar and a note that you want one in email with an address. Delivery “when I get around to it” but likely in the mail inside of a week.
Subscribe to feed