Hostname instellen in Mac OS X
Sinds een tijdje was de hostnaam in de terminal van mijn iMac veranderd in de originele hostname met een prefix -2.
Nogal storend, maar wel eenvoudig te fixen…
Sinds een tijdje was de hostnaam in de terminal van mijn iMac veranderd in de originele hostname met een prefix -2.
Nogal storend, maar wel eenvoudig te fixen…
So, I needed a few more Plugwise Circles to automate some devices at home. I’m using the very cool Perl toolkit by Mark Hindess to create an xPL compliant interface towards the devices on an NSLU2. Problem: the interface I used was only compatible with firmware v1, and of course the new Circles ship with a newer (and incompatible) firmware. Time to upgrade!
Thanks to the preparatory work of Maarten Damen and Roheve I didn’t have to reverse engineer the protocol myself. Credits to you guys! I upgraded the existing xpl-plugwise code that was originally developed by Jfn and I have put it in a git repository. It is available here.
Via een collega terechtgekomen op een ‘flashy’ monitoring pagina voor PV installaties. De status van onze installatie geef ik door via een zelfgeschreven script dat de gegevens uit een RRDtool database haalt. Updates van de live status gebeuren elke 15 minuten. Een aanrader! Nu alleen nog wat meer installaties uit BelgiĆ« erin zien te krijgen…
This script enables a ‘Time Machine alike’ backup of folders on a computer to a remote server. The script keeps daily snapshots by saving the deltas compared to the previous backup. The rest of the info is symlinked so you don’t end up using 7 times the required amount of disk space on the server.
I’ve been using this script quite some time to backup my Linux desktop to an NSLU2. I found it back during the spring clean of my archives and save it here for future reference.
#!/bin/sh
# This script does personal backups to a rsync backup server. You will end up
# with a 7 day rotating incremental backup. The incrementals will go
# into subdirectories named after the day of the week, and the current
# full backup goes into a directory called "current"
# Credits: tridge@linuxcare.com
# directory to backup
BDIR_LIST="/home /usr/share/jalbum"
# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=excludes
# the name of the backup machine
BSERVER=hydra
# your password on the backup server
export RSYNC_PASSWORD=<insert_password_here>
########################################################################
# --exclude-from=$EXCLUDES
BACKUPDIR=`date +%A`
OPTS="--force --ignore-errors --delete-excluded
--delete --backup --backup-dir=$BACKUPDIR -a --exclude-from=$EXCLUDES"
export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
# the following line clears the last weeks incremental directory
[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
echo "Clearing last weeks incremental directory..."
rsync -vv --delete -a $HOME/emptydir/ backup@$BSERVER::backup/$BACKUPDIR
rmdir $HOME/emptydir
# now the actual transfer
echo "Starting actual backup..."
for BDIR in $BDIR_LIST; do
rsync -vv $OPTS $BDIR backup@$BSERVER::backup/current
done
echo "Backup completed!"
Ok, so the power supply of my Apple Time Capsule got fried due to a not-so-efficient cooling strategy of the designer. Basically the built-in power supply stops working and all of a sudden the Time Capsule does not power on any more.
Several fixes were already proposed, but they all focussed on replacing the built-in power supply. The problem with that is that the 3.5″ internal hard drive needs both a 12V and a 5V rail. So either you fix the original supply, you connect an ATX power supply or you take a 12V supply and build your own DCDC convertor to generate the 5V net from the 12V of the supply.
I was looking for a more simple solution and came up with this…
New firmware v4.3 is available for the xPL node ‘hollie-utilmon’ with the following features…
I’m using some Plugwise circles to control various devices around the house. A few lights and the amplifiers of my SqueezeBoxes are automatically switched on and of as required. To couple this with MisterHouse, I built an NSLU2-based gateway to the Plugwise ZigBee network.
Cypress switched back to the ImageCraft compiler, and now we’re left with the task of fixing our existing codebase that was developed with the HiTech compiler.
Not too problematic. The only thing that bothers me a bit is the lack of good/up-to-date documentation. I spent an hour to figure our how to get the printf’s that I used in my code compiling again. Once you know how to do it, it is simple…
Example code:
printf("Test printf without parameters\n");
Compiling your HiTech code with the ImageCraft compiler, the printf fails with the following error:
type error in argument 1 to `printf'; found `pointer to __flash char' expected `pointer to char'
Seems that in for ImageCraft you need to use another printf function if the strings are in ROM. And this function is called… tada: cprintf.
Replace the existing printf with cprintf and you’re up and running again. I guess it would have need nice if this info was added to the ‘migrating from HiTech to ImageCraft’ document that is bundled with PSOC Designer. Maybe eventually, it will be…
Also notice: to get the ImageCraft printf functions working, you need to replace the ‘putch’ helper function for printf by:
// Helper function for the printf function.
int putchar(char c) {
// Send characters to the Lantronix interface
LTRX_PutChar(c);
return 1;
}
Finally, if you fancy some more advanced printf functionality like modifiers, or support for long/float, you’ll need to update your ‘local.mk’ (‘Project’ -> open local.mk) and add the option
CODECOMPRESSOR:=$(CODECOMPRESSOR) -lfpm8c // For floating CODECOMPRESSOR:=$(CODECOMPRESSOR) -llpm8c // For long support
Hope this helps you saving some time until the documentation gets updated!
I needed to test some XBee long-range radios. Hmm, how can we make this test useful and fun at the same time? Well, let’s put one end of the radio in the lab connected to a computer, and wander around with the other radio while transmitting the current position obtained from a GPS.
Using the XBee evaluation kit, my (t)rusty eTrex GPS, a 12V battery and some cables, the hardware was quickly in place. Now, what to transmit over the link? Full NMEA? Hmm, maybe this is a bit overkill. Sending the position once a second ought to be enough. But then I need a microcontroller between the GPS and the radio to reformat the NMEA into simple position beacons. There has to be an easier way…
When built our house, we took measures to ensure that we would consume little energy to keep our place to live warm and cosy. For this, we added extra insulation, we kept the number of air leaks as small as possible, and added a ventilation system that recycles the energy from the extracted air into the fresh air that is brought into our home.
Read the rest of this entry »