just run this command on your mac:
brew install https://gist.github.com/raw/1007028/66c1911132a2970b9df9723bd8063ac13e926993/nginx.rb
(import '(java.net DatagramSocket DatagramPacket)) | |
(def socket (DatagramSocket. 5200)) | |
(def running (atom true)) | |
(def buffer (make-array Byte/TYPE 1024)) | |
(defn parse [packet] | |
(println (String. (.getData packet) 0 (.getLength packet)))) | |
(defn start-receiver [] |
(ns performance.server | |
"The routes for the web server." | |
(:require [cheshire.core :as json] | |
[clj-time.core :refer [now]] | |
[clojure.tools.logging :refer [infof warn warnf error errorf]] | |
[compojure | |
[core :refer [defroutes GET POST]] | |
[handler :as handler]] | |
[ring.middleware.jsonp :refer [wrap-json-with-padding]] | |
[ring.middleware.params :refer [wrap-params]] |
es_alias = ENV.fetch('ALIAS') | |
hosts = ENV.fetch('HOSTS') | |
old_index = ENV.fetch('OLD_INDEX') | |
old_type = ENV.fetch('OLD_TYPE') | |
new_index = ENV.fetch('NEW_INDEX') | |
new_type = ENV.fetch('NEW_TYPE') | |
size = ENV.fetch('SCAN_SIZE', 100) | |
client = Elasticsearch::Client.new(hosts: hosts) | |
unless client.indices.exists(index: new_index) |
// Hover.com "Zone file import/export" has been *Planned* since 2011 | |
// https://help.hover.com/entries/471066-Zone-file-import-export | |
// Here's a brittle approximation of export. | |
// | |
// 1. login to your account: https://www.hover.com/domains | |
// 2. run the following in your browser's JavaScript console, changing the first line | |
// to your domain | |
// 3. copy the text logged to the console. | |
// 4. manually correct FQDNs, these have to end with a period "." | |
// |
ORIGINAL_JENKINS_SERVER= | |
ORIGINAL_SERVER_USER= | |
NEW_JENKINS_SERVER= | |
NEW_SERVER_USER= | |
# ON THE ORIGINAL JENKINS SERVER | |
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER | |
cd /var/lib/jenkins/ | |
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar |
Rehearsal --------------------------------------------- | |
any? 1.270000 0.010000 1.280000 ( 1.285305) | |
all? 0.870000 0.000000 0.870000 ( 0.880658) | |
min block 1.270000 0.010000 1.280000 ( 1.284267) | |
smart ass 0.670000 0.010000 0.680000 ( 0.689223) | |
------------------------------------ total: 4.110000sec | |
user system total real | |
any? 1.240000 0.010000 1.250000 ( 1.258006) | |
all? 0.880000 0.010000 0.890000 ( 0.890891) |
# Writes number of "unread" tweets to a file | |
# so that it can be used in tmux' status bar, like so: | |
# | |
# tail -1 ~/.earthquake_count | |
# | |
# You can reset the counter with :reset_count command | |
class NotiFile | |
def initialize file_path | |
log "new NotiFile" | |
@file = File.expand_path file_path |
just run this command on your mac:
brew install https://gist.github.com/raw/1007028/66c1911132a2970b9df9723bd8063ac13e926993/nginx.rb