Skip to content

Instantly share code, notes, and snippets.

View suapapa's full-sized avatar

Homin Lee suapapa

View GitHub Profile
@suapapa
suapapa / dependencies.sh
Created May 10, 2012 03:13
Visualize dependencies of binaries and libraries on Linux
#!/bin/bash
# Original script came from;
# http://domseichter.blogspot.com/2008/02/visualize-dependencies-of-binaries-and.html
# Written by Dominik Seichter and added patch from pfree
# analyze a given file on its
# dependecies using ldd and write
# the results to a given temporary file
#
@suapapa
suapapa / image_to_byte_array.py
Created June 15, 2012 07:03
Convert image file to C byte array
#!/usr/bin/python
import sys
import Image
fileName = sys.argv[1]
img = Image.open(fileName)
img = img.convert('L')
@suapapa
suapapa / IgorplugUDP.py
Created July 1, 2012 00:51
IgorplugUDP.py -- python transcoder for Igorplug-UDP to lirc
#!/usr/bin/python
# IgorplugUDP.py -- python transcoder for Igorplug-UDP to lirc
# Dr. Frank Borkenhagen
__version__ = "0.0.1"
__author__ = "Dr. Frank Borkenhagen"
__homepage__= "http://home.arcor.de/borkenhagen/IgorplugUDP"
def __doc__():
print """
@suapapa
suapapa / xml_unmarshal.go
Created July 9, 2012 13:26
golang: xml unmarshal practice
package main
import (
"encoding/xml"
"fmt"
"log"
)
var encoded = `
<list><value>a</value>
@suapapa
suapapa / record_mms.sh
Created July 12, 2012 11:52
record mms steram in mp3
#!/bin/bash
# example
# $ mkdir -p archive
# $ ./record_mms mms://118.223.168.32/eFM test 1 archive/
MMS_ADDR=$1
PROGRAM_NAME=$2
HOW_LONG_MIN=$3
DEST_DIR=$4
#!/usr/bin/env python
import os, sys
import subprocess
import StringIO
import xml.dom.minidom
def getTop():
for v in ('TOP', 'ANDROID_BUILD_TOP'):
if v in os.environ:
@suapapa
suapapa / gen_gitolite_conf.py
Created August 16, 2012 08:34
Script to generate conf file for gitolite in specific directory
#!/usr/bin/python
import os
def print_conf_list(project_root, project_name = ""):
root = os.path.realpath(project_root)
repositories_root = root[:root.find("repositories") + len("repositories")]
if not project_name:
project_name = root[len(repositories_root) + 1:]
project_name = project_name.replace("/", "_")
@suapapa
suapapa / w1.go
Created August 29, 2012 10:50
insight_codig_quiz_event_week_1
/*
* Copyright (C) 2012 Homin Lee <homin.lee@suapapa.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@suapapa
suapapa / s5k4ecgx_genfw.py
Created September 7, 2012 13:13
generate firmware for s5k4ecgx driver
#!/usr/bin/python
# -*- coding: utf-8 -*-
# s5k4ecgx_genfw.py - generate firmware for s5k4ecgx driver
#
# Copyright (C) 2012 Homin Lee <homin.lee@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@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)