Skip to content

Instantly share code, notes, and snippets.

@Stubbs
Stubbs / main.yml
Created March 28, 2015 14:31
Ansible Playbook to install PHP7
- name: Install Packages Needed To Compile PHP 7
apt: pkg={{ item }} state=latest
with_items:
- git
- autoconf
- bison
- libxml2-dev
- libbz2-dev
- libmcrypt-dev
- libcurl4-openssl-dev
@fightbulc
fightbulc / vagrant-vmware-packaging.md
Last active March 19, 2019 06:36
Packaging VMWare Fusion Vagrant Box

On Mac

Go to vmware vm files:
cd /path/to/vagrant-vm/.vagrant/machines/default/vmware_fusion/some-random-string

Defragment vm disk:
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -d Virtual\ Disk.vmdk

Shrink vm disk:
/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager -k Virtual\ Disk.vmdk

@airways
airways / 1 dist.config.php
Created November 1, 2011 00:44
Simple, single ExpressionEngine configuration file to override almost all paths and server settings. As used by @airways and @litzinger.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Simple, single configuration file to override almost all paths and server settings. As used by @airways
// and @litzinger.
// Only check in the default as dist.config.php, set your version control system to ignore config.php so that
// local users and each instance (staging, production) can have their own settings.
// These config files are mainly meant to be used on a shared development server used by all developers,
// although it works almost as well for local development as well.
@AutomationD
AutomationD / Logstash.xml
Last active June 18, 2020 20:39
Logstash IntelliJ Idea Filetype
<filetype binary="false" description="Logstash Config" name="Logstash Config">
<highlighting>
<options>
<option name="LINE_COMMENT" value="#" />
<option name="COMMENT_START" value="" />
<option name="COMMENT_END" value="" />
<option name="HEX_PREFIX" value="" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_BRACES" value="true" />
<option name="HAS_BRACKETS" value="true" />
@cablespaghetti
cablespaghetti / gist:54de0ae93449e4698f0206a0e85514be
Last active November 2, 2022 14:20
Example terraform for ASG with spot instances
#
# Configuration for Autoscaling group.
#
resource "aws_launch_template" "eks-cluster-worker-nodes" {
iam_instance_profile = { name = "${aws_iam_instance_profile.eks-cluster-worker-nodes.name}" }
image_id = "${data.aws_ami.eks-worker.id}"
name = "${var.cluster-name}-eks-cluster-worker-nodes"
vpc_security_group_ids = ["${aws_security_group.eks-cluster-worker-nodes.id}"]
key_name = "${var.ssh-key-name}"
instance_type = "${local.host-types[0]}"
@afolarin
afolarin / docker-log-gist.md
Last active March 16, 2023 13:02
docker-logs
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@GUI
GUI / install_vagrant_sudoers.sh
Created June 3, 2012 19:13 — forked from beddari/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@SamuelChristie
SamuelChristie / tls_1_deprecation.md
Created November 2, 2015 16:08
Explanation of how to detect TLS 1.0 connections and, by way of custom headers, warn the user about the coming change to more modern TLS versions.
@NiceGuyIT
NiceGuyIT / README.md
Last active March 4, 2024 18:10
nginx JSON to Filebeat to Logstash to Elasticsearch

Intro

This is an example configuration to have nginx output JSON logs to make it easier for Logstash processing. I was trying to get nginx > Filebeat > Logstash > ES working and it wasn't until I connected Filebeat directly to Elasticsearch that I saw the expected data. Google led me to ingest-convert.sh and I realized filebeat setup works for Filebeat > ES but not Filebeat > Logstash > ES. This is because Logstash does not use ingest pipelines by default. You have to enable them in the elasticsearch output block.

Having nginx log JSON in the format required for Elasticsearch means there's very little processing (i.e. grok) to be done in Logstash. nginx can only output JSON for access logs; the error_log format cannot be changed.

Extra fields are output and not used by the Kibana dashboards. I included them in case they might be useful. Since they are not declared in the filebeat setup, their default is "string" when yo