kvm pxe boot 
get a ISO bootable image without legacy floppy emulation (.iso) from etherboot

kvm.sh:
#!/bin/sh

switch=br0

USERID=$(whoami)
iface=$(sudo tunctl -b -u $USERID)

sudo /usr/sbin/brctl addbr $switch
sudo /sbin/ifconfig $switch 192.168.99.1 up

kvm -M pc -m 512 -smp 1 -cdrom eb-5.4.3-ns8390.iso \
-boot d -net nic,model=rtl8139 \
-net tap,vlan=0,ifname=$iface, \
script=qemu-ifup,downscript=qemu-ifdown

sudo tunctl -d $iface &> /dev/null

sudo /sbin/ifconfig br0 down
sudo /usr/sbin/brctl delbr $switch
qemu-ifup:
#!/bin/sh

#!/bin/sh

switch=br0

if [ -n "$1" ];then
echo "config $1"
/usr/bin/sudo /sbin/ifconfig $1 0.0.0.0 promisc up
/usr/bin/sudo /usr/sbin/brctl addif $switch $1
exit 0
else
echo "Error: no interface specified"
exit 1
fi
qemu-ifdown:
#!/bin/sh

switch=br0

if [ -n "$1" ];then
sudo tunctl -d $1
sudo ifconfig $switch down
exit 0
else
echo "Error: no interface specified"
exit 1
fi


[ view entry ] ( 690 views )   |  print article
format a partition with check for badblocks 
badblocks -swvo <output_file> /dev/PARTITION
mkfs.vfat -l <output_file> /dev/PARTITION


[ view entry ] ( 791 views )   |  print article
Desktopsharing with vnc 
sudo apt-get install vnc4-common vnc4

sudo vncpasswd /etc/vncpasswd

/etc/X11/xorg.conf:
Section "Module"
Load "vnc"
EndSection

Section "Screen"
Option "PasswordFile" "/etc/vncpasswd"
EndSection



[ view entry ] ( 810 views )   |  print article
Using a Flashdisk and take care about limited writes 
For me it is sufficient to have data written every 20 Minutes.

To enable this i use laptop-mode and set some values in /etc/sysctrl.conf:

vm.swappiness = 0
vm.laptop_mode = 1200
vm.dirty_writeback_centisecs = 120000
vm.dirty_expire_centisecs = 120000
vm.dirty_ratio = 40
vm.dirty_background_ratio = 1


[ view entry ] ( 867 views )   |  print article
digitemp with collectd 
I used following schematic



Additionally i connected three twisted pair wires with a 100 Ohm resistor. At the end of each wire a schottky diode reverse biased across the DS18S20 sensor against spikes is used.

At the moment i have 5 DS18S20 temperature sensors (inside, outside, heater back, heater, warmwater)

Initialising: digitemp -i -s /dev/ttyS0 -q -c /etc/digitemp.conf

Reading: digitemp -a -q -c /etc/digitemp.conf

Mar 16 12:44:06 Sensor 0 C: 20.94 F: 69.69
Mar 16 12:44:07 Sensor 1 C: 13.75 F: 56.75
Mar 16 12:44:09 Sensor 2 C: 28.69 F: 83.64
Mar 16 12:44:10 Sensor 3 C: 31.94 F: 89.49
Mar 16 12:44:11 Sensor 4 C: 48.75 F: 119.75

/etc/collectd.conf:
LoadPlugin exec
<Plugin exec> Exec "nobody:dialout" "/usr/bin/digitemp_DS9097" "-n0" "-d10" "-a" "-q" "-c/etc/digitemprc" "-oPUTVAL home/temp/temperature-%s interval=10 %N:%.2C"
</Plugin>

I had to make a patch for collectd that the exec plugin runs with user nobody and group dialout. Because user nobody's group is not dialout "setgroups" have to be called (add user nobody to /etc/groups dialout is only used if initgroups is called).

Also for digitemp i made a patch because i got sometimes 85 degrees (error condition) which are not correctly handled by digitemp:

Hi!

I discovered the use of wrong indexes:

These is your Indextable:

Temperature = scratchpad[1]
Sign = scratchpad[2]
TH = scratchpad[3]
TL = scratchpad[4]
Count Remain = scratchpad[7]
Count Per C = scratchpad[8]
CRC = scratchpad[9]


1. glitch condition

COUNT_PER_C is Index 8 and COUNT_REMAIN is Index 7

- if( (scratchpad[7] - scratchpad[6]) == 1 )
+ if( (scratchpad[8] - scratchpad[7]) == 1 )

2. Error Condition (85 Degrees)

- if( (scratchpad[4]==0xAA) &&
- (scratchpad[3]==0x00) &&
- (scratchpad[7]==0x0C) &&
- (scratchpad[8]==0x10)
+ if( (scratchpad[1]==0xAA) &&
+ (scratchpad[2]==0x00) &&
+ (scratchpad[7]==0x0C) &&
+ (scratchpad[8]==0x10) )

Also i think an Error Condition (85 Degrees) should be handled like a
CRC Error.


[ view entry ] ( 817 views )   |  print article

<<First <Back | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Next> Last>>