Skip to content

Instantly share code, notes, and snippets.

@xxhank
xxhank / ad.conf
Last active August 10, 2019 07:43
Kitsunebi
[Rule]
# DNS
IP-CIDR,1.1.1.1/32,PROXY
IP-CIDR,1.0.0.1/32,PROXY
IP-CIDR,8.8.8.8/32,PROXY
IP-CIDR,8.8.4.4/32,PROXY
IP-CIDR,9.9.9.9/32,PROXY
IP-CIDR,149.112.112.112/32,PROXY
IP-CIDR,208.67.222.222/32,PROXY
IP-CIDR,208.67.220.220/32,PROXY
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
#!/bin/sh
# Set Linux PATH Environment Variables
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check If You Are Root
if [ $(id -u) != "0" ]; then
clear
echo -e "\033[31m Error: You must be root to run this script! \033[0m"
@xxhank
xxhank / one-key-shadowsocks.sh
Last active August 29, 2015 14:05
one key install shadowsocks-libev on cent-os, and optimize net
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#===============================================================================================
# System Required: CentOS6.x (32bit/64bit)
# Description: Install Shadowsocks(libev) for CentOS
# Author: Teddysun <i@teddysun.com>
# Intro: http://teddysun.com/357.html
#===============================================================================================
@xxhank
xxhank / optimizer_centos
Created August 11, 2014 03:41
something about centos
#!/bin/bash
#author suzezhi
#this script is only for CentOS 6
#check the OS
platform=`uname -i`
if [ $platform != "x86_64" ];then
echo "this script is only for 64bit Operating System !"
exit 1
fi
echo "the platform is ok"
@xxhank
xxhank / disable-clang-warning
Created May 29, 2014 09:54
disable-clang-warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-bridge-casts-disallowed-in-nonarc"
CGImageSourceUpdateData(imageSource, (__bridge CFDataRef)imageData, totalSize == expectedSize);
#pragma clang diagnostic pop
@xxhank
xxhank / dispatch-source
Created May 29, 2014 09:31
dispatch-source
#if DEBUG
// 2
dispatch_queue_t queue = dispatch_get_main_queue();
// 3
static dispatch_source_t source = nil;
// 4
__typeof(self) __weak weakSelf = self;
####