Skip to content

Instantly share code, notes, and snippets.

@simonw
simonw / recover_source_code.md
Last active June 21, 2024 00:11
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
@williballenthin
williballenthin / Microsoft-Windows-Sysmon-schema.txt
Last active April 23, 2023 18:57
example events from sysmon
# generate via: wevtutil gp Microsoft-Windows-Sysmon /getevents /getmessage
name: Microsoft-Windows-Sysmon
guid: 5770385f-c22a-43e0-bf4c-06f5698ffbd9
helpLink:
resourceFileName: C:\Windows\Sysmon.exe
messageFileName: C:\Windows\Sysmon.exe
message:
channels:
channel:
@xnuk
xnuk / hyeong.md
Last active February 11, 2024 15:10
난해한 혀엉.... 언어

이 문서가 여기저기 알려짐에 따라, 이곳에 여러가지 댓글이 달리고 있습니다. 개인적으로는 댓글창을 없애버리고 싶지만 그럴 수 없는 터라, 댓글을 달기 전에 한번씩만 더 생각해주셨으면 합니다.

  • 개인적인 감상은 이곳이 아닌 다른 곳에 적어주세요.
  • 동성애 혐오적인 댓글을 달지 마세요.
  • 기타 "난해한 혀엉... 언어"와 관련없는 댓글을 달지 말아주세요.

위 사항들을 포함해 제 마음에 안 드는 댓글들은 임의로 삭제하고 있습니다. 양해 부탁드립니다.


@dannguyen
dannguyen / matplotlib-basemap-python3x-quakes.md
Last active January 24, 2023 07:22
How to use matplotlib's basemap and Python 3.x to plot earthquake data on a world map

Mapping earthquakes in Python 3.x using matplotlib and matplotlib's basemap

(with a big assist from Anaconda)

I currently use Python for nearly all of my data science and wrangling work these days but usually find myself switching to R to visualize data using ggplot2. This is due in part to ggplot2's general excellence, but also because I had a lot of trouble learning Python's most popular viz library, matplotlib on my own...its homepage is decent enough...but its variety of plotting APIs (--pylab? OOP? %matplotlib???) has led to widely differing examples and best practices among the many online matplotlib guides (not dissimilar to the general problem of trying to practice either Python 2.x or 3.x).

That changed yesterday when I stumbled across [Nicolas P. Rougier's beautifully designed and com

--- pwn ---

EASY

[DEFCON CTF 2012] PP500
[ksnctf] #23 Villager B [GOT SHELL]

MIDDLE EASY

@allieus
allieus / spellchecker.py
Last active August 29, 2015 14:13
네이버 자동 띄어쓰기
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function
import sys
import re
import json
import urllib
from colorama import init, Fore, Back, Style
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn'