- Install Ubuntu Server.
- Update Ubuntu with the commands:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine github.com | |
login technoweenie | |
password SECRET | |
machine api.github.com | |
login technoweenie | |
password SECRET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Tomcat Server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 10 5 | |
# run as non privileged user | |
# add user with this command: | |
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stacktrace java as one message | |
multiline { | |
#type => "all" # no type means for all inputs | |
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)" | |
what => "previous" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.net.ssl.SSLParameters; | |
import javax.net.ssl.SSLSocket; | |
import javax.net.ssl.SSLSocketFactory; | |
import java.io.*; | |
/** Establish a SSL connection to a host and port, writes a byte and | |
* prints the response. See | |
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
*/ | |
public class SSLPoke { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ knife ssh -m "...every host in the network..." "sudo netstat -nutap" -a hostname > meganetstat.txt | |
$ python | |
>>> from collections import Counter as C | |
>>> HS = "...every host in the network...".split() | |
>>> ip = lambda s: s.split(":")[0] | |
>>> xs = [map(ip, [x[0], x[4], x[5]]) for x in [x.strip().split() for x in open("meganetstat.txt").readlines() if "tcp" in x] if len(x)>=6] | |
>>> ipmap = [(h, C([x[1] for x in xs if x[0] == h])) for h in HS] | |
>>> ipmapx = dict([(sorted([(x,y) for (x,y) in ip[1].items() if x.startswith("10.")], key=lambda t: -t[1])[0][0], ip[0]) for ip in ipmap]) | |
>>> sorted(C(map(ipmapx.get, [x[2] for x in xs if x[2].startswith("10.")])).items(), key=lambda t: t[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"archive/tar" | |
"log" | |
"io" | |
"compress/gzip" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S |
OlderNewer