Skip to content

Instantly share code, notes, and snippets.

@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
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message
@ihciah
ihciah / subtitle_downloader.py
Last active March 5, 2023 10:33
Xunlei subtitle downloader
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ = 'ihciah'
# cid_hash_file function from https://github.com/binux/lixian.xunlei/blob/master/libs/tools.py
# Gist: https://gist.github.com/ihciah/30eda05ca36ee9f9f190067538b0ae04
import hashlib
import inotify.adapters
import os
import sys
@phith0n
phith0n / sqlmap_api.dockerfile
Created November 5, 2016 20:38
Docker提高生产力之SQLMAP API
FROM python:2.7
ENV VERSION 1.0.11
RUN apt-get update && apt-get install -y \
git --no-install-recommends
RUN mkdir /app
WORKDIR /app
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@idealhack
idealhack / ingress-passcode.js
Last active November 13, 2020 07:20 — forked from DragorWW/ingress-passcode.js
ingress passcode auto run
// disable iitc plugin if it's on
// go to https://www.ingress.com/intel
// open console and paste in the code below, press enter
// join https://t.me/passcodes for more passcodes
// add jquery
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
@kidatti
kidatti / clipboard_image_post_js.html
Created November 9, 2015 04:28
Upload clipboard image to server (HTML5 / JavaScript / AJAX)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<script>
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active March 4, 2024 11:27
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@huqi
huqi / trial.key
Created April 11, 2015 09:01
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active April 25, 2024 23:33
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line