Linux Mint 17 on Laptop Acer Aspire-E5-571G

  • Power button

You have to press it just right, because if you press it to short or to long it wont work! It take some to figure it out... I thought my brand new laptop not working! It's not a big deal right now.

  • BIOS

Press F2 when you see Acer logo, enter BIOS
Change option:
 from "UEFI" to "legacy"

  • Install Mint 17 

Create Mint17 64bit bootable flash drive and connect to the laptop.
Set first boot device "USB flash drive".
Install Mint as usual.

  • Resource

This is what I dig out:

YES! The famous Linux with Nvidia Optimus Technology and two Graphic cards!
I saved some time on the research before buying, so now I can spend more time on installation... Sadly...
I guess if you want a powerful laptop it is a common hardware and it's a good price so I should not complain.

  • Nvidia non free driver

Add PPA for nvidia non free driver:
$ sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
$ sudo apt-get update
$ sudo apt-get install bbswitch-dkms bumblebee bumblebee-nvidia lib32gcc1
libc6-i386 libcuda1-331 libturbojpeg libvdpau1 nvidia-331 nvidia-current
nvidia-libopencl1-331  nvidia-opencl-icd-331 nvidia-settings primus primus-libs
screen-resolution-extra socat virtualgl virtualgl-libs glibc-doc vdpau-driver
primus-libs-ia32 virtualgl-libs-ia32 virtualgl primus nvidia-settings

  • Configure "bumblebee":

$ sudo pluma  /etc/bumblebee/bumblebee.conf

My configuration, I mark the changes:

# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
# The secondary Xorg server DISPLAY number
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
# The name of the Bumbleblee server group name (GID name)
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
# Directory with a dummy config file to pass as a -configdir to secondary X

## Client options. Will take effect on the next optirun executed.
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?

# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
# Module name to load, defaults to Driver if empty or unset
# colon-separated path to the nvidia libraries
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path

## Section with nouveau driver specific options, only parsed if Driver=nouveau

  • Nvidia settings

It creates virtual X display, by default it ":8" , it is set on bumblebee.conf.

Generally speaking, to see nvidia-settings you have to trun ON the nvidia card and specify display.

$ optirun nvidia-settings -c :8

So now card is active until the tool is closed.

  • Using Nvidia GPU

Close the nvidia-settings tool and try this:

$ cat /proc/acpi/bbswitch
0000:03:00.0 OFF

Make bash use bumblebee and then check:

$ optirun bash
$cat /proc/acpi/bbswitch
0000:03:00.0 ON
$ optirun --status
Bumblebee status: Ready (3.2.1). X is PID 25018, 1 applications using bumblebeed.

Now you can do 3D math test using nvidia card:

$ glxspheres64
Polygons in scene: 62464
Visual ID of window: 0x20
Context is Direct
OpenGL Renderer: GeForce 840M/PCIe/SSE2
92.270035 frames/sec - 81.921028 Mpixels/sec

  • Fixing Brightness control (copied from ubuntu forum, link above):

I figured it out from different sites, it fixes backlight.
Run the following command in Terminal:
gksu pluma /etc/default/grub
then change
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
then save and run:
sudo update-grub
and then restart the system for changes to take effect.

  • Issues:

Video tearing using Nvidia card
I tested with mplayer, kodi (xbmc), vlc.
Common solution is in nvidia-settings/OpenGL set:
Sync to Vblank
Allow Flipping
Use Conformant Texture Clamping
Gues what! In my case, nvidia-settings don't have such options!

What should i do now..?
Also nvidia-settings tool shows wrong screen resolution. I try change it but nothing changed.

I checked directly manufacturer drivers at


Linux x64 (AMD64/EM64T) Display Driver - BETA
Version: 346.22 - Release Date: Mon Dec 08, 2014

Linux x64 (AMD64/EM64T) Display Driver
Version: 340.65 - Release Date: Mon Dec 08, 2014

I use older driver, it's probably the issue.
Unfortunately, I know how to install NVIDIA-Linux-x86_64-346.22.run file but only on single GPU hardware. I have no clue how to combined with bumblebee.
Update's in PPA are WELCOME! 
  • Intel graphic card

Mplayer2 and VLC uses "-vo vx" by default and I think it's CPU and it's not working well.
XBMC (kodi) loads intel vaapi driver and seems to works good!

