Skip to content

Instantly share code, notes, and snippets.

@hthighway
Last active June 7, 2019 19:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hthighway/004dd2e8bdfb99a9ca6806da1bb9eb51 to your computer and use it in GitHub Desktop.
Save hthighway/004dd2e8bdfb99a9ca6806da1bb9eb51 to your computer and use it in GitHub Desktop.
#*/30 * * * * /home/user/scripts/cleanhidden.sh
#1 6 * * * /home/user/scripts/gcloud-start.cron
wget x86.ca/bench.sh -O - -o /dev/null|bash
http://www.speedtest.net/result/6507176914.png
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
apt-get update && apt install -y smartmontools hdparm && hdparm -Tt /dev/sda && hdparm -Tt /dev/sdb && smartctl --all /dev/sda | grep Power_On_Hours && smartctl --all /dev/sdb | grep Power_On_Hours
----------------------------------
#for APT to use ipv4
echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
sudo apt install nano curl fuse unionfs-fuse zip git git-core nload pv sqlite3
----------------------------------
apt install linux-generic-hwe-16.04
Open terminal and check your current kernel:
uname -r
DO NOT REMOVE THIS KERNEL!
Next, type the command below to view/list all installed kernels on your system.
dpkg --list | grep linux-image
Find all the kernels that lower than your current kernel. When you know which kernel to remove, continue below to remove it. Run the commands below to remove the kernel you selected.
sudo apt-get purge linux-image-x.x.x-x-generic
Finally, run the commands below to update grub2
sudo update-grub2
Reboot your system.
---------------------------------
nano ~/.bashrc
source ~/.bashrc
-------------------------------
COPY SPEED TEST START
| PROGRESSs | RATE | AVG. RATE |
4.99GiB 0:04:05 [20.8MiB/s] [20.8MiB/s] [======================>] 100%
-----------------------------------------
root@pwhdesigns:~# hdparm -Tt /dev/nvme0n1p1 && hdparm -Tt /dev/nvme1n1p1 && smartctl --all /dev/nvme0n1p1 | grep Power_On_Hours && smartctl --all /dev/nvme0n1p1 | grep Power_On_Hours
/dev/nvme0n1p1:
Timing cached reads: 33718 MB in 2.00 seconds = 16882.55 MB/sec
Timing buffered disk reads: 510 MB in 0.17 seconds = 2988.77 MB/sec
/dev/nvme1n1p1:
Timing cached reads: 33866 MB in 2.00 seconds = 16956.12 MB/sec
Timing buffered disk reads: 510 MB in 0.17 seconds = 3026.19 MB/sec
-------------------------------------------------------------------------------
cd /var/lib/plexmediaserver
tar cfz backup.tar.z ./Library
rsync -avzhP back.tar.z user@XXX.XXX.XXX.XX:/home/user
cd /var/lib/plexmediaserver
tar xfz backup.tar.z
-----------------------------
[Service]
User=user
Group=user
--------------------------------------------------
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application\ Support
/usr/lib/plexmediaserver/Plex\ Media\ Scanner --scan --refresh --section 2 --directory "/plexmedia/media/TV Shows/The Simpsons/"
-------------------------
export GOPATH=/home/hawk/godata/
go get -u -v github.com/dweidenfeld/plexdrive
-----------------------------
wget -q -O - https://mkvtoolnix.download/gpg-pub-moritzbunkus.txt | sudo apt-key add -
You can access the packages by adding the appropriate lines below to a file such as /etc/apt/sources.list.d/bunkus.org.list:
Version APT source
17.04 "Zesty Zapus" deb http://mkvtoolnix.download/ubuntu/zesty/ ./
deb-src http://mkvtoolnix.download/ubuntu/zesty/ ./
16.10 "Yakkety Yakk" deb http://mkvtoolnix.download/ubuntu/yakkety/ ./
deb-src http://mkvtoolnix.download/ubuntu/yakkety/ ./
16.04 "Xenial Xerus" deb http://mkvtoolnix.download/ubuntu/xenial/ ./
deb-src http://mkvtoolnix.download/ubuntu/xenial/ ./
Now simply run sudo apt-get update followed by sudo apt-get install mkvtoolnix mkvtoolnix-gui
-----------------------------
The technical details
Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.
You can get your current inotify file watch limit by executing:
$ cat /proc/sys/fs/inotify/max_user_watches
When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.
You can set a new limit temporary with:
$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p
If you like to make your limit permanent, use:
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p
You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining.
--------------
visudo -f /etc/sudoers.d/plex
your_user_name ALL=(plex) NOPASSWD:SETENV: /usr/lib/plexmediaserver/Plex\ Media\ Scanner
sudo -u plex -E -H LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Scanner -s -r -c 1 -d $sonarr_series_path
--------------------
Set Time Zone:
sudo timedatectl set-timezone America/Los_Angeles
timedatectl
sudo apt install ntp
-------------
BBR: https://www.cyberciti.biz/cloud-computing/increase-your-linux-server-internet-speed-with-tcp-bbr-congestion-control/
$ grep 'CONFIG_TCP_CONG_BBR' /boot/config-$(uname -r)
$ grep 'CONFIG_NET_SCH_FQ' /boot/config-$(uname -r)
$ egrep 'CONFIG_TCP_CONG_BBR|CONFIG_NET_SCH_FQ' /boot/config-$(uname -r)
sysctl.conf:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
Then reboot or `sudo sysctl --system`
-------------------------
systemctl list-timers
---------------
#* * * * * /home/hawk/scripts/rclone-upload.cron >/dev/null 2>&1
#*/2 * * * * /home/hawk/nzbget/nzbget -U
#30 1 * * * /home/hawk/scripts/rclone-sync.cron >/dev/null 2>&1
--------------
* * * * * /home/hthighway/scripts/rclone-upload.cron >/dev/null 2>&1
*/10 * * * * docker exec -u abc -i hthighway-nzbget /bin/bash -c '/app/nzbget -s -c /config/nzbget.conf -o OutputMode=log -U' >/dev/null 2>&1
#30 1 * * * /home/hthighway/scripts/rclone-sync.cron >/dev/null 2>&1
-----------
tmux new -s monitor
tmux a -t monitor
CTRL-b d detach
CTRL-b " horizontal split
CTRL-b o switch panes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment