Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
I may be slow to respond.

Aaron Qiu qzm

🚀
I may be slow to respond.
View GitHub Profile
@qzm
qzm / web.sh
Created Apr 14, 2021
get website server
View web.sh
curl -sSI $1 | grep -i 'server:' | sed -r "s/server:\ (\w|)/\1/i"
@qzm
qzm / pritunl.sh
Last active Mar 8, 2021
Install Pritunl
View pritunl.sh
#!/bin/bash
# makecache
yum makecache
# Install Dependencies
yum install yum-cron tuned centos-release -y
# config yum-cron
sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron.conf
sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron.conf
@qzm
qzm / yum-cron.sh
Created Mar 7, 2021
Install yum-cron
View yum-cron.sh
# Install yum-cron
yum update -y
yum install yum-cron -y
sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron.conf
sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron.conf
sudo systemctl start yum-cron
sudo systemctl enable yum-cron
@qzm
qzm / ufw.sh
Last active Sep 7, 2020
UFW配置
View ufw.sh
# ------- Debian -------
sudo apt-get install ufw -y
# ------- CentOS -------
sudo yum install epel-release -y
sudo yum install --enablerepo="epel" ufw -y
# ------- Config -------
sudo ufw allow ssh
sudo ufw allow http
View sysctl.conf
net.ipv4.ip_forward = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
View docker-compose.yml
version: '2'
services:
kodexplorer:
image: 'baiyuetribe/kodexplorer'
restart: always
environment:
- DEFAULT_EMAIL=mail@example.com
- VIRTUAL_HOST=cloud.domain.com
- VIRTUAL_PORT=80
@qzm
qzm / ossfs.sh
Last active May 12, 2020
ossfs config
View ossfs.sh
#! /bin/bash
#
# ossfs Automount Aliyun OSS Bucket in the specified direcotry.
#
# chkconfig: 2345 90 10
# description: Activates/Deactivates ossfs configured to start at boot time.
# put into /etc/init.d/ossfs
# chmod a+x /etc/init.d/ossfs
# chkconfig ossfs on
View sysctl.conf
vm.swappiness = 0
kernel.sysrq = 1
net.ipv4.neigh.default.gc_stale_time = 120
# see details in https://help.aliyun.com/knowledge_detail/39428.html
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
@qzm
qzm / openssl
Created Apr 11, 2020
自签名整数
View openssl
openssl genrsa -out domain.key 2048
openssl req -new -key domain.key -out domain.csr
openssl x509 -req -in domain.csr -signkey domain.key -out domain.crt
@qzm
qzm / aria2.conf
Last active Sep 19, 2022
Best aria2 Config
View aria2.conf
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5