Social Icons

Install MiniDLNA on Raspberry Pi



*These steps works both on Raspbian Wheezy & Jessie*

Install MiniDLNA
sudo apt-get update
sudo apt-get install minidlna


Open and edit MiniDLNA's configuration file
sudo vi /etc/minidlna.conf

Configure your media directory
media_dir=V,/media/NASDRIVE/Movies

Note:
Adding "V," as prefix to the path will restrict the media dir to video content type.
Similarly, "A," for Audio and "P," for pictures respectively.

Set a name for your DLNA servers, this will show up on clients
friendly_name=RasPiDLNA

Set inotify to yes to let MiniDLNA automatically pick up file / media changes
inotify=yes
notify_interval=300 

Un-comment the line
log_dir=/var/log

Add minidlna user to pi group
sudo usermod -a -G pi minidlna

Force Restart MiniDLNA to let it build it's media database
sudo service minidlna force-reload

Check the logs at /var/logs (check if your media library is being indexed)
tail -f  minidlna.log



Viola... Your video collection should soon  show up on your DLNA devices :)

Internet Ban? Bypass blockade in easy steps


Time and again several governments and states have tried to execute their dictatorship by imposing ban on contents on internet. Some time it has been a blanket ban on a long list of file sharing sites, some times it has been discussion forums, some times popular video sharing sites like vimeo, or simple paste tool like pastebin.

And probably such problems will be more on rise in countries like India, China, Pakistan, Middle Eastern countries and many others where there is hardly any Data Protection laws and it's just the whimsical decision of government that they can bring down any website any time for any period of time.

Fortunately for us, that's not the end of the road. Internet was always free and open and that's how it is meant to be. To accept the right and reject the wrong should rest in the hands of common netizens, no corporates or governments should dictate it.

To cut the long story short, If you are unable to browse your favorite discussion forum, or unable to see short film video posted by your film-maker friend, or unable to see a porn clip (if it's not illegal to see in your country) you badly wanted to, then here is the solution.

While there are many options to bypass around such blockades, I am here to advice about two simple solutions which any layman without any techie background can opt for.
  1. Tor Browser
  2. VPN
Each have their merits and demerits as discussed below:

Tor Browser
You can download the Tor Browser and start using it for anonymous browsing, however the browser does not supports 3rd party plugins like Adobe Flash, etc. Thus any Flash enabled video sites might not give you full experience. To know more how tor works you can read here

VPN
Virtual Private Network is the ultimate solution where in you can prevent your ISP and Government from snooping into your data packets (well make sure it's a good VPN service with repute) and bypass all blockades and also hide your real identity on the web. This can also allow you to make VOIP calls where it is otherwise blocked. VPNs can be free or paid but it is always recommended to go for a reputed paid VPN service which does not logs your activity. There are lot of reviews over the Internet to guide you to make an informed decision.

As a suggestion (with no responsibility whatsoever) we do recommend the following VPNs
 You can start with a Free service of CyberGhost to get a feel and gradually choose as you opt to. It simple simply go to their website and download their VPN client, install the same on your device (PC / Mac / Linux / iOS / Android) and start using web anonymously.
 
This is a basic guide for anonymous web surfing and the author / publisher of this article does not encourage you to do anything illegal as per the laws of your state. Happy Surfing...

Dynamic DNS the easy way

THIS GUIDE IS NOT VALID ANYMORE SINCE dns4e.com IS NOT AVAILABLE ANYMORE
PLEASE REFER TO OUR OLD GUIDE HERE
In a previous post quite sometime back we explained how to configure a DynDNS service on your Raspberry pi or any similar unix system. This is no different, except for the super easy way of doing the similar thing.

Here we would be using the free DynDNS service of dns4e.com

Step. 1
Goto to https://dns4e.com/registration and sign up

Step. 2
Verify the registered email to activate the service

Step. 3
Add a zone in your account (e.g.: techjawab.dns4e.net)
You can add your own host (which you might have bought separately), in that case you will also need to update the name-servers after this step.

Step. 4
Setup a cron job to update your dynamic ip to dns4e
sudo crontab -e

In the editor add the following line on a new line to update your DNS every 10 minutes
*/10 * * * * curl 'https://api.dns4e.com/v7/<zone address>/a' --user '<Public Key>:<Secret Key>' --data '' -X POST

That's all, you should be able to reach out to your hosted server via the zone address you just configured after the DNS propagates.

Note: If your raspberry pi or unix box is behind a router or firewall then you might have to do port forwarding accordingly to enable the outside world to reach your server.

How to install Transmission on Raspberry Pi (with external storage)


Well there are already many guides on this topic, however, what I found is not all are in complete detail, or misses out on something of the other (completely personal opinion though :) ). Here comes my guide to install Transmission BitTorrent client on headless Raspberry Pi. This will especially be helpful for users who have followed my guides on setting up NAS drive with RasPi.

Let's Start...

Step 1
Install transmission
sudo apt-get update
sudo apt-get install transmission-daemon

Step 2
Create required directories on your NAS storage (path to storage is assumed as /media/NASDRIVE)
mkdir -p /media/NASDRIVE/Torrent_inprogress
mkdir -p /media/NASDRIVE/Torrent_complete

Step 3
Permissions
Transmission by default runs with user "debian-transmission", as it is recommended not to change this due to security reasons. In our setup the NASDRIVE has the permission set as 770 for pi : pi. Thus we will add user "debian-transmission" to "pi" group to give rwx access on our NASDRIVE. You can go ahead and modify this step as per your security requirement, but just make sure your torrent download directories are having rw access for "debian-transmission" user.
sudo usermod -a -G pi debian-transmission

Step 4
Configure Transmission
While most of the parameters are self explanatory in the conf file, you can use the file given below, except for modify the parameters download-dir, incomplete-dir, rpc-username, rpc-password 
Note: rpc-password will automatically converted to hashstring on saving the file
sudo nano /etc/transmission-daemon/settings.json


Step 5
Reload Transmission
Do not restart, It overwrites the configuration file in that case
sudo service transmission-daemon reload

Step 6
Open web browser and hit http://your_raspberry_pi_IP:9091
Enter the user id and password you've configured, and viola!

How to setup ownCloud 7 on Raspberry Pi





This is the second installment of the guide to install ownCloud on Raspberry Pi. Our earlier guide was for ownCloud 5.0.20 (Enterprise Edition) and can be found here.

There has been certain changes with the latest version of ownCloud 7, and this guide should be able to help you to sail through smooth. Without much ado about what is ownCloud (which you already know) let's dive deep into tech details.

Following software / packages we will be using for this setup, ideal for a personal cloud on Raspberry Pi:
  • ownCloud 7
  • Nginx
  • OpenSSL
  • php 5
  • Raspbian Wheezy
1. Tuning up the Raspberry Pi
Following changes needs to be made under Raspberry Pi configuration
sudo raspi-config

a. Expand the root filesystem to have enough space for the cloud
    Select "Expand Filesystem"

b. Change locale to en_US.UTF8
    Select "Internationalisation  Options"

c. Memory split, allocate 16M to video graphics (if you are not using X-server)
    Select "Advanced Options" --> "Memory Split"

d. Overclock to Modest or Medium (Optional Step)
    Select "Overclock" (You might have to reboot if asked)

2. Updating the package lists on Raspberry Pi
  sudo apt-get update
    sudo apt-get upgrade

3. Creating users (Raspbian might already have is user & group)
    sudo groupadd www-data
    sudo usermod -a -G www-data www-data

4. Installing the packages
    sudo apt-get install nginx openssl ssl-cert php5-cli php5-sqlite php5-gd php5-common php5-cgi sqlite3 php-pear php-apc curl libapr1 libtool curl libcurl4-openssl-dev php-xml-parser php5 php5-dev php5-gd php5-fpm memcached php5-memcache varnish


5. Make sure php5-curl is not installed
    sudo apt-get --purge remove php5-curl

6. Creating your SSL certificates for 2 years
    sudo openssl req $@ -new -x509 -days 730 -nodes -out /etc/nginx/cert.pem -keyout /etc/nginx/cert.key

   
sudo chmod 600 /etc/nginx/cert.pem
   
sudo chmod 600 /etc/nginx/cert.key

7. Configuring Ngnix web server
    sudo nano /etc/nginx/sites-available/default

    Copy and replace the entire content below:
    Note: You'll have to replace technet.example.com with the local IP of your Raspberry Pi or the domain name (make sure it matches with the details you have provided to create the certificate, else ownCloud won't work). If you have planned instead to use any Dynamic DNS domain, then use your  domain name instead of the local IP address. You can follow our guide for setting up a Dynamic DNS domain.

