Sunday, October 25, 2015

Fix for 'unknown ACL condition/modifier in "spam = debian-spamd:true"'

Exim configuration error in line 438 of /var/lib/exim4/config.autogenerated.tmp: error in ACL: unknown ACL condition/modifier in "spam = debian-spamd:true"

root@sh1:/etc/exim4# dpkg-reconfigure exim4-config
2015-10-25 14:09:40 Exim configuration error in line 438 of /var/lib/exim4/config.autogenerated.tmp:
  error in ACL: unknown ACL condition/modifier in "spam = debian-spamd:true"
Invalid new configfile /var/lib/exim4/config.autogenerated.tmp, not installing
/var/lib/exim4/config.autogenerated.tmp to /var/lib/exim4/config.autogenerated

The one stumped be for a bit but the solution - at least on a Debian based system - is to ensure you have installed 'exim4-daemon-heavy` instead of the light packages, aptitude install exim4-daemon-heavy.

If this has helped comment of follow me .

Friday, October 23, 2015

Linux Benchmarking

Simple Linux Performance Script

When deploying new virtual machines with different provides I like to do basic performance tests using built in utilities like `dd` and `bc`. I had a little script linux-benchmark.sh which I have now cleaned up and making it public. When run it will do basic test for HD, Internet and CPU and save it as a timestamped text file.

Sample output:

root@sh1:~# ./linux-benchmark.sh
Please be patient, this might take a minute or so.

Hostname:             sh1
IP(s):                45.55.218.113
CPU model:            Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz
Number of cores:      1
CPU frequency:        2399.998 MHz
System uptime:        60 days, 2:17,
Total amount of ram:  500 MB
Total amount of swap: 2929 MB
Calc PI to 5000:      0m31.818s
Download speed:       106MB/s
I/O (conv=fdatasync): 528MB/s
I/O (oflad=dsync):    293MB/s

The `linux-benchmark.sh` script

#!/bin/bash
# Author: Daniel Sokolowski
# source: https://bitbucket.org/snippets/danielsokolowski/G5oeA
# inspired by http://www.commandlinefu.com/commands/view/229/quick-integer-cpu-benchmark, http://serverfault.com/questions/372020/what-are-the-best-possible-ways-to-benchmark-ram-no-ecc-under-linux-arm


echo "Please be patient, this might take a minute or so."
hostname=$(cat /etc/hostname)
ips=$(hostname --all-ip-addresses)
cname=$(cat /proc/cpuinfo|grep name|head -1|awk '{ $1=$2=$3=""; print }' | xargs)  # xargs left/left trims the string
cores=$(cat /proc/cpuinfo|grep MHz|wc -l | xargs)
freq=$(cat /proc/cpuinfo|grep MHz|head -1|awk '{ print $4 }')
cpuspeed=$( (time echo "scale=5000; a(1)*4" | bc -l > /dev/null) 2>&1 | head --lines=2 | tail --lines=1 | awk -F ' ' '{print $2}')
tram=$(free -m | awk 'NR==2'|awk '{ print $2 }')
swap=$(free -m | awk 'NR==4'| awk '{ print $2 }')
up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }' | xargs) # xargs left/left trims the string

cache=$((wget -O /dev/null http://cachefly.cachefly.net/100mb.test) 2>&1 | tail -2 | head -1 | awk '{print $3 $4 }' | sed 's/^(\(.*\))$/\1/' )
io=$( (dd if=/dev/zero of=test_$$ bs=1M count=256 conv=fdatasync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')
io2=$( (dd if=/dev/zero of=test_$$ bs=1M count=256 oflag=dsync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')

# memory test
tempDir=`mktemp -d -t linux-benchmark-XXX`
mount -t tmpfs $tempDir $tempDir
#io3=$( (dd if=/dev/zero of=$tempDir/test_$$ bs=1M count=256 conv=fdatasync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')
io3=$( (dd if=/dev/zero of=$tempDir/test_$$ bs=1M conv=fdatasync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')
umount -f $tempDir
mount -t tmpfs $tempDir $tempDir
#io4=$( (dd if=/dev/zero of=$tempDir/test_$$ bs=1M count=256 oflag=dsync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')
io4=$( (dd if=/dev/zero of=$tempDir/test_$$ bs=1M oflag=dsync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }')
umount -f $tempDir

outputfilename=$(basename $0-run-`date "+%Y.%m.%d-%H.%M.%S".txt`)
echo "Hostname:             $hostname" >> $outputfilename
echo "IP(s):                $ips"  >> $outputfilename
echo "CPU model:            $cname" >> $outputfilename
echo "Number of cores:      $cores" >> $outputfilename
echo "CPU frequency:        $freq MHz" >> $outputfilename
echo "System uptime:        $up" >> $outputfilename
echo "Total amount of ram:  $tram MB" >> $outputfilename
echo "Total amount of swap: $swap MB" >> $outputfilename
echo "Calc PI to 5000:      $cpuspeed"  >> $outputfilename
echo "Download speed:       $cache " >> $outputfilename
echo "HDD I/O (conv=fdatasync): $io" >> $outputfilename
echo "HDD I/O (oflad=dsync):    $io2" >> $outputfilename
echo "Memory I/O (conv=fdatasync): $io3" >> $outputfilename
echo "Memory I/O (oflad=dsync):    $io4" >> $outputfilename

echo ""
cat $outputfilename
echo ""

If you found this useful comment or follow me .

Thursday, October 22, 2015

Linphone keys (DTMF) not working with Freeswitch VOIP Server

Work around to key tones not working in Linphone when connected through Freeswtich

If you find that after dialing into any IVR your key presses are not registering, and you are connecting to a Freeswitch voip gateway it is likely due to this Bug: Telephone-event codec clock-rate mismatch (leads to DTMF issue); go 'Options > Settings > Codec' and move the 8000Hz codes up.

A temporary work around is to change your codec priorities in Linphone to use one of the lower quality 8000Hz ones first.

Comment or follow me if this has helped you.

Tuesday, October 13, 2015

dnsmasq as an external DNS server

Creating a 'NS' record

It's NOT possible - try setting u BIND instead or contacting the author to add support for it; I am creating this entry so that it would save hours of searching for others.
The basic setup that should work is to point your domain dns servers to to 'ns1.yourdomain.com` where ns1 resolves to your servers IP, however because dnsmasq can not answer with a NS record and the process fails - that is my understanding based on my readings
Comment or follow on twitter .

Sunday, October 11, 2015

Windows Insider stuck at build 10162

Windows Insider won't updated

So my 10162 insider windows edition is now expired, keeps restarting, telling me it will stop working and yet Windows Update says there is no updates.

Search on the Internet found many with similar issues but none of the solutions worked, however the below did the trick for me

  • Download the Windows 10 ISO Installation
  • Mount the file by right clicking
  • Enter one of the following Product Keys - Windows 10 build 10240 keys:
    • Windows 10 Home build 10240 - TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
    • Windows 10 Pro build 10240 - VK7JG-NPHTM-C97JM-9MPGT-3V66T
    • Windows 10 Enterprise build 10240 - NPPR9-FWDCX-D2C8J-H872K-2YT43
  • When the installation finishes ensure you are still part of the insider builds

If this has helped you drop me a comment or follow me on twitter @danielsokolows.