Skip to content

Instantly share code, notes, and snippets.

View billryan's full-sized avatar

billryan billryan

View GitHub Profile
# -*- 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 / 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"
@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 / 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 / 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 / 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
<!-- mathjax config similar to math.stackexchange -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>