For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
##ss-redir 的 iptables 配置(透明代理)
透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则
创建 /etc/ss-redir.json 本地监听 7777
运行ss-redir -v -c /etc/ss-redir.json
iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
| require 'rubygems' | |
| require 'mechanize' | |
| if ARGV.size < 3 | |
| puts %q{Usage: ruby xcode.rb USERNAME PASSWORD "DOWNLOAD_URL" [WGET_PARAMS]} | |
| puts %q{Example: ruby xcode.rb myusername@apple.com 123456 "https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg" } | |
| exit | |
| end | |
| a = Mechanize.new { |agent| |
| #!/usr/bin/env bash | |
| # Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://dash.cloudflare.com/profile/api-tokens | |
| # Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit | |
| # If you want to set the root domain instead of a subdomain, set SUBDOMAIN to "@" | |
| # Step 2: Create an A record on Cloudflare with the subdomain you chose | |
| # Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created. | |
| # Fill in ZONE_ID and REC_ID below | |
| # This step is optional, but will save you 2 requests every time you run this script | |
| # Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating. |
| static void dispatch_repeated_internal(dispatch_time_t firstPopTime, double intervalInSeconds, dispatch_queue_t queue, void(^work)(BOOL *stop)) | |
| { | |
| __block BOOL shouldStop = NO; | |
| dispatch_time_t nextPopTime = dispatch_time(firstPopTime, (int64_t)(intervalInSeconds * NSEC_PER_SEC)); | |
| dispatch_after(nextPopTime, queue, ^{ | |
| work(&shouldStop); | |
| if(!shouldStop) | |
| { | |
| dispatch_repeated_internal(nextPopTime, intervalInSeconds, queue, work); | |
| } |
| /* | |
| Distributed under The MIT License: | |
| http://opensource.org/licenses/mit-license.php | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to |