Skip to content

Instantly share code, notes, and snippets.

@jackyyf
jackyyf / load-balance.diff
Last active August 29, 2015 14:14
Gist by paste.py @ 2015-01-29 16:01:25.577710
diff --git a/cmd/shadowsocks-local/local.go b/cmd/shadowsocks-local/local.go
index 78d0995..089196c 100644
--- a/cmd/shadowsocks-local/local.go
+++ b/cmd/shadowsocks-local/local.go
@@ -5,7 +5,7 @@ import (
"errors"
"flag"
"fmt"
- ss "github.com/shadowsocks/shadowsocks-go/shadowsocks"
+ ss "shadowsocks"
@datagrok
datagrok / ergodox.md
Last active January 14, 2019 07:45
Reflections on my ErgoDox keyboard
@hellman
hellman / crypto_backdoor.py
Last active June 15, 2019 07:00
Google CTF 2017 Quals - Crypto Backdoor
def I(s):
val = 0
for i in range(len(s)):
digit = ord(s[len(s) - i - 1])
val <<= 8
val |= digit
return val
def Sn(i, length):
s = ''
@stypr
stypr / pwn.py
Last active August 17, 2019 19:33
jff3 2015: web_mbm2 exploit
#!/usr/bin/python
'''
how to use
1) python pwn.py 1
2) python pwn.py 5
3) look at the "pwn.py 1" instance
'''
@laggardkernel
laggardkernel / trigger-chpwd-hook-on-startup.md
Last active September 17, 2020 11:50
Trigger chpwd Hook on Startup #zsh #hook #direnv

By default, ZSH hook chpwd is not triggered on shell startup. The tutorial here provides some ideas to fix this.

Trigger all chpwd_functions on startup

We can use a trick to define a function run only once on precmd and destruct itself automatically.

function _self_destruct_hook {
  local f
  for f in ${chpwd_functions}; do
    "$f"
@hellman
hellman / rsa_timing_attack_d_Montgomery.py
Created May 1, 2017 12:23
DEF CON 2017 Quals - Godzilla (Reverse/Crypto)
#-*- coding:utf-8 -*-
'''
DEF CON 2017 Quals - Godzilla (Reverse)
Timing attack on RSA decryption.
Based on http://www.cs.jhu.edu/~fabian/courses/CS600.624/Timing-full.pdf
Another solutions:
https://gist.github.com/nneonneo/367240ae2d8e705bb9173a49a7c8b0cd by b2xiao
https://gist.github.com/Riatre/caac24840b176cf843b3f66ad9a5eeaf by riatre
@wagenet
wagenet / glibc.md
Last active February 25, 2024 15:40
glibc Versions

glibc Versions

List of oldest supported version of top 10 Linux Distros and their glibc version according to distrowatch.com.

Summary

Out of all versions with published EOLs, 2.12 is the oldest glibc still active, found in CentOS 6.8.

If CentOS 6 and 7 are eliminated, the oldest glibc is 2.23 in Ubuntu and Slackware.

@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@njsmith
njsmith / ucrt-csv.py
Last active April 6, 2024 18:04
Information on linking to the new Windows UCRT
import sys
import subprocess
import csv
def describe_ucrt_lib(platform):
lib_path = "windows-10-sdk/Lib/10.0.10240.0/ucrt/{}/ucrt.lib".format(platform)
output = subprocess.check_output(["nm", lib_path])
output = output.decode("utf-8")
# Output (x86 32-bit) looks like:
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active April 11, 2024 22:38
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}