Skip to content

Instantly share code, notes, and snippets.

@robballou
robballou / instance_name.py
Created October 17, 2011 16:55
Get the EC2 instance name
"""
Get the EC2 instance name (tag "Name") for the instance
Usage:
python instance_name.py [instance id]
On an EC2 instance, you can run:
python instance_name.py `ec2metadata --instance-id`
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — 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.
@gm3dmo
gm3dmo / gelfsender.sh
Last active November 16, 2023 04:47
Send a log message to a gelf server using the shell.
# This script can be used to raise a graylog2/gelf message
# gzip it and send it to a graylog server using netcat (nc)
hostname='gelftester'
short_message='test message short version'
full_message='longer test message. dont\n worry be happy'
level=1
facility='gelftester'
# gnu date
date=$(date +'%s.%N')
@clifford-github
clifford-github / gist:7748223
Last active August 7, 2023 07:58
Get list of Jobs in a View Groovy from within Jenkins. Run the following snippet in the Scripting console or a Groovy build step. The latter requires the installation of the Groovy plugin
hudson.model.Hudson.instance.getView('<VIEW>').items.each() {
println it.fullDisplayName
}
@denji
denji / nginx-tuning.md
Last active July 20, 2024 17:33
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@vanjos
vanjos / kafka-upstart.conf
Created February 10, 2014 15:05
Upstart script for Kafka
description "Kafka Broker"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
respawn
respawn limit 2 5
env CONFIG_HOME="/etc/kafka"
env KAFKA_HOME="/usr/lib/kafka"
@JamesMcMahon
JamesMcMahon / ec2-autoscale-instances.py
Created March 20, 2014 20:34
Script to dynamically grab public DNS names from an EC2 autoscale instances
#!/usr/bin/env python
"""
ec2-autoscale-instance.py
Read Autoscale DNS from AWS
Sample config file,
{
"access_key": "key",
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@chelming
chelming / nxlog.conf
Last active December 9, 2020 15:35
NXLOG config that will parse SCCM and IIS logs
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
@hgomez
hgomez / jenkins-plugins-batch-install.md
Last active December 11, 2023 07:47
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :