Manual wifi config in Debian

Comments Off

Most modern GUI based distros handle setup and management of Wifi connections very well these days. However, sometimes you need to go the way of the command line. The following outlines the basics in Debian, plus some useful commands.

Driver
First, the Wifi device I had laying around was a Realtek based USB dongle similar to this. The driver for that is in the non-free repository, so I added the parts in bold to my /etc/apt/sources.list

deb http://ftp.ch.debian.org/debian/ wheezy main contrib non-free
deb http://ftp.ch.debian.org/debian/ wheezy-updates main contrib non-free

I could then install the driver:
apt-get update
apt-get install firmware-realtek

Config
There are two config files to handle: The basic network configuration (/etc/network/interfaces), which also includes wired networks and the loopback, and the WPA wifi specific configuration (/etc/wpa_supplicant/wpa_supplicant.conf). Although it is also possible to specify wifi parameters in the network interfaces file, it is better handled by the wpa because then you can configure settings for multiple networks (e.g. home and work) as seen below.

/etc/network/interfaces contains the following:

# The loopback network interface
auto lo
iface lo inet loopback

# Wired ethernet
auto eth0
iface eth0 inet dhcp

# The primary network interface
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
      wpa-driver nl80211
      wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

The loopback lo interface is configured, a wired eth0 port, and the wlan0 wifi. All networks are set to come up automatically, the last two use DHCP to get their address, and the Realtek nl80211 driver is specified as well as a reference to the WPA Supplicant config.

/etc/wpa_supplicant/wpa_supplicant.conf contains:

ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
    ssid="my_home_network"
    key_mgmt=WPA-PSK
    psk="wifi passphrase"
}

network={
    ssid="my_work_network"
    key_mgmt=NONE
}

Here two networks are configured: A home network with WPA encryption and its passphrase, and an open network for work.

To bring the wifi network up, simply run the following. If iterating on the configuration, it’s has to be stopped first.

ifdown wlan0 && ifup wlan0

Useful commands
Other useful commands while debugging this include:

For general network configuration and status:

ifconfig

iwconfig

For listing all available networks and their parameters. This works even before you have connected to a specific one, so it’s a good test to see if the wifi device is even working:
iwlist wlan0 scan

For starting the wpa supplicant manually and checking the wifi configuration. Notice the specific driver and interface name:
wpa_supplicant -B -Dnl80211 -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Comments Off

Storage prices

Comments Off

Although the prices on medium sized, 3 to 4 TB, spinnings disks remain about constant since the beginning of the year, a new drive has jumped right to the top of the list this time: The Seagate ARCHIVE HDD 8TB at 260 Euro or 0.03 GB Euro per GB (30.6 GB per Euro). This drive is not for everybody, though. It’s using Shingled Magnetic Recording (SMR) in “drive managed” mode, which means it’s a write-a-few-times / read-many drive. Or in other words, well suited for a large movie collection or as its name suggest large backups in single disk mode. It is specifically not designed for RAID mode. This review goes into further details. What’s interesting, is that it’s a 6 platter (1.33 TB platters) drive, without any other special hacks to make that work. If the same disk goes to 10 TB by next year as hinted earlier, it will mean 1.67 TB platters.

Contrast that to the Hitachi HGST Ultrastar Helium 8 TB drive at the opposite end of the HDD price spectrum. At 800 Euros, it’s more than three times more expensive than the Seagate 8 TB drive. The HGST uses helium to pack 7 platters into one drive, and needs a special seal to keep the light helium gas inside. It’s still an unproven technology, and only time will tell if it really works. Given the very high price over even 6 TB “normal” drives, it’s unclear which market segment would bet on this drive. Maybe it’s still priced at “early adopters” premium.

In the SSD section, Samsung has moved to the 850 series in both EVO Basic and Pro lines. Crucial has launched new BX100 and MX200 MLC lines. The new BX100 line gets overall good review in this Anandtech article. Prices have not changed significantly, and the larger drives still give the most bytes per coin. The 500 GB drives are now excellent laptop upgrades if you’re still on spinning disks.

Finally, on flash cards I’ve also added micro SD, and a good selection of alternative SanDisk SD cards. Except for size, the distinguishing factor on these cards is read and write speed. This SanDisk article explains the Class and UHS ratings. It’s nice to see that the cards it makes most sense to buy for the average consumer are also towards the top: For your phone (if it has a memory slot) a 64 GB Sandisk Ultra microSDXC Class 10, 48MB/s at 43 Euro should be a good investment. While for your mid-range DSLR a 64 GB Sandisk Extreme SDXC, Class 10/UHS 3, 40/60MB/s at 50 Euros will give lots of space and good burst rate even with raw files.

