Skip to content

Instantly share code, notes, and snippets.

View theand's full-sized avatar

Heesang Chae theand

  • South Korea
View GitHub Profile
@theand
theand / foxtube extract.py
Created August 23, 2012 08:07
foxtube 앱으로 아이폰에 받아놓은 동영상을 iFunbox로 추출한 다음, 알아보기 힘든 *.mp4의 파일 이름을 *.info의 xml 문서에서 유투브 제목을 찾아내서 바꿔줌.
from bs4 import BeautifulSoup
import os.path
import glob
os.chdir('c:\\temp\\swing\\')
for f in glob.glob('*.info'):
baseFile = os.path.basename(f)
srcName = os.path.splitext(baseFile)[0]
@theand
theand / gist:3950325
Last active October 12, 2015 01:28
#ObjectiveC DebugLog macro
/*
DebugLog for Objective-C
from http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code/302246#302246
paste in .pch
*/
#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DebugLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
@theand
theand / gist:4023628
Last active October 12, 2015 11:58
#ObjectiveC get main view
UIWindow *window = [UIApplication sharedApplication].keyWindow;
ViewController *rootViewController = window.rootViewController;
DebugLog(@"%@", rootViewController.myWebView);
@theand
theand / timesetting.h
Created January 18, 2013 06:09
#BASH adjust system time to korean local time.
#!/bin/sh
rdate -s time.bora.net && /sbin/clock -w
@theand
theand / home_backup.sh
Last active December 11, 2015 06:58
#BASH full backup script for entire account
#!/bin/sh
prefix="home"
home_root="/home/"
backup_root="/backup/home_backup"
dir_name="$(date +%y%m%d)"
if [ ! -d $home_root ] ; then
echo "please type the home path"
fi
@theand
theand / mysql_raw_back.sh
Last active December 17, 2015 11:55
#BASH full backup for mysql raw db
#!/bin/sh
prefix="mysql_raw"
mysql_root="/var/lib/mysql"
backup_root="/backup/mysql_raw_backup"
dir_name="$(date +%y%m%d)"
service mysqld stop
service httpd stop
@theand
theand / mysql_sql_back.sh
Last active December 11, 2015 06:59
#BASH full backup for mysql dump
#!/bin/sh
prefix="mysql"
mysql_bin="/usr/bin/"
mysqldb_root="/var/lib/mysql/"
backupdb_root="/backup/mysql_sql_backup/"
dir_name="$(date +%y%m%d)"
if [ ! -d $mysqldb_root ] ; then
echo "please type the database path"
fi
@theand
theand / remote_home_backup.sh
Last active December 11, 2015 07:09
#BASH execute remote script, fetch archive, delete old archive
#!/bin/bash
eval `ssh-agent`
keychain id_dsa
. /root/.keychain/localhost-sh
remote_dir="/backup/home_backup/latest_home_backup"
local_dir="/backup/home_backup"
dir_name="$(date +%Y%m%d)"
@theand
theand / remote_rawdb_backup.sh
Created January 18, 2013 13:30
#BASH execute remote script, fetch archive, delete old archive
#!/bin/bash
eval `ssh-agent`
keychain id_dsa
. /root/.keychain/localhost-sh
remote_dir="/backup/mysql_raw_backup/latest_mysql_raw_backup"
local_dir="/backup/mysql_raw_backup"
@theand
theand / remote_sql_backup.sh
Created January 18, 2013 13:34
#BASH execute remote script, fetch archive, delete old archive
#!/bin/bash
eval `ssh-agent`
keychain id_dsa
. /root/.keychain/localhost-sh
remote_dir="/backup/mysql_sql_backup"
local_dir="/backup/mysql_sql_backup"