Skip to content

Instantly share code, notes, and snippets.

View gitsrc's full-sized avatar
🦄
welcome

GITSRC gitsrc

🦄
welcome
View GitHub Profile
@gitsrc
gitsrc / 阿里云云盾卸载.sh
Created January 10, 2019 02:59
阿里云云盾卸载.sh
1.卸载云盾
curl -sSL http://update.aegis.aliyun.com/download/quartz_uninstall.sh | sudo bash
rm -rf /usr/local/aegis
rm /usr/sbin/aliyun-service
rm /lib/systemd/system/aliyun.service
阿里云其他进程
sudo systemctl stop accounts-daemon.service
sudo systemctl disable accounts-daemon.service
sudo systemctl stop aliyun-util.service
@gitsrc
gitsrc / haproxy.service
Created January 21, 2019 02:56
haproxy.service
[Unit]
Description=tunlink
Documentation=tunlink
After=network.target
[Service]
Type=simple
StandardError=journal
ExecStart=/usr/local/sbin/haproxy -f /etc/haproxy/haproxy.cfg
ExecReload=/bin/kill -HUP $MAINPID
@gitsrc
gitsrc / aes-cfb-example.go
Created February 16, 2019 06:57 — forked from temoto/aes-cfb-example.go
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))
@gitsrc
gitsrc / Pharos_proxy_conf.acl
Last active April 28, 2019 13:23
Pharos_proxy_acl_conf
[Rule]
URL,203.205.146.59:80,DIRECT
URL,203.205.128.103:443,DIRECT
IP-CIDR,113.0.0.0/13,DIRECT
IP-CIDR,113.96.0.0/16,DIRECT
IP-CIDR,183.0.0.0/10,DIRECT
IP-CIDR,14.0.0.0/21,DIRECT
IP-CIDR,203.205.0.0/16,DIRECT
IP-CIDR,101.0.0.0/22,DIRECT
@gitsrc
gitsrc / golang_ecdh_X25519.go
Created May 2, 2019 08:34
golang_ecdh_X25519
package main
import (
"bytes"
"crypto/rand"
"fmt"
"github.com/aead/ecdh"
"log"
)
@gitsrc
gitsrc / letsencrypt.sh
Last active December 12, 2020 04:13
letsencrypt
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --standalone --email test@gmail.com -d test.domain
@gitsrc
gitsrc / compile-haproxy.sh
Created June 6, 2019 03:04 — forked from meanevo/compile-haproxy.sh
Compile HAProxy from source on CentOS 7
# Make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel
# Download/Extract source
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz
tar -zxvf /tmp/haproxy.tgz -C /tmp
cd /tmp/haproxy-*
# Compile HAProxy
# https://github.com/haproxy/haproxy/blob/master/README
make \
TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
@gitsrc
gitsrc / send_udp.c
Created June 13, 2019 05:53
linux c send udp
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include "../common/common.h"
int sendUdpPackage(char *udpPackage, Config_INI *config) {
struct sockaddr_in servaddr;
@gitsrc
gitsrc / libuv_tcp_redis_server_example.c
Last active October 22, 2019 10:04
libuv_tcp_redis_server_example.c
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "hiredis/hiredis.h"
#include <string.h>
#include "uv.h"
typedef struct {
uv_write_t req;
@gitsrc
gitsrc / install-firacode.sh
Created November 26, 2019 02:11 — forked from nikhita/install-firacode.sh
How to install FiraCode font on Linux
mkdir -p ~/.local/share/fonts
for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done
fc-cache -f