Tuesday, February 19, 2013

Samba configuration on Raspbmc 1.0

Now that I installed version 1.0 of Raspbmc, a donation-based Debian Wheezy / XBMC OS for the Raspberry Pi. I needed to set up my services again, i.e. Samba, Zero Configuration, iTunes server, Apple networking and time machine. Samba took me a little bit mainly because there is so much confusing information on the 'net. So here is my brain dump on how to get Samba 3.6.6 configured:

/etc/samba/smb.conf:


----------------------- Network Related Options -------------------------
[global]
workgroup = SVENHOME
server string = %h Samba Server Version %v
netbios name = PI
usershare allow guests = yes

# --------------------------- Logging Options -----------------------------
log file = /var/log/samba/log.%m
max log size = 50
syslog = 0

# ----------------------- Standalone Server Options ------------------------
security = user
passdb backend = tdbsam
username map = /etc/samba/smbusers
encrypt passwords = yes
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n$
map to guest = bad user
follow symlinks = yes
wide links = yes
unix extensions = no
lock directory = /var/cache/samba

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
   name resolve order = hosts wins bcast

[devices]
    browsable = yes
    read only = yes
    guest ok = yes
    path = /media
    force user = root

[homes]
   comment = Home Directories
   browseable = no
   writable = yes
   create mask = 0700
   directory mask = 0700

[music]
   path = /media/Iomega_HDD/music
   force user = pi
   comment = Music
   browseable = yes
   writeable = yes
   create mask = 0777
   directory mask = 0777
   fstype=NTFS
   public=yes

[pictures]
   path = /media/Iomega_HDD/pictures
   force user = pi
   comment = Pictures
   browseable = yes
   writeable = yes
   create mask = 0777
   directory mask = 0777
   fstype=NTFS
   public=yes
 
Add pi to the samba users:
sudo smbpasswd -a pi
sudo smbpasswd -e pi
sudo smbpasswd -e pi
And log on from Windows 8 as SVENHOME\pi and ditto from my laptop running Ubuntu 12.04 LTS without a hitch.

Sunday, February 10, 2013

Arduino Laser Show: I

So, this popular German computer magazine called C't now also publishes "C't hacks", and I got a copy. Anton and I were immediately drawn to the Arduino-controlled low-cost laser light show. The main ingredient - besides the Arduino and the laser - are the read/write mechanics of two old hard disks. So I got some junk 2.5" HDs from work and we opened them up. After removing the platters we found that the galvos (the electromagnetic drivers of the read/write head unit) were pinned out over  ribbon cable to a little connector, and we didn't know which pins were data and which galvo power. First useful job for the new lab power source! After trying all possible combinations we found them, but they  were different for the two little drives. What was also interesting and useful for later was that 0.1 V would already drive them to center, so I am not sure we'll even need a motor driver for that. A simple Mosfet would probably do. Since Arduino Analog Write is PWM at 900Hz, we might need a Low-pass RC element as well, we'll see. For this first stage, we needed to solder wire to the tiny pins - glad we had that giant magnifying lamp from the San Jose lab! We put plumber's putty over the pins to keep everything protected.  The green laser was ordered tonight as well, and we cut little mirrors from the HD platters. Intense excitement!




Thursday, January 31, 2013

Remote access to the Raspberry Pi

Goal: Log in to the Pi from WAN.
Problem: Pi is on the LAN without 192.. address, and my Cable provider changes my WAN IP address from time to time.
Solution: Sign up with a dynamic DNS service, and set up a little program on the Pi that frequently posts its WAN address to the service.

It's dead simple with No-IP.com, and described neatly here on their support page.
Dynamic DNS Help and Support - No-IP

Of course, something needs to be listening on a port. So that port needs to be forwarded from the router to the Pi. I have a AVN Fritz!Box, which has a config page for such things. So for instance, to allow ssh access, you'd forward port 22 to port 22 on your Pi.

