Skip to content

Instantly share code, notes, and snippets.

🍻
Focusing

icyleaf icyleaf

🍻
Focusing
Block or report user

Report or block icyleaf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@icyleaf
icyleaf / load_tar_to_docker.sh
Last active Aug 1, 2016
Save all docker images to disk & Load archive file to docker.
View load_tar_to_docker.sh
for file in $(ls *.tar); do
echo "load $file"
docker load -i $file
done
View README.md

icyleaf's atom settings, automatic update by sync-settings

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@icyleaf
icyleaf / surge_main.conf
Created May 12, 2016 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
View surge_main.conf
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0
View gen_cert.sh
#!/bin/sh
# create self-signed server certificate:
# source: https://github.com/michaelliao/itranswarp.js/blob/master/conf/ssl/gencert.sh
read -p "Enter your domain [www.example.com]: " DOMAIN
echo "Create server key..."
openssl genrsa -des3 -out $DOMAIN.key 1024
View optimize-nat-for-ps4.md

PS4 网络环境优化

0 案例环境

  • 中国电信 100M 宽带接入,局域网段 192.168.1/24,光猫拥有管理员权限(后继需要);
  • NetGear WNDR3700v2 跑 OpenWRT 作为家庭主路由器, WAN IP 192.168.1.234,局域网段 10.10.10/24
  • PS4 无线连家庭网络(主),IP 10.10.10.3;有线连光猫(备),IP 192.168.1.3
View ibrute.rb
#!/usr/bin/env ruby
require 'plist'
require 'rest_client'
def try_pass(apple_id, password)
url = "https://fmipmobile.icloud.com/fmipservice/device/#{apple_id}/initClient"
basicOauth = Base64.encode64("#{apple_id}:#{password}")
headers = {
View project.pbxproj
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
000A6E5618E024720032B816 /* discount_time.png in Resources */ = {isa = PBXBuildFile; fileRef = 000A6E5218E024720032B816 /* discount_time.png */; };
@icyleaf
icyleaf / ar_migrate.rb
Last active Nov 28, 2019
ActiveRecord type of integer (tinyint, smallint, mediumint, int, bigint)
View ar_migrate.rb
# activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb
# Maps logical Rails types to MySQL-specific data types.
def type_to_sql(type, limit = nil, precision = nil, scale = nil)
return super unless type.to_s == 'integer'
case limit
when 1; 'tinyint'
when 2; 'smallint'
when 3; 'mediumint'
when nil, 4, 11; 'int(11)' # compatibility with MySQL default
You can’t perform that action at this time.