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
# | |
# Simple basic nginx conf sample for setting up a reverse proxy | |
# | |
#user nobody; | |
worker_processes 1; | |
error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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
<link href="print.css" rel="stylesheet" type="text/css" media="screen,print"/> | |
... | |
<div style="-fs-page-sequence: start; page-break-before: always"> | |
<div style="position: running(current);"> | |
<div id="page-header" class="small"> | |
<span class="align-left">some stuff here</span> | |
<span class="align-right">some other stuff here</span> | |
<div class="line"> </div> |
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
import java.io.IOException; | |
import org.w3c.dom.Element; | |
import org.xhtmlrenderer.extend.FSImage; | |
import org.xhtmlrenderer.extend.ReplacedElement; | |
import org.xhtmlrenderer.extend.ReplacedElementFactory; | |
import org.xhtmlrenderer.extend.UserAgentCallback; | |
import org.xhtmlrenderer.layout.LayoutContext; | |
import org.xhtmlrenderer.pdf.ITextFSImage; | |
import org.xhtmlrenderer.pdf.ITextImageElement; |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' 'http://10.140.10.40'; | |
# |
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
<!-- check https://github.com/flyingsaucerproject/flyingsaucer --> | |
<div style="-fs-page-sequence: start; page-break-before: always"> | |
<!-- header for each page --> | |
<div style="position: running(current);"> | |
<div id="page-header" class="small"> | |
<span style="text-align: left; float:left;"> | |
<!-- header will appear on all pages --> |
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 | |
# deploy.sh | |
N="`readlink \"$1\"`" | |
mv -T "$1.stage" "$1" | |
ln -s "$N" "$1.stage" | |
rm -rf "$N" | |
cp -aH "$1" "$N" |
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
# will listen on 4444, redir to 4567, speed is 1024*32 = 32kbytes/sec (slow!) | |
redir --lport=4444 --cport=4567 --max_bandwidth $((1024*32)) |
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
# | |
# aliases | |
# | |
alias pserv='python -m SimpleHTTPServer $*' | |
alias wget='wget --trust-server-names --no-check-certificate' | |
alias ls='LC_COLLATE=C ls -lFha --group-directories-first --color ' | |
alias grep='grep --color=always' | |
alias less='less -R' |
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
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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
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
require 'rubygems' | |
require 'mechanize' | |
cert_store = OpenSSL::X509::Store.new | |
cert_store.add_file 'cacert.pem' #get it at https://dl.dropboxusercontent.com/u/947497/cacert.pem | |
a = Mechanize.new do |agent| | |
agent.cert_store = cert_store | |
end |
OlderNewer