Media Type Product Capacity Price CHF Price Euros Euros / GB GBs / Euro
HDD Seagate ARCHIVE HDD 8TB 8000 GB 272.00 261.54 0.03 30.59
HDD Western Digital Green 3TB 3000 GB 107.00 102.88 0.03 29.16
HDD Western Digital Green 4TB 4000 GB 148.00 142.31 0.04 28.11
HDD Seagate Desktop 4TB 4000 GB 149.00 143.27 0.04 27.92
External 3.5 Western Digital Elements Desktop 4TB, USB3 4000 GB 150.00 144.23 0.04 27.73
External 3.5 Western Digital My Book 4TB, USB3 4000 GB 157.00 150.96 0.04 26.50
HDD Western Digital Purple 3TB 3000 GB 118.00 113.46 0.04 26.44
HDD Western Digital Green 6TB 6000 GB 237.00 227.88 0.04 26.33
External 3.5 Western Digital Elements Desktop 3TB, USB3 3000 GB 119.00 114.42 0.04 26.22
HDD Western Digital Red 3TB 3000 GB 120.00 115.38 0.04 26.00
External 3.5 Western Digital My Book 3TB, USB3 3000 GB 126.00 121.15 0.04 24.76
HDD Western Digital Red 4TB 4000 GB 169.00 162.50 0.04 24.62
HDD Western Digital Purple 4TB 4000 GB 169.00 162.50 0.04 24.62
HDD Western Digital Green 2TB 2000 GB 84.70 81.44 0.04 24.56
HDD Western Digital Red 6TB 6000 GB 259.00 249.04 0.04 24.09
HDD Western Digital Red 5TB 5000 GB 216.00 207.69 0.04 24.07
HDD Hitachi Deskstar 7K4000, 4TB 4000 GB 175.00 168.27 0.04 23.77
External 3.5 Western Digital My Book 6TB, USB3 6000 GB 282.00 271.15 0.05 22.13
HDD Western Digital Purple 2TB 2000 GB 95.30 91.63 0.05 21.83
HDD Western Digital Red 2TB 2000 GB 98.00 94.23 0.05 21.22
External 2.5 Western Digital Elements Portable 2TB, USB3 2000 GB 99.00 95.19 0.05 21.01
External 2.5 Western Digital My Passport Ultra 2TB, USB3 2000 GB 107.00 102.88 0.05 19.44
HDD Western Digital Green 1TB 1000 GB 57.50 55.29 0.06 18.09
HDD Western Digital Purple 1TB 1000 GB 66.30 63.75 0.06 15.69
HDD Western Digital Red 1TB 1000 GB 68.00 65.38 0.07 15.29
External 2.5 Western Digital Elements Portable 1TB, USB3 1000 GB 69.00 66.35 0.07 15.07
Blu-ray Verbatim BD-R SL 10 @ 25GB 250 GB 18.00 17.31 0.07 14.44
External 2.5 Western Digital My Passport Ultra 1TB, USB3 1000 GB 73.40 70.58 0.07 14.17
DVD-R Verbatim 16x DVD-R 100 @ 4,7GB 470 GB 34.70 33.37 0.07 14.09
HDD Hitachi Ultrastar He6 6TB 6000 GB 476.00 457.69 0.08 13.11
HDD Hitachi Ultrastar He8 8TB 8000 GB 803.00 772.12 0.10 10.36
Blu-ray Verbatim BD-R DL 10 @ 50GB 500 GB 52.00 50.00 0.10 10.00
DVD+R DL Verbatim 8x DVD+R DL 25 @ 8,5GB 213 GB 37.30 35.87 0.17 5.92
DVD+R DL Verbatim 8x DVD+R DL 50 @ 8,5GB 425 GB 80.10 77.02 0.18 5.52
SSD Crucial BX100 SSD, MLC, 1000GB 1000 GB 349.00 335.58 0.34 2.98
SSD Crucial BX100 SSD, MLC, 250GB 250 GB 89.70 86.25 0.34 2.90
SSD Samsung SSD 850 EVO Basic, TLC, 1TB 1000 GB 369.00 354.81 0.35 2.82
SSD Crucial MX200 SSD, MLC, 1000GB 1000 GB 372.00 357.69 0.36 2.80
SSD Samsung SSD 850 EVO Basic, TLC, 500GB 500 GB 189.00 181.73 0.36 2.75
SSD Crucial BX100 SSD, MLC, 500GB 500 GB 190.00 182.69 0.37 2.74
SSD Crucial MX200 SSD, MLC, 500GB 500 GB 192.00 184.62 0.37 2.71
SSD Crucial MX200 SSD, MLC, 250GB 250 GB 104.00 100.00 0.40 2.50
SSD Crucial MX100 SSD, MLC, 256GB 256 GB 113.00 108.65 0.42 2.36
SSD Samsung SSD 850 EVO Basic, TLC, 250GB 250 GB 116.00 111.54 0.45 2.24
SSD Samsung SSD 850 Pro, MLC, 1024GB 1024 GB 495.00 475.96 0.46 2.15
USB Flash SanDisk Cruzer Edge Flash Drive 64GB 64 GB 31.50 30.29 0.47 2.11
CD-R Verbatim CD-R 100 @ 700MB 70 GB 36.00 34.62 0.49 2.02
SSD Samsung SSD 850 Pro, MLC, 512GB 512 GB 267.00 256.73 0.50 1.99
SSD Samsung SSD 850 Pro, MLC, 256GB 256 GB 145.00 139.42 0.54 1.84
SDXC SanDisk Ultra SDXC, Class 10, 40MB/s, 64GB 64 GB 37.00 35.58 0.56 1.80
USB Flash SanDisk Cruzer Edge Flash Drive 32GB 32 GB 19.20 18.46 0.58 1.73
SSD Samsung SSD 850 EVO Basic, TLC, 120GB 120 GB 72.50 69.71 0.58 1.72
microSDXC SanDisk Ultra microSDXC Android, Class 10, 48MB/s, 64GB 64 GB 45.00 43.27 0.68 1.48
SDHC SanDisk Ultra SDHC, Class 10, 40MB/s, 32GB 32 GB 22.50 21.63 0.68 1.48
microSDXC SanDisk Ultra microSDXC Android 48MB/s, 128GB 128 GB 93.00 89.42 0.70 1.43
SSD Samsung SSD 850 Pro, MLC, 128GB 128 GB 93.70 90.10 0.70 1.42
SDXC SanDisk Extreme SDXC, Class 10/UHS 3, 40/60MB/s, 64GB 64 GB 51.60 49.62 0.78 1.29
USB Flash SanDisk Extreme Pro, USB 3.0, 128GB 128 GB 105.00 100.96 0.79 1.27
microSDXC SanDisk Extreme microSDXC, Class 10 40/60MB/s, 64GB 64 GB 52.60 50.58 0.79 1.27
SDXC SanDisk Ultra SDXC, Class 10, 40MB/s, 128GB 128 GB 108.00 103.85 0.81 1.23
SDXC SanDisk Extreme SDXC, Class 10/UHS 3, 40/60MB/s, 128GB 128 GB 111.00 106.73 0.83 1.20
USB Flash SanDisk Cruzer Edge Flash Drive 16GB 16 GB 15.00 14.42 0.90 1.11
SDHC SanDisk Extreme SDHC, Class 10/UHS 3, 40/60MB/s, 32GB 32 GB 30.20 29.04 0.91 1.10
SDXC SanDisk Extreme Plus SDXC, Class 10/UHS 1, 80/60MB/s, 128GB 128 GB 122.00 117.31 0.92 1.09
SDHC SanDisk Ultra SDHC, Class 10, 40MB/s, 16GB 16 GB 15.40 14.81 0.93 1.08
microSDHC SanDisk Ultra microSDHC Android, Class 10, 48MB/s, 32GB 32 GB 30.90 29.71 0.93 1.08
SDXC SanDisk Extreme Pro SDXC UHS-I, Class 10/UHS 3, 95/90MB/s, 256GB 256 GB 258.00 248.08 0.97 1.03
SDXC SanDisk Extreme Pro SDXC UHS-I, Class 10/UHS 3, 95/90MB/s, 512GB 512 GB 525.00 504.81 0.99 1.01
SDXC SanDisk Extreme Pro SDXC UHS-I, Class 10/UHS 3, 95/90MB/s, 128GB 128 GB 135.00 129.81 1.01 0.99
microSDXC SanDisk Extreme Pro microSDXC, Class 10, 90/95MB/s, 64GB 64 GB 70.90 68.17 1.07 0.94
microSDXC SanDisk Extreme Plus microSDXC, Class UHS-I/10, 50/80MB/s, 64GB 64 GB 79.00 75.96 1.19 0.84
SDXC SanDisk Extreme Plus SDXC, Class 10/UHS 1, 80/60MB/s, 64GB 64 GB 79.00 75.96 1.19 0.84
SDHC SanDisk Extreme SDHC, Class 10/UHS 3, 40/60MB/s, 16GB 16 GB 21.00 20.19 1.26 0.79
USB Flash SanDisk Cruzer Edge Flash Drive 8GB 8 GB 10.50 10.10 1.26 0.79
SDXC SanDisk Extreme Pro SDXC UHS-I, Class 10/UHS 1, 95/90MB/s, 64GB 64 GB 93.00 89.42 1.40 0.72
microSDXC SanDisk Ultra Premium microSDXC 90MB/s, 200GB 200 GB 299.00 287.50 1.44 0.70
SDHC SanDisk Extreme Pro SDHC UHS-I, Class 10/UHS 1, 95/90MB/s, 32GB 32 GB 48.70 46.83 1.46 0.68
Compact Flash SanDisk Extreme 120MB/s, 128GB 128 GB 199.00 191.35 1.49 0.67
SDHC SanDisk Extreme Plus SDHC, Class 10/UHS 1, 80/60MB/s, 32GB 32 GB 51.10 49.13 1.54 0.65
microSDHC SanDisk Extreme Plus microSDHC, Class 10, 50/80MB/s, 32GB 32 GB 51.40 49.42 1.54 0.65
SDHC SanDisk Extreme HD Video SDHC, Class 6, 20MB/s, 8GB 8 GB 15.80 15.19 1.90 0.53
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 64GB 64 GB 127.00 122.12 1.91 0.52
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 256GB 256 GB 535.00 514.42 2.01 0.50
SDXC SanDisk Extreme Pro SDXC UHS-II, UHS 3, 280/250MB/s, 64GB 64 GB 145.00 139.42 2.18 0.46
SDHC SanDisk Extreme Pro SDHC UHS-I, Class 10/UHS 1, 95/90MB/s, 16GB 16 GB 37.30 35.87 2.24 0.45
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 32GB 32 GB 78.10 75.10 2.35 0.43
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 32GB 32 GB 79.00 75.96 2.37 0.42
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 64GB 64 GB 160.00 153.85 2.40 0.42
SDHC SanDisk Extreme Plus SDHC, Class 10/UHS 1, 80/60MB/s, 16GB 16 GB 40.70 39.13 2.45 0.41
SDXC SanDisk Extreme Plus SDXC, Class 10/UHS 1, 80/30MB/s, 8GB 8 GB 22.90 22.02 2.75 0.36
SDHC SanDisk Extreme Pro SDHC UHS-II, UHS 3, 280/250MB/s, 32GB 32 GB 93.00 89.42 2.79 0.36
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 16GB 16 GB 50.70 48.75 3.05 0.33
Compact Flash SanDisk Extreme Pro 160MB/s, UDMA 7, 128GB 128 GB 408.00 392.31 3.06 0.33
SDHC SanDisk Extreme Pro SDHC UHS-II, UHS 3, 280/250MB/s, 16GB 16 GB 63.80 61.35 3.83 0.26

