Skip to content

Instantly share code, notes, and snippets.

View Rockheung's full-sized avatar

Heung Jun Park Rockheung

View GitHub Profile
@Rockheung
Rockheung / Using Git to Manage a Live Web Site.md
Last active January 10, 2019 07:32 — forked from Nilpo/Using Git to Manage a Live Web Site.md
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@Rockheung
Rockheung / make-ovpn.md
Last active July 21, 2018 09:11
Simple openvpn script with Mikrotik CHR

First, create RAW disk for CHR larger than 128MB. Exact 128MB would work, too.

Second, boot Linode in rescue mode with disk just created above.

After boot, download latest CHR image and write it on disk.

Download link is stable version of CHR raw image at this point.

wget --no-check-certificate https://download.mikrotik.com/routeros/6.41.3/chr-6.41.3.img.zip

If you have multiple disk, you should check which one is to be written. Use command fdisk -l

sudo gunzip -c chr-6.41.3.img.zip | sudo dd of=/dev/sda bs=1M

Shut it down, and make boot profile for CHR. It should be -

@Rockheung
Rockheung / Main-skel.elm
Created March 23, 2018 06:03
Skeleton of elm
module Main exposing (..)
import Html exposing (Html, div, text, program)
-- MODEL
type alias Model =
String
#!/bin/bash
#
#@script : sb_installer.sh
#@about : install streambuilder on client side
#@usage :
# $ wget -q http://repo.streambuilder.pro/open/binary/sb_installer.sh && bash sb_installer.sh
#
# TODO:
# for centos:
# $ cat /etc/redhat-release
@Rockheung
Rockheung / init_setting.md
Last active December 27, 2021 11:03
OpenWRT on MikroTik MetaRouter setting

Set interface for this VM on MikroTik console

/metarouter interface add virtual-machine=mr1 type-dynamic dynamic-bridge=bridge

Enter VM's console

/metarouter console 0

Set lan interface dhcp

root@OpenWrt:/# vi /etc/config/network
@Rockheung
Rockheung / sd
Created November 15, 2018 21:48
afreeca download script
import requests, shutil, os
from time import sleep
URL = {1:'http://211.110.86.210/video/_definst_/smil:mvod/20181116/998/F764D250_208789998_{}.smil/media_b4000000_t64b3JpZ2luYWw=_{}.ts',
2:'http://101.79.136.27/video/_definst_/smil:mvod/20181116/998/B38B6850_208789998_{}.smil/media_b4000000_t64b3JpZ2luYWw=_{}.ts',
3:'http://101.79.136.27/video/_definst_/smil:mvod/20181116/998/1744DC8E_208789998_{}.smil/media_b4000000_t64b3JpZ2luYWw=_{}.ts',
}
DownFolder = '38699638'
try :

Data Structure Chapter 1

C로 배우는 쉬운 자료구조: 이지영 지음: 한빛아카데미

형태에 따른 자료 구조 분류

  1. 단순 구조: 정수, 실수, 문자, 문자열
  2. 선형 구조: 자료들 사이의 관계가 1:1
  3. 비선형 구조: 1:다, 다:다
  4. 파일 구조

자료의 표현

Data Structure Chapter 2 - Array

배열

  • 형태: array[index]

  • 다차원 배열 빠르게 시각화하기: a[3][5][7]와 같은 배열의 경우 7, 5, 3 순으로 가로, 세로, 깊이 방향으로 생각하면 된다.

  • 예제 2-1, 자료형에 대한 메모리 할당 크기 확인하기

#include <stdio.h>

Data Structure Chapter 2 - Pointer

포인터

  • 사용하는 모든 변수는 메모리의 특정 위치에 저장되는데, 그 위치를 나타내는 메모리의 주소를 포인터라고 한다!
/* 포인터 변수의 크기는 일반적으로 메모리 주소의 크기인 2바이트 */
/* 포인터 변수의 타입은 해당 포인터가 가리키는 데이이터 길이를 뜻한다고 볼 수 있다. */
/* 그러니까 액세스 범위를 뜻한다고도 할 수 있다. */

Data Structure Chapter 2 - Structure

구조체

  • 배열과 비슷하지만 각 구성요소의 타입을 명시해야
/* 사용1 */
struct employee {
    char name[10];
    int year;