Tuesday 17 November 2015

How to install Docker in Debian 8

Steps(run these commands as root)
1-apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
2-echo "deb https://apt.dockerproject.org/repo debian-jessie main">>/etc/apt/sources.list.d/docker.list
3-apt-get update
4-apt-get install docker-engine
5-service docker start
6-docker run hello-world
Now you can docker as root but not as a normal user.Make a user group to run Docker as a normal user.
7-gpasswd -a changethisToNormalUsername docker
Done :)
Adapted from https://docs.docker.com/engine/installation/debian/#debian-jessie-80-64-bit

Saturday 7 November 2015

How to clone OpenFrameWorks documentation in Debian

Its helpful to have documentation of openFrameworks locally.Its possible to clone websites using wget but the good thing of using git is you can always update your clone with real one.

Follow these steps to clone documentation locally

1-git clone https://github.com/openframeworks/ofSite.git
2-install blogofile or apt-get install blogofile python-levenshtein
3-cd your git cloned folder
4-blogofile build
5-blogofile serve
6-go to http://127.0.0.1:8080/

Now you have openFrameworks website running locally :) 

Friday 10 July 2015

Installing Android studio in Debian 8

Installing Android studio in Debian 8
1- Make sure you have java jdk>=7.0 {if not link}

2- Install this package lib32stdc++6 using synaptic-pkexec or run this "apt-get install lib32stdc++6"

3- Download Android sdk link

4- Extract it

5- goto(cd to)  "android-studio/bin" directory

6-  you can see( ls ) there is bash file called studio.sh ;Run it using command "./studio.sh"

7- <optional> if you want you create a desktop icon for Android studio copy(blue lines) the following lines and change Exec and Icon to match your file path;then save it as Android sdk.desktop

[Desktop Entry]
Version=1.0
Name=Android studio
GenericName=Android studio
Exec=/home/usr1/android/sdk/android-studio/bin/studio.sh
Terminal=false
Icon=/home/usr1/android/sdk/android-studio/bin/studio.png
Type=Application

Install java(oracle) in Debian 8

Install java(oracle) in Debian 8
(here is the .deb file i created gdrive link)
1-Download java jdk from oracle website
2- Install java-package from debian repos using command "apt-get install java-package"
3-Run this command to create .deb file "make-jpkg jdk-8u45-linux-x64.tar.gz"
4 Install .deb file using "dpkg -i oracle-java8-jdk_8u45_amd64.deb"
5-Run this command to check java version "java -version"

Thursday 9 July 2015

Copy google-chrome[data] From computer A to computer B

Copy google-chrome From computer A to computer B
Sometime you need all your book marks ,most visited pages and everything from machine A to B.so here its copy everything in
"/home/usr1/.config/google-chrome/Default" of A to
"/home/usr1/.config/google-chrome/Default" of B.

[Tested on Linux/GNU Debian 8]

Wednesday 8 July 2015

Auto indent code in Sublime

Auto indent code in Sublime
Goto Preference > Key Bindings- Default
write this in file { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }


(src:http://stackoverflow.com/questions/8839753/how-do-i-reformat-html-code-using-sublime-text-2)

How to write to a file from terminal

How to write to a file from terminal
type this command
  echo "linux is cool">>linux.txt
if you don't want to append(write without erasing previous content) then you can use this(NOTE the single arrow)
 echo "linux is cool">linux.txt


if you run echo "linux is cool">>linux.txt  this two times then contents of linux.txt would be "1st line is linux is cool and 2nd line is linux is cool"
But if you run echo "linux is cool">linux.txt  this two times then contents of linux.txt would be "linux is cool"
                            

Monday 11 May 2015

Installing VIM in debian 8

Installing VIM with clipboard support in debian 8(VIM series part-1)

TL;DR
1-Type this in terminal vim --version | grep xterm_clipboard.
[if result same as pic below]
2-Type this in terminal apt-get install vim-gtk or install using synaptic package manger

When I started using VIM i couldn't copy from VIM to system clipboard.after googling found that the VIM version i had didn't support clipboard.Type this in terminal vim --version | grep xterm_clipboard.

if you have the same result as above then we have install VIM with clipboard support one of them is vim-gtk.Install vim-gtk using synaptic package manger or type this in terminal ->apt-get install vim-gtk.
Examples: "+2yy – copy two lines to X11 clipboard
"+dd – cut line to X11 clipboard
"+p – paste X11 clipboard

some cool VIM cheat-sheets :sheet1,sheet2

:)

Friday 8 May 2015

How to stop mongod [or any other daemon] from automatically starting.

How to stop mongod[mongo daemon] from automatically starting.


TL;DR
1-Install  sysv-rc-conf ->apt-get install sysv-rc-conf
2-Run sysv-rc-conf [run as root if no root privileges] ->sysv-rc-conf 

When i look up running process in htop or in conky ,i can see mongod running .mongod which is the daemon for running mongo database.i don't always use  mongodb except for projects.So i didn't want mongod to run in background when i don't need it.There are many methods of doing this.The easiest way i found ways to use program call sysv-rc-conf.Its available in debian repository and can be installed using this command apt-get install sysv-rc-conf or using synaptic package manger.
Next go to terminal type sysv-rc-conf[use su or sudo if current user has no root privileges].Then stop mongod at all run-levels.As you can see sysv-rc-conf can be used to manage all kinds of program related daemon like docker etc..
Make sure you don't stop system critical daemons.Tested on debian 8 but all other linux distros should be able to replicate.

:)


Before stopping mongod



Thursday 7 May 2015

why VIM in 2015 or 201*

VIM
VIM[hipster/*nix SWAG] is terminal based text-editor used  by many programmers for a long time.
installed by default in most POSIX systems.
so i'am going to try it instead of using sublime2 text editor

Reasons to switch/why VIM
1-VIM is almost universal[sublime you have to install it].
2-VIM doesn't need X11 to run[sublime is GUI app].
3-VIM is more versatile in situation like SSH tunneling[maybe no X11 right?].
4-VIM free and opensource
5-VIM is more lightweight.

Q- But in 2015 should i use a terminal based text-editor ?
Ans- YES !! [click yes to find cool video :)]
i'll be blogging my journey with VIM.