Skip to content

Instantly share code, notes, and snippets.

View billryan's full-sized avatar

billryan billryan

View GitHub Profile
@billryan
billryan / settings.xml
Created July 24, 2017 12:34
Maven mirror for Aliyun
<?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 / google_scholar
Last active February 7, 2024 10:33
unbound configurations for 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"
@billryan
billryan / webhook.go
Last active August 28, 2023 08:17
GitHub webhook with Go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"gopkg.in/go-playground/webhooks.v5/github"
"os"
"os/exec"
@billryan
billryan / README.md
Last active August 30, 2022 13:41 — forked from chuangbo/README.md
DNSPod DDNS Python Script

替换上你的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 / apple_dns
Last active October 30, 2021 09:26
Unbound configuration
forward-zone:
name: "apple.com"
forward-addr: 223.5.5.5
forward-zone:
name: "itunes.com"
forward-addr: 223.5.5.5
forward-zone:
name: "akadns.net"
forward-addr: 223.5.5.5
forward-zone:
@billryan
billryan / chinadns-local@.service
Last active April 22, 2021 12:52
科学上网相关配置文件
[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 / config.py
Created February 24, 2018 06:16
Python config class for different environment
#!/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 / 70-noto-cjk-zh-hans.conf
Last active September 18, 2017 22:45 — forked from anthonywong/20-noto-cjk.conf
思源/Noto CJK fonconfig 設定檔
<?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 / spark_swarm.sh
Last active January 27, 2017 05:58
setup Spark HA with docker swarm mode
#!/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..."
# /etc/rsyslog.d/49-ship-syslog.conf
*.*;syslog;auth,authpriv.none action(
type="omfwd"
Target="logstash.marathon.mesos"
Port="5001"
Protocol="tcp"
)