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 ] ( 737 views )   |  print article
Install minimal sid with cdebootstrap from ubuntu gutsy 
To bootstrap debian sid on a second harddisk do following

* create partitions / filesystems

cfdisk /dev/hdc
mkfs.ext2 /dev/hdc1
mount -o rw,suid,dev /dev/hdc1 /mnt

mkswap -f /dev/hdc2
swapon /dev/hdc2

* bootstrap (with a deb proxy like approx)

cdebootstrap -v sid /mnt http://proxy:9999/debian

install cdebootstrap from hardy if something went wrong

wget [mirror]cdebootstrap_0.4.4ubuntu1_i386.deb
dpkg --force-all -i cdebootstrap_0.4.4ubuntu1_i386.deb

* enter chroot

mount --bind /proc /mnt/proc/
mount --bind /dev /mnt/dev

chroot /mnt
export LANG=C

* install kernel and bootloader

apt-get install grub linux-image-2.6.24-1-486

cat /etc/kernel-img.conf<<EOF
# Kernel Image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
postinst_hook = update-grub
postrm_hook = update-grub

* config bootloader

echo "/dev/hdc1 / ext2 rw 0 0" > /etc/mtab
grub-install /dev/hdc

change in /boot/grub/menu.lst root=/dev/hdc1 with UUID
sed "s|root=/dev/hdc1|root=UUID=$(/lib/udev/vol_id --uuid /dev/hdc1)|" /boot/grub/menu.lst

* create /etc/fstab

echo "UUID=$(/lib/udev/vol_id --uuid /dev/hdc1) / auto defaults,noatime 0 1" > /etc/fstab

echo "UUID=$(/lib/udev/vol_id --uuid /dev/hdc2) none swap sw 0 0" >> /etc/fstab

* add a user

shadowconfig on
adduser USERNAME

* setup network, timezone

echo "nameserver NAMESERVERIP" > /etc/resolv.conf
echo HOSTNAME >/etc/hostname
cat > /etc/network/interfaces <<EOF
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

* individual configs



SYSLOGD="-m 0"

* cleanup

apt-get clean
apt-get install deborphan
apt-get remove --purge $(deborphan)

* search for unused packages

dpkg -l | grep ^ii | less

* remove unused packages

apt-get remove --purge aptitude cdebootstrap-helper-diverts laptop-detect nano tasksel-data tasksel vim-common vim-tiny

[ view entry ] ( 705 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

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"

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:


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 ] ( 663 views )   |  print article
Linksys SPA-3102 call throu PSTN / Call Forward no answer (CFNA) 
I will make calls from my phone to PSTN and with dial extension "#9" to my voip account.

This is done with following dialplan "(xx.<:@gw0>|<#9,:>xx.)"

If a call from PSTN is not answered within 20 sec the call should be redirected via voip (see CFNA Solution).

Because my SPA-3102 is behind a firewall i use it as a bridge.


modprobe ip_conntrack_sip ports=9060; modprobe ip_nat_sip
iptables -A FORWARD -p udp --dport 9060 -m state --state NEW,ESTABLISHED -j ACCEPT

With this settings i don't need "NAT Keep Alive" and Register every 3600 sec (1 hour) is ok.

Usually udp connectiontracking has a timeout of 180 sec, but ip_conntrack_sip reads the sip content and set the timeout (3600).

My Settings


Connection Type: DHCP
Enable WAN Web Server: yes

Lan Setup

Networking Service: Bridge
Enable DHCP Server: no


RFC 2543 Call Hold: no
RTP Port Min: 9000
RTP Port Max: 9059


Provision Enable: no
Upgrade Enable: no


Ring1 Cadence: 60(1/4)
Ring Waveform: Sinusoid
Ring Frequency: 50
Ring Voltage: 60
CWT Frequency: 420@-20
FXS Port Impedance: 270 + (750 || 150nF)
Caller ID Method: ETSI FSK
Caller ID FSK Standard: v.23

Line 1

Make Call Without Reg: Yes (if no network connected)
User ID: sipuid
Password: xxxx
Preferred Codec: G729a
G7* Enable: no
Dial Plan: (xx.<:@gw0>|<#9,:>xx.)


Make Call Without Reg: Yes
User ID: sipuid
Password: xxxx
Preferred Codec: G729a
G7* Enable: no
medium Min CPC Duration: 0.25
Disconnect Tone: 440@-30,440@-30;2(0.4/0.4/1+2)
FXO Port Impedance: 270 + (750 || 150nF)
On-Hook Speed: 3ms
Line-In-Use Voltage: 25
Current Limiting Enable: Yes
Ring Validation Time: 150 ms
Ring Indication Delay: 0
Ring Timeout: 650 ms

Without this "Ring Timings" after "PSTN Ring Timeout" the call to Line 1 got CANCELED also immediately the following call to VOIP (don't know why - saw it in traces to syslog).
With "PSTN Ring Timeout: 20" i also saw no cancel but that's a dirty workaround for me (better are a correct "Ring Timings").

Enable Traces


Syslog Server:
Debug Server:
Debug Level: 3

Line 1 / PSTN Line

SIP Debug Option: full

CFNA Solution 1:

User 1

Cfwd No Ans Dest: 12345678
Cfwd No Ans Delay: 20


PSTN Answer Delay: 40 (20 sec Line 1 and 20 sec voip => after that forced hangup)

disable via phone with *93
enable via phone with *92[Number as dialed via dialplan(use #9 for voip)]

* after disabling with *93 the number is deleted
* enable with *92#9NUMBER (without #9 PSTN is used according to Dialplan (xx.<:@gw0>|<#9,:>xx.) it would be NUMBER@gw0)
* only G711 Codec supported (because PSTN calls Line 1 and then only G711 seams to be supported)

CFNA Solution 2:


Dial Plan 8: (S0<:12345678@>)
PSTN Caller Default DP: 8
PSTN Answer Delay: 20

Drawback: you cannot dis/en-able via phone

CFNA Solution 3:

Use a local asterisk where you can connect sip clients rinnging at the same time when a call arrives on the SPA-3102

[ view entry ] ( 1049 views )   |  print article
copy partition 

copy local


cp -dpRx /OLD /NEW


cd /OLD && \
tar -cp --atime-preserve --one-file-system --exclude=/lost+found -f - . \
| ( cd /NEW && tar -xpv --atime-preserve -f - )


rsync -avHx --delete /OLD /NEW

copy via network


cd /OLD && \
tar -cp --atime-preserve --one-file-system --exclude=/lost+found -f - . \
| ssh "( mkdir -p /NEW ; cd /NEW \
&& tar -xpv --atime-preserve -f - )"


rsync -avHx --delete /OLD/ root@

rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/

[ view entry ] ( 1161 views )   |  print article

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