8. Configuring max upload limit in php
    sudo nano /etc/php5/fpm/php.ini

    Tip: Use ctrl+w to search below lines and update:
    upload_max_filesize = 1000M
    post_max_size = 1000M

9. Configuring PHP 
    sudo nano /etc/php5/fpm/pool.d/www.conf
    Change the following line from:
    listen = /var/run/php5-fpm.sock
    to 
    listen = 127.0.0.1:9000

    sudo nano /etc/dphys-swapfile
    Change the following line from:
    CONF_SWAPSIZE=100
    to 
    CONF_SWAPSIZE=512

10. Restart web server and Php
    sudo /etc/init.d/php5-fpm restart
    sudo /etc/init.d/nginx restart

11. Install ownCloud (version 7.0.1 used here)
    sudo mkdir -p /var/www/owncloud
    sudo wget https://download.owncloud.org/community/owncloud-7.0.1.tar.bz2
    sudo tar xvf owncloud-7.0.1.tar.bz2
    sudo mv owncloud/ /var/www/
    sudo chown -R www-data:www-data /var/www
    rm -rf owncloud owncloud-7.0.1.tar.bz2

12. Setup admin account
     While setting up the admin account you should provide the path to your data folder. You can ideally set this to your NAS drive or external drive which you may have mounted. Owncloud will complain and not proceed with admin account if the data directory path is not readable & writable by the user www-data. Also it should not be readable by "others". You can refer to our guide here for setting up appropriate permission before proceeding to create the admin account.
     Now in the browser, login to the ip address of Raspberry Pi or if you have configured your domain name then use that and set up the admin account.
    https://yourdomain.com    or    https://192.168.XXX.XX


That's all... Celebrate the fun... Fly high on clouds... and if you liked this guide, got benefited or feel worth reading kindly do share with your network, and share your comments.