Configuring Samba on Raspberry Pi, to share USB drives

Today it is time to use Samba for USB Drives sharing.

Mounting USB Drive

1. Create new directory where your drive will be mounted

sudo mkdir /media/usbHDD
sudo chmod 744 /media/usbHDD

2. List your storage devices and save UUID of your drive

ls -l /dev/disk/by-uuid/

3. Mount that drive to /media/usbHDD, use proper user and group (uid, guid), adjust drive path

sudo mount -o uid=pi,gid=pi /dev/sda1 /media/usb

4. Edit fstab

sudo nano /etc/fstab

and add line with UUID of your drive

UUID=18A9-9943 /media/usbHDD vfat auto,nofail,noatime,users,rw 0 0

5. Verify if drive is mounted

ls -l /media/usbHDD

restart and verify if drive is mounted after reboot

sudo reboot now
ls -l /media/usbHDD

Installing Samba

The process of installation is very simple

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install samba samba-common-bin

Czytaj więcej

Useful commands on Raspberry Pi

In this post I’ll gather all useful commands that I used during my experiments with RPi


Lists all attached bulk storage devices


List all drives by uuid

ls -l /dev/disk/by-uuid/

Mount drive

sudo mount -o uid=pi,gid=pi /dev/sda1 /media/usb 

you have to use uid and gid in order to delete add new devices.

Automount drive at start-up

sudo nano /etc/fstab

and add

UUID=18A9-9943 /media/usb vfat auto,nofail,noatime,users,rw 0 0

The “nofail” option allows the boot process to proceed if the drive is not plugged in. The “noatime” option stops the file access time being updated every time a file is read from the USB stick. This helps improve performance.
Czytaj więcej

Install latest Java 8 on raspbian

I’m always looking for this commands when I need to install latest Java 8 JDK on my RPi, so I’m adding them here just in case I’ll need to use them again.

Unfortunately default Raspbian repository contains old Java version 1.8.0_65-b17 while the latest (when I’m writing this post) is 1.8.0_151-b12.


First install dirmngr:

 sudo apt-get install dirmngr

Second add deb repositories and key:

echo "deb trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
sudo apt-key adv --keyserver hkp:// --recv-keys EEA14886

Warning! If you add xentail repositories (as many RPi forums and other pages state) you’ll end up with old 1.8.0_65 version, you must be using trusty repositories in order to install latest Java version.

Update repositories:

sudo apt-get update

Install Java installer:

 sudo apt-get install oracle-java8-jdk 

Verify Java version

To be 100% sure I have proper version of Java I use basic command:

java -version

Remove old Java

In case you have old Java 8 JDK

sudo apt-get remove --purge oracle-java8-jdk


Remove Java
Default Java installation
trusty repositories of Java 8 JDK

Monitor Raspberry Pi 3 temperatute while stress

Basically I wanted to test how fast my RPi will heat up under stress with or without heat sinks

How to perform stress test

It is easy with stress application.


sudo apt-get install stress 

Stress test:

sudo stress --cpu 4

it will span 4 processes that will execute on each of RPi core calculating sqrt function (source).

Constantly measure CPU temperature


watch -n 1 /opt/vc/bin/vcgencmd measure_temp

This command will print cpu temperature on console each 1 second.

CPU utilisation

You can observe how 4 stress processes are utilising cpu with command:


Radiator tests

Cheapest small aluminium radiators under 0.24$ per lot: link

No heat sinks:

  • idle: around 50 C
  • under stress: up to 82 C
  • response on air flow: low decreases maximum temperature by 2-3 C

With heat sinks:

  • idle: around 44 C
  • under stress: up to 77 C
  • response on air flow: good decreases maximum temperature by 7-8 C


I’m a bit disappointed with those small heat sinks, expecting that they’ll lower temperatures more drastically. Using fan that will blows air on them will give better results.

Internet LTE w plusie na Xiaomi mi 5

Sorry that this post is not in English but this problem is related only to polish mobile network.

Po kilku godzinach walki, aby zadziałało w końcu LTE w plusie na moim Xiaomi Mi 5 znalazłem działające rozwiązanie.

Ustawienia sieci plus

Najpierw sprawdzamy czy mamy włączone LTE w Plusie kodem: *101#
Jeśli mamy wyłączone LTE aktywujemy je kodem: *101*11*24#

Ustawienia telefonu:

Wchodzimy w Ustawienia -> Karty Sim i sieci komórkowe -> SIM X (tam gdzie mamy kartę plusa) -> Punkty dostępu -> Plus internet

APN z „internet” na „plus
Typ APN z „default,supl” na „default, supl” !!! bardzo ważna spacja po przecinku !!!
Protokół APN z „IPv4/IPv6” na „IPv4

Wchodzimy w Ustawienia -> Karty Sim i sieci komórkowe -> SIM X (tam gdzie mamy kartę plusa) -> Preferowany tryb sieci
i wybieramy „Preferowane sieci LTE

Uruchamiamy ponownie telefon, bez tego nie wskoczymy do sieci 4G.


Przetestowane na MIUI 8

Auriol IAN94702 kitchen timer manual

Each time there is time change between summer and winter I always have to look for a manual to kitchen timer Auriol IAN94702.
Now it is in this place so I don’t have to look for it.

Auriol IAN94702 kitchen timer manual PDF

Quick manual for Setting the time:

  1. In Clock mode, press and hold down the CLOCK (TIMER) key 5 for 3 seconds. The top field of the display 1 flashes.
  2. Press the SEC key 4 , the MIN key 3 or the HR key 2 to change the displayed values for seconds (SEC), minutes
    (MIN) or hours (HR) in steps. TIP: Press and hold the key to make the numbers change
    more quickly.
  3. Press the CLOCK (TIMER) key briefly, in order to confirm the set time. The time does not flash.

sed in-place – find and replace string in all files

Sed is a really powerful and useful linux program when you want to replace certain string in a file.
But it gets harder when you wan replase srting in all available files in directory .
Here is the solution with sed in-place command:

find /home/user/mydir -type f -exec sed -i 's/oldstring/newstring/g' {} \;

Useful links: