Back

GNU/Debian studying notes

hilaolu

hilaolu

February 3, 2018

I use GNU/Debian for my desktop operating system from now on.Here are some commands I used.

Remote login Debian server by RSA key

ssh-keygen
cd ./.ssh
cat id_rsa > authorized_keys
sudo nano /etc/ssh/sshd_config

Then set AuthorizedKeysFile.
If login with RSA key successfully,disable PasswordAuthentication in /etc/ssh/sshd_config.

Install Java/JDK/ServerJRE

cd /tmp
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/server-jre-8u162-linux-x64.tar.gz --no-check-certificate
#you need to generate a download link yourself
tar xzvf server*
mkdir /opt/jdk
mv jdk1.8.0_162 /opt/jdk/jdk1.8.0_162
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_162/bin/java 110
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_162/bin/javac 110
java -version

Configure Hugepage

nano /etc/security/limits.conf

with

*  soft   memlock    512000
*  hard   memlock    512000

In KB,then

nano /etc/sysctl.conf

Add vm.nr_hugepages=250,then

sysctl -p
grep HugePages /proc/meminfo

Install Libsodium

apt update 
apt install build-essential -y 
cd /tmp
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz --no-check-certificate 
tar xzf LATEST.tar.gz 
cd libsodium* 
./configure && make -j2 && make install 
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf 
ldconfig

Open TRIM for SSD

nano /etc/fstab

Add discard,noatime parameter in the partition which / mounts.

reboot

Switch to low lag I/O schedule on SSD

nano /etc/default/grub

Add elevator=noop in line GRUB_CMDLINE_LINUX_DEFAULT.

reboot

Install Driver for AMD Graphics Card

nano /etc/apt/sources.list

And add contrib non-free after every main source.

apt update
apt install firmware-linux
reboot

Fix tearing

apt install driconf
nano /usr/share/X11/xorg.conf.d/20-radeon.conf

With

Section "Device"
    Identifier "Radeon"
    Driver "radeon"
    Option "TearFree" "on"
    Option "DRI" "3"
    Option "AccelMethod" "glamor"
EndSection

Then

Reboot

Install Driver for Nvidia Graphics Card

nano /etc/apt/sources.list

And add contrib non-free after every main source and deb http://httpredir.debian.org/debian stretch-backports main contrib non-free

apt update
apt-get install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//')
apt install -t stretch-backports nvidia-driver
reboot

Install Monaco Font

wget http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
mv Monaco_Linux.ttf /usr/share/fonts/truetype/monaco.ttf
fc-cache -fv
Comment has been closed