Thursday, April 9, 2015

Firefox Console XPath Query

To find a page element using an xpath from the Firefox (Firebug) console, use:

$x("//your/path/here")

Sunday, March 22, 2015

Windows 7 Custom Text Size

To set a Custom text size in Windows 7, open Control Panel -> Display -> Set custom text size (DPI), and drag the scale.


Sunday, March 15, 2015

CT30 Thermostat Wifi Setup

This was harder than it should be. The process that finally worked was something like this:

- Disable cellular data on iPhone
- Forget wireless network on iPhone
- Press the Menu button on thermostat, press Mate twice, ensure yellow light is flashing
- Connect to thermostat wifi network on iPhone
- Go to http://192.168.10.1/ in browser on iPhone
- Follow the 5 steps and enter requested details: wifi network, wifi password, provisioning code
- If you're lucky, the thermostat chirps and then green light flashes

It seemed like the iPhone had trouble staying on the thermostats network and the provisioning process kept timing out.

I had a lot of trouble getting the browser to connect, for more details, see this FAQ:


Tuesday, February 17, 2015

Convert Tokenized BBC Basic to Plain Text

Use the BBCBasicToText python script from https://github.com/tom-seddon/beeb

For example, to convert a directory of files:
for file in `ls $dir`
do
 txt=`echo $file | sed 's/,ffb/.txt/g' `
 if [[ $txt == *".txt"* ]]; then
  echo $txt
  python BBCBasicToText.py $dir/$file > out/$txt
 fi
done

Sunday, December 14, 2014

Raspberry Pi Streaming Webcam with Motion

To setup a streaming webcam:

sudo apt-get install motion

sudo vi /etc/motion/motion.conf  # to enable web access

sudo vi /etc/default/motion      # to enable the daemon to start


sudo service motion start


For motion configuration options, see: ConfigFileOptions

You might also need to add this to your /etc/rc.local file to enable to pi camera on boot:

sudo modprobe bcm2835-v4l2

And if you want to turn the camera led off, add the following to the /boot/config.txt file:

disable_camera_led=1

Tuesday, November 4, 2014

Install Python MySQL Connector on Debian

Download the "Platform Independent" version from MySQL and follow the instructions here.

Check the version:
user@host ~ $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>> mysql.connector.__version__
'2.0.2'

Thursday, September 25, 2014

Using apt-get to update packages

Get the latest package lists:
$apt-get update
Check the versions:
$ apt-cache policy bash
bash:
  Installed: 4.2+dfsg-0.1
  Candidate: 4.2+dfsg-0.1+deb7u3
  Version table:
     4.2+dfsg-0.1+deb7u3 0
        500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages
 *** 4.2+dfsg-0.1 0
        100 /var/lib/dpkg/status
$ 
Install the update:
$ sudo apt-get install bash
...
The following packages will be upgraded:
  bash
1 upgraded, 0 newly installed, 0 to remove and 206 not upgraded.
Need to get 1,443 kB of archives.
...
$