Skip to content

Instantly share code, notes, and snippets.

mkdir /tmp/example
pip install -d /tmp/example flask
for i in *.tar.gz; do
tar -zxf $i
fpm -s python -t rpm ${i%%.tar.gz}
done
ls *.rpm
----
[root@localhost log]# systemctl start test
[root@localhost log]# systemctl status test
test.service - Starts and stops a single Logstash instance
Loaded: loaded (/usr/lib/systemd/system/test.service; disabled)
Active: active (running) since Fri 2014-02-28 13:34:56 EST; 5s ago
Docs: http://www.elasticsearch.org
Main PID: 1214 (sleep)
CGroup: name=systemd:/system/test.service
└─1214 /usr/bin/sleep 3600
% fpm -s dir -t sh -n example -v 1.0 $HOME/.{vim,zsh}rc
Created package {:path=>"example.sh"}
% ./example.sh -h
Usage: example.sh [options]
Install this package
-i <DIRECTORY> : install_root - an optional directory to install to.
Default is package file name without file extension
-o <USER> : owner - the name of the user that will own the files installed
by the package. Defaults to current user
-r: disable capistrano style release directories - Default behavior is to create a releases directory inside
@jordansissel
jordansissel / Summary
Last active August 29, 2015 14:01
ELK disk efficiency tests.
Elasticsearch 1.2.0, Logstash 1.4.1
* logs raw size: 217.72M
* logs.gz : 21.36M
* test 1: 374.4mb (no filters)
* test 2: 545.6mb (grok)
* test 3: 626.1mb (grok + date)
* test 4: 347mb (grok + date + remove 'message' field)
* test 4 w/ lzop (theoretical): 277.5mb
* test 4 w/ lzop -7 (theoretical): 228.5mb
input { stdin { } }
filter {
grok {
match => { "message" => "<%{NUMBER:syslog_pri}>%{DATA:message}$" }
overwrite => "message"
}
syslog_pri {
remove_field => "syslog_pri"
}
@jordansissel
jordansissel / ec2.rb
Last active August 29, 2015 14:08 — forked from electrical/ec2.rb
require 'logstash-output-elasticsearch-ec2_jars.rb'
module LogStash::Outputs::ElasticSearch::Ec2
def self.included(base)
base.extend(self)
base.register
end
def register
curl http://tachyon.vektra.io/install.sh > it.sh && test $(openssl sha1 < it.sh) = "23fb0450b152dfaa8331dd37c3a4c13d4de9dbb8" && bash it.sh
@jordansissel
jordansissel / data.md
Last active August 29, 2015 14:09
SSL/TLS. JRuby, BouncyCastle, OpenSSL, MRI. Fun.

Try openssl ciphers in ruby 2.1.4 on google.com

% openssl ciphers | tr : '\n'| rvm 2.1.4 do ruby -an -rsocket -ropenssl -e 'cipher = $_.chomp; begin; x = TCPSocket.new("google.com", 443); c = OpenSSL::SSL::SSLContext.new; c.ciphers = cipher; o = OpenSSL::SSL::SSLSocket.new(x, c); o.connect; o.close; puts "OK #{cipher}"; rescue => e; puts "FAIL #{cipher} - #{e}"; end' | sort
FAIL DES-CBC-MD5 - SSL_CTX_set_cipher_list: no cipher match
FAIL DES-CBC-SHA - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure
FAIL DES-CBC3-MD5 - SSL_CTX_set_cipher_list: no cipher match
FAIL DHE-DSS-AES128-SHA - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure
FAIL DHE-DSS-AES256-SHA - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure
```
2015-01-13 18:13:30
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.71-b01 mixed mode):
">output" daemon prio=10 tid=0x000000000153e800 nid=0x6b3 in Object.wait() [0x00007f92e73da000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000e7991b88> (a org.jruby.ext.thread.SizedQueue)
at java.lang.Object.wait(Object.java:461)
at org.jruby.RubyThread$SleepTask.run(RubyThread.java:1049)
% bin/logstash -e 'filter { mutate { gsub => [ "message", "-", "none" ] } }'
hello - world
- - -
---
{
"message" => "hello none world",
"@version" => "1",
"@timestamp" => "2015-01-22T19:22:38.208Z",
"type" => "stdin",