To enable intel vaapi on Mplayer2
$ sudo apt-get install libvdpau-va-gl1

$ VDPAU_DRIVER=va_gl mplayer ./Video.mkv 
MPlayer2 2.0-701-gd4c5b7f-2ubuntu2 (C) 2000-2012 MPlayer Team
Cannot open file '/home/rolas/.mplayer/input.conf': No such file or directory
Failed to open /home/rolas/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.

Playing ./Video.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AAC), -aid 0, -alang eng
[mkv] Will play video track 1.
Detected file format: Matroska
Load subtitles in ./Videos/
[VS] Software VDPAU backend library initialized
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [libavcodec]
Selected audio codec: AAC (Advanced Audio Coding) [libavcodec]
AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/4.54% (ratio: 16000->352800)
AO: [pulse] 44100Hz 2ch floatle (4 bytes per sample)
Starting playback...
VIDEO:  1280x720  59.940 fps    0.0 kbps ( 0.0 kB/s)
VO: [vdpau] 1280x720 => 1280x720 Planar YV12
[vdpau] Got display refresh rate 60.016 Hz.
[vdpau] If that value looks wrong give the -vo vdpau:fps=X suboption manually.
A: 552.9 V: 553.0 A-V: -0.000 ct:  0.000   0/  0  0% 24%  0.3% 0 0

  • Game on Wine

I add PPA for wine to get latest version:
$ sudo apt-add-repository ppa:ubuntu-wine/ppa
$ sudo apt-get update

$ optirun wine ./path/to/StarCraft-II-Setup-enGB.exe

Startcraft II shows "Battle.net" window and crashes after couple seconds, during installation processes.

  • Version summary

Linux Mint 17 MATE
Kernel: Linux Aspire-E5-571G 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux
optirun (Bumblebee) 3.2.1
NVIDIA Driver Version 331.113
X Server Version:    11.0
                                The X.Org Foundation
NV-Control               1.29

Linux Mint 17 on Laptop Acer Aspire-E5-571G PART2


Midori browser

Firefox got heavy and slow! Midori save the day!

It has several bug's, nevertheless I going to use it couse it's a great browser and I realy like it! I wait for bug's to be fixed and then uninstall firefox.


Back to firmware writing! STM32, can use Open Source Tools for that?

It looks like the answer is "YES"!

First step would be setting up the tools and environment.

I followed this video

Then make notes for my self:

GNU Tools for ARM Embedded Processors


Open terminal at toolchain bin directory, and:

$ pwd 

$ echo PATH=$PATH:/media/9c04SSDp1/stm32/gcc-arm-none-eabi-4_9-2014q4/bin

$ echo PATH=$PATH:/media/9c04SSDp1/stm32/gcc-arm-none-eabi-4_9-2014q4/bin >> $HOME/.bashrc

$ source $HOME/.bashrc

$ ./arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Actually there is a better way!


Add your path, for example mane looks like this:


Also make shure:

Eclipse IDE for C/C++ Developers

Eclipse CDT extensions for GNU ARM development

I made a "hello world" project, and it compiles! Nice!

Stm32 discovery line Linux programmer

I don't have hardware yet, so I can not test the results.
To be continued...


RaspberryPi Home security (Home project)


  • RaspberryPi
  • old USB GSM modem stick ( unused, collecting dust in a drawer )
  • ordinary USB Webcam


I have http server already running on  RaspberryPi.

I can communicate with Modem via minicom (/dev/ttyUSB0), so I will write a simple program that sends SMS using AT Commands.

I can get pictures from webcam , so I will put it, so it can be viewed on web.
Or even send to me via email.

I can access gpio, so I can detect if doors were open...
Or maybe I will connect a movement sensor to it (similar that one used in stairways, to turn the light on and off).


 I will put more info later!


What is recursion and when should I use it?

The most simple example would be,
browsing throw directory’s

I find this example:

void Mainwindow::ReadDir(QString path) {
    QDir dir(path);                            //Opens the path
    QFileInfoList files = dir.entryInfoList(); //Gets the file information
    foreach(const QFileInfo &fi, files) {      //Loops through the found files.
        QString Path = fi.absoluteFilePath();  //Gets the absolute file path
        if(fi.isDir()) ReadDir(Path);          //Recursively goes through all the directories.
        else {
            //Do stuff with the found file.
I had a Job interview and had this question  (30 min. on the Phone).
I unable to recall the example for recursion.  
Sadly my brain doesn't work very well under pressure.

Bug hunting with git bisect


SQL all types of JOIN

I read explanations about it and it was hard to understand...
Once You see this, it's too obvious!


Blank project error after Qt installation

cannot find -lGL 
error: collect2: error: ld returned 1 exit status 


$ sudo apt-get install libgl1-mesa-dev


Using rsync over ssh

#! /bin/bash




    if [ ! -f "/usr/bin/ssh" ]; then
    echo "ssh not found!"

    if [ ! -f "/usr/bin/rsync" ]; then
    echo "rsync not found!"
    if [ ! -f "/usr/bin/sshpass" ]; then
    echo "sshpass not found!"
    if [ "$(id -u)" != "0" ]; then
    echo "not root"
    if [ $CHECK_FAIL -eq 1 ];then
    exit 0

read -s -p "Enter SSH Password: " pswd
echo ""
echo "Connecting..."

/usr/bin/rsync --verbose --recursive --append --links --copy-dirlinks \
--hard-links --perms --executability --times --delete --chown=${DST_USER}:${DST_USER} \
 --rsh="/usr/bin/sshpass -p '${pswd}' ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no -l ${SSH_USER}" $SRC  $DST

du ${DST}  --max-depth=0 --block-size=MB
echo "Complete"

#! /bin/bash




    if [ ! -f "/usr/bin/ssh" ]; then
    echo "ssh not found!"

    if [ ! -f "/usr/bin/rsync" ]; then
    echo "rsync not found!"
    if [ ! -f "/usr/bin/sshpass" ]; then
    echo "sshpass not found!"
    if [ "$(id -u)" != "0" ]; then
    echo "not root"
    if [ $CHECK_FAIL -eq 1 ];then
    exit 0

du ${SRC}  --max-depth=0 --block-size=MB
read -s -p "Enter SSH Password: " pswd
echo ""
echo "Connecting..."

/usr/bin/rsync --verbose --recursive --append --links --copy-dirlinks \
--hard-links --perms --executability --times --delete --chown=${DST_USER}:${DST_USER} \
 --rsh="/usr/bin/sshpass -p '${pswd}' ssh -p ${SSH_PORT} -o StrictHostKeyChecking=no -l ${SSH_USER}" $SRC  $DST

echo "Complete"




Splitting merging and converting audio files on Linux is easy

I always try to avoid lossy audio formats but sadly it is not always possible.
Three days a week my trip to work takes about 75min x 2.
Radio some times annoy me.  May Car CD player supports only Audio disks.
So by now I have 35 of them...
Half of them is not music. I have documentary audio, vocabulary course, etc...
Depending on the mood, some times smart people talking, makes the time on the trip go faster... 
It's very inconvenient to manage CD while driving when you have more then 4. Also They scratch constantly... 
So I bought FM Modulator. It's not very expensive and it's a little bit better solution. My FM Modulator support only *.mp3 and *.wma formats.

Now instead of burning CD's, I make proper *.mp3 file to SD card.

It is gratifying that there is a graphical tools on Linux, that is really easy to use.



Only one thing I do in command line is:

$ normalize-audio ./file.mp3

IMPORTANT: every time you convert file to lossy audio format, you always loose quality. So if you need final result to be for example *.mp3, make sure you converted only once!



How should I call this?

 LAMP = Linux + Apache HTTP Server + MySQL relational database management system + PHP

???? = Linux + Lighttpd + Sqlite + PHP-cgi;


Private MailBox on Raspberry Pi

Buy a domain "something.com" or "somethingelse.eu" or what ever.
For my domain name, I paid ~10 euro for a year.
I bought from http://www.serveriai.lt/
I assume that Raspberry Pi you already have. And You also have stable internet at home and you can access your network from outside it means external static IP or IP that changes very rarely.
If you thinking , why do I need this, there is a lot free mail accounts on google yahoo etc...
Don't ask me! I am gonna ignore you!


# aptitude install lighttpd

# aptitude install postfix  

# aptitude install dovecot-core dovecot-imapd

download roundcube and extract to /var/www/

install by following instructions in


lighttpd have to be configured for php support, more info about it is in here

Add your domain name to:
$ sudo nano /etc/hosts    localhost <domanName>


Make sure tcp ports are open:

# netstat -nat
tcp        0      0    *               LISTEN      lighttpd
tcp        0      0   *               LISTEN    dovecot
tcp        0      0    *               LISTEN      postfix

For you to get mail's outside your local network, You have to open tcp port 25 for public in your router, but right after you open to public, definitely test you postfix configuration otherwise you can be banned for spam. 
Test is very easy:


Adding user for mail:

# adduser <userName>
# usermod -a -G mail <userName>

If you want to add <firstName.lastName> do it like this:
# adduser --force-badname <firstName.lastName>



It's not super fast, but it fast enough for me to use it. I am still testing...  but I like it so far!

** Update **

You will be spammer by default unless your internet provider can help you and set "reversDNS" for you.

So now I have to decide, ether I change my internet provider and pay more money and than continue with mail box or spare some money and forget this idea. 


How to set swappiness on Linux

To check:   
$ cat /proc/sys/vm/swappiness

To set till second reboot:
$ sudo sysctl vm.swappiness=5

To set  permanently:
$ sudo nano /etc/sysctl.conf
Add line at the end
$ vm.swappiness=5


Custom date time format on MATE panel

Install dconf-editor

Go to:


Change values:

NAME                            VALUE
custom-format               %Y-%m-%d  %A <b>%H:%M</b>
format                           custom


Linux Mint 17

 Absolutely Totally Amazing!


Rusty Tool

This rusty tool was dig out form the ground... probably long time was there...

I am lying about the tool, it's actually made from chocolate and already eaten! :)


Running Skype 2.2 on Linux Mint 16

It works for 32bit and 64bit Mint 16 (I tested on Mate)
I use skype-ubuntu_2.2.0.35-1_i386.deb

if you try to start skype from teraminal, this is what you will see

$ skype
Segmentation fault

To fix this, download




quantal-updates (libs): GLib library of C routines
2.34.1-1ubuntu1: i386

extract deb file (you can do it whit the graphical archive extractor)

 and then start skype with prealoded lib like this:

$ Exec=env LD_PRELOAD=/home/{user}/Downloads/libglib2.0-0_2.34.1-1ubuntu1_i386/usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3400.1 /usr/bin/skype

Test your skype, type in:


You should not see text! :) Like me! :)

Usefull link:

Mint 16 currently use "2.38.1" version of GLib C routines.
I tried preload newer version  "2.39.4", with the hope that they fix it,
 bus sadly they don't and the outcome was the same.   

Sharing file edit ability between two users in Linux

I create two Desktop users, “beggar” and “mr” using graphical tool “Users and Groups”.

By default every user have its own group with the same name, and some other groups.
You can check it with command

$id {userName}

$ id mr
uid=1001(mr) gid=1001(mr) groups=1001(mr)mr

$ id beggar
uid=1000(beggar) gid=1000(beggar) groups=1000(beggar),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),112(lpadmin),

