/ MACOS, GITHUB, JEKYLL

맥에서 GitHub Page와 Jekyll 연동한 블로깅 시작하기

최초의 블로깅

GitHubJekyll을 연동하여 블로깅을 시작함

javascript highlight

function syntaxHighlight(code) {
   var foo = 'Hello World';
   var bar = 100;
}
var agent = navigator.userAgent.toLowerCase();
        var _iPhone = false;
        var _chrome = false;
        var result = false;
        if (agent.indexOf("iphone") != -1) {
            _iPhone = true;
        }
        if (agent.indexOf("chrome") != -1) {
            _chrome = true;
        }

bash highlight

➜  kiros33.github.io git:(master) git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 46.26 KiB | 23.13 MiB/s, done.
Total 6 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:kiros33/kiros33.github.io.git
   796e219..a570287  master -> master

python highlight

#!/usr/bin/python

import sys
import base64

def error_handle():
    print '[+] use: $python Base64EnDecoder.py -e [file] -o [file]'
    print '[+] use: $python Base64EnDecoder.py -d [file] -o [file]'
    sys.exit(1)

if len(sys.argv) != 5:
    error_handle()

try:
    input = open(sys.argv[2], 'rb').read()
except:
    print '[*] error: file does NOT exist.'
    sys.exit(1)

try:
    if sys.argv[1] == '-e':
        data = base64.b64encode(input)
    elif sys.argv[1] == '-d':
        data = base64.b64decode(input)
    else:
        print '[*] error: input option is \'-e\' or \'-d\'.'
        error_handle()
except:
    print '[*] error: incorrect padding'
    sys.exit(1)

if sys.argv[3] == '-o':
    output = open(sys.argv[4], 'wb')
    output.write(data)
else:
    print '[*] error: output option is \'-o\'.'
    error_handle()