Works flawlessly on my setup!

Wednesday, January 16, 2013

Heike's German web site is up now!

Just wanted to let you know. Since I was an unreliable resource as web admin for my wife for her US business web site at www.releaseintopeace.net, she decided to go with a pro for her new German presence at  www.releaseintopeace.de ! While I had picked Drupal as a CMS, Volker Buchwald, her new designer/developer/web master, does things in Joomla! Looks great - congrats Volker!! If you need a site like this, I plug for him with his web address www.werbung-energiearbeit.de.

BTW I also really like Heike's new studio. (Ahem I spent quite a few weekends on the floor, the painting walls, the furniture, the Ethernet cable routing, the ISDN phone system etc etc :-))

Best of all, EFT Tapping and Matrix Reimprinting works great on me too, and I get to go to her Eckehart Tolle night tomorrow, since the kids are off to skiiing in Austria (Bezau to be precise, and yes, sweet little 6-year old Annika will be away for the longest ever 9 days from her parents, but she was soooooo excited on the train platform this morning!).

Sunday, January 06, 2013

Raspberry PI as an iTunes server with forked-daapd

OK, so I have my basic connectivity to the Mac OS with avahi, the HD containing the music is being automounted mode 0666/0777 with autofs udev, and I can see the Pi from the Mac (not from my Windows 8 box yet, for which I will wait for the release of Raspbmc, currently at RC3Raspbmc 1.0 has been released, I have configured Samba, works very well now).

forked-daapd is a free iTunes server, and diegocaro describes a forward port to Raspbian here, which he recommends instead of the foorked-daapd  normally packaged with Raspbian Wheezy due to  problems with the libevent-2.0 dependency. His port uses libevent-1.4.1. I followed his description, and lo and behold, it works, i.e. I can see my music on a iTunes client. Well, it almost worked. I did get drops.

I experimented with the iTunes setting in /etc/forked-daapd.conf


        # Should iTunes metadata override ours?
        itunes_overrides = true

I upped the log level in the conf file and looked at the log output with 

tail -f /var/log/forked-daapd.log

and saw that I started to process the 'iTunes Music Library.xml' file, whose entries refer to the old mp3 file locations back from when I still had the music HD directly on my Windows box, resulting in a slew of "Could not find..." messages. Now the iTunes client is still seeing the share, but hangs at Loading and then reverts back to the local library. So I turned the commented out itunes override again.

The drops are still happening, and more web research will be needed about that. Meanwhile, I wait for that Raspbmc release. Now with the Raspbmc March update, forked-daapd is working great! It picked up all my music, and NO MORE DROPS!! I love it! Banshee and Rythmbox on my Ubuntu Laptop pick up the service just fine, so does iTunes on Windows 8, iTunes on my wife's Mac. I even tried Rythmbox and Banshee simultaneously, no problem. Hyperfine Remote for iTunes on my pad on the hand shows the library content correctly but doesn't play it. Pairing worked as described in the source's README (the Device name is "Remote for iTunes") , but when I select a song, it simply doesn't play at all. Stay tuned for that part.



Friday, January 04, 2013

Raspberry PI USB automounting

Update May 13: This is no longer necessary - raspbmc does automount the drives now.

Somehow I thought that the Raspbmc OS variant would automount my USB drives, but it didn't. I tried installing usbmount, a Debian package, but didn't get the automount at boot to work.
So I gave autofs a shot, which on Raspbmc, my distro, is already installed.

[Edit: With Raspbmc 1.0, it's no longer there, so I installed it with

sudo apt-get install autofs

Then I found that both drives are already mounted in /media, so the rest here is no longer necessary!!
I am unsure now whether they are now mounted because something else than autofs now ships with raspbmc or whether the default autofs installation took care of it
]

I took me some reading, but I got both USB drives to automount with autofs. The Multimedia drive is an NTFS file system, whereas I formatted the other one as HFS+ to be used as a Time Machine drive for my wife's Mac.

