Debian/Nginx

# wget http://nginx.org/keys/nginx_signing.key
# apt-key add nginx_signing.key
# echo -ne "# http://wiki.nginx.org/Install\ndeb http://nginx.org/packages/debian/ squeeze nginx\ndeb-src http://nginx.org/packages/debian/ squeeze nginx\n" >>/etc/apt/sources.list
# apt-get update
# apt-get install nginx
    

Tagged with:

Categorised as:


Debugging pyergometer

pyergometer

See also: ergometria.async.fi

Tagged with:

Categorised as:


Kettler ergometer serial protocol

I'm having some issues getting JErgometer working with my new Kettler E3, so to rule out the possibility of miswiring (the bike has a traditional RS-232 interface so I got a USB-RS232-WE-5000-BT_0.0 cable from FTDI which comes "wire-ended" and requires some soldering) I dug out "Kettler Treadmill Serial lua class" from mhwlng (thanks!). This, and my own brute-force testing got me the following list of commands relevant in the bike's context, which may be only a subset of the commands that the bike accepts but what could be used to build one's own implementation:

RS
Reset device
ID
Ergometer computer model info ("SF1B1706")
VE
Ergormeter computer firmware version ("117")
ST
Request status; reply:

pulse rpm speed*10 distance requested_power energy mm:ss actual_power
CM
Enter command mode; required before calling the P-commands below
PW x
Request power of x watts
PT mmss
Request time of mmss
PD x
Request x/10 km distance

Notes: I only connected RX, TX and signal ground (looks like the bike does not use any kind handshaking). Serial port settings are 9600bps, 8N1.

Tagged with:

Categorised as:


Gone static

Update 2: Looks like page load times, at least as reported by Pingdom, went up from what they initially were. In my own testing cached pages still load in something like 150 to 250 milliseconds but Pingdom disagees. I don't know if this is regular CloudFront performance fluctuation, some kind of impedance mismatch between Pingdom and CloudFront or "something else".

Update: That really did the trick and the estimated -90% page load time wasn't that far off:

Having been fed up with wastefulness (resource wise) and general slowness of the MySQL/PHP/WordPress/CloudFlare setup for some time, I have now moved this site to S3/CloudFront. Site is generated from an XML file (which I derived from a WordPress export dump) with a Python script that is hosted here. Commenting is obviously impossible but if you for some reason need to contact me you'll find contact details on your left.

Tagged with:

Categorised as:


Daily MySQL database dump, back up to S3

I'm in the process of, or planning at least, ditching MySQL/WordPress/CloudFlare and moving to a static site hosted on S3/CloudFront. At the moment, as AWS Route 53 does not support S3 or CloudFront as an Alias Target, moving to S3/CloudFront means that I have to have an A record pointing to a web server somewhere, which in turn redirects the request to the actual site's CloudFront CNAME. I do have such a server (running Nginx), but the same thing could be as well achieved by using a service such as Arecord.net. This redirect means that there's no way to run a site without the www.-prefix. Which I can live with. Also, at the moment, no SSL support is available but I'm sure I can live with that too as WordPress is simply slow, and most of all a big waste of resources. Getting rid of all the dynamic parts (seriously, it's not like there are a lot of commenters around here) will make this thing run fast, at least compared to what page load times currently are. My tests show that CloudFront returns cached pages in less than 200ms.

So, I'm killing one extra server in the near future and putting these snippets here for my own possible future use.

~/.my.cnf:
[client]
user = usename
password = password
host = hostname

[mysql]
database = dbname 
<dir>/wp-db-backup.sh:
#!/bin/sh

DBFILE="<dir>/dbname-`/bin/date +%s`.gz"

/usr/bin/mysqldump --quick dbname | /bin/gzip -c >$DBFILE
/usr/bin/s3cmd put $DBFILE s3://bucketname/
/bin/rm $DBFILE
crontab:
45 3 * * * /usr/bin/nice -n 20 <dir>/wp-db-backup.sh >/dev/null 2>&1
 

Tagged with:

Categorised as: