This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| 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}" |
| # 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 |
| /** | |
| * 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 | |
| */ |
| This playbook has been removed as it is now very outdated. |
| /* | |
| 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; |
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.
| # 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'] |
| --- | |
| ### | |
| # 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 |
| 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 |