Skip to content

Instantly share code, notes, and snippets.

View tboeghk's full-sized avatar
🚀

Torsten Bøgh Köster tboeghk

🚀
View GitHub Profile
@omaryoussef
omaryoussef / Create_Laravel_Pipeline.txt
Last active December 13, 2023 13:25
Creates a Filebeat pipeline to ingest Laravel Monolog/log lines.
PUT _ingest/pipeline/laravel
{
"description": "Parses Laravel log files.",
"processors": [
{
"rename": {
"field": "message",
"target_field": "event.original"
}
},
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@joergrathlev
joergrathlev / gist:a697b7d74de8a404e81a
Created February 24, 2015 14:50
Convenience Bash function to connect to a server by its Ansible name
function ssha () {
if [ $# -eq 0 ]
then
echo "Usage: ssha <ansible-hostname> [ssh arguments]" >&2
return 1
fi
local inventory=/path/to/your/inventory # CHANGE THIS LINE
local ansible_name="$1"
shift
@GABeech
GABeech / haproxy.cfg
Created August 21, 2014 18:35
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@pauloconnor
pauloconnor / gist:4707710
Last active December 1, 2022 09:33
Logstash Mutate Filter for stripping Linux color codes from log files
# Get rid of color codes
mutate {
gsub => ["message", "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", ""]
}
@kostia
kostia / gist:4075236
Created November 14, 2012 22:15
German synonyms for Elasticsearch
This file has been truncated, but you can view the full file.
80470 => 80470
ABC => ABC
ABM => ABM
ACL => ACL
ACPI => ACPI
ADAC => ADAC
ADSL => ADSL
AEG => AEG
AG => AG
AGP => AGP
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@raggiskula
raggiskula / clippy.cow
Created April 10, 2012 13:58 — forked from mattiz/gist:2351145
cowsay clippy template
##
## Milk from Milk and Cheese
##
$the_cow = <<EOC;
$thoughts ___
$thoughts / \\
$thoughts / \\
/ \\
___ ___
/___\\ /___\\
@bradfordcp
bradfordcp / Syns2Syms.java
Created September 2, 2010 19:12
Converts a WordNet prolog file into a flat file useful for Solr synonym matching.
/**
* Based off of the Lucene prolog parser in the wordnet contrib package within the
* main Lucene project. It has been modified to remove the Lucene bits and generate
* a synonyms.txt file suitable for consumption by Solr. The idea was mentioned in
* a sidebar of the book Solr 1.4 Enterprise Search Server by Eric Pugh.
*
* @see <a href="http://lucene.apache.org/java/2_3_2/lucene-sandbox/index.html#WordNet/Synonyms">Lucene Sandbox WordNet page</a>
* @see <a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/wordnet/">SVN Repository of the WordNet contrib</a>
* @see <a href="https://www.packtpub.com/solr-1-4-enterprise-search-server/book">Solr 1.4 Enterprise Search Server Book</a>
*/