2014-03-09

Apache forgots about configurations

After upgrading Ubuntu 13.04 to 13.10 I received a new Apache (2.4). In the base configuration it now only looks for (example) sites with configuration files ending with .conf. It is not a bad thing but if you earlier (as I) did not have that extension my sites were not configured.

It is easy to solve. Just add .conf to the name of the configuration files and restart apache. Now it should work.

Install php json support after upgrade of Ubuntu to 13.10

After upgrade of Ubuntu to 13.10, json support in php was removed. To solve this you have to install the support explicit with

> sudo apt-get install php5-json

and then

> sudo service apache2 restart

2013-08-04

OWFS for Raspberry Pi

One Wire File System is a nice package that helps you use 1wire in a simple way.
There is a very good description for how to install OWFS on Raspberry Pi on temperatur.nu. It is in Swedish but should be easy to follow for most of you.

Note that in newer Raspian Wheezy SW there is a conflict between owfs and some sound drivers. To fix this add "blacklist snd_soc_tas5713" to the file /etc/modprobe.d/raspi-blacklist.conf and reboot. Thanks to the people at m.nu forum.

Prolong life of SD card on Raspberry Pi by sending all logs to my NAS via syslog

You can read a lot about how your SD card in the Raspberry Pi can become broken if you write too much to it. I don't know if it is still applicable for modern SD cards.
However I have tried to reduce writing log events to the SD card and instead sending them to my NAS.
You need to edit a few text files. I'm used to emacs and have installed that. You can use whichever editor that you feel comfortable with.
This is what I did:

  1. Set the host name of the Raspberry Pi to something unique. This is the host name that will show up for each log on the NAS.
    $ sudo emacs /etc/hostname
    Replace raspberrypi with the host name you would like to use. Save the file and exit the editor.
  2. Then open the next file:
    $ sudo emacs /etc/hosts
    Replace all instancied of raspberrypi with the new host name. Save the file and exit the editor.
  3. You have to restart a process or reboot your Raspberry Pi. To restart process type
    $ sudo /etc/init.d/hostname.sh start
  4. To redirect all syslog logs to a NAS open the syslog config file:
    $ sudo emacs /etc/rsyslog.conf
    Under the RULES sections add the following line:
    *.* @11.22.33.44
    You need to change 11.22.33.44 with the IP number to your NAS server.
    Then you have to comment out all log directives to log files by setting a # before each row.
    Save the file and exit the editor.
  5. Now you need to restart the rsyslog daemon mto make it reread the config file:
    $ sudo service rsyslog restart
    Now you can watch the logs come to your NAS instead of to the SD card.

2012-12-07

Problems with syncing iPad with Windows machine

I bought an iPad 3 in April and started to sync it with my Windows 7 machine. It work well until November when I replaced my boot HD with an SSD disk. Suddenly I could not sync my iPad with my computer.
I searched on the web and found some articles describing the problem that I had. Here is one thread at the forum on Apple that describes my problem 2011 and it is still not solved. There is a service called AppleMobileDeviceService.exe that takes 100% CPU on one core. When a new iTunes were released last week I hoped this was solved. It was not.

2012-11-24

Install Tellstick on Fedora

Tellstick is a USB device that makes it possible for you to control different electrical devices in your house. It is very useful when you would like to control lamps wireless.

I did this to install Tellstick on my Fedora server:

UDEV configuration
Create the file /etc/udev/rules.d/99-tellstick.ruleswith the following content:

KERNEL=="ttyUSB*", BUS=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c30", NAME="tellstick", GROUP="niklas"
"niklas" in the GROUP part shall of course be changed to something useful in your case. Specify a group where the user, who will use the tellstick, are included.

Install telldus software
Download source code by reading installation instructions. Patch it via the information found here.
Build and install the software according to instructions.
Create the file /etc/ld.so.conf.d/tellduscore.conf with the following content:
 /usr/local/lib
 If the lib is installed somewhere else you have to change the row above.

Install tellstickController
TellstickController is a simple and, in my opinion, useful tool which you can use to program your lamps relative sunrise and sunset.
Download src-rpm for perl-datetime-event-sunrise from RepoForge. Create an RPM for your Fedora version by reading instructions and install the RPM.
Download and install tellstickController by reading instructions.

Start tellstickd
To start the daemon, add the following rows in /etc/rc.d/rc.local:


#!/bin/sh
# Start telldusd
telldusd
sleep 3
/home/niklas/SW/tellstick/tellstickControllerTdtool -d
I found good info around adding things in rc.local here.