Sunday, October 26, 2014

Adding a new disk to an LVM Ubuntu system

Today I'm adding another disk to my main Linux server.

I used cgdisk to write a partition table. I set the partition type to 8e00 for LVM (Logical Volume Manager?)

sudo pvcreate /dev/sdb1

$ sudo lvcreate --extents 100%FREE -n lvdisk2 vgdisk2 
  Logical volume "lvdisk2" created

$ sudo vgcreate vgdisk2 /dev/sdb1

  Volume group "vgdisk2" successfully created

sudo mkdir /mnt/disk2
sudo mount /dev/vgdisk2/lvdisk2 /mnt/disk2/

And it's up!

Tuesday, October 21, 2014

Avoiding Paralells price gouging

Paralells makes a virtual machine software for the Mac, called Paralells Desktop. They said I needed to upgrade their product to before upgrading to Mac OS X 10.10 Yosemite (although it seems they may have been lying).

The upgrade price in the US is $50, but if you're located in Europe they charge you $76 for exactly the same thing. Not a respectful way to treat your customers to charge 50% more for a download depending on where you live. (Note - it's not just the VAT).

So, the way to avoid paying their EU surcharge is to use a free web proxy like www.webproxyusa.com. Go to the site, enter "http://www.parallels.com" in the web address box, and navigate to the download you want. Note: don't enter any credit card details using the web proxy since it circumvents encryption. But enter your e-mail address and pay by Paypal. It's OK to enter an EU address. The price ended up being $59.41 including VAT.

There you go - save some money!

Thursday, October 02, 2014

Ubuntu server maintenance

I'm doing some server maintenance today.

The main reason being that Ubuntu 13.10 systems are not updated to fix the Shellshock security hole, so I'll try to upgrade my main server to 14.04 or 14.10.

I had a full /boot partition first which I needed to fix. I had to move two initrd files (initrd.img-3.11.0-15-generic and initrd.img-3.11.0-17-generic) to /tmp temporarily to be able to fix it.

I then did an "apt-get install -f" to fix some broken package stuff, probably due to the full /boot partition.

I still got some out of diskspace errors, so I guess I have to move another initrd or two to /tmp:


run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.11.0-26-generic /boot/vmlinuz-3.11.0-26-generic
update-initramfs: Generating /boot/initrd.img-3.11.0-26-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.11.0-26-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.11.0-26
Rerunning "sudo apt-get -f install". It's very slow when doing "running depmod". Success! I now have 23M free on /boot. 

I'll try running apt-get autoremove. I now have 87 MB free on /boot.

I now do:

sudo apt-get purge linux-image-3.11.0-23-generic
sudo apt-get purge linux-image-3.11.0-24-generic
sudo apt-get purge linux-image-3.11.0-15-generic 
The last command removed the running kernel, which I hadn't really planned to do. Oh well. Now I have 155 MB free on /boot.

Actually, I got a bit worried, so I reinstalled the running kernel (3.11.0-15). 140 MB free.

Now I'll try again to upgrade to 14.04:

Hm. I did some kind of resurrect in the previously failed 14.04 installation window. I wonder if the installation restarted properly? I don't dare to interrupt it, so I'll let it run.

Rebooted after 240 days uptime. It is taking a very long time with the hard disk light on. I hope it is just a forced fsck.

For some reason the network didn't come up on the first boot, but after the next reboot.



Saturday, August 30, 2014

Adding StartCom CA Cert to JDK 1.7.0 on Mac OS X to access FYB-SE API

I tried to access the Bitcoin exchange FYB-SE's API using a Java program under JDK 1.7.0 on Mac OS X 10.9.4. I got an exception:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
The reason is that FYB-SE's https SSL security certificate was issued by the Israeli certificate authority StartCom, whose Certificate authority (CA) certificate is not listed in Java's database of trusted certificate authorities.

My fix was to download Smartcom's CA certificate from http://www.startssl.com/certs/ca.crt. Then I did the following:
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/security/
cp cacerts cacerts.orig
sudo keytool -importcert -file ~/certs/ca.crt -keystore cacerts
After this, my Java program trusted the certificate, and got stuck at the next error instead ;-)

Did you find this useful? Please Flattr me! 

