For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
Browse: | |
https://oauth.twitter.com/2/authorize?oauth_callback_url=http://www.example.com/&oauth_mode=flow_web_client&oauth_client_identifier=7ynojZQ3uVE2DifWftbS3w | |
After authentication, user gets redirected to: | |
http://www.example.com/#oauth_access_token=RnEJAQAAAABpYH8NAAAAAGKSBQAAAAAAr9G2hLrnXaznri8LlSIaR0HuNBI=HLx1r47oqpobPncAm9DNeRCdySaMqoTKJcCLwnhIP&oauth_bridge_code=2wxWDd3IIZ0UW1y4oFpioWfbzTeaAlSGoJk5L6qMpGQ | |
...Use the API: |
sys = require "sys"; | |
http = require "http"; | |
url = require "url"; | |
connect = require "connect"; | |
redis = require "redis"; | |
hashRing = require "hash_ring"; | |
Sharding = { | |
servers = { "127.0.0.1 10000 6378": 1 }; | |
ring = new hashRing.HashRing servers; |
git clone https://github.com/kevinweil/elephant-bird.git | |
ant nonothing | |
cp lib/google-collect*jar lib/json-simple*jar /tmp/x | |
cd build/classes | |
jar -cf /tmp/x/elephant-bird.jar com | |
REGISTER google-collect-1.0.jar; | |
REGISTER json-simple-1.1.jar; | |
REGISTER elephant-bird.jar; |
SET = [ 3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99 ] | |
def find_with(set, target, expr = [ ], res = [ ]) | |
lowset = set.select { |e| e <= target } | |
lowset.each do |n| | |
expr2 = expr + [n] | |
if n == target | |
res << "#{expr2.sort.join(' + ')} = #{expr2.inject(:+)}" unless expr.empty? | |
else | |
find_with(lowset - [n], target - n, expr2, res) |
#include <string.h> | |
size_t zob1(const char *c) | |
{ | |
const char *s = "abcdefghijklmnopqrstuvwxyz"; | |
return strspn(c, s); | |
} | |
size_t zob2(const char *c) | |
{ |
#! /bin/sh | |
LDNS_SIGNZONE="ldns-signzone" | |
errx() { | |
echo "$1" >&2 | |
exit 1 | |
} | |
parse_opts() { |
This is a data structure for a Slowly-Changing Dimension Type 2 temporal database, implemented using only PostgreSQL >= 9.0 features.
Any application code is completely unaware of the temporal features: queries are done against a view that behaves exactly like a plain table (it can be SELECTed, UPDATEd, INSERTed INTO and DELETEd FROM), but behind the scenes the database redirects the queries to backend tables holding actual data, using the PostgreSQL rule system.
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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD 150,000 ns 0.15 ms | |
Read 1 MB sequentially from memory 250,000 ns 0.25 ms | |
Round trip within same datacenter 500,000 ns 0.5 ms |
#include <sys/types.h> | |
#include <sys/ptrace.h> | |
int ptrace_interposed(int request, pid_t pid, caddr_t addr, int data) | |
{ | |
return 0; | |
} | |
const struct { void *hook_func; void *real_func; } | |
interposers[] __attribute__ ((section("__DATA, __interpose"))) = { |