Sonntag, 29. April 2018

minecraft server on pi

Try https://pimylifeup.com/raspberry-pi-minecraft-server/

Samstag, 25. November 2017

torrent i2p

inspired by https://www.deepdotweb.com/2016/12/31/torrenting-dark-net/

Install i2p accorindg to https://geti2p.net/en/download/debian

then follow instruction as in https://rebuildingalexandria.wordpress.com/2012/02/21/secure-and-anonymous-file-sharing-using-torrents-on-the-i2p-network-library-nu-exiles-take-a-look/


some hints that might help to get the beast running
https://github.com/m6urns/i2pberry/blob/master/README.md

Samstag, 17. Dezember 2016

surveillance cam : zoneminder and rasperry pi model b+

got a pi b+ model from straubson and installed: raspian jessy on it.

- add a file "ssh" in the /boot/ directory so you can access the pi without using a monitor, change the password afterwards.
Based on  https://bkjaya.wordpress.com/2016/11/23/how-to-install-zoneminder-1-29-0-on-raspberry-pi-3-with-raspbian-8-1-jessy-64-bit/  adapted it to work following these steps
-add zhe Jessie backports
sudo gedit  /etc/apt/sources.list
-add following line to the bottom of the file and save
deb http://http.debian.net/debian jessie-backports main
You will encounter signature errors, to
-fix those errors run following on the terminal

gpg --keyserver pgpkeys.mit.edu --recv-key  8B48AD6246925553
gpg -a --export 8B48AD6246925553 | sudo apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key  7638D0442B90D010
gpg -a --export 7638D0442B90D010 | sudo apt-key add -

-Then run on the terminal
sudo apt-get update
-Install PHP, and MySQL server. You will be prompted to set a MySQL password
sudo apt-get install php5 mysql-server php-pear php5-mysql php5-gd
- Then install zoneminder using the software center of Raspbian
sudo apt-get install zoneminder

Create Zoneminder database in MySQL
There is a line missing from zm_create.sql that is packed with this version.
-If you search /usr/share/zoneminder/db/zm_create.sql (On Debian Wheezy, Your location may differ) for line:

CREATE TABLE `Logs` (

Simply add a line above this which reads:

DROP TABLE IF EXISTS `Logs`;

-Run following on the terminal

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.*
to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload
sudo chmod 740 /etc/zm/zm.conf
sudo chown root:www-data /etc/zm/zm.conf
sudo systemctl enable zoneminder.service
sudo adduser www-data video
sudo ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf
sudo a2enmod cgi
sudo a2enconf zoneminder
sudo a2enmod rewrite
sudo chown -R www-data:www-data /usr/share/zoneminder/
sudo systemctl enable zoneminder
sudo service zoneminder start

-Adding  timezone to PHP

sudo nano /etc/php5/apache2/php.ini

Edit 894 line to enter your time zone  and save the php.ini file
-then

sudo service apache2 reload

Open Zoneminder http://localhost/zm/

As USB Camera I used a 046d:08da Logitech, Inc. QuickCam Messanger (sic) according to lsusb

the resolution is bad, but, heck lets also account for annonymity

I set it up the following way

Monitor

If the USB camera on your pi tends to crash /stop working: set the resolution to 320 and 240


Zone Setting


Challenge: I want to count people using the biodegradbale bin . ( yep, nerdy...)

"The bin"



False events I get from

a) big cars/semis covering the bin



b) lights of cars passing by at night




Task

Set up zones

Zone 1 setting


zone 2 setting


zone 3



zone 4




and then I added as well a zone to overcome moving shadow induced by the trees/wind

  




Create a event video  every day

Since ffmpeg avconv etc and rasperry is not a love story, due to missing hardware accelerated video encoding of those packages use gstreamer - with that you use the very powerfull GPU, and it is actually converting the thousands of images to a vid faster than my WIN10 machine. Inspired , I managed to get the it run following this steps
sudo apt-get install gstreamer1.0-tools
sudo sh -c 'echo deb http://vontaene.de/raspbian-updates/ . main >> /etc/apt/sources.list'
add the missing key for this repo

gpg --recv-keys 0C667A3E
gpg -a --export 0C667A3E | sudo apt-key add -
 update your machine
