2015-02-15

GIT ANNEX

  • Installing latest git version

https://launchpad.net/~git-core/+archive/ubuntu/ppa

$ sudo add-apt-repository ppa:git-core/ppa

$ apt-get update && apt-get --only-upgrade install git

$ apt-get install git-annex
 
$ git --version
git version 2.3.0

$ git annex version
git-annex version: 5.20140412ubuntu1

https://git-annex.branchable.com/walkthrough/


  • Git-annex binary for Raspberry-pi


https://github.com/tradloff/git-annex-RPi

  • Windows version


https://downloads.kitenet.net/git-annex/windows/current/
















2015-02-14

Installing Texmaker

http://www.xm1math.net/texmaker/index.html
  • Linux

$ sudo apt-get install texlive-full texmaker

To see the result press F6 to convert  and then press blue arrow next to "View PDF".

  •   Windows

http://www.howtotex.com/howto/installing-latex-on-windows/


  • Gray background with white letters

\documentclass{article}
\usepackage{xcolor}

\pagecolor[rgb]{0.15,0.15,0.15}
\color[rgb]{1,1,1}
\begin{document}

Hello \clearpage
World

\end{document}


2015-01-25

Digital background color


I think in the old days, white screen with black letters was design to make an impression of sheet of paper. Now it still exists.
On Smart Phones and Tablets it's changing cause less white light means longer battery life. On the Desktop not a lot of normal people care. Unless that’s your style and You want to be unique.

My digital background's turning black not only cause its environment friendly, but the main reason is how it effects my eyes. I noticed that dark background while programming are less intense for my eyes.

It worth mention that, the room where you work also sloud be similre lighting as your computer screen. You also shloud look at the monitor a fiew degrees down and don't forget blink. This way your eyes will be less dray.  About blinking it's easier to say than done! :)

If you do tee or coffee break, to give your eyes a break you should look throw the window far far away.

I do not ware glasses!  At least Yet!

I have one weaker eye then the other. My vision changing during the week. If I would do eye test , ware you cover one eye and then have to see and say letters or animal names watching form the distance, on a Friday after intensive work week I most likely failed, but on Monday after a weekend in the village away and away from PC, I most likely pass the test.



So it's great that Qt-Creator can have a dark skin!

https://github.com/alexpana/qt-creator-wombat-theme





And "Sublime text" it's great by default. If You did not try yet, It's a great editor, definitely should try out!

http://www.sublimetext.com/



Keep your eyes healthy :) and have fun programming!



2015-01-17

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

Linux Mint 17 on Laptop Acer Aspire-E5-571G PART1
  • Nvidia driver

I added this PPA
https://launchpad.net/~xorg-edgers/+archive/ubuntu/ppa
And install Nvidia-343 driver
I find out that prismusrun is alternative to optirun
  • Avoiding Video tearing while watching 60 fps video

VLC useless
Mplayer works only with Intel vaapi
$ export VDPAU_DRIVER=va_gl &&  mplayer -cache 8192 file.mkv 
XBMC kodi can use both Nvidia or Intel vaapi (default)
$ prismusrun kodi
$ kodi
Totem works with Nvidia
$ prismusrun totem
  • Gaming

I Instaled Wine1.7 and using prismus StartCraft II works!
$ prismusrun wine /path/to/StarCraft-II-Setup-enGB.exe
  • Resource

http://askubuntu.com/questions/305305/running-xbmc-on-bumblebee-nvidia
http://ubuntuforums.org/showthread.php?t=2121749
  • Note

Hard drive on this laptop is large 1TB, but not very fast. Thats why mplayer better works with bigger cache option. I came to conclusion that most of the lag is hard drive retailed. So I made a few more settings. Set swappiness to 1 (how to) ant added "noatime" to FSTAB.


2015-01-02

Web chat on Raspberry Pi using nodejs


  • Writing image to SD card

 sudo dd bs=1M if=./2014-12-24-wheezy-raspbian.img of=/dev/sdc

  • Installing nodejs and modules

http://doctorbin.tumblr.com/post/53991508909/how-to-install-the-latest-version-of-nodejs-npm

I used this version: http://nodejs.org/dist/v0.11.7/
Newer versions "npm" not working, throws "Illegal instruction". 

  • Working chat app example

https://github.com/Automattic/socket.io/tree/master/examples/chat




  • Javascript & JQuery tutorial

https://www.youtube.com/playlist?list=PLoYCgNOIyGACnrXwo5HMCfOH9VT05znGv



2014-12-30

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:
https://wiki.ubuntu.com/Bumblebee
http://outhereinthefield.wordpress.com/2014/12/21/linux-gaming-setup-part-2-software-configs-nvidia-binary-and-bumblebee-steam-and-playonlinux-howto/
https://wiki.manjaro.org/index.php?title=Configure_NVIDIA_%28non-free%29_settings_and_load_them_on_Startup
http://askubuntu.com/questions/128463/how-to-control-brightness

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
nvidia-opencl-icd-331


  • 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.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# 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.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to "true", '-f' will
# be ignored.
NoEcoModeOverride=false
# 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)
Driver=nvidia
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d

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


# 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
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia-331
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-331:/usr/lib32/nvidia-331
#LibraryPath=/usr/lib/nvidia-current:/usr/lib32/nvidia-current
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-331/xorg,/usr/lib/xorg/modules
#XorgModulePath=/usr/lib/nvidia-current/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.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"
GRUB_CMDLINE_LINUX=""
to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX="acpi_osi=Linux"
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
http://www.geforce.com/drivers


Results:

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
wine-1.6.2
NVIDIA Driver Version 331.113
X Server Version:    11.0
                                The X.Org Foundation
                                1.15.1
NV-Control               1.29


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