There are two files that I needed to touch: /etc/auto.master and /etc/auto.media.

In auto.master, I needed to comment out everything, including

+dir:/etc/auto.master.d

+auto.master
and then added at the end

/mnt/auto /etc/auto.media --timeout=120 --ghost

This last line tells autofs that it should look at the lines in /etc/auto.media and mount those in under /mnt/auto. The --ghost option causes autofs to create the directories there before they are mounted. After 120 seconds inactivity they will be unmounted.

In /etc/auto.media, I put

mm      -fstype=ntfs-3g,defaults,noauto,rw,uid=pi,gid=pi          :/dev/disk/by-uuid/844019F84019F222
tm      -fstype=hfsplus,defaults,noauto,rw       :/dev/disk/by-uuid/d5fd173f-c472-3594-8448-e61b466a52a0

This is almost self-explanatory, but it took me a while to get to the disk/by-uuid trick. /dev/sda1 etc would not work if I ever unplugged the drives and reconnected them in a different order as the OS assigns them different letters then (I read this can be fixed with an entry in the udev config, but I didn't go far enough with it). Usage of disk/by-label seems widespread, but my disk labels contain spaces, and I couldn't figure out how to encode this in auto.media. Ditto with the colons in disk/by-id!

After that I had the ntfs drive under /mnt/auto/mm and the Apple drive under /mnt/auto/tm. Automounting worked after restarting the autofs daemon with

/etc/init.d/autofs restart

I confirmed that this still worked after reboot. Now that I can see my music, on to forked-daapd for serving music with iTunes protocol!






Tuesday, December 25, 2012

Raspberry Pi, Raspbmc, HFS+, AFP and Time Machine

So last week I got myself a Raspberry PI. The idea was - and still is - to turn it into a little media server for the family (ahem, me). One thing that I want it to do as well is a backup server for all the gadgets in the house. First up, my wife's Mac with OS 10.7.4.

First, I formatted a USB drive on her Mac following Apple's support pages.

Like I said, I installed Raspbmc on the PI. This is a pretty naked Debian system. I roughly followed the instructions on Simon's blog to install HFS+ Apple file system support:

sudo apt-get install hfsplus hfsutils hfsprogs
sudo mkdir /media/timemachine
sudo mount -o force /dev/sdb2 /media/timemachine
sudo adduser timemachine
sudo chown timemachine /media/timemachine
      
However, compiling netatalk 3.0.1 for which there is no Debian compiled package yet was a little harder since I first needed to install the build tools, compiler etc.

sudo apt-get install make gcc binutils 

Then following Simon again with 


sudo apt-get install avahi-daemon libavahi-client-dev libdb5.3-dev db-util db5.3-util libgcrypt11 libgcrypt11-dev

I retrieved the netatalk sources directly from the SourceForge web site and copied them over to the Pi with scp. Then I unpacked them and installed them the standard way:


./configure --with-init-style=debian --with-zeroconfmake install
make
sudo make install
I configured the afp service like so
sudo nano /usr/local/etc/afp.conf
;; Netatalk 3.x configuration file;
[Global]

; Global server settings
uam list = uams_guest.so, uams_dhx.so, uams_dhx2.so
; [Homes]basedir regex = /home
; [My AFP Volume]; path = /path/to/volume
[Time Machine Raspberry]
path = /media/timemachine 
time machine = yes
Then I needed to restart the netatalk and avahi services:

sudo /etc/init.d/netatalk restart
sudo service avahi-daemon reload
Then I needed to prepare the Mac, for which I followed this page (the stuff at the top of the page I didn't do). 



What's needed now is the auto-mount of the USB drive!  Change 05/13: Raspbmc now automounts the drives, I believe with improved udev rules.

I did have to go through the above rigmarole again, after the raspbmc OS update, and found that the timemachine drive would now auto-mount, but only read-only. After some hours of research :-), I found the solution: Take the drive off the pi, plug it into the Mac and repair it with the disk utility. Also, I think somehow Journaling was switched back on, so I turned it back off (For the option to appear in the "Edit" ("Ablage" in German) menu, you have to first press the "Alt" key, then select the menu.) This didn't work, so I used the cmd-line diskutil tool to do it:

sudo diskutil unmount /Volumes/timemachine

sudo diskutil disableJournal force /dev/disk2s2


(I knew the disk2s2 bit from running diskutil list)


'via Blog this'

Monday, November 05, 2012

Installing ipython on python 2.7

In order to get PyDev in Eclipse going with ipython, a much nicer cmd line interface to python, install ipython as a package. Here's how: Overview — IPython 0.13.1 documentation

'via Blog this'

Monday, June 11, 2012

App Showdown: Password Keepers | Mac|Life

Re the review App Showdown: Password Keepers | Mac|Life:
Favorite for me: mSecure, because of its DropBox sync. My wife has an iPhone and I am on Android, we tried the sync between our devices via DropBox and it works. Luckily the mSecure devs kept the code similar enough.

'via Blog this'

Tuesday, May 15, 2012

CVS from behind a corporate firewall

I am posting this as it wasn't easy to find: CVS from behind a corporate firewall. 

In the end it was quite easy. Example - Instead of 

:pserver:anonymous@public.kitware.com:/cvsroot/CableSwig

write 

:pserver;proxy=your.corporate.proxy.com;proxyport=8080:anonymous@public.kitware.com:/cvsroot/CableSwig

Also, the file .cvsroot in your $HOME directory must exist.

 

Sunday, May 06, 2012

Installing Sun/Oracle JDK on my Ubuntu system

Ubuntu provides OpenJDK, but Aptana Studio doesn't support it, so I need to install the Sun/Oracle version of the JDK, but as a package they only provide RPM's, which Ubuntu  doesn't support. So I followed these instructions on askubuntu.

'via Blog this'

Monday, August 15, 2011

German sourdough variation #1

1 cp sourdough starter
1 1/3 cp warm water
2 1/2 cups rye flour
1 1/4 cups whole wheat flour
1 1/4 type 00 flour
2 tsp salt
1 tsp active yeast
Basic wheat program


Wednesday, November 17, 2010

White House Defense Policy

On my mind (briefly) - White House Defense Policy:

I urge the president to include the avoidance of war as top priority on his administration's defense policy. I quote the first line from this web site "The Obama Administration is investing in a strong, agile, well-trained, and well-equipped U.S. military that can fight and win the nation’s wars." I am shocked by the underlying overly narrow and aggressive definition of defense as successful warfare and juxtapose it with the UK's guiding principle on war: "The point of war is not just to win but to make a better peace." It logically follows that it preferable to make better peace without war. This must therefore be the maxime of a comprehensive defense policy.

Moving on to more mundane and immediate topics: Breathe in, breathe out. OK? OK.

Wednesday, August 18, 2010

ReleaseIntoPeace.net | Release Into Peace

ReleaseIntoPeace.net | Release Into Peace

Here is my wife's web site. She is an EFT (Emotional Freedom Technique) practitioner. I am the web master and a late-night practitioner of SEO (Search Engine Optimization). No go forth to #1 page rankings!

Thursday, April 22, 2010

Anton on his way to Abu Dhabi


Anton on his way to Abu Dhabi, originally uploaded by sprevrha.

Sunday, April 18, 2010

Wave organ


Wave organ, originally uploaded by sprevrha.

Put your to the tube and get a free noise concert

Saturday, April 17, 2010

Great backdrop for kids soccer games

sven
- sent from my phone

Saturday, April 10, 2010

saus


saus, originally uploaded by sprevrha.

Swing time


Swing time, originally uploaded by sprevrha.

Saturday after soccer

Thursday, April 08, 2010

Flower girl


Flower girl, originally uploaded by sprevrha.