Skip to content

Instantly share code, notes, and snippets.

View Taehun's full-sized avatar
👋
Hello world

Taehun Kim Taehun

👋
Hello world
View GitHub Profile
@Taehun
Taehun / gist:960475
Created May 7, 2011 12:59
switch area case in gcc
#include <stdio.h>
int main(void)
{
switch (15) {
case 10 ... 20:
printf("This case run.\n");
break;
default:
printf("Default\n");
@Taehun
Taehun / gist:1359720
Created November 11, 2011 23:56
연결 리스트 예제
#include <stdio.h>
#include <arch/types.h>
/**
* @brief 이중 연결 리스트 아이템.
*/
struct list_item {
struct list_item *prev, *next;
};
@Taehun
Taehun / vimrc
Last active June 27, 2022 08:13
vimrc
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
"=== For linux kernel ===
"set noexpandtab
"set tabstop=8
"set shiftwidth=8
"set softtabstop=8
@Taehun
Taehun / merge_sub.py
Created April 3, 2012 12:19
Python: 리눅스용 한/영 통합자막 생성 스크립트
#!/usr/bin/python
# -*- coding:utf-8 -*-
# 사용법: ./merge_sub.py <자막 파일>
import sys
import os
import re
def main(argv):
en_start = False
@Taehun
Taehun / pcap_exam.c
Created April 26, 2012 19:30
libpcap example code
#include <pcap.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
@Taehun
Taehun / w5300e01_defconfig
Last active October 9, 2015 23:48
w5300e01_defconfig: WIZnet(http://wiznet.co.kr)'s W5300E01-ARM board linux kernel configuration
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.6.0-rc3 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_NO_IOPORT=y
CONFIG_STACKTRACE_SUPPORT=y
@Taehun
Taehun / hello.c
Last active October 11, 2015 11:27
Linux Kernel Module Example: Hello kernel
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int __init hello_init(void)
{
printk(KERN_INFO "Hello kernel.\n");
return 0;
}
@Taehun
Taehun / nf.c
Created October 9, 2012 01:08
Linux Kernel Module Example: Netfilter
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netfilter_ipv4.h>
#include <linux/skbuff.h>
#include <linux/udp.h>
#include <linux/ip.h>
/* This function to be called by hook. */
static unsigned int
hook_func(unsigned int hooknum,
@Taehun
Taehun / stream.sh
Created October 9, 2012 01:15
Live stream shell script using ffmpeg in justin.tv
#!/bin/sh
# ref> http://onestep.tistory.com/83
INRES="1920x1080" # input resolution
OUTRES="640x360"
FPS="20" # target FPS
# Justin
STREAM_KEY="live_29225937_MudL5ituoYdWTqHSZkIrMqMxKTi0OG"
URL="rtmp://live.justin.tv/app/$STREAM_KEY"
@Taehun
Taehun / define_const.c
Last active October 12, 2015 08:57
Define #define constant for compile time in gcc
#include <stdio.h>
#define _2_0 (1)
#define _2_1 (_2_0*2)
#define _2_2 (_2_1*2)
#define _2_3 (_2_2*2)
#define _2_4 (_2_3*2)
#define _2_5 (_2_4*2)
#define _2_6 (_2_5*2)
#define _2_7 (_2_6*2)