Skip to content

Instantly share code, notes, and snippets.

View cyrilpic's full-sized avatar

Cyril Picard cyrilpic

View GitHub Profile
@cyrilpic
cyrilpic / gist:264ced9732f602983344
Created July 20, 2015 07:43
Numba function with LLVM IR parsing error
@jit("float64[:], float64[:], float64[:], int64, float64, float64, float64[:]", nopython=True)
def cable_cost_function(angles, x1, x2, n, D2, a, memo):
t1 = angles[:n]
t2 = angles[n:]
cost = 0.
for i in range(n):
s1 = np.sin(t1[i])
c1 = np.cos(t1[i])
s2 = np.sin(t2[i])
c2 = np.cos(t2[i])
@cyrilpic
cyrilpic / apache_serviceproxy_customsites_disableproxy.conf
Created December 24, 2015 11:06
Disable OS X Server proxied services
<VirtualHost *:80>
ServerName www.example.com
ProxyPreserveHost On
SetEnv proxy-chain-auth on
RequestHeader set X-Forwarded-Proto "http"
RequestHeader set X-Forwarded-Port "80"
ProxyPass / http://127.0.0.1:34580/
ProxyPassReverse / http://127.0.0.1:34580/
</VirtualHost>
#!/bin/bash
# Use certbot brewed version
insert_into_keychain() {
openssl pkcs12 -export -inkey /etc/letsencrypt/live/$1/privkey.pem -in /etc/letsencrypt/live/$1/cert.pem -certfile /etc/letsencrypt/live/$1/fullchain.pem -out /etc/letsencrypt/live/$1/letsencrypt_sslcert.p12 -passout pass:topsecret
SHA_NEW=`openssl pkcs12 -in /etc/letsencrypt/live/$1/letsencrypt_sslcert.p12 -nomacver -nodes -passin pass:topsecret | openssl x509 -noout -fingerprint -sha1 | cut -f2 -d'=' | sed 's/://g'`
if [[ $2 != $SHA_NEW ]]; then
# New certificate available
# Import into keychain