Disable swap on Ubuntu

disable swap only for a current session

sudo swapoff -a


sudo -s
crontab -e

And add

@reboot sudo swapoff -a  

Or ( best solution )

Open fstab file, type sudo nano /etc/fstab in terminal.

File’s contents would look like this:

proc            /proc           proc    nodev,noexec,nosuid 0       0
/host/ubuntu/disks/root.disk /               ext4    loop,errors=remount-ro 0       1
/host/ubuntu/disks/swap.disk none            swap    loop,sw         0       0
#/dev/sda10 /media/ASD  vfat    defaults    0   0
#/dev/sda1  /media/98   vfat    defaults    0   0

Just add hash (#) to the beginning of the swap partition line, so the line looks as:

#/host/ubuntu/disks/swap.disk none            swap    loop,sw         0       0

Reboot your PC


Set Up WireGuard VPN on Ubuntu 18.04

Server Installation

wget https://raw.githubusercontent.com/complexorganizations/wireguard-install/master/wireguard-server.sh -P /etc/wireguard/
bash /etc/wireguard/wireguard-server.sh

Client Installation

wget https://raw.githubusercontent.com/complexorganizations/wireguard-install/master/wireguard-client.sh -P /etc/wireguard/
bash /etc/wireguard/wireguard-client.sh


apt-get update
apt-get install software-properties-common -y
add-apt-repository ppa:wireguard/wireguard -y
apt-get update
apt-get install linux-headers-"$(uname -r)" -y
apt-get install wireguard qrencode haveged resolvconf -y

Run Client

# Install the config file to the WireGuard configuration directory on your
# Linux client:
sudo install -o root -g root -m 600 <username>.conf /etc/wireguard/wg0.conf

# Start the WireGuard VPN:
sudo systemctl start wg-quick@wg0

# Check that it started properly:
sudo systemctl status wg-quick@wg0

# Verify the connection to the AlgoVPN:
sudo wg

# See that your client is using the IP address of your AlgoVPN:
curl ipv4.icanhazip.com

# Optionally configure the connection to come up at boot time:
sudo systemctl enable wg-quick@wg0


Deploy .NET Core app on Ubuntu

check if it runs

dotnet run

Deploy in a build directory

dotnet publish --output “ /var/www/build” --configuration release

Go to the build directory and run the application

dotnet ForExample.dll

Create the service file

sudo nano /etc/systemd/system/kestrel-ForExample-test.service
Description=Example .NET Web API App running on Ubuntu
ExecStart=/usr/bin/dotnet /var/www/build/ForExample.dll
# Restart service after 10 seconds if the dotnet service crashes:

Register the service

sudo systemctl enable kestrel-ForExample-test.service

Start the service and verify that it’s running.

sudo systemctl start kestrel-mebgispanel-test.service
sudo systemctl status kestrel-mebgispanel-test.service

Check the server logs

sudo journalctl -fu kestrel-helloapp.service


Install Tor with torsocks and proxychains on Ubuntu 18.04

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


curl 'https://api.ipify.org'
torsocks curl 'https://api.ipify.org'
proxychains curl 'https://api.ipify.org'


Install VirtualBox on KDE Neon Ubuntu 18.04

sudo apt install build-essential dkms linux-headers-$(uname -r)
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt install virtualbox-6.0

Download VirtualBox Extension Pack

sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-${LatestVirtualBoxVersion}.vbox-extpack