Skip to content

Instantly share code, notes, and snippets.

View jbpadgett's full-sized avatar

Jeffery Padgett jbpadgett

  • Texas, USA
View GitHub Profile
#!/usr/bin/env ruby
#
# Originally written by http://redartisan.com/tags/csv
# Added and minor changes by Gavin Laking
# Rewritten by Andrew Bennett for Ruby 1.9
#
# Usage: ruby csv_to_fixture.rb file.csv [--json]
#
# "id","name","mime_type","extensions","icon_url"
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif"
@nicerobot
nicerobot / tmbundles.sh
Created January 2, 2012 04:54
The TextMate Bundles I use, a script install/update them, and a LaunchAgent plist to keep them updated (for TextMate 1.0)
#!/bin/sh
# To run using my bundles (https://raw.github.com/gist/1549404/tmbundles.txt):
# curl -ks https://raw.github.com/gist/1549404/tmbundles.sh | sh
# To use bundles listed in another gist:
# curl -ks https://raw.github.com/gist/1549404/tmbundles.sh | FILE=1549404/tmbundles.txt sh
# Just replace "1549404/tmbundles.txt" with another bundle list
(
cd ~/Library/Application\ Support/TextMate/Bundles || exit $?
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@matthewlehner
matthewlehner / autopgsqlbackup
Created July 11, 2012 16:10
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@larsks
larsks / generate_password-2.ps1
Created November 4, 2012 13:34
Generating a random password using Get-Random
# Generate a random password
# Usage: random-password <length>
Function random-password ($length = 15)
{
$punc = 46..46
$digits = 48..57
$letters = 65..90 + 97..122
# Thanks to
# https://blogs.technet.com/b/heyscriptingguy/archive/2012/01/07/use-pow
@mmoulton
mmoulton / README.md
Last active November 7, 2020 18:19
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.

@robertstarmer
robertstarmer / add_cobbler_nodes.py
Created October 22, 2013 06:59
a script for adding nodes to cobbler based on a yaml formatted file.
#!/usr/bin/python
""" A quick script to load up the test physical systems
into cobbler. This should allow for faster build times, even
with some manual intervention
"""
"""
sudo cobbler system add --name="cloud-os-09.cisco.com"
--mac-address="00:25:B5:00:00:03"
--ip-address="192.168.100.9"
@simonista
simonista / .vimrc
Last active June 19, 2024 15:35
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
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']