Tips and tricks Because you can't remember everything!

Mount an SMB network drive

In this tutorial we will describe how to connect your Raspberry Pi to a network drive and permanently mount it to your system. Even though this article uses a Raspberry Pi as an example to connect to an SMB drive, the steps used can be applied to any Debian based system, such as Ubuntu.

If you have a Raspberry Pi you might have noticed that the storage possibilities are kind of limited unless you have some external storage. Even though you can get SD cards with 64+gb of storage, you probably want more if you have a lot of music and movies that you are streaming through your Pi.

There are several choices when it comes to storage for your Pi, such as network drives, flash drives, or external USB HDDs. Using a network drive you can not only access your files from the Pi, but from any computer connected to your network, which is very convenient.

How to configure WDS function

Step 1
Log into wireless router’s management page.

Step 2
Go to Wireless -> Wireless Settings. Check Enable WDS (Enable WDS bridging).

Step 3
The SSID on the top of the page is the local wireless network name of this router. You can name whatever you like.

Step 4
Click Search/Survey. On the pop-up window, find the SSID and channel of your root AP, and hit Connect.

Step 5
The root AP’s SSID and BSSID (MAC Address) will be filled in automatically. Then please input the wireless security settings and wireless channel to match the ones on the root AP. Click on Save.

Step 6
Go to Wireless Security page to secure the local wireless network of the router itself. The Encryption settings here can be different with your root router if you want to.

Step 7
Click DHCP-> DHCP Settings page. Choose Disable DHCP Server, and click Save button.

Step 8
Go to Network->LAN->Modify the LAN IP Address of the router-Save.
Note:It is suggested to change the router’s IP Address to be in the same network of the root network.For example,if your root router’s IP Address is,IP Range is,while our router’s default LAN IP Address is,we need change our router’s IP Address to be 192.168.1.X.

Step 9
Please go to System Tools-> Reboot page to reboot the unit.

Step 10
Check whether you can get internet when connect to our router’s network.If not,it is suggested to power cycle the main root AP and our router and try the internet again.The two devices could be incompatible in WDS bridge mode if internet still does not work after power cycling them.

How to create shortcuts in LXDE

A good tutorial in creating shortcuts in LXDE can be found here:

Basic steps:

1. Create a .desktop file in the ~/.local/share/applications (note that this folder may not exist on a brand new LXDE installation, but you can create it manually)

2. Paste the following text into the file:

[Desktop Entry]
Name=Hardware info
Name[en_US]=Hardware info
Comment[en_US]=Hardware info

Note that the ‘freedesktop’ categories do not directly map to the LXDE category names, so here is the mapping between LXDE categories and freedesktop categories:

Accessories <-> Utility
Graphics <-> Graphics
Internet <-> Network
Office <-> Office
Sound & Video <-> AudioVideo
System Tools <-> System


If you want to create a shortcut on the Desktop, then copy the .desktop file to $HOME/desktop

Check sunrise and sunset time

When using the raspberry pi camera, it is usefull to only take images when there is suffcient light. Based on the command line below it is possible to check if the current time is within the sunrise and sunset time,

echo Sunrise is at `l=12776844;curl -s$l|grep astronomy| awk -F\" '{print $2}'`

echo Sunset is at `l=12776844;curl -s$l|grep astronomy| awk -F\" '{print $4}'`

This will get the sunrise and sunset times of a specific location. To be able to determine $l you need to first go to and look up your location. The last numbers in the URL will be the $l

ruTorrent installer

This is an easy installer for ruTorrent (multi-user support), rtorrent, plugins and other dependencies. It requires no Linux knowledge. The only requirement is that you can copy and paste 2 lines of code. In 5-10 mins, you should have a fully working ruTorrent.

To install it, use the lines of code below.The installation script will ask you some questions and then install everything you selected.

Run script at start

It takes a few steps to run a script at bootup in Linux. See the example below for starting rTorrent at boottime.

sudo -s
mv /etc/init.d/

After that you only need to make the script runnable and insert it into update-rc.d.

sudo chmod +x /etc/init.d/
cd /etc/init.d/
sudo update-rc.d defaults

#now you can start it as a service by using
/etc/init.d/ start