Skip to content

Instantly share code, notes, and snippets.

View jamesmoriarty's full-sized avatar
🔮
0xc0000005

James Moriarty jamesmoriarty

🔮
0xc0000005
View GitHub Profile
@jamesmoriarty
jamesmoriarty / http-connect-proxy.rb
Last active September 26, 2021 00:25
HTTP CONNECT by example
require 'socket'
listen_socket = TCPServer.new('127.0.0.1', 9292)
client_conn = listen_socket.accept
request_line = client_conn.gets
while(line = client_conn.gets) do
break unless line.include?(':')
end
@imantung
imantung / ast_print_struct_fields.go
Created June 3, 2020 11:07
Print struct field using golang AST
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
)
var src = `package mypackage
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@gregbuehler
gregbuehler / docker-compose.yml
Created March 2, 2019 00:00
Observability Compose
---
version: "3"
services:
# utility
ouroboros:
image: pyouroboros/ouroboros
container_name: ouroboros
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
@robrichard
robrichard / persistedQuery.js
Last active January 8, 2019 00:09
express-graphql persisted query
const express = require('express');
const bodyParser = require('body-parser');
const graphqlHTTP = require('express-graphql');
const app = express();
app.use(bodyParser.json());
async function getPersistedQueryMiddleware(req, res, next) {
if (!req.body.id) {
next();
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active April 22, 2024 11:24
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@nadavrot
nadavrot / Matrix.md
Last active April 2, 2024 06:45
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@jed
jed / deploy.sh
Last active February 27, 2024 14:56
Using AWS CloudFormation to deploy an edge lambda
#!/bin/sh
aws cloudformation deploy \
--template-file stack.yaml \
--stack-name edge-lambda-test \
--capabilities CAPABILITY_IAM \
--parameter-overrides Nonce=$RANDOM
@paragonie-scott
paragonie-scott / jose-security.md
Last active June 12, 2020 11:32
Suggestions for a Secure JOSE Alternative (or Protocol Upgrade)

Changes to JOSE that will prevent insecurity

Deletions

JWS and JWE

Drop the alg header

Neither JOSE users nor JOSE library designers should be required to understand cryptography primitives. At a lower level, this can lead to badly implemented primitives. On a higher level, this can lead to reasoning by lego.