Tuesday, 14 January 2014

OwnCloud Raspberry Pi




Owncloud is like dropbox, but then local and hosted on your OWN Raspberry Pi!
Features of Owncloud:
Acces your data
Sync your data
share your data
Calendar share
And more!

Here we go!

sudo aptitude install nginx php5-fpm php5-sqlite php5-gd
[ENTER]
cd /etc/nginx/sites-available
[ENTER]
sudo nano owncloud.vhost
[ENTER]
Copy this txt info the owncloud.vhost file

# redirect http to https.
#server {
#  listen 80;
#  server_name owncloud.example.org;
#  rewrite ^ https://$server_name$request_uri? permanent;  # enforce https
#}
 
# owncloud (ssl/tls)
server {
  #listen 443 ssl;
  listen 80;
  #ssl_certificate /etc/nginx/certs/server.crt;
  #ssl_certificate_key /etc/nginx/certs/server.key;
  #server_name localhost;
  root /usr/share/nginx/www/owncloud;
  index index.php;
  client_max_body_size 1000M; # set maximum upload size
 
  # deny direct access
  location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
    deny all;
  }
 
  # default try order
  location / {
    try_files $uri $uri/ @webdav;
  }
 
  # owncloud WebDAV
  location @webdav {
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }
 
  # enable php
  location ~ \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param HTTPS on;
    include fastcgi_params;
  }
}




sudo ln -s /etc/nginx/sites-available/owncloud.vhost /etc/nginx/sites-enabled/
[ENTER]
sudo nano /etc/php5/fpm/php.ini
ADD THE FOLLOWING:
extension=sqlite.so
extension=zip.so
extension=json.so
extension=xmlrpc.so
extension=curl.so
extension=gd.so
Hit control + X to close/save the file.
Now download Owncloud. 
Check the website for the newest release: http://mirrors.owncloud.org/releases/
cd /home/pi
[ENTER]
wget http://download.owncloud.org/community/owncloud-4.5.7.tar.bz2
[ENTER]
sudo tar -xjf owncloud-4.5.7.tar.bz2

(CHANGE THE 4.7.5 TO THE CURRENT VERSION)

sudo chown -R www-data:www-data owncloud
[ENTER]
sudo mkdir /usr/share/nginx/www/owncloud[ENTER]sudo mv owncloud /usr/share/nginx/www/
[ENTER]
sudo /etc/init.d/nginx start[ENTER]sudo nano /etc/php5/fpm/php.ini
And change the  
upload_max_filesize = 2M (from 2MB to the max size you want)
post_max_size = 6M (To the size you want)

Reboot your raspberry pi:
Sudo reboot now
[ENTER]

Now acces the Owncloud page! http://RASPBERRYPIIPADRES




Register your own account, you are good to go!

Raspberry Pi CherryMusic - Music Streaming - Spotify look-a-like


A music streaming server written in python, Stream your own music collection to all your devices!
* You can listen to your music on all HTML5 compliant devices, that includes your pretty smart phone (Android or iPhone) as well as just about any modern browser.
* You can create accounts for your friends and share playlists. Just like ol'times, give away a cassette tape.* CherryMusic can automatically fetch the album cover art for all your music. But don't worry, we don't change anything in your collection.* CherryMusic has a built-in database, that will index your music. Find your favorite song in an instant!* And for those who have AppleTV, yes! It does also work with Apple TV.
Tested CherryMusic Raspberry pi by my self now for a few hours, it's great! And it's so easy to install..
How to install:

mkdir /home/pi/music
sudo apt-get -y install imagemagick vorbis-tools lame flac
git clone -b master https://github.com/devsnd/cherrymusic.git

Run python cherrymusic --setup --port 8080 in the CherryMusic directory.
Go to http://raspberry-pi-ip-adres:8080 for basic configuration and later the web client. 

Setup looks like this, edit the Media base dir. That's the important one!


Settings saved? Control + C to close server.

In my case, the config file was not saved. Let's edit the file manually: nano /home/pi/.config/cherrymusic/cherrymusic.conf
Edit the basedir to: /home/pi/Music
Control + x to close/save the file.
python cherrymusic to start the server!

