Blog


Chromebook

After 4 and a bit years of service I have finally replaced my netbook (£200 Dell Mini 9), but interestingly with a Chromebook (£160 Acer C720). Handily the newest Chromebooks have real Intel processors and installing Linux Mint was relatively painless.

The first round was putting the laptop into Developer mode and the using ChrUbuntu to create the appropriate partitions. Once this was done ctrl-l at the boot screen loads SeaBIOS mode, from where you can install Mint to the already-created partitions. Whist this worked quite well, after a number of tweaks to get the touchpad to work and the shortcut keys, it still wasn't quite as stable as ChromeOS, and seemed overkill to just run TeXWorks.

So the second attempt was rolling back the Chromebook to stock, and then using Crouton to install Ubuntu within ChromeOS. This seems to be working very well at the moment, though it has only been tested by installing Java and running Minecraft which worked perfectly fine.


Oscilloscopes

I'm thinking of buying a USB oscilloscope, this attempts to be an ad-hoc review of different models.


Wireless Access Point

I am currently using a Buffalo WZR-HP-G300NH, and from the web gui installed the squashfs version of OpenWrt Attitude Adjustment 12.09. This works perfectly fine with the openreach modem, including the pppoe authentication. The next device may possibly be a TL-WDR7500 as it supports wireless AC, 5Ghz, and gigabit LAN, which ticks all the boxes if I ever get any AC devices.


Server Setup

This website used to be run from within AppEngine, but with the recent inclusion of charges for even the most basic version of Google Apps I decided it was time to do things myself. I could go for the normal Apache / Postfix / Courier set-up but its overly heavy for my needs and has a lot of required configuration. So instead I have decided on just running some Python programs for the majority of my needs. A basic RAM overview is as follows, (need to add Apache and the rest for comparison).

3.6MB - Python W/O Anything
6.4MB - Python SMTP
9.1MB - Localmail (SMTP + IMAP4)
15MB - Tornado Web (Website)

Currently I have a python SMTP server to accept incoming mail, taken from the default libraries. PyDns is used to provide mail server lookups for direct unauthenticated email sending from the server, which appears to work fine. The website is generated via Tornado, which is useful as it has automatic form and cookie handling for us, along with handing all our OAuth woes.

Ideally we would transition to something like Twisted, which covers everything in one package which should allow for even lower RAM. If we use Twisted as a DNS server we could just point the registrars name server towards our server, which in turn can identify the current server as the Web and Mail server, including the addition of the SPF Policy and the DomainKeys records, without the need to fiddle with the registrars control panel. In addition to running a DNS server we can also use Twisted to run the web server and the email server. Localmail is a good example of a combined SMTP and IMAP4 server, which with a little bit of work, should work well for a simple single / few user set-up. These web servers also allow us to use websockets if we fancy. As a note-to-self I should take a look at Stunnel, it might be a good temporary solution to get TLS/SSL running.

Ideally we would have another script which simply takes a domain name and then does the following; logs in to the server, sets up SSH access, removes things like Apache, installs Twisted from the repo's, and then installs the main script to run on boot. (It could also install BtSync if we are doing our Dropbox replacement stuff). Conch from within Twisted looks like a good solution for this.

The ultimate goal would be to have the back-end distributed across all the VPS's to store all the information such as DNS records and emails, this would be the hard part as we basically want an encrypted, private, DHT. Entangled could be a solution for this part, need to look into it in more detail.


Tornado Performance

Using "ab -n 1000 -c 10 http://localhost/" to test Tornado. this is a test.

Maximal Memory was at 20MB, the output from ab is as follows.

Requests per second: 91.36 [#/sec] (mean)
Time per request: 109.453 [ms] (mean)
Time per request: 10.945 [ms] (mean, across all concurrent requests)
Transfer rate: 172.29 [Kbytes/sec] received

Looking at increasing the concurrency it seems that the Requests per second is relatively constant. The time per request increases accordingly.


PiBackup

Every time I see the price drop for things like Google Drive or Dropbox I get tempted. So for this reason I'll leave these calculations here:

RasPi with SdCard and power supply from Farnell is £47
3TB external HDD from Ebuyer is £78
10W for Pi and HDD is ~87.6KwH/y, which at 35p/KwH is £30.66/y

If we assume it lasts for three years, per year its ~£72.32, or ~£6 a month. Cheaper if the hardware lasts longer.


Controlling Mains Appliances

Had a quick go at dimming a light by hooking up a solid state relay (SSR-25DA) to an Arduino, doesn't work all that great as the speed of my lamps bulb lighting up was much faster than the switching speed, it it just flickered at different speeds. It might work well on something like an electric blanket, or one of my storage heaters, will try that soon. Also remember that the SSR is a zero crossing SSR, which happens twice on each 50Hz cycle, so every 10ms. Finally I could do with measuring the trigger current as the datasheet for these SSRs is v v poor.

Website Content Management

A while ago I discovered that in the HTML5 specification there is a ContentEditable attribute which can be applied to webpages to make them editable without any editors such as CKEditor (which I have used in the past). Using a combination of ContentEditable and a simple overlay in the corner of each page (when logged in), I can now edit any page just like within a document editor (with working copy & paste of formatted data!). With a bit more modification it is also possible to allow pasting of images directly into the page from the clipboard as seen below (the green indicates the currently selected option).

Also there are times when you just want to edit the source directly to do some formatting or insertion of elements, as there are no editor buttons to help with things like tables. To support source modification there is an Edit Page button which takes you to a syntax highlighted source of the current page as seen below.

At some point it would be nice to not only modify the contents of the page, but also the header and the footer from within the same page, with the modifications being saved to the appropriate files, but that will have to come later :-)


Notes

All the old notes from my previous site are here, nothing much of interest, just a few small notes.