sudo apt-get update
sudo apt-get -y upgrade
Install all necessary OPENMAX plugins for gstreamer

sudo apt-get install libgstreamer1.0-0 liborc-0.4-0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-alsa gstreamer1.0-omx gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-x libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
done

Create a bash script to create a movie out of daily images
and upload it to youtube based
install sudo apt-get python-pip 
based on on http://stackoverflow.com/questions/36962260/batch-upload-videos-to-youtube-via-command-line-python

#!/bin/bash
# Ugly script to generate AVI files for youtube  from zoneminder events
# Change the followingvariables to accomodate your install and where you want the videos exported, there are more links in the code to check

events_dir=/var/cache/zoneminder/events/
THEDATE=$(date --date="today" +%Y-%m-%d)
MYTITLE="KompostNutzer-Gaselstr-$THEDATE"

#cd $events_dir
# If you don't want the ENTIRE server's events and just want the latest week's worth
# then just add something like -mtime -7 before the "-print" part.  That's what I did later so I could have a weekly cron job.
find $events_dir -name "*-capture.jpg" -mtime -1 -print > /home/pi/temp/unsortedallevents.txt
sort -n /home/pi/temp/unsortedallevents.txt > /home/pi/temp/allevents.txt
filename='/home/pi/temp/allevents.txt'

echo Start copying files ....
cd temp/
aa=0
while read p; do
#    echo $p
cp $p `printf "%04d" $aa`.jpg; aa=$(($aa+1))
done < $filename

echo Start creating vid files .... grab a coffee
#gsttramer create movie
gst-launch-1.0 multifilesrc location=%04d.jpg index=1 caps="image/jpeg,framerate=24/1" ! jpegdec ! omxh264enc ! avimux ! filesink location=daily.avi

#upload
youtube-upload --title=$MYTITLE daily.avi

cd

