Skip to content

Instantly share code, notes, and snippets.

Avatar

billryan billryan

View GitHub Profile
@billryan
billryan / webhook.go
Last active Oct 27, 2019
GitHub webhook with Go
View webhook.go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"gopkg.in/go-playground/webhooks.v5/github"
"os"
"os/exec"
@billryan
billryan / config.py
Created Feb 24, 2018
Python config class for different environment
View config.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from os import getenv
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
@billryan
billryan / settings.xml
Created Jul 24, 2017
Maven mirror for Aliyun
View settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@billryan
billryan / spark_swarm.sh
Last active Jan 27, 2017
setup Spark HA with docker swarm mode
View spark_swarm.sh
#!/usr/bin/env bash
docker network create -d overlay spark 2>/dev/null || true
# ignore service remove error
docker service rm spark-master 2>/dev/null || true
sleep 3s
echo "create spark-master service..."
View 49-ship-syslog.conf
# /etc/rsyslog.d/49-ship-syslog.conf
*.*;syslog;auth,authpriv.none action(
type="omfwd"
Target="logstash.marathon.mesos"
Port="5001"
Protocol="tcp"
)
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@billryan
billryan / chinadns-local@.service
Last active Feb 24, 2021
科学上网相关配置文件
View chinadns-local@.service
[Unit]
Description=ChinaDNS Service
After=network.target
[Service]
Type=simple
User=nobody
ExecStart=/usr/bin/chinadns -s %i,8.8.8.8,208.67.222.222:443 -m -p 5353 -y 0.3 -d -c /etc/chnroute.txt
[Install]
@billryan
billryan / README.md
Last active Jan 2, 2021 — forked from chuangbo/README.md
DNSPod DDNS Python Script
View README.md

替换上你的ID, Token, domain, sub_domain 就可以运行了。(ID,Token) 可以从 API 鉴权方式升级为 Token 获得。 脚本会在后台一直运行,初始化时会根据 sub_domain 查询是否已经创建,每隔30秒检查一遍IP,如果修改了就更新IP。

以 Archlinux 为例,按照如下步骤操作即可设置开机启动这个 DDNS 服务。

sudo wget -O /usr/local/bin/dnspod_ddns.py https://gist.github.com/billryan/239778f0821937939c8c140bdddd6840/raw/dnspod_ddns.py
sudo chmod +x /usr/local/bin/dnspod_ddns.py
sudo wget -O /etc/systemd/system/dnspod-ddns.py.service https://gist.github.com/billryan/239778f0821937939c8c140bdddd6840/raw/dnspod-ddns.service
sudo systemctl start dnspod-ddns
@billryan
billryan / 70-noto-cjk-zh-hans.conf
Last active Sep 18, 2017 — forked from anthonywong/20-noto-cjk.conf
思源/Noto CJK fonconfig 設定檔
View 70-noto-cjk-zh-hans.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<!-- /etc/fonts/conf.d/20-noto-cjk-zh-hans.conf
Fallback fonts zh-Hans
-->
<fontconfig>
<match target="pattern">
<test name="lang">
<string>zh-tw</string>
</test>
@billryan
billryan / google_scholar
Last active Jun 28, 2017
unbound configurations for google scholar
View google_scholar
# file: /etc/unbound/google_scholar
local-data: "scholar.google.cn AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.google.com.hk AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.google.com.sg AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.google.com.tw AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.google.com.uk AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.google.com AAAA 2607:f8b0:4005:80a::200e"
local-data: "scholar.l.google.com AAAA 2607:f8b0:4005:80a::200e"