Skip to content

Instantly share code, notes, and snippets.

View darjeeling's full-sized avatar

Kwon-Han Bae darjeeling

  • LineCorp
  • Seoul, Korea
  • 12:33 (UTC +09:00)
View GitHub Profile
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jennings
jennings / install-rhodecode.rst
Last active March 28, 2024 21:13
Step-by-step instructions for installing RhodeCode 1.3.6 on Ubuntu Server 12.04 with Nginx 1.2.1 as the reverse proxy. This was written when these were the latest versions; add a comment if the scripts need to change to accommodate changes in newer versions.The script assumes you want to use a SQLite database. Sorry, you'll need to find another …

Setting up RhodeCode on Ubuntu Server 12.04

Goal

  • Everything running on a single Ubuntu Server
  • RhodeCode running in a virtualenv
  • Use SQLite as the database
@dahlia
dahlia / hstore.py
Created February 18, 2012 14:58
PostgreSQL hstore + SQLAlchemy
""":mod:`hstore` --- Using PostgreSQL hstore with SQLAlchemy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note::
I released it under Public Domain. Feel free to use!
It provides :class:`Hstore` type which makes you to store Python
dictionaries into hstore columns in PostgreSQL. For example::
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@lifthrasiir
lifthrasiir / crypto.md
Last active November 14, 2023 07:10
High-level understanding of cryptography

고수준에서 암호학 이해하기

이 글은 메아리 저널에 쓸 목적으로 한동안 작업하던 글입니다. 메아리 특유의 디자인(...)이 싫다면 여기로 링크하셔도 됩니다. 어느 쪽이든간에 의견은 이 아래의 코멘트 란 또는 메아리에 기재되어 있는 메일 주소를 써 주시면 감사하겠습니다. --lifthrasiir

암호학을 사용하는 많은 시스템은 세부적으로 무슨 알고리즘을 쓰는지보다는 그 알고리즘들이 어떻게 연결되어 있는지, 즉 구조가 실제 안전성에 더 큰 영향을 미친다. 따라서 구조와 그 구조를 이루는 빌딩 블럭을 아는 것이 중요한데, 여기에서는 이러한 암호학적 빌딩 블럭과 함께 블럭들이 어떻게 쓰여서 더 큰 구조를 만드는지를 알아 본다.

Key Exchange

키 교환. 두 사람만이 알 수 있는 새로운 키를 만든다. 이 과정이 끝나도 상대방이 내가 아는 사람인진 알 수 없지만 적어도 상대방과 내가 같은 키를 가지고 있다는 건 확신할 수 있다.

from flask import Flask, request, session, g, redirect, url_for
from flask import abort, render_template, flash
app = Flask(__name__)
app.config.from_object(__name__)
hosts = {
'b': "https://code.google.com/p/android/issues/"
's': "https://android.googlesource.com/",
'r': "https://android-review.googlesource.com/",
@ziozzang
ziozzang / README.md
Last active July 30, 2021 10:01
코로나 잔량 백신 검색 스크립트

코로나 백신 잔량 검색 스크립트

  • 네이버 맵 API를 사용 합니다.

  • 언제든지 동작 하지 않을수 있습니다.

  • 그냥 가져가서 쓰세요

  • 지정된 좌표 주변으로 최대 100개의 의료기관을 검색해서 잔량 백신을 검색해서 수량을 알려줍니다.

사용법

  • 파이썬 3 + requests에서 동작 합니다.
@daniellawrence
daniellawrence / tasks.py
Created October 17, 2013 10:54
Queuing fabric tasks and stream reading output using celery & redis - A little bit of evil with tempfiles and stdout redirection.
# RUN ME, I am the worker!
# $ pip install fabric celery-with-redis
# $ celery -A tasks worker -E --loglevel=debug
from celery import Celery
from time import sleep
from fabric.api import env, run, execute
import sys
celery = Celery('tasks', broker='redis://', backend='redis://')
@kkung
kkung / result.md
Created August 14, 2014 02:52
RSA library benchmark
  • RMBP 15" / Early 2013(2.4GHz i7, 16GB RAM), CPython 2.7.6
  • rsa==3.1.4
  • pycrypto==2.6.1
  • cryptography==0.5.3
Cryptography PyCrypto RSA
1.0222690105438232 1.453489065170288 4.905964136123657
1.0008471012115479 1.3903019428253174 4.860486030578613
0.9761111736297607 1.3885319232940674 5.226905107498169