Sunday, May 25, 2014

Installing OctoPrint for an original PrintrBot Plus with a TP-Link TL-WN725N Wifi adapter

I'm trying to make my Printrbot Plus accessible over WiFi so that I can move it outdoors when printing, to reduce exposure to dangerous fumes and nanoparticles.

I formatted the SD-card on my MacBook Pro using the SD Formatter program downloaded from here (following instructions here).

I used the 2014-01-07 Wheezy Octopi 0.8.0 image from here.

I then unzipped the OctoPi image and copied it to the SD card using:

sudo dd if=2014-01-07-wheezy-octopi-0.8.0.img of=/dev/rdisk3 bs=1m

I connected my Pi to the wired ethernet network and booted it. After boot I could ssh to octopi.local with username pi and password raspberry.

I ran sudo raspi-config on first boot to enlarge the initial partition to fill the card, and set my time zone, and rebooted.

The OctoPi interface is now available at http://octopi.local/

Next step was to set up my TP-Link TL-WN725N Wifi adapter.

I used uname -a to determine my OS version (was 3.10.25+ #622). Using this list, I determined i had to download this file:

https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

I downloaded:


wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

unpacked:

tar -xf 8188eu-20131219.tar.gz

installed:
sudo install -p -m 644 8188eu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a

Checked that the dongle was installed with iwconfig

Installed my favorit editor 'emacs' (took a while): sudo apt-get install emacs

I edited the wpa_supplicant.conf file to add my WiFi password:

sudo emacs /etc/wpa_supplicant/wpa_supplicant.conf

I added:

network={
ssid=""
psk=""
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
auth_alg=OPEN

}

I took down and and up the interface (not sure if it was neccessary), and could see with ifconfig that wlan0 had an IP address on my wifi network. Note that this was not obvious from the iwconfig results.

I have not tried a print yet, but it's looking good.

Tuesday, February 18, 2014

Getting an Azoteq IQS213 IC touch IC to work with a Nordic Semiconductor nRF51822 microcontroller

I'm trying to get an Azoteq IQS213 touch controller to work with the Nordic Semiconductor NRF51822 processor in my smartwatch project.

According to the IQS213 documentation, the ready / TO2 line is supposed to go low after startup to signal that the IQS is ready to receive commands from the controller.

However, this is not happening. The TO2 line is supposed to have a 4.7 kOhm pull-up resistor. Instead I have used the processor's internal 11-16 kOhm resistor as pull-up. Since it's larger than the specified resistor, it should not prevent the line from going low.

I've verified:

  • Power (2.8V)
  • Ground
  • VReg (1.68 V)
  • Checked for shorts
  • Orientation of chip
Still no ready low.

Next step will be to look for anomaly notes from Azoteq, and program an ACK handshake to see if that could work.

Monday, December 09, 2013

Setting up Eclipse under Mac OS X for the Nordic Semiconductor nRF51822

I'm developing a smartwatch with the Nordic Semiconductor nRF51822 IC (a really nice chip!).

The development environment that comes with Nordic's Development Kit is based on Keil (a very expensive commercial IDE), which has a limit of 16K code to use in circuit debugging. Therefore I want to set up a development environment on my Mac using free and open source tools. Nordic has an application note, nAN-29, which describes doing this for Windows.

I will try installing the GCC ARM Embedded, because according to this post on the Nordic forums (quote):

  1. a new gcc toolchain based on gcc ARM embedded instead of Codesourcery (As Nordic has chosen to support it and not the other)
  2. Codesourcery on Mac OSX is only a great trouble, as this toolchain lacks of S3 Mentor libs) 
  3. Nordic has released new linker scripts for gcc ARM embedded.
I'm going to try to use Eclipse rather than XCode, so that the project won't depend on OS X.

I downloaded the "Mac Installation Tarball", which didn't contain an installer. I'm not sure where to put it, so for now I'll put it in my Eclipse workspaces folder.

I created a symbolic link (not an alias) called "gcc-arm-none-eabi" so I wouldn't have to change paths in the project if I update the cross compiler version.

