Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'yaml'
require 'murmurhash3'
require 'bundler'
require 'set'
def node_for name
"n#{MurmurHash3::V32.str_hash(name).to_s(16)}"
end
Checks
======
plog
----
- initialize check class [ERROR]: Exception('init_config:\n\ninstances:\n\t- port: 23456\n',)
From git@github.com:airbnb/plog branch master
- Create a config file with:
$ echo 'plog.server.udp.listeners=[{handlers=[{provider="com.airbnb.plog.stress.EaterProvider"}]}]' > plog-server/src/main/resources/application.conf
- Fire up the server with './gradlew run'
- Package with './gradlew shadowJar'
- Run the stresser with:
Exception in thread "main" javax.xml.ws.WebServiceException: Unknown class type javax.xml.transform.dom.DOMSource
at com.sun.xml.internal.ws.api.pipe.Stubs.createDispatch(Stubs.java:274)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:504)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:531)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:510)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:478)
at javax.xml.ws.Service.createDispatch(Service.java:352)
@pcarrier
pcarrier / x11.md
Last active August 29, 2015 13:56

X11 root window default texture in PNG

Compile with grep -vE '#|>' x11.md | xxd -p -r > x11.png
Result visible here

PNG header

8950 4e47 0d0a 1a0a
@pcarrier
pcarrier / gist:8663328
Last active January 4, 2016 18:49
Nasty scripts to extract initial window sizes from nmap-os-db. Results on http://gcarrier.fr/windowsizes.html
#!/usr/bin/env ruby
require 'json'
text = STDIN.read
data = {}
extract = text.split("\n\n").collect do |block|
lines = block.split("\n")
HASH_CHUNK_SIZE = 65536
UINT64_MAX = 2**64 - 1
require 'xmlrpc/client'
require 'time'
require 'pp'
def withOST
server = XMLRPC::Client.new_from_uri 'http://api.opensubtitles.org/xml-rpc'
login = server.call 'LogIn', '', '', 'en', 'OS Test User Agent'
Install fsnotifier for IntelliJ IDEA on your ARM laptop.
Works better than one might expect with JDK8.
Usage:
$ sh fsnotifierto.sh /opt/idea/bin/
...
Sorry for the truncate insanity.
@pcarrier
pcarrier / gist:7201805
Created October 28, 2013 18:17
Git snapshot to be pushed to a temporary ref
#!/bin/sh
TMP_INDEX="`mktemp .git/tmp_index.XXXXXX`"
trap "rm -f \"$TMP_INDEX\"" EXIT
rm -f "$TMP_INDEX"
GIT_INDEX_FILE="$TMP_INDEX" git add --all
TREE_ID=`GIT_INDEX_FILE="$TMP_INDEX" git write-tree`
COMMIT_ID=`echo "snapshot"|git commit-tree $TREE_ID`
echo $COMMIT_ID
(defn src->gems
[src]
(with-open [stream (input-stream src)]
(->> (ruby)
(stream->xs stream)
(map rb->gem))))