Colorized man pages howto

1) Create a file ~/.less_termcap with color settings

export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan
export LESS_TERMCAP_me=$(tput sgr0)
export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
export LESS_TERMCAP_mr=$(tput rev)
export LESS_TERMCAP_mh=$(tput dim)
export LESS_TERMCAP_ZN=$(tput ssubm)
export LESS_TERMCAP_ZV=$(tput rsubm)
export LESS_TERMCAP_ZO=$(tput ssupm)
export LESS_TERMCAP_ZW=$(tput rsupm)
export GROFF_NO_SGR=1         # For Konsole and Gnome-terminal

2) Add the following lines to your .bashrc

export LESS="${LESS} --RAW-CONTROL-CHARS"
[[ -f ~/.less_termcap ]] && . ~/.less_termcap

3) Reload bash settings with

source ~/.bashrc

And now you should be able to see man pages in color.

Add source code syntax highlighting for less

It is about how to get colorized less output for source code.

This howto is written with respect to Ubuntu 17.10.

1) Install source-highlight

sudo apt-get install source-highlight

2) Look for lesspipe

dpkg -L libsource-highlight-common | grep lesspipe

My one is in /usr/share/source-highlight/ folder

3) add two following lines in your .bashrc

export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '

Happy lessing!

Mounting Blackberry 10 device using CIFS

Blackberry 10 devices

//10.0.0.13/media /media/Playbook cifs user=playbook,password=<your_passord>,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,user,noauto
//10.0.0.8/media /media/Z30 cifs user=BlackBerry,password=slytvyn,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,user,noauto
//10.0.0.8/removable_SDCARD /media/Z30_sdcard cifs user=BlackBerry,password=<your_password>,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,user,noauto