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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'net/https' | |
BASEDIR = '/etc' | |
LAST_IP_FILE = "#{BASEDIR}/tunnelbroker.lastip" | |
# for debugging. | |
BE_VERBOSE = false |
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
var Search = { | |
searchUrl: "http://search.xenji.com/xenjicom/_search", | |
processResults: function(results) { | |
if (typeof results != "undefined") | |
this.renderResults(results.hits); | |
}, | |
onkeypress: function(event) { |
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 'tire' | |
require 'sanitize' | |
module Jekyll | |
class ElasticSearchIndexer < Generator | |
safe true | |
def generate(site) | |
Tire::Configuration.url(site.config['search_server']) |
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 "mongo" | |
require 'json' | |
connection = Mongo::Connection.new("localhost", 27017) | |
db = connection.db('log_201208') | |
col = db.collection('d_01') | |
col.create_index([['ts', Mongo::ASCENDING], ['pid', Mongo::DESCENDING]]) | |
col.create_index('status') | |
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
entries = Atom::Feed.load_feed(URI.parse("https://speakerdeck.com/u/xenji.atom")) | |
base_url = "https://speakerdeck.com" | |
path = "/oembed.json?url=" | |
@embeds = [] | |
entries.each_entry do |entry| | |
link = entry.links.alternate.to_s.sub "https", "http" | |
fullpath = path + CGI.escape(link) | |
uri = URI.parse(base_url + fullpath) |
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
set git_branch_color green | |
set mycolor 875f5f | |
function headrev | |
echo (git log --pretty=%h -n 1) | |
end | |
function __git_ps1 | |
set -l g (git rev-parse --git-dir ^/dev/null) |
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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
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
Quercus q; | |
QuercusEngine qce = new QuercusEngine(); | |
qce.getQuercus().init(); | |
FilePath executableFile = new FilePath(cmdLine[7].replace("\"", "")); | |
// Set the ini path | |
qce.getQuercus().setIniFile(new FilePath(cmdLine[3])); | |
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); | |
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
CFLAGS="-D_REENTRANT -D_THREAD_SAFE -O3 -pipe -pthread" CXXFLAGS="-D_REENTRANT -D_THREAD_SAFE -O3 -pipe -pthread" ./configure |
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
package main | |
import ("os";"runtime") | |
func main() { | |
var aFromList [2]string= [2]string{"/tmp/checkout/folder1_new","/tmp/checkout/folder2_new"} | |
var aToList [2]string = [2]string{"/var/www/folder1","/var/www/folder2"} | |
runtime.GOMAXPROCS(2) | |
c := make(chan int) |