If you want to show all the currently open ports on linux, just use the following command:
netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:39790 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 0.0.0.0:41121 0.0.0.0:*
udp6 0 0 :::57063 :::*
udp6 0 0 :::42147 :::*
I was looking for ways to visualize the progress of a project and also I wanted to do this with on-board tools. After a quick search I found the following command.
git log --graph --decorate --oneline
~/.giconfig
helps:
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%
~/.bashrc
. This saves 2/3 of the letters.
alias g='git'
If you have multiple CSV files with the same format and you want to combine them to just a single file, just do
cat file1.csv file2.csv > output.csv
cat *.csv > output.csv
To count lines of one or many files on the shell I use wc
(Wordcount). If you want to count all lines of all CSV files in a dictionary, just type:
wc -l *.csv
There are two things to increase the security for ssh logins.
sudo nano /etc/ssh/sshd_config
and change the line Port 22
to something higher. Make sure to stay below 65,000 and don’t use any port which is already used by another service like 80 (web). After changing and saving the file, simply restart the ssh daemon and reload the configuration with sudo /etc/init.d/ssh reload
. Done.
# Open the sshd config file
sudo nano /etc/ssh/sshd_config
ChallengeResponseAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
/etc/init.d/sshd restart