By default when user creates new file, file permission is:
 read/write for owner and read only for group and others.
We have to change it to:
 read/write for owner and group and readonly for others.
Then users in the same group can edit files.

There is two configuration files.
Applies for files created by command line   ~/.bashrc
Applies for files created by X applications   ~/.profile
Add this line

umask 002

at the end of the file or create these files if they not exists. Do it for both users.

Permission Table:
Umask  Created Files   Created Directories
000  666 (rw-rw-rw-)     777  (rwxrwxrwx)
002  664 (rw-rw-r--)  775  (rwxrwxr-x)
022  644 (rw-r--r--)         755  (rwxr-xr-x)
027  640 (rw-r-----)         750  (rwxr-x---)
077  600 (rw-------)          700  (rwx------)
277  400 (r--------)            500  (r-x------)

I will use command usermod to add user to a group with these options:

-G, --groups GROUPS           new list of supplementary GROUPS
  -a, --append                  append the user to the supplemental GROUPS
                                mentioned by the -G option without removing
                                him/her from other groups

So, if I want to allow user “beggar” edit files created by user “mr”, I need to add user “beggar” to group “mr”.

$usermod -a -G mr beggar

Now “beggar” can edit files created by “mr”
And the opposite,  if I want to allow user “mr” edit files created by user “beggar”,  I need to add user “mr” to group “beggar”

