View gist:3829cb02e983d6102c3e
1 2 3 4 5 6 7 8 9 10
--- app.js 2015-04-12 16:31:48.433430728 +0100
+++ app.js 2015-04-12 16:31:48.433430728 +0100
@@ -19,6 +19,12 @@
app.set('view engine', 'jade');
app.set('x-powered-by', false);
+var sessions = require("client-sessions")
+var c_auth = require('./lib/google-oauth')
+var config_security = require('./config/security')
+app.use(sessions({ cookieName: 'session', secret: config_security.cookie_secret }))
View upstart-kibana.conf
1 2 3 4 5 6 7 8 9 10
# Upstart Kibana
 
stop on shutdown
 
setuid kibana
setgid kibana
 
respawn
 
chdir /opt/kibana/
View gist:88d6801bdda100b77cc7
1 2 3 4 5 6 7 8 9
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943538] BUG: Bad page map in process java pte:00000320 pmd:02a5c067
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943549] addr:00007f5520fbc000 vm_flags:08000070 anon_vma: (null) mapping: (null) index:7f5520fbc
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943556] CPU: 1 PID: 18149 Comm: java Tainted: G B 3.13.0-29-generic #53-Ubuntu
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943558] ffff8800f4154f00 ffff8800029e3a98 ffffffff8171a214 00007f5520fbc000
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943561] ffff8800029e3ae0 ffffffff81174653 0000000000000320 00000007f5520fbc
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943563] ffff880002a5cde0 0000000000000320 00007f5520fbc000 00007f5520fbd000
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943565] Call Trace:
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943573] [<ffffffff8171a214>] dump_stack+0x45/0x56
Apr 9 13:11:41 ip-10-107-16-220 kernel: [59519.943577] [<ffffff
View gist:6b375269df5e8c0f3b16
1 2 3 4 5 6 7 8 9 10
input {
file {
path => "/var/log/syslog"
type => "syslog"
}
file {
type => "tomcat"
path => [ "/var/log/tomcat7/catalina.out" ]
codec => multiline {
pattern => "(^\d+\serror)|(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)"
View gist:755ae607e70c8335ceec
1 2 3 4 5 6 7
andrew@andrew-laptop:~/Downloads/kibana-4.0.2/src/server/bin$ dmsesg
...
[78982.842191] https[12107]: segfault at 69 ip 000000000040ac8b sp 00007fffb6749b40 error 4 in https[400000+11000]
[79011.850704] https[12147]: segfault at 69 ip 000000000040ac8b sp 00007fffbfe7b270 error 4 in https[400000+11000]
[79136.983464] https[12301]: segfault at 69 ip 000000000040ac8b sp 00007fffd0b51d10 error 4 in https[400000+11000]
[79293.960252] https[12461]: segfault at 69 ip 000000000040ac8b sp 00007fff831e6000 error 4 in https[400000+11000]
[79457.281094] https[12723]: segfault at 69 ip 000000000040ac8b sp 00007fffcceae8d0 error 4 in https[400000+11000]
View quorum.rb
1 2 3 4 5 6 7 8 9 10
require 'pp'
require 'typhoeus'
 
ENV['QUORUM'] ||= '3'
ENV['CONCURRENCY'] ||= '2'
ENV['TIMEOUT'] ||= '0.001'
ENV['VERBOSE'] ||= '0'
 
urls = {
'www.example.com/1' => {},
View gist:e3a666e58b71c14f35a7
1 2 3 4 5 6 7 8 9 10
docker is easily broken, e.g. its process management becomes easily out of sync.
I.e create container, kill process 1, then exit.
 
CID=$(docker run -it -d ubuntu:latest bash);
docker exec -i -t $CID kill 1;
docker ps
docker rm -f $CID;
 
Error response from daemon: Could not kill running container, cannot remove - no such process
FATA[0000] Error: failed to remove one or more containers
View gist:1d5aa5486ac19d96eec1
1 2 3 4 5 6 7 8 9 10
 
root@services-api2:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 7.4G 0 100% /
udev 1.9G 12K 1.9G 1% /dev
tmpfs 375M 288K 375M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 0 1.9G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/xvdb 15G 39M 15G 1% /mnt
View gist:23771d5e60f297e1e799
1 2 3 4 5 6 7 8 9 10
SELECT
COUNT(1) as number_of_orders,
WEEK(o.created) AS week_no,
get_meta_value('_HASH_brand_id', c.meta) AS brand_id,
rc.value,
SUM(o.total_gross) AS total_gross,
SUM(o.total_net) AS total_net
FROM orders o
JOIN channels c ON (o.channel_id = c.id)
JOIN reference_codes rc ON (rc.id = get_meta_value('_HASH_brand_id',c.meta))
View dns.md

DNS

IMPORTANT! - The naming conventions are important to the creating DNS records. The DNS records are to be largely scripted.

Naming

Instance IDs

Amazon instance ids are in the form "i-2227656c".

Something went wrong with that request. Please try again.