Exchange rate: 1 Euro = 1.040000 CHF.

Comments Off

The Negative Effects of Lead

Comments Off

There have been several studies over the last years which investigate the correlation between lead exposure and crime. Just last week, Feigenbaum and Muller (2015) [PDF] published another, looking at the correlation between the use of lead pipes in US cities in the 1890s and the homicide rates 30 years later. Their most conservative estimates “suggest that cities’ use of lead service pipes increased city-level homicide rates by twenty-five percent.”.

There have been more studies, and the Mother Jones article from 2013 did a good job of summarizing many of them: Rick Kevin shows in his (1999) [PDF] paper the effect of lead from gasoline in US cities on the violent crime rate 20 to 25 years later. The correlation is consistent over up to 120 years in some of his data. In another paper from (2007) [PDF], he found similar correlation in other nations, including Britain, Canada, France, Australia, Finland, Italy, West Germany, and New Zealand. Similar studies were made by Reyes (2007), and Mielkea, Zahran (2012).

What makes these studies interesting, as the Mother Jones article points out, is that they are the only theories which can accurately describe the raise and fall of the “crime epidemic” of the 1970s and 80s in the US and elsewhere. In particular, it makes the claim that the “tough on crime” and “war on drugs” had a significant effect on crime levels less likely, or at least had a minor effect compared to lead exposure.

