Skip to content

Instantly share code, notes, and snippets.

Ola Nordstrom ooola

Block or report user

Report or block ooola

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ooola
ooola / dummy-web-server.py
Created Oct 25, 2017 — 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.
View dummy-web-server.py
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
View golang random string
package main
import (
"math/rand"
"time"
"fmt"
)
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
View printheaders.go
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 / password_strength.md
Created Dec 28, 2016 — 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.
View password_strength.md

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
@ooola
ooola / latency.txt
Created Dec 28, 2016 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
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
View get-sshkeys-from-ldap
#!/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+:
View keybase.md

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:

View qr_codify.py
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))
You can’t perform that action at this time.