Go to: http://raspberry-pi-ip-adres:8080

The putty session must be active. If you close the session. The server will stop.
2 options to run the server in the background.
1: start server with command: nohup  python cherrymusic --port 8080 &
2: Use the program "screen" to keep the putty session alive!

Note: Music files with special characters in it, like: Ã˜ é ü wont load in the playlist. Change it to normal characters. Problem probably only occur with python 2.x

taken from - http://raspberrypihelp.net/tutorials/44-raspberry-pi-cherrymusic-music-streaming

Fail 2 ban Raspberry Pi

Raspberry Pi SSH security - Fail2ban

There are a lot of shady 
people on the internet, scanning IP ranges for vulnerable machines/raspberry pi's.
With a simple program called Fail2ban you can kick out the bruteforcers.
After 6 non non succeeded ssh login's the IP of the client will be blocked by default for 10 minutes.
Your raspberry pi is a lot safer now!
How to:

sudo apt-get update
[ENTER]
sudo apt-get install fail2ban
[enter]

Now fail2ban is installed! Easy isn't it ?
You can change settings @ /etc/fail2ban/jail.conf
1st picture are the common settings, 2nd picture is specific for SSH.






Wednesday, 8 January 2014

Android 4.3 Jelly Bean Enable Developer Mode

Random Post for me really

To enable USB debugging or developer mode in android 4.3 do the following

Settings > About Phone > Tap Build Number a few times > It will say your a developer now > Go back and you will see developer options above About Phone > Check USB Debugging option in Developer Options

Tuesday, 7 January 2014

Raspberry Pi Cam to MMS or Email or Tweet

PiCam-image-requester

Install this script on your Pi with Picam and portforward your http port.
enter the details in the settings on your textlocal inbox.
once you have set it up
send a text to your inbox with either "MMS" or "email" or "tweet" and you will get an image back!
I have used apache for this and setup postfix to send the email.
Does require a Textlocal account.
Contact me if you need to use a different providers API.
Click here to go to the github - https://github.com/txt3rob/PiCam-image-requester

config.php

// Textlocal account details
$txtusername = '';  // Your textlocal username/email
$hash = '';   // Your Textlocal API hash
$keyword = ''; // Your Inbox Keyword ensure you add a space

// MMS Message details
$mmsmessage = "Your Requested Image";  // MMS message with pic
$sender = 'Pi Cam';  // Sender ID
$test = "TRUE";  // Set to FALSE to send the MMS true is set to test it's working

//Authorised Numbers array
$auth = array('447741256987');  // add your number or any other numbers here to allow them to use the service

//Twitter Config
// Get your details from http://dev.twitter.com
$consumer_key = '';  
$consumer_secret = '';
$access_token = '';
$access_token_secret = '';
$tweetstatus = '';

//Email Config
$efrom = "PI CAM <FROM EMAIL ADDRESS>";  // Sender email address 
$eto = "Email test <TOEMAILADDRESS>"; // email address to send all pics to
$subject = "Pi Cam"; // Email subject

Run the following command as root
sudo echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
This repo includes codebird - https://github.com/jublonet/codebird-php
Hopefully all is clear for you to set this up.
Any help or donations send to txt3rob@gmail.com

Friday, 3 January 2014

Easy installer for hamachi for your raspberry pi

Install Hamachi on your Raspberry Pi
copy and paste the below
sudo wget https://raw.github.com/txt3rob/hamachi-pi/master/hamachi.sh
sudo chmod 777 hamachi.sh
sudo ./hamachi.sh
follow the on screen instructions and your raspberry pi will be added to your hamachi network.
Need any help or wish to donate to me my email address is txt3rob@gmail.com

Thursday, 12 December 2013

SMS Command Server

I've been a little busy with loads of different projects recently and also entering a API competition
So I made this nice little script.


You can text a keyword to the raspberry pi and then it will execute the command associated with it.
It also has for a bit of security only allow from 1 number (could be altered to use an array of numbers)

Please review and let me know!

This does use the textlocal API but I can use the SMSPI api as well to control things :)

Amazon

Donate

Donate Towards More Raspberry PI's for Projects