#sleep 10
rm /home/pi/temp/*.jpg
rm /home/pi/temp/*.avi
rm /home/pi/temp/allevents.txt
rm /home/pi/temp/unsortedallevents.txt
exit

run the script as cron every nite

Mail events to Googledrive spreadsheet

install mail agent: http://www.sbprojects.com/projects/raspberrypi/exim4.php I prefer  exim4 with my gmail account, set gmail account to accept unsecure (sic) apps
since zoneminder EMAIL send is PITA
use https://ifttt.com/channels/google_drive/actions/81-add-row-to-spreadsheet

install

apt-get install html-xml-utils 

and add run with cron or a script for daily entries with a date and number events of the last 24


wget http://192.168.1.100/zm/index.php?view=events&page=1&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3E%3D&filter[terms][0][val]=-1+day&filter[terms][1][cnj]=and&filter[terms][1][attr]=MonitorId&filter[terms][1][op]=%3D&filter[terms][1][val]=1

hxnormalize -x zr49zcf | hxselect -s '\n' -c "h2" > FILE
sed "s@Events@@g" FILE > EVENTS
THEDATE=$(date --date="today" +%Y-%m-%d)
mail -s "$THEDATE #ZM" trigger@applet.ifttt.com < EVENTS

and in case: the USB cam does suddenly stops working: unplug cam reboot device use a different port, etc see
https://www.raspberrypi.org/forums/viewtopic.php?t=17212

I have script which checks if the conenction zoneminder usb cam is broken, and reboots the pi, which usually brings the cam back on
#/bin/bash
echo Checking if USB Cam is still running.....
cd /home/pi/temp/

#extracting last 10min of syslog
sed -n "/^$(date --date='10 minutes ago' '+%b %_d %H:%M')/,\$p" /var/log/syslog
> last10min.txt

#if usb cam is not working..simply reboot.
if grep -q "Failed to start capture stream: Broken pipe" last10min.txt ; ##note
the space after the string you are searching for
then
echo "Cam not working" ; echo "restarted zoneminder due to broken pipe of USBCAM
" | mail -s "zm restarted" david.oesch@gmail.com ; sleep 10m ; rm last10min.txt
; /sbin/reboot
else
echo "Cam working"
fi

#if usb cam is not working..simply reboot.
if grep -q "Failed to set video format: Device or resource busy" last10min.txt ;
 ##note the space after the string you are searching for
then
echo "Cam not working" ; echo "restarted zoneminder due to Device busy" | mail -
s "zm restarted" david.oesch@gmail.com ; sleep 10m ; rm last10min.txt ; /sbin/re
boot
else
echo "Cam working"; rm last10min.txt
fi


exit


To omit zoneminder running at night I halt via sunwait command on bootup:

install
wget http://www.risacher.org/sunwait/sunwait-20041208.tar.gz
tar xvzf sunwait-20041208.tar.gz
cd sunwait-20041208/
ls
make
sudo cp sunwait /usr/local/bin


then launch it on boot



i) Create a script called mystartup.sh in /etc/init.d/ directory(login as root)

# vi /etc/init.d/mystartup.sh

ii) Add commands to this script one by one:

#!/bin/bash
/usr/local/bin/sunwait civ down -1:00:00 46.90860N 7.41549E; /usr/sbin/service zoneminder stop

iii) Setup executable permission on script:
# chmod +x /etc/init.d/mystartup.sh
iv)Make sure this script get executed every time Debian Linux system boot up/comes up:

# update-rc.d mystartup.sh defaults 100


Where,

mystartup.sh: Your startup script name

defaults : The argument ‘defaults’ refers to the default runlevels, which are 2 through 5.

100 : Number 100 means script will get executed before any script containing number 101. Just run the command ls –l /etc/rc3.d/ and you will see all script soft linked to /etc/init.d with numbers.

Next time you reboot the system, you custom command or script will get executed via mystartup.sh. You can add more commands to this file or even call other shell/perl scripts from this file too.

And of course I have at sixish in the morning a cron which starts up zoneminder

Upload Event Images

Download gdrive-linux-rpi and install it according to this guide 

Analogue above, create a script called zm_alatm which scans messages for alarmstates and add it to run update-rc.d


#!/bin/bash
tail -f /var/log/messages | grep --line-buffered 'Gone into alarm state' | while read line; do cp -p "`find /var/cache/zoneminder/events/1/$(date +"%y/%m/%d/") -name "*aptur*" -printf "%p\n" | sort -rn | head -n 1`" /home/pi/eventimages/$(date +"%Y%m%d%H%M").jpg;  done




the Result? Here


UPDATE: 2018

with "stretch" if followed this https://wiki.zoneminder.com/Raspbian
- just install php (not php5)
- for raspberry pi camera modul follow http://marcel.duketown.com/?p=651

Samstag, 30. März 2013

XBMC and Raspberry Pi

Teste raspbmc: well the official package showed already some errors when an apt-get update was done... so I switced to xbian.org. I like this one since couchpotatoe and transmission are already built in, and I can install other packages I need... since it is based on debian

Xbian runs fine, but there seems to be an issue with my SD Card ( a transcend SDHC class 10 8GB card) file system gets corrupted after approx one week

Back up raspian/xbain installation:

Followed this instruction 


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

Sonntag, 6. November 2011

Dienstag, 9. November 2010

ftp server vsftpd

after  adding dyndns for static IP access
sudo apt-get install vsftpd
added an ftp user
sudo adduser 

Samstag, 24. Juli 2010

2010 eddition: ubuntu server 10.04 on a DELL OPTLIPLEX G620

Well ,my T22 is dying after 4 years. So I got a new old DELL and the what I will do is
  • install  ubuntu 10.04 server edition
  • LAMP and SAMBA Packages
and then hook up my webcam, transmission including moblock (shall i give a try to the TOR and proxify as well ?) and  a mail server... then lets start
  • dowloaded and installed ubuntu-10.04-server-i386.iso 
  • installe LAMP, OpenSSH, SAMBA fileserver and MailServer
  • no root pwd on mysql
Postinstallation

done

using this time 192.168.1.221


  • SAMBA 
Follow this guide:http://www.unixmen.com/linux-tutorials/566-install-samba-server-in-ubuntu-karmic but used the existing user for
sudo smbpasswd  -a   "myuser"
 
Adding 
follow symlinks = yes
wide links = yes
unix extensions = no
to have access as well to mounted external harddrives
  • Transmission torrent
Following this guide http://www.techdrivein.com/2010/06/install-new-improved-transmission-20-in.html  
used this settings $ sudo nano /var/lib/transmission-daemon/info/settings.json
{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "cache-size-mb": 2,
    "dht-enabled": true,
    "download-dir": "/home/daevu/download",
    "download-limit": 1000,
    "download-limit-enabled": 0,
    "encryption": 2,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/home/daevu/Downloads",
    "incomplete-dir-enabled": false,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 53958,
    "peer-port-random-high": 64000,
    "peer-port-random-low": 42000,
    "peer-port-random-on-start": true,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": false,
    "preallocation": 1,
    "proxy": "",
    "proxy-auth-enabled": false,
    "proxy-auth-password": "",
    "proxy-auth-username": "",
    "proxy-enabled": false,
    "proxy-port": 80,
    "proxy-type": 0,
    "ratio-limit": 0.2500,
    "ratio-limit-enabled": true,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{81ed8acf066233eabf1621d75adc85f0a3faa20b8021nMli",
    "rpc-port": 9091,
    "rpc-username": "daevu",
    "rpc-whitelist": "127.0.0.1,192.168.*.*",
    "rpc-whitelist-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 5,
    "speed-limit-up-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14,
    "watch-dir": "/home/daevu/torrents/",
    "watch-dir-enabled": true
}
 





  •  JdDownloader: first install vncserver:
  • apt-get install -y vnc4server xinetd
    run vnc4passwd (enter desired pwd
    to run vncserver on startup: add this lieno to /etc/rc.local just before exit =
    • su "myusername" -c 'vnc4server :1 -geometry 1024x768 '
  • Install JAVA (since transmission works not with OpenJDK) 
    sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
    sudo apt-get update 
    sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk sun-java6-plugin 
  • Download transmission over VNC
    $wget -c http://212.117.163.148/jd.sh
    After download let's make it executable and run it :
    $chmod +x jd.sh
    $./jd.sh


  • INSTALL WLAN Chipset (ZyDas1211) (Follow  http://wiki.ubuntuusers.de/WLAN/wpa_supplicant
     
    • To get MAC Address:
      •  ifconfig -a
    • to initially start it
      • sudo ifconfig wlan0 up
  • Edit /etc/initd.interfaces so it will start from boot  (comment out eth0)
##WLAN
auto wlan0
iface wlan0 inet static
address "your desired IP"
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
wpa-ssid "mynetwork"
wpa-psk "mypassphrase"
wpa-proto RSN
wpa-key_mgmt WPA-PSK
wpa-pairwise CCMP
wpa-group TKIP
         
         

TO DO
  • move torrent after finish: http://1000umbrellas.com/2010/04/28/how-to-automatically-move-and-remove-transmission-daemon-downloads does not work
  • TOR & privoxy
  • BAckup Pics and docs on the machine




    Dienstag, 13. Juli 2010

    transmission torretn client 2.0 on karmic

    according to http://www.techdrivein.com/2010/06/install-new-improved-transmission-20-in.html

    Montag, 12. April 2010

    JDOWNLOADER - Rapidshare on the headless machine

    Since torrents are getting scarce on the net, rapidshare seems to be an option

    Install
    sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk sun-java6-plugin fluxbox tightvncserver
    Setting up vnc server 
    vncpasswd
    vncserver


    Connect with VncClient, like tightvnc (according to the port and pwd selected above)


    in the vnc Window (X server needed) install jdwonloader


    with
    $wget -c http://212.117.163.148/jd.sh
    After download let's make it executable and run it :
    $chmod +x jd.sh
    $./jd.sh


    Since my headless machine has only 128MB RAM , Jdownloader crashes after 5hours or so. Therefore I kill the java PID and restart it using cron (Assuming there is a vnc session on display1 and I configured JDownloader to automatically restart the app on startup)

    7 0,6,12,18 * * * killall java >/dev/null 2>&1; export DISPLAY=:1 ;/usr/bin/java -Xmx512m -jar .jd/JDownloader.jar >/dev/null 2>&1
    or even better: start the beast lke this in a vncserver bash

      while true; do killall java; java -Xmx1024m -jar /home/daevu/.jd/JDownloader.jar; sleep 21000; done

    Reference:

    http://service.jdownloader.net/old/wiki.jdownloader.org/indexd69d.html?title=Running_On_A_Headless_Linux_Server
    and
    http://www.skullbox.net/vncserver.php
    and
    http://www.ubuntu-inside.me/2009/02/jdownloader-ultimate-freepremium.html

    Samstag, 6. Februar 2010

    Transmission-daemon disk space in web gui

    follow this intructions: http://forum.transmissionbt.com/viewtopic.php?f=8&t=8610
    go for the lats AJAX solution

    Samstag, 30. Januar 2010

    torrent client, the 2010 edition

    Forget rtorrent, newest releases often report "bencoded" error, therefore swicth to

    tranmission

    sudo apt-get install transmission transmission-deamon

    then edit the /etc/transmission-daemon/settings.json to be compliant with tor privoxy, local port settings, watch dir. Bes sure to sto the deamon before editing the file


    {
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "dht-enabled": true,
    "download-dir": "\/home\/daevu\/finished",
    "encryption": 1,
    "lazy-bitfield-enabled": true,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 62078,
    "peer-port-random-high": 64000,
    "peer-port-random-low": 62000,
    "peer-port-random-on-start": true,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "proxy": "127.0.0.1",
    "proxy-auth-enabled": false,
    "proxy-auth-password": "",
    "proxy-auth-username": "",
    "proxy-enabled": true,
    "proxy-port": 8118,
    "proxy-type": 2,
    "ratio-limit": 2.0000,
    "ratio-limit-enabled": false,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{9da631e4ce6a9d2e6408c781a2c18c41e5f03250qeZzHteA",
    "rpc-port": 9091,
    "rpc-username": "",
    "rpc-whitelist": "192.168.*.*",
    "rpc-whitelist-enabled": true,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 5,
    "speed-limit-up-enabled": true,
    "umask": 18,
    "upload-slots-per-torrent": 14,
    "watch-dir": "\/home\/daevu\/torrents\/",
    "watch-dir-enabled": true
    }



    check on client:
    install daemon
    add torrent
    $ transmission-remote -a one.torrent two.torrent
    transmission-remote -tall --start


    To move finished torretns to a predefined directory

    - sudo apt-get install php5-cli
    - add stop-and-move-finished.php script, modify it to your needs and
    - make a cronjob
    0,10,20,30,40,50 * * * * /usr/bin/php /home/daevu/top-and-move-finished.php >/dev/null 2>&1

    Dienstag, 22. Dezember 2009

    rtorrent in ubuntu karmic

    jus make a script out of:
    http://libtorrent.rakshasa.no/wiki/Install

    Samstag, 12. Dezember 2009

    timelapse movie

    -Install motion
    http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
    edit motion.conf

    # Image width (pixels). Valid range: Camera dependent, default: 352
    width 640

    # Image height (pixels). Valid range: Camera dependent, default: 288
    height 480

    output_normal off




    - set timelapse var (use 10min) get an idea aoubit settings from http://en.wikipedia.org/wiki/Time-lapse

    # Use ffmpeg to encode a timelapse movie
    # Default value 0 = off - else save frame every Nth second
    ffmpeg_timelapse 600

    # The file rollover mode of the timelapse video
    # Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual
    ffmpeg_timelapse_mode manual


    - dowload sunwait http://ppa.launchpad.net/mdeslaur/ubuntu/pool/main/s/sunwait/

    Dienstag, 9. Juni 2009

    Save torrenting moblock peerguardian

    just to be on the save side of life while torrenting
    Using moblock according to
    http://moblock-deb.sourceforge.net/
    additional how to under: https://help.ubuntu.com/community/MoBlock

    Very important: make sure you can still talk to your headless machine!! add doing

    sudo nano /etc/blockcontrol/blockcontrol.conf

    ssh allow all incoming traffic on port 22

    WHITE_TCP_IN="22"

    otherwise you will be blocked out!

    Mittwoch, 4. Februar 2009

    Check network connection

    - create a file check_network.sh

    #!/bin/bash
    x=`ping -c1 google.com 2>&1 | grep unknown`
    if [ ! "$x" = "" ]; then
    echo "It's down!! Attempting to restart."
    /etc/init.d/networking restart
    echo "restarted gurke" | mail -s gurke_restart test@hotmail.com
    fi



    - chmod 777 check_network.sh
    - add it to crontab so it checks it for every hour or so..

    Mittwoch, 2. Juli 2008

    webgui status rtorrent over cgi

    Follow this instructions

    http://www.g-loaded.eu/2007/06/23/rtorstat-a-simple-rtorrent-status-web-page-generator/

    1) to get it run
    edit rtorstat.py and get rid of this:

    Requirement
    try:
    from bencode import bdecode
    except ImportError:
    try:
    from BitTorrent.bencode import bdecode
    except ImportError:
    sys.stderr.write("%s: ERROR: Missing dependency\nbencode.py was not found in current directory or in local BitTorrent Client (Mainline) installation.\n" % sys.argv[0])
    sys.stderr.flush()
    sys.exit(1)

    download somewhere from the web "bencode.py" file and JUST paste it where the previouys lines above were....

    2) access over the your installation
    place 3 files in your cgi-bin (/usr/lib/cgi-bin/) : rtorstat.py, rtorstat.cgi and bencode.py.

    Now, you can visit the web page http://yourdomain.example.org/cgi-bin/rtorstat.cgi

    Samstag, 26. Januar 2008

    External Hard Drive

    get more gigs

    you can not life these days with only 20 gig, so: configuring the External Hard Drive, as recommended in here

    a)add in /etc/fstab

    /dev/sdb1 pladde/ ntfs-3g defaults,force 0 0

    b) After the installation is done, you can optionally add an external hard drive to make it easier to move your data. We'll be using a service called "autofs" to automatically detect your hard drive and make it ready to share on the network each time you plug it in. To install autofs, use this command:

    sudo apt-get install autofs

    Once that finishes, you'll want to connect your external hard drive and find out what device Ubuntu assigns it. After plugging in the hard drive wait a few seconds and then enter this command:

    dmesg | tail

    You should see something very similar to this:


    [47820.164000] sdb: Write Protect is off
    [47820.164000] sdb: Mode Sense: 03 00 00 00
    [47820.164000] sdb: assuming drive cache: write through
    [47820.164000] SCSI device sdb: 398297088 512-byte hdwr sectors (203928 MB)
    [47820.168000] sdb: Write Protect is off
    [47820.168000] sdb: Mode Sense: 03 00 00 00
    [47820.168000] sdb: assuming drive cache: write through
    [47820.168000] sdb: sdb1
    [47820.184000] sd 4:0:0:0: Attached scsi disk sdb
    [47820.184000] sd 4:0:0:0: Attached scsi generic sg2 type 0

    The line "[47820.168000] sdb: sdb1" is what you'll want to pay attention to. This tells us that Ubuntu is assigning the device to "sdb", and it's partition is labeled as "sdb1". "1" being the first and only partition on the disk. Next, we'll what to find out what kind of partition is on the disk. Enter this into the console:

    sudo fdisk -l /dev/sdb

    The "System" column will display what kind of partition it is. Take note on what type of partition it is for the following instructions. If it's "HPFS/NTFS", you'll want to use the "ntfs-3g" driver. If it contains "FAT", you'll use the "vfat" driver. Finally, if it's "Linux", you can just use the "auto" driver. Note, if it is a NTFS partition, you will have to manually install the new NTFS read/write drivers by using:

    sudo apt-get install ntfs-3g

    Next, we'll want to add this information to the autofs service. Use to following command to edit to autofs master configuration file:

    sudo nano /etc/auto.master

    Note: You can replace "nano" with your preferred text editor. To save a file in nano, use the keyboard shortcut Ctrl+O. To exit, press Ctrl+X.

    Now, find the line containing:

    #/misc /etc/auto.misc

    Change it to:

    /misc /etc/auto.misc --timeout=60

    Save it and edit the autofs "miscellaneous" configuration file next by entering this command:

    sudo nano /etc/auto.misc

    Add this to the bottom of the file:

    external -fstype=ntfs-3g :/dev/sdb1

    Remember to replace "ntfs-3g" with the type of driver you found earlier in this section. Note, if you are using "ntfs-3g", you might want to append ",force" , making it "-fstype=ntfs-3g,force". This makes it easier to use uncleanly unmounted drives. This maybe a little risky, but it makes it so much easier to troubleshoot.

    Finally, restart the autofs service:

    sudo /etc/init.d/autofs restart

    Now, every time anything tries to find files in the "/misc/external" directory, Ubuntu will attempt to automatically mount that drive to be used.