Skip to content

Instantly share code, notes, and snippets.

View jage's full-sized avatar

Johan Eckerström jage

View GitHub Profile
@jage
jage / README.md
Last active August 29, 2015 14:26

My prompt has some information in the far right, which is superuseful and pretty but not that nice when copying command output to share with my co-workers.

Example from the clipboard:

$ uptime                                                        jage@11D0D585 ~
22:46  up  1:14, 2 users, load averages: 1,74 1,85 1,70
$ date jage@11D0D585 ~
@jage
jage / find-unused-csproj.sh
Last active August 29, 2015 14:23
Find unused csproj files by searching through sln files
find . -iname '*.csproj' | sort | uniq | while read csprojpath; do
grep -i $(basename $csprojpath) $(find . -iname '*.sln' -print) > /dev/null || echo "$csprojpath does not seem to be used"
done
@jage
jage / check_zookeeper.sh
Last active January 7, 2018 14:11
Consul (Nagios) compatible script to check ZooKeeper node
#!/bin/sh
test "$(echo ruok | nc 127.0.0.1 2181)" = "imok" || $(exit 2)
@jage
jage / xml-rpc-ping.lua
Last active August 29, 2015 14:19
To be used with wrk
wrk.method = "POST"
wrk.body = '<?xml version="1.0"?><methodCall><methodName>weblogUpdates.ping</methodName><params><param><value>Twingly Blog</value></param><param><value>http://blog.twingly.com/</value></param></params></methodCall>'
wrk.headers["Content-Type"] = "text/xml"
@jage
jage / tls_test.rb
Created December 11, 2014 13:16
Test TLSv1.1 against Ori
require 'openssl'
require 'socket'
context = OpenSSL::SSL::SSLContext.new
context.ssl_version = :TLSv1_1
client_socket = TCPSocket.new 'ori', 5671
ssl_client = OpenSSL::SSL::SSLSocket.new client_socket, context
ssl_client.connect
--- nginx.conf.prev Sun Oct 12 20:44:43 2014
+++ nginx.conf Sun Oct 12 20:52:44 2014
@@ -8,13 +8,13 @@
events {
- worker_connections 1024;
+ worker_connections 1024;
}
@jage
jage / iozone.md
Last active August 29, 2015 14:03 — forked from nicwi/iozone.md

iozone: marv vs hild vs Storm SSD

  • marv: MacBook Air 11-inch, Mid 2013 (256 GB APPLE SSD SM0256F)
  • hild: Supermicro SuperServer 2027TR-H72RF+ (6x Samsung 840 Pro, HW RAID10)
  • Storm SSD
$ iozone -l 32 -O -i 0 -i 1 -i 2 -e -+n -r 4K -s 4G

    Iozone: Performance Test of File I/O
@jage
jage / ping.lua
Created June 21, 2014 17:39
XML-RPC ping payload for https://github.com/wg/wrk
wrk.method = "POST"
wrk.body = "<?xml version=\"1.0\"?><methodCall><methodName>weblogUpdates.ping</methodName><params><param><value>Twingly Blog</value></param></params></methodCall>"
wrk.headers["Content-Type"] = "text/xml"
@jage
jage / kif_bonnie.txt
Created May 11, 2014 18:22
Bonnie++ on Kif. OpenBSD 5.5, 2x 500 GB SATA in softraid 1.
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
Create files in random order...done.
@jage
jage / execution_visualizer.rb
Last active December 22, 2015 04:48
Show which line is executing
# Please convert this to a Sublime Text 3 plugin.
require 'curses'
Curses.init_screen
SOURCE_LINES = File.read(__FILE__).split("\n")
TracePoint.trace(:line) do |tp|
Curses.clear
SOURCE_LINES.each_with_index do |src,row|
Curses.setpos(row, 0)
Curses.addstr(src)
end