Tuesday, February 7, 2017

SSH typing password only once

In order to type the SSH password only once, and not have to type it again during the active session in your local computer, you need to enable multiple sessions over a single connection in ~/.ssh/config:

host *
    controlmaster auto
    controlpath /tmp/ssh-%r@%h:%p
    ControlPersist yes


Source.


If your connection crashes and you are not kicked out of it, your stuck connection process will lie around your system, not connection and not allowing you to create a new connection. You can either reboot the computer (dumb way) or kill the process. You can perform the second method by following the steps:

Run the following command and identify the PID (Process ID) of the connection (it's the first column of numbers):
ps -aux | grep ssh

Kill the process:
kill <PID>

Thursday, August 4, 2016

How to install printer Dymo LabelWriter 450 on Ubuntu 14.04

Download driver

List of drives.

Follow the instructions in the INSTALL file.

You might need to install some CUPS dependencies:


sudo apt-get install libcups2-dev
sudo apt-get install libcupsimage2-dev

From: https://ubuntuforums.org/showthread.php?t=1502581

Thursday, May 19, 2016

Ubuntu 14.04 lts "The system network services are not compatible with this version"

No network error

http://askubuntu.com/questions/727988/the-system-network-services-are-not-compatible-with-this-version-ubuntu-14-0

Friday, November 20, 2015

Tuesday, October 27, 2015

How to colorify GIT

Add the following tags to your ~/.gitconfig file:

[color]
        diff = auto
        status = auto
        branch = auto
        interactive = auto
From https://glance-stage.cern.ch/wiki/doku.php?id=git:configuration

Friday, October 16, 2015

How to create terminal alias / shortcuts / hotkeys

Edit the file:
vim ~/.bashrc

add the aliases. Mine were:

alias gs='git status'
alias ga='git add'
alias gb='git branch'
alias gc='git commit'
alias gca='git commit --amend'
alias gd='git diff'
alias gdc='git diff --cached'
alias gch='git checkout'
alias gl='git lg1'
alias gpl='git pull'
alias gps='git push'
alias gpssu='git push --set-upstream'
alias gmn='git merge --no-ff'
alias grh='git reset HEAD'

Windows

alias gsh='git show HEAD'

Linux

function gsh() {
    git show HEAD$1
}

function lucas() {
    cd /srv/lucas$1
}

function dev() {
    cd /srv$1
}
Execute the file to make the changes work:
. ~/.bashrc


From:
http://githowto.com/aliases
http://askubuntu.com/questions/17536/how-do-i-create-a-permanent-bash-alias

Add alias auto completion:
Now its time for adding the auto completion to your alias:

wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
mv git-completion.bash .git-completion.bash
vim .bash_profile

Add the following content to the file:
# add alies auto completion
source ~/.git-completion.bash
__git_complete gch _git_checkout
__git_complete gb _git_branch
__git_complete gmn _git_merge

Now just reboot shell and enjoy your auto completion :)

From:
http://stackoverflow.com/questions/342969/how-do-i-get-bash-completion-to-work-with-aliases

Friday, August 28, 2015

How to create a linux bash script to automatic ssh

Install sshpass software

sudo apt-get install sshpass

Create an executable file YOUR_FILE.sh, with the following content:

#!/bin/bash
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SERVER_ADDRESS


Make it executable
sudo chmod +x <filename> 

Now just execute:
./YOUR_FILE.sh