Skip to content

Instantly share code, notes, and snippets.

View qzm's full-sized avatar
🚀
I may be slow to respond.

Aaron Qiu qzm

🚀
I may be slow to respond.
View GitHub Profile
@qzm
qzm / web.sh
Created April 14, 2021 04:00
get website server
curl -sSI $1 | grep -i 'server:' | sed -r "s/server:\ (\w|)/\1/i"
@qzm
qzm / pritunl.sh
Last active March 8, 2021 05:24
Install Pritunl
#!/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 March 7, 2021 12:17
Install yum-cron
# 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 February 25, 2024 02:56
UFW配置
# ------- 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
@qzm
qzm / sysctl.conf
Created May 21, 2020 09:03
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
@qzm
qzm / docker-compose.yml
Created May 12, 2020 09:51
kodexplorer
version: '2'
services:
kodexplorer:
image: 'baiyuetribe/kodexplorer'
restart: always
environment:
- [email protected]
- VIRTUAL_HOST=cloud.domain.com
- VIRTUAL_PORT=80
@qzm
qzm / ossfs.sh
Last active May 12, 2020 09:48
ossfs config
#! /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
@qzm
qzm / sysctl.conf
Created April 22, 2020 15:11
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 April 11, 2020 03:44
自签名整数
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 November 15, 2024 21:19
Best aria2 Config
### 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