Skip to content

gnostrenoff/linux-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

linux-utils

This repository contains some useful linux commands.

SSH

Generate key pair

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

ssh config

-> Simplify remote access command create a config file in your ~/.ssh folder. Each host you want to reach are configured in this config file. Here is an example of template for one host:

Host <hostNickName>
HostName <hostfullName>
IdentityFile ~/.ssh/certif.pem
User <theUser>

Git

Cheatsheet

Here is a link heading to a nice interactive cheatsheet.

Pretty tree

git log --graph --oneline --all --decorate=short

Docker

Cheatsheet

here is a link heading to a nice cheatsheet.

Utils

Utils

Change user name

Add a temporary user

sudo adduser temporary

Add this user to sudoers

sudo adduser temporary sudo

Then log out, and log in using created user.

sudo usermod -l newUsername oldUsername
usermod -d /home/newHomeDir -m newUsername

( You may need to killall oldUsername before executing the 2 commands above to make sure no process is running for this user)

Kill process by name

pkill -f <processName>

Get your machine's core number

cat /proc/cpuinfo | grep processor | wc -l

Disable service autostart

update-rc.d <service-name> disable

Get public ip

wget http://ipinfo.io/ip -qO -

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published