Monday, 15 April 2019

Change default editor Linux

You can change default terminal editor to vim:

$ sudo update-alternatives --config editor

add user to admin group via PolKit

Latest Ubuntu uses PolicyKit so from that time you can use polkit to add user to admin group:

$ sudo usermod -aG sudo MyDearUser

Friday, 12 April 2019

Custom Git Username For ssh clone

Probably you meet the followings when you using vagrant or virtualbox:

vagrant@vagrant:~$ git clone ssh://gerrit.mycompany.com:29418/sample
Cloning into 'sample'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


To solve (if you sure chmod is fine on your .ssh folder and files) you have to send your username also:
GIT_SSH_COMMAND="ssh -o User=MyGodUserName"

vagrant@vagrant:~$ GIT_SSH_COMMAND="ssh -o User=MyGodUserName" git clone ssh://gerrit.mycompany.com:29418/sample
Cloning into 'sample'...
remote: Counting objects: 21, done
remote: Finding sources: 100% (21/21)
remote: Total 18416 (delta 0), reused 18397 (delta 0)
Receiving objects: 100% (18416/18416), 6.63 MiB | 17.91 MiB/s, done.
Resolving deltas: 100% (11663/11663), done.

And now it works like charm.