Skip to content

Instantly share code, notes, and snippets.

View chiwanpark's full-sized avatar

Chiwan Park chiwanpark

View GitHub Profile
@chiwanpark
chiwanpark / update-dnsimple
Last active March 27, 2016 10:59
Update DNSimple
#!/bin/bash
CURRENT_IP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'`
curl -H 'X-DNSimple-Token: <EMAIL>:<API_TOKEN>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X PUT \
-d '{"record":{"name":"<DOMAIN_NAME>", "content":"'$CURRENT_IP'"}}' \
https://api.dnsimple.com/v1/domains/chiwanpark.com/records/<DNS_RECORD_ID> \
@chiwanpark
chiwanpark / keybase.md
Created October 15, 2014 13:50
keybase.md

Keybase proof

I hereby claim:

  • I am chiwanpark on github.
  • I am chiwanpark (https://keybase.io/chiwanpark) on keybase.
  • I have a public key whose fingerprint is 13BE C5AB 2123 4E4A CFCF F1FC 9205 2D19 8F14 F96E

To claim this, I am signing this object:

@chiwanpark
chiwanpark / preprocess.py
Created October 10, 2014 16:15
BioGRID/TCGA Preprocessing
# -*- coding: utf-8 -*-
from builtins import float, len, sum, range, set
import click
from codecs import open
from collections import defaultdict
import math
import os
@chiwanpark
chiwanpark / gist:6997265
Created October 15, 2013 19:27
Keyboard Interrupt Example
while True:
try:
print "hi"
except KeyboardInterrupt:
print "bye"
import sys
sys.exit(0)