Seedbox - GitBib/personal-wiki GitHub Wiki

Updating Ubuntu

  • sudo apt update
  • sudo apt upgrade
  • sudo apt dist-upgrade
  • sudo apt-get autoremove
  • sudo apt install update-manager-core
  • sudo do-release-upgrade

Can't upgrade due to low disk space on /boot

  • dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
  • sudo apt-get -y purge some-kernel-package

Quick installation of rtorrent on seedbox

https://github.com/arakasi72/rtinst

Required Packages

Mediainfo , audacity, Znb, filezilla, makeMKV, mkvtoolnix, 7zip

  • sudo apt-get update
  • sudo apt-get install firefox
  • sudo apt-get install mediainfo-gui
  • sudo apt-get install audacity

install usernet

  • sudo apt-get install software-properties-common
  • sudo add-apt-repository multiverse
  • sudo add-apt-repository universe
  • sudo add-apt-repository ppa:jcfp/nobetas
  • sudo add-apt-repository ppa:jcfp/sab-addons
  • sudo apt-get update && sudo apt-get dist-upgrade
  • sudo apt-get install sabnzbdplus python-sabyenc
  • sudo apt-get install par2-tbb
  • sudo apt-get install p7zip p7zip-rar

Installation of rdp

http://c-nergy.be/blog/?p=14888

Step 1- Install xRDP

  • sudo apt-get update
  • sudo apt-get install xrdp

Step 2- Install preferred desktop environment

XFCE

  • sudo apt-get install xfce4
  • #Optional stuff
  • sudo apt-get install xfce4-terminal
  • sudo apt-get install gnome-icon-theme-full tango-icon-theme

or

MATE

  • sudo apt-get install mate-core mate-desktop-environment mate-notification-daemon

Step 3- Tell xRDP to use your environment

XFCE sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n xfce-session \n' /etc/xrdp/startwm.sh

or

MATE

sudo sed -i.bak '/fi/a #xrdp multiple users configuration \n mate-session \n' /etc/xrdp/startwm.sh

Step 4- Firewall permission

  • # allow just RDP through the local firewall
  • sudo ufw allow 3389/tcp
  • # restart xrdp
  • sudo /etc/init.d/xrdp restart

Xrdp creates a strange directory called thinclient_drives

In Ubuntu 18.04, Bionic Beaver, if you are using xrdp for remote access, you may notice a directory called "thinclient_drives" appearing in your home directory. In the permissions it may show a bunch of question marks, which looks scary.

sudo umount $HOME/thinclient_drives

How to Add Swap Space

sudo swapon --show

Otherwise, if you get something like below, you already have swap enabled on your machine.

NAME TYPE SIZE USED PRIO

/dev/sda3 partition 1G 906.6M -2

  1. Start by creating a file which will be used for swap: sudo fallocate -l 4G /swapfile If fallocate is not installed or you get an error message saying fallocate failed: Operation not supported then use the following command to create the swap file:

sudo dd if=/dev/zero of=/swapfile bs=4096 count=1048576

  1. Only the root user should be able to write and read the swap file. Set the correct permissions by typing: sudo chmod 600 /swapfile

  2. Use the mkswap utility to set up a Linux swap area on the file: sudo mkswap /swapfile

  3. Activate the swap file using the following command: sudo swapon /swapfile To make the change permanent open the /etc/fstab file: sudo nano /etc/fstab and paste the following line: /swapfile swap swap defaults 0 0

  4. Verify that the swap is active by using either the swapon or the free command as shown below: sudo swapon --show and sudo free -h

Adjusting the Swappiness Value

Swappiness is a Linux kernel property that defines how often the system will use the swap space. Swappiness can have a value between 0 and 100. A low value will make the kernel to try to avoid swapping whenever possible while a higher value will make the kernel use the swap space more aggressively.

The default swappiness value is 60. You can check the current swappiness value by typing the following command:

cat /proc/sys/vm/swappiness

While the swappiness value of 60 is OK for most Linux systems, for production servers you may need to set a lower value.

For example, to set the swappiness value to 35, type: sudo sysctl vm.swappiness=35

To make this parameter persistent across reboots append the following line to the /etc/sysctl.conf file: vm.swappiness=35