This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generates necessary certificates to ~/.docker | |
| # | |
| # Usage: | |
| # bundle install | |
| # ruby certgen.rb <domain> | |
| require 'certificate_authority' | |
| require 'fileutils' | |
| if ARGV.empty? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start working on a pull request, this requires a .git/user-repo file | |
| # containing the string "user/repository" | |
| pr() { | |
| local pr_num=$1 | |
| if [[ -z $pr_num ]]; then | |
| echo "Need the pull request number" >&2 | |
| return 1 | |
| fi | |
| if [[ ! -r .git/user-repo ]]; then | |
| echo "Need to setup user/repo" >&2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cribbed from http://vimeo.com/52569901 (Twilio carrier call origination moderation) | |
| # The idea is that many fan-in queues can enqueue at any rate, but | |
| # dequeue needs to happen in a rate-controlled manner without allowing | |
| # any individual input queue to starve other queues. | |
| # http://en.wikipedia.org/wiki/Leaky_bucket (second sense, "This version is referred to here as the leaky bucket as a queue.") | |
| # | |
| # requires: | |
| # redis 2.6+ | |
| # redis-py>=2.7.0 | |
| # anyjson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| obj-m += rootkit.o | |
| all: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
| clean: | |
| make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'jruby' | |
| module Serialize | |
| def self.serialize(obj) | |
| baos = java.io.ByteArrayOutputStream.new | |
| oos = java.io.ObjectOutputStream.new(baos) | |
| oos.write_object(JRuby.reference(obj)) | |
| oos.close | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/mman.h> | |
| #ifndef MAP_32BIT | |
| #error "MAP_32BIT not defined" | |
| #endif | |
| struct scope | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # snapshot the previous volume before updating | |
| # otherwise there will be a CoW for each child, which could get slow quickly | |
| btrfs subvolume snapshot /btrfs/base/precise-amd64-2013-04-01 /btrfs/base/precise-amd64-2013-04-31 | |
| # differential copy --inplace avoids the tempfile/mv so large files can remain shared | |
| rsync -avx --inplace --delete server.domain.com::precise-amd64 /btrfs/base/precise-amd64-2013-04-31 | |
| # now make a snapshot for an app |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "mkmf" | |
| $libs += " -lstdc++ " | |
| create_makefile("human") |