This is important, since the government wars on abstracts and concepts, “crime” “drugs” and “terrorism” are all raging and threatening innocent lives across the US. If some of the fuel behind these polices can be removed by research, all the better.

Comments Off

6 May : International Day Against DRM

Comments Off

Today has been designated International Day Against DRM. Free Software Foundation Europe has a brief leaflet to print and handout [PDF]. Defective by Design has a campaign and event page, with tips on launching your own event. Their page also comes with a list of repeat offenders: Sony, Microsoft, Apple, Netflix, Amazon and of course Motion Picture Association of America.

To round it off, an illustrative quote by Disney Executive, Peter Lee:

“If consumers even know there’s a DRM, what it is, and how it works, we’ve already failed.”

Comments Off

Wifi with the ESP8266

Comments Off

The ESP8266 is an interesting chip that has gained a lot of traction lately. At only $5, it’s quite impressive what you get: a wifi to serial adapter, a TCP/IP stack, and even an embedded user-programmable micro controller. It is in fact a complete System-on-a-Chip itself. As an adapter, it can easily be connected to a micro controller like the Arduino, and there is now also an SDK to program it stand-alone. Espressif, the Chinese company behind it targets the “Internet of Things” market, which is bound to grow in the near future. They also seem keen on creating an open source community around the chip, with an open source Github project, the open source SDK, and a community forum.

The chip comes on a large range of modules and break-out boards, as seen below. Deal Extreme stocks most of them, and I got the ESP-01 with easy to use header pins.

With a bit of help from various blogs about the board, I had it up and running. The basics are neatly explained by ray, with the AT commands to try out first. shin-ajaran goes into a bit more detail about the wiring and other options. And once you have it running, the MIT class instruction mentions a few scripts to try out. Finally, Dave Vandenbout explains firmware flashing and more advanced use.

My own Hello World attempt does not add much to what is already mentioned above. To summarize, my basic setup includes:

  • The ESP-01 ESP8266 board.
  • A USB-to-TTL serial cable, e.g. based on the PL2303
  • Assuming you get a 5V USB-TTL cable, you need to lower the input voltage. I got the $2 AMS1117 Power Module
  • Two resistors for a 5 to 3.3 voltage divider. I went with 100 and 220 Ohm; see shin-ajaran blog post for details.
  • A breadboard to connect the voltage divider.
  • Also note, I had to connect both the reset (RST) pin and CH_PD pin to 3.3 VCC before the terminal on the computer connected.

In the pictures below I’ve tried to show my setup. Not sure how much clarity it adds, though. It shows the pins of the esp-01: red for 3.3 VCC, black for ground, green for URXD (connected via a voltage divider, and matching green on the PL2303 cable), and yellow for UTXD (connect directly to white on the PL2303 cable). The breadboard shows the voltage divider, and all the red VCC wires connect (but of course not connect to the resistors).

Comments Off

Importing contacts to the Ubuntu Touch phone

Comments Off

I recently bought the bq Aquaris E4.5 Ubuntu Edition. As the name suggests, it comes with the new Ubuntu Touch OS. It’s a refreshing take on a phone OS, and with it’s GNU/Linux base system, apt-get repository backed installation, it is in fact the phone I’ve always wanted. However, at this stage it is still in beta, so if you expect a polished UI and applications, you’ll have to wait. At €169, it is not a bad deal, and I see it as part of my contribution to free open source software this year.

There are a number of features still lacking or half-backed. For example, there is Bluetooth, and I could connect my Android phone, but not transfer a VCARD contact information. Also, there seems to be no way to import a VCARD file. However, as the contacts database is based on the GNOME Evolution application, I could edit its SQLite database. Below is the procedure I used to successfully transfer my phone and contacts list from an Android (Android 4.3, Cyanogenmod 10.2) phone to the Ubuntu Touch (Ubuntu 14.10 (r21)).

Export

On the Android phone, open the “People” app, select its settings pop-up, and click “Import / Export”. In the selection window, choose “Export to storage” and acknowledge. A text file with your contacts information will be saved somewhere on your device. Find it, and transfer it over to your computer by e-mail, SFTP, etc.

Convert

Maybe there is a better way to import the file, but I did a raw edit of the SQL DB. It means I had to convert the VCARD file to SQL INSERT commands. The following awk script takes care of that.

cat 00001.vcf | awk -F":" 'BEGIN { FS = ":"; i=0 }; {
if ($0 ~ /BEGIN/) {
  print "INSERT INTO folder_id(uid, vcard) VALUES(\"" i  "\", \"BEGIN:VCARD";
  i=i+1;
} else if ($0 ~ /END/) {
  print "END:VCARD\");"
} else if ($0 ~ /FN/) {
  print "X-EVOLUTION-FILE-AS:" $2 "\nFN:" $2
} else {
  print $0
} }'

 

Besides adding the SQL statement, this adds the special field X-EVOLUTION-FILE-AS, and a unique ID counter. All fields in the DB will not be populated, however, it will still work. And, the first time you edit one of the contacts from the phone UI, it will update and populate the rest.

Save the result of the command to update.sql (or any other file name you like).

Import
Finally, transfer the result of the awk command as a file to the Ubuntu phone, and modify the contacts DB. (Please note, I take no responsibility for loss of data or other failures this might cause).

The contacts SQLite3 file is located at
/home/phablet/.local/share/evolution/addressbook/system/contacts.db


sqlite3 -init /tmp/update.sql contacts.db

