Skip to content

Instantly share code, notes, and snippets.

import sys
import subprocess
import tempfile
import urllib
text = sys.stdin.read()
chart_url_template = ('http://chart.apis.google.com/chart?'
'cht=qr&chs=300x300&chl={data}&chld=H|0')
chart_url = chart_url_template.format(data=urllib.quote(text))

Keybase proof

I hereby claim:

  • I am ooola on github.
  • I am ooola (https://keybase.io/ooola) on keybase.
  • I have a public key whose fingerprint is B0FE E001 C378 CF2C 7B5E FBF0 D17F 17B1 7726 65C6

To claim this, I am signing this object:

#!/bin/sh
#
# This script finds and prints authorized SSH public keys in LDAP for the
# username specified as the first argument. The SSH public key read from the
# streetAddress field.
#
# The program must be owned by root and not writable by group or others.
# It expects configuration file /etc/ssh/ldap.conf in format of ldap.conf(5).
#
# sshd_config for OpenSSH 6.2+:
@ooola
ooola / latency.txt
Created December 28, 2016 18:31 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@ooola
ooola / password_strength.md
Created December 28, 2016 18:32 — forked from atoponce/password_strength.md
A document evaluating different open source password generators and password strength testers. See the other Gists at the end of the document for the password results.

Open Source Password Generator / Strength Meter Testing

This is a collection of password generators and strength meter testing. Each generator produces a different array of passwords, of which are then tested against each of the strength meters. The defaults are used where possible, otherwise sane options are provided.

The Results

The following results are tables showing the generators, passwords, and strength testers described below.

  1. Randomly generaterd passwords: atoponce/random_results_table.md
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func handler(w http.ResponseWriter, r *http.Request) {
requestDump, err := httputil.DumpRequest(r, true)
@ooola
ooola / dummy-web-server.py
Created October 25, 2017 16:42 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
// Copyright (c) 2020 Andrew Ayer
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
@ooola
ooola / dual-csps.go
Created January 27, 2023 02:00
Dual CSP - A small go program showing that a report-only CSP does not impact an enforced content security policy (CSP
package main
import (
"fmt"
"net/http"
)
func serve(w http.ResponseWriter, req *http.Request) {
page := `
<!doctype html>
# Ola's ~/.tmux.conf
#
# This config file was originally based on the tmux config that ships with tmux.
# See https://github.com/tmux/tmux/blob/master/example_tmux.conf
#
# It has been modified so that the prefix is <Ctrl>-a and the CapsLock
# key also acts as a Ctrl via an OS keymap change.
#
# On OS X be sure to install 'reattach-to-user-namespace' via brew.