Copy a directory from local machine to remote machine using rsync
rsync -avz -e 'ssh -p 22002' /root/backup/monitoring_201909280430 [email protected]:/root/backup/
rsync -avz -e 'ssh -p 22002' /root/backup/monitoring_201909280430 [email protected]:/root/backup/
Start a new session
tmux tmux new tmux new-session
Start a new session with the name mysession
tmux new -s mysession
kill/delete session mysession
tmux kill-session -t mysession
kill/delete all sessions but the current
tmux kill-session -a
kill/delete all sessions but mysession
tmux kill-session -a -t mysession
Show all sessions
tmux ls tmux list-sessions
Attach to a session with the name mysession
tmux a -t mysession tmux at -t mysession tmux attach -t mysession tmux attach-session -t mysession
Rename session
Ctrl + b $
Detach from session
Ctrl + b d
Create window
Ctrl + b c
Rename current window
Ctrl + b ,
Close current window
Ctrl + b &
Previous window
Ctrl + b p
Next window
Ctrl + b n
Switch/select window by number
Ctrl + b 0 ... 9
Scroll
Ctrl-b [ # Press q to quit scroll mode
Ctrl-b PgUp
References
https://tmuxcheatsheet.com/
https://gist.github.com/MohamedAlaa/2961058
.NET Core
If you only want to run .NET Core managed applications, install the dotnet-runtime package.
To build apps with .NET Core, install dotnet-sdk as well.
Microsoft recommends using Visual Studio Code , their Electron-based FOSS IDE, to build & debug .NET Core apps.
~/.dotnet/tools
to PATH
, otherwise dotnet tools with not work from shell.References
https://wiki.archlinux.org/index.php/.NET_Core
https://wiki.archlinux.org/index.php/Mono
sudo nano /etc/fonts/local.conf
<match target="font"> <edit name="autohint" mode="assign"> <bool>true</bool> </edit> <edit name="hinting" mode="assign"> <bool>true</bool> </edit> <edit mode="assign" name="hintstyle"> <const>hintslight</const> </edit> <edit mode="assign" name="lcdfilter"> <const>lcddefault</const> </edit> </match>
cp ~/.Xresources ~/.Xresources.bak
nano ~/.Xresources
Xft.dpi: 120 Xft.antialias: true Xft.hinting: true Xft.rgba: rgb Xft.autohint: false Xft.hintstyle: hintslight Xft.lcdfilter: lcddefault
xrdb -merge ~/.Xresources
Make sure that Anti aliasing is On, and Hiting is set to Slight in System Settings (Appearence).
References
https://wiki.manjaro.org/index.php?title=Improve_Font_Rendering
gsettings set org.gnome.shell.app-switcher current-workspace-only true gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true
References
https://askubuntu.com/questions/1068097/separate-workspaces-in-ubuntu-18-04-desktop
sudo apt install qemu qemu-kvm libvirt-bin bridge-utils virt-manager
sudo service libvirtd start sudo update-rc.d libvirtd enable
service libvirtd status
grep kvm /etc/group
sudo adduser $USER kvm
References
https://www.linuxtechi.com/install-configure-kvm-ubuntu-18-04-server/
https://stackoverflow.com/questions/37300811/android-studio-dev-kvm-device-permission-denied
sudo apt install tor torsocks proxychains
tor --hash-password "passwordhere"
CookieAuthentication OR HashedControlPassword (if you choose to uncomment HashedControlPassword, copy the hashed password you got in the previous step and paste it next to HashedControlPassword in the torrc file)
nano /etc/tor/torrc
# This provides a port for our script to talk with. If you set this then be # sure to also set either CookieAuthentication *or* HashedControlPassword! # # You could also use ControlSocket instead of ControlPort, which provides a # file based socket. You don't need to have authentication if you use # ControlSocket. For this example however we'll use a port. ControlPort 9051 # <--- uncomment this ControlPort line # Setting this will make Tor write an authentication cookie. Anything with # permission to read this file can connect to Tor. If you're going to run # your script with the same user or permission group as Tor then this is the # easiest method of authentication to use. CookieAuthentication 1 #either uncomment this or below HashedControlPassword line # Alternatively we can authenticate with a password. To set a password first # get its hash... # # % tor --hash-password "my_password" # 16:E600ADC1B52C80BB6022A0E999A7734571A451EB6AE50FED489B72E3DF # # ... and use that for the HashedControlPassword in your torrc. HashedControlPassword 16:E600ADC1B52C80BB6022A0E999A7734571A451EB6AE50FED489B72E3DF #if you choose to uncomment this line, paste your hashed password here
sudo /etc/init.d/tor restart
Test
curl 'https://api.ipify.org'
torsocks curl 'https://api.ipify.org'
proxychains curl 'https://api.ipify.org'
References
https://www.linux.com/blog/beginners-guide-tor-ubuntu%20
sudo pkcon refresh && sudo pkcon update
References
https://averagelinuxuser.com/10-things-to-do-after-installing-kde-neon/
sudo apt install iptables-persistent netfilter-persistent
systemctl enable netfilter-persistent netfilter-persistent save netfilter-persistent start iptables-save > /etc/iptables/rules.v4 ip6tables-save > /etc/iptables/rules.v6 iptables-restore < /etc/iptables/rules.v4 ip6tables-restore < /etc/iptables/rules.v6 systemctl stop netfilter-persistent systemctl start netfilter-persistent systemctl restart netfilter-persistent
Remove persistent iptables rules
To remove persistent iptables rules simply open a relevant /etc/iptables/rules.v*
file and delete lines containing all unwanted rules.
References
https://askubuntu.com/questions/1052919/iptables-reload-restart-on-ubuntu-18-04
https://linuxconfig.org/how-to-make-iptables-rules-persistent-after-reboot-on-linux
nano /etc/sysctl.conf
net.ipv4.icmp_echo_ignore_all=1
sysctl -p
sudo iptables -A INPUT -p icmp --icmp-type echo-request -j DROP sudo iptables -A OUTPUT -p icmp --icmp-type echo-reply -j DROP
then Make iptables rules persistent after reboot on Ubuntu 18.04
References
https://vitux.com/how-to-block-allow-ping-using-iptables-in-ubuntu/
http://ubuntuhandbook.org/index.php/2013/07/disable-ping-response-ubuntu-server/