Skip to content

Instantly share code, notes, and snippets.

View shuxiao9058's full-sized avatar
🎯
Focusing

Aaron Ji shuxiao9058

🎯
Focusing
View GitHub Profile
@shuxiao9058
shuxiao9058 / Makefile.golang
Created October 7, 2015 16:23 — forked from dnishimura/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@shuxiao9058
shuxiao9058 / README.md
Created September 19, 2016 13:47 — forked from doitian/README.md
Scripts to control Vitamin-R

Usage

osascript Start.applescript "objective" "tag1,tag2"
osascript Stop.applescript

I have skipped most Vitamin-R workflows. See the attached settings snapshot. If you have them enabled, you need to update the script to handle different steps.

I use the scripts in my org pomodoro script

@shuxiao9058
shuxiao9058 / README.md
Created November 21, 2016 07:58 — forked from e7d/README.md
[Debian] Build a Squid transparent proxy from source code
@shuxiao9058
shuxiao9058 / EmacsKeyBinding.dict
Created November 27, 2016 07:32 — forked from jwreagor/EmacsKeyBinding.dict
Global Emacs Key Bindings for OS X
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally
@shuxiao9058
shuxiao9058 / Mount TimeCapsule on RaspberryPi
Created December 25, 2016 14:19 — forked from Gr1N/Mount TimeCapsule on RaspberryPi
Mount TimeCapsule on RaspberryPi
# Install dependencies
% apt-get install cifs-utils
# Create mount point folder
% mkdir /mnt/capsule
# Create credentials file
% touch /root/.cifs/capsule
% cat /root/.cifs/capsule
username=username
@shuxiao9058
shuxiao9058 / Installation.md
Last active May 10, 2017 05:10 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
curl http://blog.monstuff.com/ad-block-pac.js | \
grep dnsDomainIs | \
grep -v '//' | \
grep -v 'function' | \
awk -F '[""]' '{print $2}' | \
awk '$1 ~ /^\./ {printf "DOMAIN-SUFFIX,%s,ADBLOCK\n",substr($1,2)} $1 !~ /^\./ {printf "DOMAIN,%s,ADBLOCK\n",$1}' \
> adblock.txt
@shuxiao9058
shuxiao9058 / sr_adb.conf
Created September 2, 2017 14:17 — forked from mcxiaoke/sr_adb.conf
surge adblock rules
# Shadowrocket Rules with AdBlock (https://github.com/h2y/Shadowrocket-ADBlock-Rules)
# by Moshel
# 17-5-5
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlynatics.com,captive.apple.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server =
[Rule]
@shuxiao9058
shuxiao9058 / Tuto.md
Created April 19, 2018 08:59 — forked from d12frosted/Tuto.md
Starting Emacs in GUI with shell environment variables correctly set

Problem

When starting Emacs.app on Mac, the Emacs doesn't have some environment variable set correctly. Typically it is terrible when you use GPG, pinentry-mac, gpg-agent But also a lot of different variables used to make git works correctly, etc...

Solution

  1. Create the file ~/bin/init-app-env.sh:
@shuxiao9058
shuxiao9058 / nginx-install.sh
Created August 22, 2018 10:25 — forked from abola/nginx-install.sh
Nginx install step with CentOS 6.7 min
#!/bin/sh
# required install
yum -y groupinstall 'Development Tools'
yum -y install wget patch git
yum -y install pcre-devel zlib-devel openssl-devel
# nginx download
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar zxvf nginx-1.8.1.tar.gz