I installed Eclipse according to nAN-29. When I build, it tries and fails to use "C:/Program Files/GNU Tools ARM Embedded/4.7 2013q1/bin/arm-none-eabi-gcc" to compile the project. I need to find where to change this path.  nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common uses a GNU_INSTALL_ROOT environment variable, I wonder where it is set.

The file nrf51_sdk_v5_0_0_34603/nrf51822/Source/templates/gcc/Makefile.common references Makefile.posix, which does not seem to exist.

GNU_INSTALL_ROOT is set in Makefile.windows, but I don't see why Makefile.windows is used. I'll try to make a Makefile.posix and see if it works better.

I made a Makefile.posix as follows:
GNU_INSTALL_ROOT := /Users/erlandlewin/Eclipse-workspaces/gcc-arm-none-eabiGNU_VERSION := 4.7.4
GNU_PREFIX := arm-none-eabi
 I had to edit the Makefile.common as follows:
#ifeq ($(OS),Windows_NT)
#include $(TEMPLATE_PATH)Makefile.windows
#else
include $(TEMPLATE_PATH)Makefile.posix
#endif
I can now build the project in Eclipse and from the command line!

I will download the J-Link software for Mac from here.

 Followed the instructions in nAN-29 to set up the debugging. In the "GDB command" field of the Debug Configurations dialog, I used the Browse button to find the arm-none-eabi-gdb binary. This way I don't have to set up any paths.

I start the gdb server using the terminal from the /Application/SEGGER directory, using the following command line:

./JLinkGDBServer -if SWD -device nRF51822
(Thanks to info from Christopher Mason)

Woohoo! I can now run debug the ble_app_hrs project from Eclipse via the JLinkGDBServer!


Wednesday, August 14, 2013

Making a Raspberry Pi 3G Bridge / Hotspot

This post documents making a 3G Internet bridge / hotspot from a Raspberry Pi, a 3G modem, and a separate WiFi access point.

The purpose was to create an Internet connected WiFi-network at my parents' summer cottage.

