Skip to content

Instantly share code, notes, and snippets.

View billryan's full-sized avatar

billryan billryan

View GitHub Profile
<!-- mathjax config similar to math.stackexchange -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
@billryan
billryan / script.fex
Created July 21, 2014 15:22
mmc0.fex for cubieboafd2-2card
[product]
version = "1.0"
machine = "cubieboard2"
[platform]
eraseflag = 0
[target]
boot_clock = 912
dcdc2_vol = 1450
@billryan
billryan / pic_composite.py
Created August 26, 2014 08:05
Figure composition
#!/usr/bin/env python2
#-*-coding:utf-8 -*-
import os
import sys
import re
import PIL
from PIL import Image
pic_raw_path = 'pic_raw/'
pic_resize_path = 'pic_resize/'
@billryan
billryan / user_mapping.sh
Created December 21, 2014 00:17
user mapping for docker shared volume
#!/bin/bash
export ORIG_PASSWD=$(grep hexo /etc/passwd)
export ORIG_UID=$(echo $ORIG_PASSWD | cut -f3 -d:)
export ORIG_GID=$(echo $ORIG_PASSWD | cut -f4 -d:)
# set NEW_UID with ORIG_UID if MAP_UID not exist
export NEW_UID=${MAP_UID:=$ORIG_UID}
export NEW_GID=${MAP_GID:=$ORIG_GID}
@billryan
billryan / qiniu_sync
Created April 20, 2015 15:03
Qiniu Sync json
{
"src": "/root/upload",
"dest": "qiniu:access_key=AccessKey&secret_key=SecretKey&bucket=docs4bill&key_prefix=doc/",
"deletable": 0,
"debug_level": 1
}
@billryan
billryan / mkdir4sbt.sh
Created August 5, 2015 02:25
joint compilation of Scala and Java
#!/bin/sh
mkdir -p src/{main,test}/{java,resources,scala}
mkdir lib project target
touch project/Build.scala
# create an initial build.sbt file
cat <<EOF > build.sbt
name := "sbtProject"
# -*- 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
# /etc/rsyslog.d/49-ship-syslog.conf
*.*;syslog;auth,authpriv.none action(
type="omfwd"
Target="logstash.marathon.mesos"
Port="5001"
Protocol="tcp"
)
@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..."
@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>