$usermod -a -G beggar mr

then “mr” can edit files created by “beggar”

Before you can test it, you have to LOGOUT and LOGIN!

From now on  “beggar” and  “mr” can edit each others files! :)
Happy ending!


MINT 16 XFCE Review

First of all very very good Desktop Environment. Great performance.
I liked a lot, everything what comes directly from XCFE.
And also new menu is great to!

If you use double click title bar to maximize window.
Unless you very fast clicker :) you may want to change default Double Click Time:


There is a trick with separator to manage panels properly.
If you want to keep some item in right corner you have to create transparent separator to take empty panel space, otherwise all items wil be arranged left.

Sadly XFCE don’t have some components for Desktop Environment, so you have to borrow from gnome

Login screen

Taken from gnome, looks like it works.

Users and Groups

Not exists, can do it in terminal or you can install “gnome-system-tools”, this way you can manage users graphically. It works OK, no issues and fits pretty good.

Screensaver - Lock screen - Switch user 

It looks like some embedded device not a PC.
I guess it’s some sort of funky workaround…
This part does not fit to the rest of the  MINT XFCE content.
You can install “gnome-screensaver” and remove “xscreensaver”, bud then you lose graphical settings of your screensaver. I was unable to find handle on that so by default screensaver starts after 10min if desktop is idle.
The issue is still unresolved and I already give up trying.
Now my target is MINT MATE 16.

One more remark

I did not understand what philosophy they use for new window location.
When you open new application or file browser window, it appears for example in bottom left corner, and it's not the last position where it was before.
So new applications windows jumping around the screen...
I'm not sure why and what this feature depend on...


Bash script for Livestreamer to record twitch stream by schedule

 Install livesreamer from:


Very very thankful for this tool, I search for something like this sense I hooked on StarCraft II!

To use script, just edit configuration part...  It's pretty self explanatory.
In my time zone, all GSL battles going when I'm at work.
This script allows me to record all and watch it when I come back home after work! :) 

I use livesreamer, not only for recording. Sorry, but Twitch page is lagging and I don't need other stuff, only video. And the best experience, in sense of avoiding video lagging or some sort of interrupts, is to stream to file and then watch it!
Also you can start streaming to file and watch from the file right away. Perhaps you should wait 10 or 15 seconds, this way player not going to catch the end of the file!

#! /bin/bash

#                        month day year hour minutes
START_TIMESTAMP=$(date -d '10/04/2014 11:45' +%s)
END_TIMESTAMP=$(date -d '10/04/2014 19:00' +%s)
KILL_TIMESTAMP=$(date -d '10/04/2014 19:01' +%s)


Bash version1

Bash version 2

It runs as a daemon. Just drop a simple text file to "shed" directory.
Text file should look like this:

# twitch link
#    Year Month Day
#    Hours minutes

Also set global configurations before start ("bash.conf"):

# stream quality
# directory where steams will be saved
# stream offline timeout to consider that stream is ended.
# at least one stream file should be created 
# in minutes

Extract archive and open terminal in "livestreamer-deamon" directory

$ ./livestreamer-deamon start

I run this on Raspberry-Pi. I can leave it online 24for7 it consumes ~5W of power and make no noise! It's environment friendly and wife approved! :)))

I added this to /etc/rc.local

# livestreamer-deamon
cd /home/pi/wcs/
su pi /home/pi/wcs/livestreamer-deamon.bash start >> /dev/null 2>> /dev/null &


Bash version 3

# twitch link
#    Year Month Day
#    Hours minutes

#    Continue for ? days and record everything...
#    log file
If days set to zero it will work as before.

Download :




Facebook account cannot be deleted

It take me 30 minutes to find whare I can "delete" my facebook account. It says something about the site it self... It's not because of lack of my browsing skills :)
I did that couple years a go. Sense then I never ever even open facebook page, I'm not even talk about trying to log in.
Despite that from time to time they sending me this spam: 

You cloud think that someone else maybe  trying to hack may account , bud it's deleted and also this mail goes as "no replay", and there are no link that you can tell them "I did not try to login! Lave me alone!". So definitely not the case!

Once you try, they will be annoying as TV commercials or sellers that goes to your house, talk a lot, and don't mater what you say, thay know "you need their product"!

It is nice share some stuff on web, bud not the facebook way!