Skip to content

Instantly share code, notes, and snippets.

View roccozanni's full-sized avatar

Rocco Zanni roccozanni

View GitHub Profile
// Create http request
let message = CFHTTPMessageCreateRequest(kCFAllocatorDefault, "GET", self.url, kCFHTTPVersion1_1).takeRetainedValue()
// Create stream
let readStream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, message).takeRetainedValue()
// Set stream properties
CFReadStreamSetProperty(readStream, NSStreamNetworkServiceTypeBackground, NSStreamNetworkServiceTypeBackground)
CFReadStreamSetProperty(readStream, kCFStreamPropertyHTTPShouldAutoredirect, kCFBooleanTrue)
function FindProxyForURL(url, host) {
return “PROXY <your_mac_lan_ip>:<your_charles_proxy_port>”;
}
*** Terminating app due to uncaught exception 'std::__1::system_error', reason: 'mutex lock failed: Invalid argument'
Last Exception Backtrace:
0 libc++abi.dylib 0x00000001817cf66c std::__terminate(void (*)()) + 16
1 libc++abi.dylib 0x00000001817cef84 __cxa_throw + 132
2 libc++.1.dylib 0x00000001817a578c std::__1::__throw_system_error(int, char const*) + 84
3 CFNetwork 0x00000001834d0150 PAC::PACClient::finishPAC() + 24
4 CFNetwork 0x00000001834cffe4 ___ZN3PAC9PACClient10initializeEPKvPK7__CFURL_block_invoke + 96
5 CFNetwork 0x0000000183438978 BlockHolderVar<std::__1::shared_ptr<__CFArray const>, std::__1::shared_ptr<__CFError> >::invoke_normal(std::__1::shared_ptr<__CFArray const>, std::__1::shared_ptr<__CFError>) + 88
*** Terminating app due to uncaught exception 'std::__1::system_error', reason: 'mutex lock failed: Invalid argument'
Last Exception Backtrace:
0 libc++abi.dylib 0x000000018f7af66c std::__terminate(void (*)()) + 16
1 libc++abi.dylib 0x000000018f7aef84 __cxa_throw + 132
2 libc++.1.dylib 0x000000018f78578c std::__1::__throw_system_error(int, char const*) + 84
3 CFNetwork 0x00000001914b0150 PAC::PACClient::finishPAC() + 24
4 CFNetwork 0x00000001914b0000 ___ZN3PAC9PACClient10initializeEPKvPK7__CFURL_block_invoke + 124
5 CFNetwork 0x0000000191418978 BlockHolderVar<std::__1::shared_ptr<__CFArray const>, std::__1::shared_ptr<__CFError> >::invoke_normal(std::__1::shared_ptr<__CFArray const>, std::__1::shared_ptr<__CFError>) + 88
prompt_kubectl()
{
# Exit if kubectl is not configured
local kubectl_config="$HOME/.kube/config"
if [[ ! -a "$kubectl_config" ]]; then
return
fi
# Get current context
local kubectl_context=$(cat $kubectl_config | grep "current-context:" | sed "s/current-context: //")
Verifying that +roccozanni is my blockchain ID. https://onename.com/roccozanni

Keybase proof

I hereby claim:

  • I am roccozanni on github.
  • I am roccozanni (https://keybase.io/roccozanni) on keybase.
  • I have a public key whose fingerprint is 7B6A 1241 2B6B E7F0 C278 9AD8 6043 40D7 B683 4C08

To claim this, I am signing this object:

@roccozanni
roccozanni / gist:8730419
Created January 31, 2014 11:31
Simulate slow network on Mac
# Create a bandwith/delay configurable pipe
ipfw pipe 1 config bw XXXKBytes/s delay XXXms
# Route traffic to that pipe
ipfw add 1 pipe 1 dst-port XXXX
# Stop routing traffic to that pipe
ipfw delete 1