This file contains 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 | |
# This script reads text from stdin, generates its QR code and splits it into two visual cryptographic images. Both images appear random and have as many whites as blacks. Only when print on transparent film (or extremely thin paper) and superposed, the ciphered qrcode appears as gray/black dots. | |
# We use the program "qrencode" to generate a QR at an average 7% error-correction rate ("low" quality; the lowest available). We create then a random array and we visual-XOR it with the QR code to retrieve the ciphered code. Only the random array (nonce or one-time pad) and the ciphered array are recorded, and only when both are superposed they reveal the QR code. | |
# The visual-cryptographic scheme used is inspired of http://leemon.com/crypto/VisualCrypto.html . It transforms 0s and 1s into diagonal 2x2 squares (01\10 and 10\01). The visual XOR either repeats (gray superposition; corresponding to a white dot) or flips (black superposition; corresponding to a black dot), following the QR code. | |
# Security |
This file contains 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 -eu | |
# Download, configure and install Ruby and Bundler on a Debian-family or Redhat-family fresh system | |
# https://gist.github.com/infertux/a5252bf8023f0a0e9380 | |
RUBY="2.2.2" | |
SHA256="5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44" | |
# This runs as root on the server | |
[ $UID -eq 0 ] |
This file contains 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
DROP TABLE IF EXISTS parent; | |
DROP TABLE IF EXISTS child; | |
CREATE TABLE parent( | |
identity_id integer, | |
valid_range int4range | |
); | |
CREATE TABLE child( | |
valid_range int4range, |
This file contains 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 | |
# -*- sh -*- | |
# vim: ft=sh | |
: << =cut | |
=head1 NAME | |
unicorn_connections - Plugin to monitor the number of Unicorn connections |
This file contains 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
l={};s=m=[];i=pc=mc=0 | |
alias p proc | |
h={'>':p{mc+=1},'<':p{mc-=1},'+':p{m[mc]+=1},'-':p{m[mc]-=1},'.':p{putc m[mc]}} | |
j={'[':->(i){s<<i;->(){pc=l[pc-1]+1 if m[mc]==0}},']':->(i){o=s.pop;l[o]=i;p{pc=o}}} | |
ins=DATA.each_char.map{|c|c=:"#{c}";x=(j[c]||->(_){h[c]||p{}}).(i);i+=1;x} | |
while k=ins[pc];pc+=1;m[mc]||=0;k.();end | |
__END__ | |
[ This program prints "Hello World!" and a newline to the screen, its | |
length is 106 active command characters. [It is not the shortest.] |
This file contains 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
class Proc | |
def |(g) | |
lambda {|*args| | |
g.(self.(*args)) | |
} | |
end | |
end | |
class Printer |
This file contains 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/sh | |
# -*- sh -*- | |
# vim: ft=sh | |
: << =cut | |
=head1 NAME | |
axp_pmu - Plugin to monitor power |
This file contains 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
--- V3.car 2015-09-18 09:21:11.000000000 +0000 | |
+++ V3.car 2016-04-01 14:51:17.783726416 +0000 | |
@@ -61,16 +61,16 @@ | |
#--------------------------- | |
[ hover ] | |
-hAbove = 2.5 | |
+hAbove = 4.0 | |
hRayLen = 4.0 | |
This file contains 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
class CheckOut | |
def initialize(rules) | |
@items = Hash.new { 0 } | |
@pricer = Pricer.new(rules) | |
end | |
def scan(sku) | |
@items[sku] += 1 | |
end |
This file contains 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
(2 * 2 * 5 * 7 * 37 * 149 * 5417 * 148781 * 51939996061871).to_s(16).scan(/../).map { |x| x.hex.chr }.join |
OlderNewer