Skip to content

Instantly share code, notes, and snippets.

@ushis
ushis / nginx.conf
Created April 9, 2013 23:55
Nginx proxy_pass filtered by HTTP verbs.
# From http://stackoverflow.com/questions/8591600/nginx-proxy-pass-based-on-whether-request-method-is-post-put-or-delete
server {
location / {
# This proxy_pass is used for requests that don't
# match the limit_except
proxy_pass http://127.0.0.1:8080;
# For requests that *aren't* a PUT, POST, or DELETE,
# pass to :9080
@ushis
ushis / man-index.py
Created July 13, 2012 20:29
systemd man index
#!/usr/bin/env python3
from xml.etree import ElementTree as ETree
from glob import glob
PATH = './refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function'
index = {}
for p in glob('systemd/man/*.xml'):
index[p] = [f.text for f in ETree.parse(p).findall(PATH)]
@ushis
ushis / curve25519-chacha20poly1305.go
Last active February 20, 2022 19:17
golang curve25519 chacha20poly1305
package main
import (
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"golang.org/x/crypto/chacha20poly1305"
"golang.org/x/crypto/curve25519"