This will execute the specified sql file, and then open sqlite3 in interactive mode. You can list the contacts table to verify:

SELECT * FROM folder_id;

Finally, you want to stop any processes using the address book. After exiting the SQL shell (CTRL+D), use something like:

kill `ps aux |grep -i address.*book | grep -v grep | tr -s ' ' | cut -d ' ' -f 2`

Now open the Contacts app on the phone, and confirm that all information is there.

Comments Off

Multi SATA support on Banana Pi

Comments Off

HTPC Guides has a fun post detailing how you can make the Banana Pi (and presumably the Banana Pro) work with multiple SATA drives. Using a SATA multiplier from AliExpress and a 2.5″ HDD enclosure with separate SATA ports more drives can be hooked up.

At the time of writing, a minor change and recompile of the kernel is required. However, if this catches on, it is sure to be supported out of the box.

Comments Off

Debian 7 – netinst

Comments Off

In search of a small simple GNU/Linux server setup, I started with a Debian 7 installation through a network based install – netinst. Using that image is simple, either by writing to a CD, or simply to a USB drive or memory card:
(Replace X with your flash drive, but be careful; everything will be overwritten, without any recovery option).

sudo dd if=debian-7.8.0-i386-netinst.iso.torrent of=/dev/sdX
The installation was straight forward, but it has to be hand-held since there are multiple prompts from various parts of the installation throughout. Unfortunately, the final step of writing out the GRUB configuration failed, since the install medium, the USB flash reader, was included in the GRUB device map. Removing it from /boot/grub/device.map fixed that, and a little rescue operation resolve the rest.

Once booted, there was a problem with the start-stop-daemon; for some reason, it was set to a fake mock implementation. That caused all services to not start. Swapping in with the real implementation took care of that:

mv /sbin/start-stop-daemon /sbin/start-stop-daemon.FAKE
ln -s /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon

Finally, some essentials are always missing:

apt-get install emacs atop htop iftop iotop tree git tig sudo autossh iptables-persistent wpasupplicant cryptsetup smartmontools

Comments Off

Thirty years of GNU

Comments Off

In a brief and accurate article, The New Yorker commemorates Richard Stallman’s work on the GNU project, and the history of the GPL. It was thirty years ago this month that Stallman published the GNU Manifesto, where he outlined the goal to create a free operating system. This was followed a few years later, in February 1989, by the first free software license, the GNU General Public License.

As is pointed out in the article, the world might have looked very different were it not for these documents. Today, some of the biggest technology companies are built on the basis of free software, and specifically the GNU/Linux operating system at its core. This includes Google’s, Amazon’s and Facebook’s server farms; the majority of web sites are served by Apache, running on a GNU/Linux distribution; Android, which has the biggest market share, is based on the Linux kernel (but without GNU tools).

Free software, with the right to inspect, change and distribute the source, is critical to a free society, as Stallman tirelessly points out in his writing and speeches. A good collection of his essays can be found in the book “Free Software Free Society”, itself available for free download. With NSA and other’s intrusive mass surveillance, Stallman’s message is as relevant as ever. He has been called paranoid and crazy over and over again, but in the end, he has been proven right in even the most extreme scenarios. If we want to live in a free society, we cannot afford to ignore his message.

So instead of downloading the book, buy it for $20, and support the Free Software Foundation or its sister organization Free Software Foundation Europe. Even better, become a member of either organization, to support the ongoing work of teaching politicians and policy-makers about the necessity of free software; supporting free software alternatives; and guarding the freedom of users. Today makes an excellent day to put your money on something which matters!

 

Free Software Foundation           Free Software Foundation Europe

Comments Off

Banana Pro

Comments Off

The Banana Pro from Lemaker is another credit card sized Single Board Computer. The Raspberry Pi is still leading that space with more than five million units sold, but it’s starting to get crowded. Banana Pro is probably one of the boards which comes closest to the Raspberry Pi, and indeed, their first version was called Banana Pi. This is from China, where imitating is a compliment.

However, except for its size, the Banana Pro is a very different computer. It has 1 GHz dual core Cortex ARM 7 CPU and comes with 1 GB of DD3 RAM, embedded Wifi, IR receiver, and maybe the best, a full speed SATA 2.0 connector. The price is similar though, at about €45 from Reichelt in Germany.

Compared to the original Raspberry Pi, it’s actually a very usable computer for day-to-day use. However, the Pi 2 probably evens that out, with a similar CPU and RAM. Just like the Pi, it has a 40 pin header, with 28 GPIO pins. It also has a camera interface, but also a display interface connector.

The distribution Lubuntu comes with Firefox, which runs quite OK. However, graphics acceleration is missing, and that is noticeable. The Lubuntu install detected and used the Wifi and IR receiver out of the box. It so happened that the volume button on my stereo remote was mapped to “CALC”, so the calculator application pops up. Should be great for XBMC / Kodi. An XBMC Debian based distribution is available, called LeMedia. It claims to support hardware graphics acceleration.

There are many distributions available. Another interesting and obvious one would be the Open Media Vault, which makes it into a Debian based NAS with a good web UI. Here the SATA port comes in handy.

Below are front and back pictures, which should be pretty self explanatory (if you click to get a large picture and zoom). All connectors are described. Also notice the Wifi antenna to the left on the last picture, below the micro SD card.

Comments Off

Storage prices

Comments Off

Since last September, there have been only minor changes in most storage prices. Some have actually gone up, and most price changes are due to currency exchange rates.

For spinning disks, 3 TB still gives most bytes per coin, and the 1 TB disks are now rather poor options. I will probably remove them in the next iteration, as it makes little sense to buy these models.

On SSD, bigger is also cheaper, and 512 GB models possibly the best for a laptop drive now. For a OS drive in a desktop with an extra disk, 256 should be fine.

Finally, on flash cards, some older versions have been removed. The remaining are fast and competitively priced.

Media Type Product Capacity Price CHF Price Euros Euros / GB GBs / Euro
HDD Western Digital Green 3TB 3000 GB 109.00 107.92 0.04 27.80
HDD Western Digital Purple 3TB 3000 GB 110.00 108.91 0.04 27.55
External 3.5 Western Digital Elements Desktop 3TB, USB3 3000 GB 110.00 108.91 0.04 27.55
External 3.5 Western Digital My Book 3TB, USB3 3000 GB 117.00 115.84 0.04 25.90
HDD Western Digital Purple 4TB 4000 GB 158.00 156.44 0.04 25.57
HDD Western Digital Red 3TB 3000 GB 120.00 118.81 0.04 25.25
HDD Western Digital Green 4TB 4000 GB 165.00 163.37 0.04 24.48
HDD Seagate Desktop 4TB 4000 GB 165.00 163.37 0.04 24.48
External 3.5 Western Digital My Book 4TB, USB3 4000 GB 169.00 167.33 0.04 23.91
HDD Western Digital Purple 2TB 2000 GB 85.30 84.46 0.04 23.68
HDD Western Digital Red 4TB 4000 GB 172.00 170.30 0.04 23.49
HDD Western Digital Red 6TB 6000 GB 269.00 266.34 0.04 22.53
External 3.5 Western Digital Elements Desktop 4TB, USB3 4000 GB 180.00 178.22 0.04 22.44
HDD Western Digital Green 6TB 6000 GB 277.00 274.26 0.05 21.88
HDD Western Digital Green 2TB 2000 GB 93.10 92.18 0.05 21.70
HDD Hitachi Deskstar 7K4000, 4TB 4000 GB 187.00 185.15 0.05 21.60
HDD Western Digital Red 2TB 2000 GB 99.00 98.02 0.05 20.40
HDD Western Digital Red 5TB 5000 GB 249.00 246.53 0.05 20.28
External 2.5 Western Digital Elements Portable 2TB, USB3 2000 GB 109.00 107.92 0.05 18.53
External 2.5 Western Digital My Passport Ultra 2TB, USB3 2000 GB 115.00 113.86 0.06 17.57
HDD Western Digital Purple 1TB 1000 GB 62.70 62.08 0.06 16.11
HDD Western Digital Green 1TB 1000 GB 66.30 65.64 0.07 15.23
HDD Western Digital Red 1TB 1000 GB 69.00 68.32 0.07 14.64
External 2.5 Western Digital Elements Portable 1TB, USB3 1000 GB 69.00 68.32 0.07 14.64
DVD-R Verbatim 16x DVD-R 100 @ 4,7GB 470 GB 34.80 34.46 0.07 13.64
External 2.5 Western Digital My Passport Ultra 1TB, USB3 1000 GB 75.00 74.26 0.07 13.47
Blu-ray Verbatim BD-R SL 10 @ 25GB 250 GB 25.10 24.85 0.10 10.06
Blu-ray Verbatim BD-R DL 10 @ 50GB 500 GB 57.40 56.83 0.11 8.80
DVD+R DL Verbatim 8x DVD+R DL 50 @ 8,5GB 425 GB 57.20 56.63 0.13 7.50
DVD+R DL Verbatim 8x DVD+R DL 25 @ 8,5GB 213 GB 35.70 35.35 0.17 6.01
SSD Crucial M500 SSD, MLC, 960GB 960 GB 357.00 353.47 0.37 2.72
SSD Crucial M550 SSD, MLC, 1024GB 1024 GB 385.00 381.19 0.37 2.69
SSD Samsung SSD 840 EVO Basic, TLC, 1TB 1000 GB 379.00 375.25 0.38 2.66
SSD Crucial MX100 SSD, MLC, 512GB 512 GB 199.00 197.03 0.38 2.60
SSD Crucial M550 SSD, MLC, 512GB 512 GB 199.00 197.03 0.38 2.60
SSD Samsung SSD 840 EVO Basic, TLC, 500GB 500 GB 198.00 196.04 0.39 2.55
SSD Crucial M500 SSD, MLC, 480GB 480 GB 191.00 189.11 0.39 2.54
SSD Samsung SSD 840 EVO Basic, TLC, 250GB 250 GB 120.00 118.81 0.48 2.10
USB Flash Sandisk Cruzer Edge Flash Drive 64GB 64 GB 32.80 32.48 0.51 1.97
CD-R Verbatim CD-R 100 @ 700MB 70 GB 37.30 36.93 0.53 1.90
SSD Samsung SSD 840 Pro Basic, MLC, 256GB 256 GB 142.00 140.59 0.55 1.82
SSD Samsung SSD 850 Pro, MLC, 1024GB 1024 GB 579.00 573.27 0.56 1.79
SSD Samsung SSD 850 Pro, MLC, 256GB 256 GB 147.00 145.54 0.57 1.76
SSD Samsung SSD 840 EVO Basic, TLC, 120GB 120 GB 69.60 68.91 0.57 1.74
USB Flash Sandisk Cruzer Edge Flash Drive 32GB 32 GB 20.40 20.20 0.63 1.58
SSD Samsung SSD 850 Pro, MLC, 512GB 512 GB 333.00 329.70 0.64 1.55
SSD Samsung SSD 840 Pro Basic, MLC, 128GB 128 GB 92.70 91.78 0.72 1.39
USB Flash Sandisk Extreme Pro, USB 3.0, 128GB 128 GB 95.00 94.06 0.73 1.36
USB Flash Sandisk Cruzer Edge Flash Drive 16GB 16 GB 13.00 12.87 0.80 1.24
SSD Samsung SSD 850 Pro, MLC, 128GB 128 GB 131.00 129.70 1.01 0.99
SDXC Sandisk Extreme Plus SDXC, 80/60MB/s, 128GB 128 GB 157.00 155.45 1.21 0.82
USB Flash Sandisk Cruzer Edge Flash Drive 8GB 8 GB 11.10 10.99 1.37 0.73
SDXC Sandisk Extreme Plus SDXC, 80/60MB/s, 64GB 64 GB 89.00 88.12 1.38 0.73
SDXC Sandisk Extreme Pro SDXC, 90/95MB/s, 64GB 64 GB 95.00 94.06 1.47 0.68
Compact Flash Sandisk Extreme 120MB/s, 128GB 128 GB 217.00 214.85 1.68 0.60
SDHC Sandisk Extreme Pro, Class UHS-I, 90/95MB/s, 32GB 32 GB 59.30 58.71 1.83 0.55
Compact Flash Sandisk Extreme 120MB/s, UDMA 7, 64GB 64 GB 127.00 125.74 1.96 0.51
Compact Flash Sandisk Extreme Pro 160MB/s, UDMA 7, 256GB 256 GB 695.00 688.12 2.69 0.37
Compact Flash Sandisk Extreme 120MB/s, UDMA 7, 32GB 32 GB 91.30 90.40 2.82 0.35
SDHC Sandisk Extreme Pro, Class UHS-I, 90/95MB/s, 16GB 16 GB 45.70 45.25 2.83 0.35
SDXC Sandisk Extreme Plus SDXC, 80/30MB/s, 8GB 8 GB 24.90 24.65 3.08 0.32
Compact Flash SanDisk Extreme 120MB/s, UDMA 7, 16GB 16 GB 51.00 50.50 3.16 0.32
Compact Flash Sandisk Extreme Pro 160MB/s, UDMA 7, 64GB 64 GB 204.00 201.98 3.16 0.32
Compact Flash Sandisk Extreme Pro 160MB/s, UDMA 7, 128GB 128 GB 408.00 403.96 3.16 0.32
SDXC Sandisk Extreme Pro SDXC, UHS-II, 280/250MB/s, 64GB 64 GB 219.00 216.83 3.39 0.30
Compact Flash Sandisk Extreme Pro 160MB/s, UDMA 7, 32GB 32 GB 124.00 122.77 3.84 0.26

Exchange rate: 1 Euro = 1.010000 CHF.

Comments Off

100TB HDD by 2025?

Comments Off

ComputerWorld is reporting on a roadmap from the industry consortium ASTC where they predict magnetic hard drives will reach 100 TB by 2025. This is based on the figure below, where they project data areal density will increase a ten-fold from today’s 1 Tbit per square inch.

The technology to make this work, is Heat Assisted Magnetic Recording (HAMR), which integrates a laser into the hard disk read/write head. Bit patterned magnetic recording (BPMR) will take this further by isolating the bits into smaller “islands”. Finally, Heated-Dot magnetic recording (HDMR) combines the two technologies to reach 10 Tbit / square inch.

However, it is unclear if these technologies will be compatible with the helium filled drives HGST released earlier this year. From the chart, it seems the new technologies are partly based on Shingled Magnetic Recording (SMR). If this is not compatible with seven platter helium drives, we are stuck at only five platters. The biggest of this kind right now is Seagate’s 8 TB disk, but that is already at about 2 Tbit / inch. Therefore, the increase will “only” be five-fold, starting at 8 TB, for at total of 40 TB in a 3.5″ drive. A four times increase of today’s biggest drive in ten years would not be very impressive.

Comments Off

Review: No Place to Hide, Glenn Greenwald

Comments Off

In his latest book, No Place to Hide, Glenn Greenwald gives a brief summary of the events since Edwards Snowden first contacted him 1 December 2012, up until UK government’s harassment of David Miranda at London Heathrow airport on 18 August 2014. He gives an overview of some of the released NSA documents, showing the scope and detail of the illegal surveillance.

It is however the last two chapters of the book which makes this a must-read. Here, Greenwald examines why ubiquitous surveillance is so dangerous and damaging to all of society, and why the “nothing to hide – nothing to fear” argument is misguided and naive.

In the final chapter, Greenwald describes the toxic climate of modern journalisms, and how challenging state power is the exception rather than the norm in many newspapers.

Besieged by state surveillance

Glenn Greenwald’s examination of the harms of mass state surveillance is an indispensable read for anybody debating the topic. He explains why privacy is essential to all humans, on an individual level, as well as for society as a whole. Without privacy, we automatically conform to written and unwritten rules and expectations of behaviour and and thought.

Surveillance stifles self-expression, creativity and experimentation. On a state level, its very purpose is to hinder deviant and radical thought and action. As such, surveillance and lack of privacy is an obstacle to political and cultural progress. The goal is to freeze the status quo with its current power structure and current authority.

Herein lies the rebut of the “nothing to hide – nothing to fear” argument. Rather than grasping for fringe groups and special circumstances, Greenwald shows that this argument is narrow minded, egoistical and hypocritical. Given that mass state surveillance harms us all, our individual relation with the state authority is nonessential to the debate. It is irrelevant if you yourself is involved in politics, opposition groups, and protests. In many ways, surveillance harms everybody, depriving us of freedom, and hindering political, cultural, and human progress. It makes us complacent, unable or unwilling to question authority.

Furthermore, Greenwald points out that state surveillance is masked in secrecy, often with little oversight. It makes the surveillance a one-way mirror: They can see you, but you cannot see them. This is by design, and Greenwald examines multiple examples of why this works so well in controlling the population. He shows why it is important to break this one-way mirror; to shine light on government activities so its power cannot be used for harassment and control.

News as state propaganda

In the last chapter, Greenwald gives an introspective look into the failures of US media. Journalists and newspapers are nicknamed the Fourth Estate, because they were supposed to challenge the other three branches of government. However, many have become mere propaganda outlets for those in power.

