Posts

Showing posts from 2012

automating netscaler with soap

I recently had to script some citrix netscaler stuff (around using the running config to create graph trees in cacti and collectd with ecostats front end) to use the soap interface you have to make a soap request to login, then reuse the returned cookie to authenticate the other requests like this. I use this wget to login wget   -O- --cookies=on --keep-session-cookies  --save-cookies cookies.txt  --post-file=login.xml --header="Content-Type: application/soap+xml"  http://yourNSip/soap   and this to get the details of vservers etc.   wget  -O- --load-cookies cookies.txt  --post-file=getlbserver.xml --header="Content-Type: application/soap+xml"  http://yourNSip/soap   where the post-files contain the soap requests you can pipe into xmllint to tidy up the output if you want   | xmllint --format --encode utf-8 – cat login.xml <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:NSConfig"

Sky remote code for LG

A friend got an LG 47LM660t and couldn't get his sky HD remote to work the tv volume. After some google searching the code isn't know, so I thought I'd post it. Follow the usual sky instructions and use code 1293 . This still looked like it didn't work for him, but it appears the remote was confused. the up down arrows around the select button did the volume, not the volume control ! I had seen this before fortunately, Press TV Key Hold down select and press 2 until the remote's LED flashes twice (if it only flashes once or remains on steady I'm afraid your remote does not support this feature). Press Sky key and it should work if it doesn't try select and press 1 instead of 2.

rsync with CDN and purge

I recently had to setup a new CDN for, using Edgecast, They support rsync for content and also have an API, so I started with cron'd full rsync, but this was taking too long, so I moved to rsync only recently changed files, and used the output to do a flush of the cache for updated files. Edgecast provide a really good CDN solution, and also provide EU based rsync endpoints for getting your logs and pushing your content #!/bin/sh set -e rm -rf /tmp/rsync.ec.out rm -rf /tmp/changedfiles #move to directory so path names are good in outputs cd /opt/www/htdocs/ #find recently modified files find . -mmin -120 > /tmp/changedfiles #run rsync for these changed files, only changing existing files and logging output /usr/bin/rsync --itemize-changes -az --existing -e "ssh -i /home/rsync/.ssh/my_special_id_rsa -p8022 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no" --files-from=/tmp/changedfiles /opt/www/htdocs/ user@domain@rsync.ams.edgecastcdn.net:/content/mysubdi