Skip to content

starnodes/linux-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linux-tools

tools and scripts for linux systems

change ssh port

ssh_port=1022
sudo sed -i 's/#Port 22/Port $ssh_port/' /etc/ssh/sshd_config
systemctl restart sshd

Rust install

curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env" && \
echo -e "\n$(cargo --version).\n"

NodeJS + npm install

curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - && \
sudo apt-get install nodejs -y && \
echo -e "\nnodejs > $(node --version).\nnpm  >>> v$(npm --version).\n"

change timezone

Ubuntu

timedatectl set-timezone Europe/Moscow
apt -y install chrony
systemctl restart chrony && systemctl enable chrony

RHEL

timedatectl set-timezone Europe/Moscow
yum -y install chrony
systemctl restart chronyd && systemctl enable chronyd

swap usage change

echo "vm.swappiness=10" >> /etc/sysctl.conf
sysctl -p

required packages

sudo apt update
sudo apt install -y curl git build-essential jq lz4 unzip tar mc chrony htop ncdu nload screen

ssh root login enable + random root password generation

PASS=`openssl rand -base64 15`
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
echo -e "$PASS\n$PASS" | passwd root
echo $PASS

sftp file download

make archive

tar cfvz example.tar.gz exampledir

download archive

port=22
srv_ip=111.111.111.111
sftp -P $port root@$srv_ip:/home/example.tar.gz /home
tar xvf example.tar.gz

http share folder

python3 -m http.server 8181

Check for Listening Ports

netstat -tulpn

-t - Show TCP ports.

-u - Show UDP ports.

-n - Show numerical addresses instead of resolving hosts.

-l - Show only listening ports.

-p - Show the PID and name of the listener’s process. This information is shown only if you run the command as root or sudo user.

Linux performance test

wget -qO- bench.sh|bash

Disk speed

iotop

Network speed

nload

SElinux permissive Centos

sudo setenforce 0
sudo sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config

ipv6 low priority

echo 'precedence ::ffff:0:0/96 100'  >> /etc/gai.conf

About

tools and scripts for linux systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages