Automount NFS in ubuntu slows boot time

You can automaticly mount a NFS share in ubuntu by adding the following to /etc/fstab
nas:/path/to/share /path/to/mount nfs defaults 0 0
What I did notice was that once the automount line was added, the boot time became slightly longer, because lvmetad tries to do something to /path/to/mount, you can exclude the path by filtering it in /etc/lvm/lvm.conf, add this to devices
filter = [ "r|/path/to/mount|" ]
This should fix the slow boot.

Pfsense 2.1.5-RELEASE dhcpd keeps crashing

I don’t know about you but for me for some reason the dhcpd keeps crashing, .. before it didn’t really matter to me, because I had a second router for NAT doing dhcpd, but now I’ve removed that router and put everything on pfsense, ..

This is a pain because at some point I was watching a movie on my xbmc and suddenly the movie froze, .. after a little of searching I found out that the IP of the mediacenter was not assigned, for some reason it lost the IP while it was active, .. so because I don’t want to spend my time watching the dhcpd all the time. I made this little script, witch runs every minute, that does all the checking for me and if it’s required it will restart the service.

#!/bin/sh

INTERFACES="vr1 vr2_vlan10"
USER="dhcpd"
GROUP="_dhcp"
CHROOT="/var/dhcpd"
PIDFILE="/var/run/dhcpd.pid"
CONFFILE="/etc/dhcpd.conf"
DHCPBIN="/usr/local/sbin/dhcpd"

if [ ! -r "${CHROOT}${CONFFILE}" ]; thenhttp://gmpg.org/xfn/11
  echo "no config file found"
  exit 1
fi

if [ -r "${CHROOT}${PIDFILE}" ]; then
  ps -p `cat "${CHROOT}${PIDFILE}"` >/dev/null 2>&1
  if [ $? = 1 ]; then
    rm -f "${CHROOT}${PIDFILE}"
    $DHCPBIN -user ${USER} -group ${GROUP} -chroot ${CHROOT} -cf ${CONFFILE} -pf ${PIDFILE} ${INTERFACES}
  fi
else
  $DHCPBIN -user ${USER} -group ${GROUP} -chroot ${CHROOT} -cf ${CONFFILE} -pf ${PIDFILE} ${INTERFACES}
fi

exit 0

It might not be the best solution, because that would be fixing the problem, but hey it works for me, for the time being.

Paypal monthly expense calculator

Ever had problems keeping track of your expenses, on Paypal, .. here is a little script that will parse the csv and make a grand total.

put this script in a file, lets say whatever.tcl then run tclsh whatever.tcl mydatabase.csv

#!/usr/bin/tclsh
set GBP 1.26365512
set USD 0.761260953
set EUR 1

#don't edit
set offset 36 ;#number of data items per line

if {![catch {open [lindex [split $argv] 0]} r]} {
  set i 0; set array 0; set total 0
  set data [read $r]
  foreach {--> x} [regexp -all -inline -nocase {["]{1}(.*?)[",]{2}} $data] {
    set [set array]($i) $x
    if {[string equal $offset $i]} {
      set i 0
      incr array
    } else {
      incr i
    }
  }
  close $r
  for {set i 0} {$i < $array} {incr i} {
    set total [expr $total + [set [string toupper [set [set i](6)]]] * [string map {, .} [set [set i](7)]]]
  }
  puts $total
}

By changing the GBP, EUR or USD value it will calculate the proper value, for example if you want the total to be USD you set USD to 1, EUR to 1.31361, GBP to 1.65995, ..

Also you can just add any currency you like if the csv has other types of currencies you just add a new upper case variable to that currency and it will just calculate the proper amount all by it self, this script is dynamic.

You can get the currency values from google by search for example for eur to usd.

Firmware upgrade & ReplicatorG from github for Wanhao Dupciator 4 on Xubuntu 14.04.01 64bit

For some reason only this version of ReplicatorG allows me to connect to my 3D printer.

For those who want it I offer the compiled binaries:

Continue reading

The hassle of makerware

All looked well and simple according to this page, but at least their trusty repository seems to broken, when I run sudo apt-get update I get an error.

Fout http://downloads.makerbot.com trusty InRelease

Fout http://downloads.makerbot.com trusty Release.gpg
Kon ‘downloads.makerbot.com’ niet vinden
2.197 kB opgehaald in 20s (110 kB/s)
Pakketlijsten worden ingelezen… Klaar
W: Ophalen van http://downloads.makerbot.com/makerware/ubuntu/dists/trusty/InRelease is mislukt

W: Ophalen van http://downloads.makerbot.com/makerware/ubuntu/dists/trusty/Release.gpg is misluktĀ  Kon ‘downloads.makerbot.com’ niet vinden

W: Sommige indexbestanden konden niet worden opgehaald. Deze zijn genegeerd, of oude versies zijn gebruikt.

Continue reading