Skip to content

Instantly share code, notes, and snippets.

rraallvv

Block or report user

Report or block rraallvv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rraallvv
rraallvv / enable-ssl-wordpress-with-nginx.md
Last active Dec 2, 2018
Enable SSL for WordPress with Nginx
View enable-ssl-wordpress-with-nginx.md

In order to use Wordpress in SSL with NGINX add

$_SERVER['HTTPS']='on';

to wp-config.php just before

require_once(ABSPATH . 'wp-settings.php');
@rraallvv
rraallvv / build-unit-php.txt
Created Dec 2, 2018
Build Unit-PHP on Ubuntu
View build-unit-php.txt
$ sudo apt-get install build-essential
$ sudo apt-get install golang
$ curl -sL https://deb.nodesource.com/setup_<Node.js version>.x | bash -; apt-get install nodejs
$ sudo apt-get install php-dev libphp-embed
$ sudo apt-get install libperl-dev
$ sudo apt-get install python-dev
$ sudo apt-get install ruby-dev
$ sudo apt-get install libssl-dev
$ git clone https://github.com/nginx/unit
@rraallvv
rraallvv / open-cloudflare-ufw.sh
Last active Nov 15, 2018
Open ports to Cloudflare with UFW
View open-cloudflare-ufw.sh
#!/usr/bin/env bash
# Instructions:
#
# 1) Place this script in the /root/ directory, give it proper permissions.
# $ sudo chmod +x /root/open-cloudflare.sh
#
# 2) Open the cron job editor
# $ sudo crontab -e
#
View traffic-controller-limit.sh
# clear limit
sudo tc qdisc del dev eth0 root
# add limit
cgcreate -g net_cls:slow
echo 0x10001 > /sys/fs/cgroup/net_cls/slow/net_cls.classid
cgclassify -g net_cls:slow <pid of the process you want to limit>
tc qdisc add dev eth0 root handle 1: htb
tc filter add dev eth0 parent 1: handle 1: cgroup
tc class add dev eth0 parent 1: classid 1:1 htb rate 1mbps
View benchmarking.sh
# CPU
sysbench --test=cpu --cpu-max-prime=1000 run
# Disk
# Random read write
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randrw --rwmixread=75
# Random read
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randread
# Random write
fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=1M --readwrite=randwrite
@rraallvv
rraallvv / ubuntu-kernel-upgrade.sh
Created Nov 8, 2018
Ubuntu 16.04 Kernel Upgrade
View ubuntu-kernel-upgrade.sh
# source: https://askubuntu.com/a/970965/128893
apt-get install linux-image-generic-hwe-16.04 -y
@rraallvv
rraallvv / curl.service
Created Nov 5, 2018
curl service unit
View curl.service
[Unit]
Description=CURL daemon
After=network.target
[Service]
User=myuser
Group=myuser
#CPUQuota=
#MemoryLimit=
@rraallvv
rraallvv / rtorrent.service
Created Nov 4, 2018
rTorrent service unit
View rtorrent.service
[Unit]
Description=rTorrent daemon
After=network.target
[Service]
Type=forking
KillMode=none
User=myuser
Group=myuser
@rraallvv
rraallvv / enable-cgroups-on-centos-7.md
Last active Nov 2, 2018
Enabling Cgroups on CentOS 7
View enable-cgroups-on-centos-7.md

Install packages to use Cgroups.

# yum -y install libcgroup libcgroup-tools
# systemctl start cgconfig 
# systemctl enable cgconfig
@rraallvv
rraallvv / open-cloudflare_(firewalld).sh
Last active Nov 15, 2018
Open public ports to Cloudflare for Firewalld
View open-cloudflare_(firewalld).sh
#!/usr/bin/env bash
# Instructions:
#
# 1) Place this script in the /root/ directory, give it proper permissions.
# $ sudo chmod +x /root/open-cloudflare.sh
#
# 2) Open the cron job editor
# $ sudo crontab -e
#
You can’t perform that action at this time.