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:
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
require "bson" | |
def make_insert(table_name, bson) | |
columns = ["id",*bson["value"].keys] * ", " | |
values = ["'#{bson["_id"]}'",*bson["value"].values.map{|value| value.is_a?(Numeric) ? value : "'#{value}'"}] * ", " | |
return "insert into #{table_name} (#{columns}) values (#{values});" | |
end | |
file_name = ARGV.first | |
file=File.new(file_name) |
require "fiber" | |
require "rack/fiber_pool" | |
require "sinatra/base" | |
require "redis" | |
require "redis/connection/synchrony" | |
class App < Sinatra::Base | |
use Rack::FiberPool |
// Copyright 2011 Will Fitzgerald. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
/* | |
Package bitset implements bitsets. | |
It provides methods for making a bitset of an arbitrary | |
upper limit, setting and testing bit locations, and clearing | |
bit locations as well as the entire set. |
import fcntl | |
import os | |
import struct | |
import subprocess | |
# Some constants used to ioctl the device file. I got them by a simple C | |
# program. | |
TUNSETIFF = 0x400454ca | |
TUNSETOWNER = TUNSETIFF + 2 |
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |