Skip to content

Instantly share code, notes, and snippets.

View recall704's full-sized avatar
💭
I may be slow to respond.

recall704 recall704

💭
I may be slow to respond.
View GitHub Profile
@recall704
recall704 / supervisord.service
Created March 28, 2016 07:06 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
@recall704
recall704 / tmux-cheatsheet.markdown
Created July 13, 2017 02:41 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@recall704
recall704 / do-debian8-locale-issues.md
Created June 4, 2018 01:53 — forked from 5car1z/do-debian8-locale-issues.md
Debian 8 DO Locale Issues Fix

Debian 8 DO Locale Issues Fix

Problem

"Locale problems" in both the 32-bit & 64-bit versions of Debian 8 droplets

Create a new Debian 8 droplet and login as root:

@recall704
recall704 / gen_Corefile.sh
Created January 15, 2019 06:18 — forked from missdeer/gen_Corefile.sh
generate Corefile which uses your ISP's DNS servers to resolve domain names in China and uses OpenDNS/Cloudflare/Google DNS servers to resolve domain names outside China for CoreDNS. You should change 116.228.111.118 180.168.255.18 to your ISP's DNS server address or use public DNS server such as 114/DNSPod etc. directly.
#!/bin/bash
echo ". {" > Corefile
echo " forward . 208.67.222.222:443 208.67.222.222:5353 208.67.220.220:443 208.67.220.220:5353 tls://1.0.0.1 tls://8.8.8.8 tls://8.8.4.4 {" >> Corefile
china=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
apple=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
google=`curl https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/google.china.conf -s | while read line; do awk -F '/' '{print $2}' | grep -v '#' ; done | paste -sd " " -`
echo " except $china $apple $google" >> Corefile
echo " }" >> Corefile
echo " proxy . 116.228.111.118 180.168.255.18" >> Corefile
echo " log" >> Corefile
@recall704
recall704 / trackers-list-aria2.sh
Created June 12, 2019 11:20 — forked from DogeVenci/trackers-list-aria2.sh
[trackers-list-aria2.sh] 自动更新bt-tracker #shell #aria2 #bt #awk
#!/bin/bash
/usr/sbin/service aria2 stop
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
if [ -z "`grep "bt-tracker" /root/.aria2/aria2.conf`" ]; then
sed -i '$a bt-tracker='${list} /root/.aria2/aria2.conf
echo add......
else
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /root/.aria2/aria2.conf
echo update......
fi
@recall704
recall704 / vpc-ip-address-to-container-amazon.sh
Created July 23, 2019 09:46 — forked from dbathgate/vpc-ip-address-to-container-amazon.sh
Assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Description: How to assign VPC addresses to Docker containers associated as secondary IP addresses to an ENI in AWS
# Operating System: Amazon Linux AMI 2016.09.1 (HVM)
# Prerequisites:
# - Assign N number of secondary IP addresses to network interface on Docker host
# - Each new container requires additional assignment of secondary IP addresses
# - Containers can be launched with --net=none to avoid adding a Docker networked NIC (docker run --net=none -d imageId)
# Credit to https://github.com/jpetazzo/pipework for steps on linking IP address
################# Setup Bridge of eth0 ######################
yum install bridge-utils -y
@recall704
recall704 / ipset.service
Last active August 7, 2019 03:14 — forked from meanevo/ipset.service
IPSet settings persistence
#
# reference: http://namsep.blogspot.com/2015/12/yad-centos-7-iptables-ipset-and-fail2ban.html
# reference: http://pkgs.fedoraproject.org/cgit/ipset.git/tree/ipset.service
# file location: /etc/systemd/system/ipset.service
# cp ipset.service /etc/systemd/system
# systemctl enable ipset.service
# systemctl start ipset
# systemctl status ipset.service
#
# mkdir /etc/ipset
@recall704
recall704 / gzip.go
Created September 6, 2019 07:49 — forked from alex-ant/gzip.go
golang: gzip and gunzip
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"log"
)
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@recall704
recall704 / human_time_duration.py
Created October 13, 2020 14:57 — forked from borgstrom/human_time_duration.py
Python: Convert seconds (duration) to human readable string
TIME_DURATION_UNITS = (
('week', 60*60*24*7),
('day', 60*60*24),
('hour', 60*60),
('min', 60),
('sec', 1)
)
def human_time_duration(seconds):