What’s worse, Greenwald was attacked by fellow journalists across the political spectrum for publishing his stories based on the NSA documents. UK in particular has gone very far in attacking anybody working with these documents. There is no Forth Amendment or similar law protecting free speech in the UK. As a result, the Guardian was threatened with lawsuits and shutdown by GCHQ (Government Communications Headquarters) agents. Through an ultimatum, they destroyed the computers belonging to the newspaper which they believed contained copies the NSA documents.

Later, Greenwald’s partner, David Miranda, was detained using an anti-terrorist law while in transit through London Heathrow airport. As Greenwald put it, UK agents grabbed him out of non-British neutral territory. Lacking anything to charge him with, the UK police later acknowledged that this was an harassment tactic, to send a message to anybody working with Snowden or Greenwald.

Read it now!

If you haven’t kept an eye on the Snowden and NSA story, Gleen Greenwald’s latest book is an excellent and brief overview of the important events and facts. Still, even if you have followed the details of the NSA documents, the last half of the book is refreshing and worth the read.

State propaganda with its excuses to justify surveillance is as prevalent as ever. It is essential that we all know how to refute those arguments. Also, putting an end to the “nothing to hide & fear” argument will be important if we want to repel mass state surveillance.

Comments Off

anonabox : a Tor hardware router

Comments Off

Update: This project turned out to be too good too be true, at least for now. Wired has a brief article on the problems of the project, and why it was canceled by Kickstarter.

However, as the developer Germar says: “This would have been a success even if we’d raised $10,000. – This is a place to start.” (The project went above $600.000 before it was canceled).

 
 
I just backed the KickStarter project “anonabox”. It’s a drop-in Tor hardware router, which makes all outgoing traffic anonymous without any user configuration. As seen in the picture, it connects between your incoming ISP point, and your laptop. Or, the other way around, where the box itself pickup up a foreign Wifi signal, and give you a wired hotspot. Or where the laptop in the picture is connected over wifi instead of wired.

At the price of $50, I ordered two, to be delivered beginning of next year. The Kickstarter has already gone almost 100x above their set goal of $7500, so they might have some extra work to backfill orders. The project looks promising though, with the device to be shipped already in its fourth generation of development.

Order yours now! There’s still 26 days to go.

Comments Off

SSDs last a long time

1 comment

At 24 GB/day, or 8.8 TB/year, it would take 114 years to reach 1 PB.
Several SSDs have gone past that point, and still work fine.

Last year, I wrote about estimates for durability of SSD drives. Looking at how long it would take to exhaust the theoretical limit of the storage cells, based on different write speeds and quantities. The assertion was: It would take a very long time, and other technical failures were more likely to render the drive useless long before all cells were used up. In fact, the owner is not likely to outlive full cell exhaustion. This has now been confirmed through an experiment.

Over at Tech Report, they have done an endurance experiment lasting more than a year, with several consumer drives. For months, they have been writing data to the drives, while monitoring drive health, and verifying correctness. Some of the drives were rated for 20 GB / day for three days, which means about 22 TB. However, several of them made it past the 1000 TB, or 1 PB, mark. That’s about 50 times the advertised endurance rating. And two of the drives, a Samsung 840 Pro 256GB, and a Kingston HyperX 3K 240GB, have made to past 1.5 PB. It’s not all clear from the article exactly when they started, or how much they write per day. However, assuming a year to get to 1.5 PB, that’s 4.1 TB / day, or 47 MByte/s. The actual write speed is probably higher, but this leaves time for verification as well.

To put these numbers into perspective, I’ve extended the table from last time, and added a line for the speed of the Tech Report endurance test, as well as extra columns for multiple years total. As can be seen, the endurance test is running at 171 the write speed of what was identified as “heavy use”. Furthermore, the heavy use scenario is within what the typical consumer drives are rated for, i.e. about 20 GB/day.

MBit/s MByte/s MByte/hour GByte/day GByte/year TByte 3 years TByte 5 years
SATA3 max speed 6000 750 2700000 64800 23652000 70956 118260
Stress test 2000 250 900000 21600 7884000 23652 39420
Endurance test 376 47 171000 4109 1500000 4500 7500
Heavy use 2.2222 0.2778 1000 24 8760 26.280 43.800
Low/Medium use 0.0926 0.0116 41.67 1 365 1.095 1.825

What about the time to failure estimates; how do they compare to the empirical evidence? Last year, I noted that a 256 GB drive with cells of 10k write cycle life span (typical MLC memory), would take 256 years to reach 10% of failed cells, and about 350 years for full exhaustion, assuming 24 GB/day written. It turns out that was a bit optimistic. At 24 GB/day, or 8.76 TB/year, it would take “only” 172 years to reach 1.5 PB (where the Tech Report drives are now). If we go by 1 PB, it would take 114 years.

This is all for MLC memory. If we look at TLC, typically rated for 1000 write cycles, the endurance numbers are also a tenth. I.e. they would fail between 11 to 17 years of sustained 24 GB/day writes, again assuming a 256 GB drive.

If larger drives are used, the time to failure also increases. This is because there are more total space to level the writes across. In fact, doubling the size of the drive, will in theory double its lifespan. So an MLC 512 GB drive would last some 228 years, and a 1 TB drive 456 years. For TLC, the numbers are again a tenth, so 22 and 45 years respectively.

This is all well and good, and should at least put the final nail in the coffin regarding worries for SSD reliability. The only concern which the Tech Report experiment raises, is the way the drives fail when they do reach end of life. Of course there are plenty of relocated sector warnings in the SMART data beforehand. However, once they are past the point of no recovery, all data is lost. Several of them cannot be accessed at all. This is of course a bit different from spinning disks, which usually keep on reading some of the tracks, even if other parts are broken.

It highlights the fact that monitoring SMART data should be a standard procedure, and part of good data hygiene. Of course, a good backup strategy is required, regardless of drive type or usage pattern.