Montag, 30. Juli 2012

Raspberry PI

Raspian Linux image

- write to a ntfs external HD, 

configure /etc/fstab according to http://www.liberiangeek.net/2012/04/auto-mount-windows-ntfs-partitions-in-ubuntu-12-04-precise-pangolin/

UUID="822482F72482ED8B" /media/Pladde ntfs-3g defaults,auto,uid=1000,gid=1000,umask=000 0 0

- podcast: 

install "podracer"

- mail server and sending mails using the gmail account

mutt is your tool of choice
use this instruction from lifehacker 
and then, from 2013 onward sudo apt-get install  libsasl2-modules
  then echo "hello from raspi"   | mutt test@mail.com test

- couchpotato: dowload movies when the are available

follow this guide http://raspberry-blog.com/howto/installing-couchpotato-on-raspberry-pi/


- rtmp

Some radio streams are not available as mp3... solution: use a script to dump the stream and convert it to the mp3 Here the bash script, install rtmdump and mplayer and avconv


#!/bin/bash
URL="${1}"
FILEmp3="${URL##*\/}"
FILEwav="${FILEmp3%%.*}.wav"
FILE3="${FILEwav%%.*}.mp3"
WDIR="$(mktemp -d "/tmp/rtpdump.XXXXXX")"
trap 'rm -rf "${WDIR}"' EXIT INT HUP
rtmpdump -r ${URL} -o ${WDIR}/${FILEmp3}
mplayer ${WDIR}/${FILEmp3} -ao pcm:file=${FILEwav}
avconv -i $FILEwav  "$FILE3"
rm $FILEwav




- Samba 

according to http://www.forum-raspberrypi.de/Thread-tutorial-samba-windows-freigabe-server-installation-raspbian-debian and dont forget to add the support for symlinks in case you would like to use an mounted device

http://www.maistech.net/2011/09/ubuntu-server-samba-sharing-with.html


- Sync your data do the cloud

Dropbox aint working: no support for the ARM chip. Therefore I used BOX.com, as descriebd here:
http://linuxfordummies.org/mount-your-box-com-account-in-linux/
EDIT: dropbox seems to work now: see https://github.com/andreafabrizi/Dropbox-Uploader 

- Check & Monitor temperature... and mail it to you

https://github.com/fechu/PiTemp nice script for local display
and
https://sites.google.com/site/benhewitttechnology/raspberry-pi-with-xivley for the internet of things (may fail if network connection is to slow while torrenting)

- control podcast remote with a smartphone:

install vlc
and make sure you use the 3.5mm jack (thanks to this post)
sudo modprobe snd_bcm2835sudo amixer cset numid=3 1

edit  sudo nano /usr/share/vlc/lua/http/.hosts according to http://wiki.videolan.org/Documentation:Modules/http_intf#Access_control
start vlc on boot based on http://mvpmc.wikispaces.com/vlc the script , add  the --extraintf=http in the vlc call at the end and 

and finally add the script with 
update-rc.d vlc defaults

Sonntag, 18. März 2012

convert youtube to mp3 bash script

this nice script will do it
call it youtube2mp3.sh and call it up like  youtube2mp3 "url youtube" "title.mp3"


x=~/.youtube-dl-$RANDOM-$RANDOM.flv
youtube-dl --output=$x --format=18 "$1"
ffmpeg -i $x -acodec libmp3lame -ac 2 -ab 128k -vn -y "$2"
rm $x

prerequisites here; http://askubuntu.com/questions/218932/convert-youtube-to-mp3