Skip to content

Instantly share code, notes, and snippets.

@jbrown
jbrown / packages.rb
Created October 3, 2011 15:03
Detailed package info for CentOS 5.6
require 'rubygems'
require 'nokogiri'
require 'open-uri'
@xml = Nokogiri open 'http://vault.centos.org/5.6/os/x86_64/repodata/comps.xml'
def printGroups(default = true)
puts "=== #{'Non' unless default}Default Groups ==="
@xml.xpath("//default[text()='#{default}']/..").each_with_index do |group, ix|
puts "#{ix + 1}.) #{group.at_xpath('name').text}"
@bradland
bradland / ssh-known-hosts-mgmt.sh
Last active April 4, 2023 21:21
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com
@marlun78
marlun78 / httpStatusCodes.js
Last active October 23, 2020 00:45
An HTTP Status Codes object
/**
* HTTP Status Codes
* Copyright (c) 2012, marlun78
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83
*
* Taken from: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
* Visual Studio find regex: ^(\d{3}) ([^\r\n]+)\r\n
* Visual Studio replace regex: '$1': '$2', //
* Notes wrapped in parens moved manually
*/
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active August 25, 2025 12:52 — 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.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 15, 2025 02:35
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@randomecho
randomecho / australian-postcodes.sql
Last active October 19, 2025 11:12
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@caseywatts
caseywatts / 0instructions.md
Last active October 14, 2022 00:07
Easily fill out web forms using data from a spreadsheet using this bookmarklet.

Other gists & tricks: http://caseywatts.com/gists-and-tricks

To set this up, paste the code below into the "location" of a bookmark. Make sure it starts with "javascript:", some browsers strip this out when you paste.

  1. Find the "name" of each form element you want to put data into. You can find the "name" by right clicking on the form box and "inspecting" it.
  2. By using a spreadsheet, create a set of urls with the data you want to input. Example: variablename1 is the "name" of the form field. "value1" is the value you want to put into the box.www.website.com/page.html?variablename1=value1&variablename2=value23. Navigate to that custom URL4. Click the bookmarklet. Voila!
@rothgar
rothgar / main.yml
Last active April 28, 2025 04:18
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@labrown
labrown / elasticsearch-handlers-main.yml
Last active September 22, 2023 12:11
Ansible rolling restart of Elasticsearch Cluster
---
###
# Elasticsearch Rolling restart using Ansible
###
##
## Why is this needed?
##
#
# Even if you use a serial setting to limit the number of nodes processed at one
@deepzm
deepzm / gist:06fb2d34f480bd6b1e49
Last active September 11, 2020 11:48
faraday file upload
require 'faraday'
field_file_url = 'http://localhost/blah'
file_to_upload = 'test.txt'
connection = Faraday.new(field_file_url) do |builder|
builder.request :multipart
builder.request :url_encoded
builder.adapter :net_http
end