Skip to content

Instantly share code, notes, and snippets.

View suapapa's full-sized avatar

Homin Lee suapapa

View GitHub Profile
@suapapa
suapapa / apink.txt
Last active October 27, 2015 12:32
random pick n person from input
박초롱
윤보미
정은지
손나은
김남주
오하영
def tour(nodes, graph):
print ">>", nodes, graph
if len(nodes) == 0:
return []
if len(graph) == 0:
return nodes
start_node = nodes[-1]
@suapapa
suapapa / test1.go
Last active August 29, 2015 14:27
goroutine
package main
import "sync"
type atom struct {
sync.Mutex
i uint64
}
func main() {
@suapapa
suapapa / go-ssh.go
Created September 3, 2014 06:41
execute cmd on multiple server via ssh
package main
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"time"
"code.google.com/p/go.crypto/ssh"
@suapapa
suapapa / spam.go
Last active December 16, 2015 08:28
Invitation spammer for Go mini conference Korea 2013.
package main
import (
"encoding/csv"
"log"
"net/smtp"
"os"
)
func main() {
@suapapa
suapapa / gen-cp949_dat.py
Created April 3, 2013 23:12
Script to create cp949.dat of go-charset from the CP949.TXT.
#!/usr/bin/env python
# CP949 specs;
# http://ko.wikipedia.org/wiki/%EC%BD%94%EB%93%9C_%ED%8E%98%EC%9D%B4%EC%A7%80_949
# http://msdn.microsoft.com/ko-kr/goglobal/cc305154.aspx
import re
ptn = re.compile(r'0x([A-F0-9]*)\s*0x([A-F0-9]*)')
@suapapa
suapapa / check-plug.go
Created March 27, 2013 12:57
Check battery status to notify unplug. Tested on my notebook, Dell mini 12.
package main
import (
"fmt"
"log"
"os"
)
const (
PATH_B_STAT = "/sys/class/power_supply/BAT1/status" // Full or Discharging
@suapapa
suapapa / ssl_cipher_suite_names_generate.go
Created February 15, 2013 12:38
fixed it to work with Go 1.x
// This program reads in the contents of [1] from /tmp/tls-parameters.xml and
// writes out a compact form the ciphersuite information found there in.
// It's used to generate the tables in net/base/ssl_cipher_suite_names.cc
//
// [1] http://www.iana.org/assignments/tls-parameters/tls-parameters.xml
package main
import (
"encoding/xml"
"fmt"
@suapapa
suapapa / gdg_events.go
Last active December 12, 2015 07:28
Practice to retrieve and parse GDG chapter's event feed.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"time"
@suapapa
suapapa / Android.mk
Created October 19, 2012 08:05
simple CLI tool to scan i2c devices
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES += i2c_scan.c
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := i2c_scan
include $(BUILD_EXECUTABLE)