I want to cover a fairly large area of the property and house. I might want several WiFi access points and control their placement and the placement of the 3G modem, therefore I did not want an integrated WiFi hub such as a Dovado 3/4G router (SEK 799 / €92 at Kjell & Co.

I'm using:
  • a Raspberry Pi model B (SEK 298 / €34 at Webhallen)
  • the Adafruit Occidentalis v 0.2 distribution (since I'd used it before)
  • an unlocked Huawei HiLink E353, originally tied to Swedish operator Tre, I think (SEK 179 / €21 at Swedish auction site Tradera)
  • Connected a WiFi access point I had earlier to the Raspberry Pi.
  • My plan is to use Telenor Bredband Kontant (SEK 400 / €46 for 6 months and 10 GB data). I did my tests by borrowing the SIM card from my iPad.
  • I think I also need a powered USB hub for the 3G modem, will experiment later to see if a more powerful supply for the Raspberry Pi might remove the need for this.
  • Normally, I used ssh over a network connection to the Raspberry Pi, but when setting up the network bridge, I used a regular monitor (with an HDMI - DVI cable) and a USB keyboard, because the network interfaces must be shut down to set up the bridge.
Installed Occidentalis on the SD card.

Connected RasPi to MacBook with Ethernet cable. Internet sharing from WiFi to Ethernet on MacBook, to give RasPi Internet access. Logged in with ssh on Raspberry Pi.

Booted the RasPi.
Did:
sudo apt-get update
sudo apt-get upgrade
(takes a long time)

usb_modeswitch is required to get 3G modem to work:
apt-get install usb-modeswitch
Install UPnP client, will be needed to open ports in the modem:
apt-get install miniupnpc
Remove and re-insert dongle?

Reboot:
sudo shutdown -r now
On startup, stick should be available as eth1, check with ifconfig. If it doesn't it might be that the modem needs to be in a powered USB hub.

edit /etc/network/interfaces

Add:
iface eth1 inet dhcp 
check with:
sudo ifup eth1
Great. Try to ssh into RasPi over public internet. How to get public IP?
wget http://ipecho.net/plain -O - -q ; echo
Got 90.129.85.242

Can't ssh to it (connection refused). After some research found out that in order to open port forwarding on the 3G modem, one must use UPnP.

Open port 22 to allow ssh connections from the Internet to the Raspberry Pi.
// to receive ssh
upnpc -r 22 TCP
Set up bridge (for more information, see documentation). This entails shutting down both network interfaces, so you will need to be connected to the Pi with keyboard & monitor, or with a third network connection:

I think I shut down eth0 and eth1 first:
ifdown eth0
ifdown eth1 
Then set up the bridge:
brctl addbr br0
brctl addif eth0
brctl addif eth1
dhclient br0
It works! Can access Internet via Dongle from WiFi. 

Modified my WiFi access point to have IP 192.168.1.2

Now set configuration in /etc/network/intefaces:
auto lo br0
iface lo inet loopback 

# Ethernet
iface eth0 inet manual

# Huawei 3G dongle
iface eth1 inet manual

allow-hotplug eth1

# Bridge
iface br0 inet dhcp
  bridge_ports eth0 eth1
  bridge_fd 0 # no forwarding delay

Configured DynDNS for my DNS provider Loopia according to these instructions. 

Works very nicely!

Did you find this useful? Please Flattr me! 

Thursday, December 27, 2012

PrintrBot Plus Stepper Motor Current


If you have a multimeter, you can set your current limiting potentiometers to the theoretically correct values for the stepper motors by connecting your multimeter ground (black) probe to one of the unused connectors with black wires going from the power supply to the PrintrBoard, and measuring with the multimeter's positive probe at the potentiometer terminals shown in the PrintrBoard image below (red, X, should be 440 mV, yellow (Y and E) should be 400 mV, blue (Z) should be 825 mV:
Works for me, and the motors run without getting too hot.

The background for those interested

The Printrbot X, Y and E stepper motors are according to the bill of materials here of type 42BYGH4807. The Z steppers are of type 42BYGH011.

The X, Y, and E stepper datasheet specifies their current as 500 mA per phase. The Z stepper datasheet lists the current as 330 mA.

The PrintrBoard uses Allegro A4982 stepper motor drivers. The datasheet says that:
The maximum value of current limiting is set by the selection of RSx and the voltage at the VREF pin. The transconductance function is approximated by the maximum value of current limiting, ITripMAX (A), which is set by
ITripMAX = VREF / ( 8 * RS)
where RS is the resistance of the sense resistor (Ω) and VREF is
the input voltage on the REF pin (V). 
The sense resistors (RS) of the PrintrBoard (except for the X stepps for some reason) are 0.1Ω, and VREF is set by the pontentiometer. For the X, Y, and E steppers, we want an ITripMAX of 500 mA. Solving the equation gives a VREF of 0.4V for Y and E, and 0.44 V for X

For the Z steppers, we have two steppers each wanting 330 mA, which gives us an  ITripMAX of 660 mA. This gives us a  VREF of 0.66 / (0.8) = 825 mV (0.825 V).

Good luck, have fun!

Tuesday, August 09, 2011

Skandiabanken login

Looking into how Skandiabanken login works.

Login with certificate link leads to:

http://www.skandiabanken.se/hem/templates/pages/StartPage____1579.aspx?login=1

Leder till Bank ID/Certifikatsval.

Klick på Certifikats-radioknappen verkar leda till:

ActiveNextButtonBankIdCert();SetBankIDChoosen(1)

"GÃ¥ vidare" Button calls BankIDActivate()

Ends up calling:

document.authenticateIE.PerformAction('Authenticate');
or
var res = document.authenticateMoz.PerformAction('Authenticate');
Depending on if the browser is IE or Mozilla. No action for other browsers.

They are defined like this:


Wednesday, September 01, 2010

Thursday, February 11, 2010

I just found an existing iPhone app doing exactly what I had planned to do: PushMail. Kudos to its author Simon Patarin. I'll have to think of something else for my first app.

Working on my first iPhone app project.

Will have a back-end receiving E-mails from exim, putting them in a database.

Installed php plugin for parsing MIME e-mails:
sudo pear install Mail_Mime-1.6.0
sudo pear install Mail_MimeDecode
Hm, according to this:
I really want this:
Trying:
sudo pecl install mailparse
Ok, think it worked, added an entry in /etc/php5/conf.d for mailparse.

I have a work-in-progress version of mime mail parsing in /home/erl/bin/informMailPiper.php. Run with php -f , and send msg to stdinput.

Monday, January 18, 2010

Ok, I'm not sure if I built fink in 32 or 64 bit version, or how to check.

Now rebuilding fink in 64-bit only mode.

Will probably take a while to redownload all packages. Sigh.

Sunday, January 17, 2010

Continuing with insight3d...

...Seems like my opencv was built for i386 architecture (despite being on a 64 bit architecture).
Manually changed CMakeCache.txt to read:

CMAKE_OSX_ARCHITECTURES:STRING=x86_64

did make clean and make, we'll see how it goes (takes a long time to compile, IIRC).

Didn't work right away.

Deleted contents of build dir, and rebuilding, using instructions at http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port, but also changing architecture to x86_64.

Getting trouble with carbon, because it is not 64 bits. Trying to disable carbon.
Uncommented #undef HAVE_CARBON something in cvconfig.h
That didn't work.

Modified the CMakefile for highgui to use gtk+ highgui code also under APPLE.
rebuilding (in src/highgui/CMakeLists.txt). This time it actually built.

Argh. Now I get the following when building insight3d:
Erland-Lewins-Mac-mini:src erl$ make
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`
ld: warning: in /sw/lib/libgtk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk-x11-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libatk-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgio-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangoft2-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgdk_pixbuf-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpangocairo-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libcairo.dylib, file is not of required architecture
ld: warning: in /sw/lib/libpango-1.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libfreetype.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgobject-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgmodule-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libglib-2.0.dylib, file is not of required architecture
ld: warning: in /sw/lib/libintl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgsl.dylib, file is not of required architecture
ld: warning: in /sw/lib/libgslcblas.dylib, file is not of required architecture
Undefined symbols:
"_gdk_screen_get_default", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_height", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_init", referenced from:
_display_big_img in libfeat.a(utils.o)
"_gdk_screen_get_width", referenced from:
_display_big_img in libfeat.a(utils.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [siftfeat] Error 1
This mix of 64 bit and 32 bit libraries is really frustrating. I imagine some will be 32 bit, others 64 bit. What is the best strategy? Force everything to be 32 bits? 64 bits?

The night ends in frustration.
Continuing trying to get insight3d to work.

History: Didn't work well under Ubuntu. Got it to run under Bootcamp Windows XP, but got some crash there too.

Plan: Will try to build on mac, which is my main machine.

Compiled opencv on the mac. Copied the opencv.pc (pkg-config file) manually to /sw/share/pkgconfig.

Compilation on insight3d started.

Stopped in:
g++ -O3 -c `pkg-config --cflags opencv libxml-2.0 sdl gtk+-2.0` -I./ann_1.1.1/include/ cv_extensions.cpp
cv_extensions.cpp: In function ‘void cvComputeRQDecomposition(CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvMat*, CvPoint3D64f*)’:
cv_extensions.cpp:18: error: ‘__BEGIN__’ was not declared in this scope
cv_extensions.cpp:197: error: ‘__END__’ was not declared in this scope
cv_extensions.cpp:22: error: label ‘exit’ used but not defined
#include in cv_extensions.cpp.
Changed __BEGIN__ to __CV_BEGIN__ and __END__ to __CV_END__
Lots of warnings about printf formats being wrong, ignoring those.

Next stopped on missing gsl lib.
Trying "sudo fink install gsl"
Added ,0 parameter last in call to cvSaveImage in sift/src/siftfeat.c

Getting errors like this:

Erland-Lewins-Mac-mini:sift erl$ make
make -C ./src siftfeat
ar rc ../lib/libfeat.a imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o
ranlib ../lib/libfeat.a
ranlib: warning for library: ../lib/libfeat.a the table of contents is empty (no object file members in the library define global symbols)
gcc -O3 -I../include `pkg-config --cflags opencv` `pkg-config --cflags gtk+-2.0` `pkg-config --cflags gsl` siftfeat.c -o ../bin/siftfeat -L../lib -lfeat `pkg-config --libs opencv` `pkg-config --libs gtk+-2.0` `pkg-config --libs gsl`
ld: warning: in ../lib/libfeat.a, file is not of required architecture
ld: warning: in /usr/local/lib/libcxcore.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libcv.dylib, file is not of required architecture
ld: warning: in /usr/local/lib/libhighgui.dylib, file is not of required architecture
sift/src/imgfeatures.c: 298, change format for line number from %s to %d
sift/src/imgfeatures.c: 369, added -1, -1 to parameters to cvEigenVV

Now getting the "file is not of required architecture problems". Will continue to investigate later



Friday, January 15, 2010

Found insight3D, a cool program to make 3D models out of photos of objects from different angles.

Will try to compile for Ubuntu Linux 9.10, doesn't seem to be immediately available for MacOS X.

Downloaded OpenCV from:

http://dfn.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.0/OpenCV-2.0.0.tar.bz2

Did: apt-get install libgtk2.0-0
Did: sudo apt-get install libgtk2.0-dev
Did: sudo apt-get install gsl-bin
Did: sudo apt-get install libgsl0-dev

Trying to configure with:

./configure --prefix=/usr/local

Compiling insight3D with make.

Failed to run insight3d over X11 on my mac.

Will try to compile on my mac.

Managed to compile opencv with instructions here (after installing cmake with fink).

Managed to compile and run isight3D under Ubuntu on my laptop, but it crashes with an assertion on the example photos. Will try running it under Windows XP on bootcamp on the Mac.


Friday, November 06, 2009

Plan: make my server into a good file server for Macs with Time Machine support.

Found this page: Howto: Make Ubuntu a Perfect Mac File Server and Time Machine Volume

Did:
sudo apt-get build-dep netatalk
sudo apt-get install cracklib2-dev fakeroot libssl-dev
sudo apt-get source netatalk
cd netatalk-2*
sudo DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
sudo dpkg -i ~/netatalk_2*.deb
Hm, got errors at this point. Hope it won't be a problem.

Did:

echo "netatalk hold" | sudo dpkg --set-selections
Followed the instructions modifying settings file. Left the printer service and old appletalk in, since it seems like the printer daemon was dependent on the old appletalk stuff.
Added -ipaddr to the /etc/netatalk/afpd.conf to make sure the intranet IP address was chosen.

To open up the firewall, did:
sudo ufw allow proto tcp from any to 172.16.1.21 port 548
sudo ufw allow proto udp from any to 172.16.1.21 port 5353
After a bit of 'fippling' by following the article's instructions for creating a disk image etc, it works!

Wednesday, November 04, 2009

Debugging why my squeezeboxserver (version 7.4 under Ubuntu 9.04) can't find my SliMP3 player.

The Squeezeboxserver perl stuff seems to be installed under /usr/share/perl/Slim.

I can see with tcpdump that the player is broadcasting, but the perl squeezeboxserver process doesn't seem to be listening.

Debugging the server with:
perl -d -w /usr/sbin/squeezeboxserver --prefsdir /var/lib/squeezeboxserver/prefs --logdir /var/log/squeezeboxserver/ --cachedir /var/lib/squeezeboxserver/cache --charset utf8 --playeraddr 172.16.1.21 --logfile debuglog --logging debug
which invokes the perl debugger.

Didn't get anywhere. I suspect it may have to do with the two network interfaces on cumulus. Apparently UDP broadcasts only go out on one interface, which is arbitrary unless the server binds to a particular address. That's why I tried the playeraddr command above, which actually helped move the broadcast to the right interface, but that wasn't enough.

The key thing seems to be that although the server is listening to UDP on port 3483 (according to netstat -l), the process isn't receiving or selecting on that socket.

Reinstalling didn't help. Disabled most plugins.

Did a lot of debugging, and playing around with the firewall. After removing the -playeraddr argument to squeezeboxserver, it found the SliMP3. May have been a firewall issue with broadcast addresses?

Problems which have a combination of causes can be so hard to track down...

Saturday, October 31, 2009

Started looking at nagios on cumulus.

Created a host for cumulus in /etc/nagios3/conf.d/cumulus-host.cfg

Added user erl as having all access rights in /etc/nagios3/cgi.cfg

The nagios commands seem to be in /usr/lib/nagios/plugins

To check nagios configuration:
sudo nagios3 -v /etc/nagios3/nagios.cfg