Skip to content

Instantly share code, notes, and snippets.

View dragon3's full-sized avatar
🍺
🍺 🍻 🍺 🍻 🍺

Ryuzo Yamamoto dragon3

🍺
🍺 🍻 🍺 🍻 🍺
View GitHub Profile
@roccoblues
roccoblues / timezone
Created March 8, 2013 10:01
Ansible module to set timezone on hosts. DISCLAIMER: this is probably totally unportable and only tested on Debian 6.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import os
from subprocess import call
DOCUMENTATION = '''
---
module: timezone
@GedowFather
GedowFather / percona_backup.sh
Last active April 11, 2024 10:16
Backup & Restore Scripts for Percona XtraBackup
#!/bin/bash
#
# ============================================================
#
# @license This program is free software.
#
# @category Script for Percona Server
# @project Gedow Software
# @package Gedow Percona Utils
# @author GedowFather http://blog.father.gedow.net/
@kiwanami
kiwanami / gridfs-proxy.pl
Created October 22, 2012 15:37
http proxy for gridfs (psgi)
use MongoDB::Async;
use Coro;
use Coro::EV;
use MongoDB::Async::GridFS;
use Data::Dumper;
use POSIX qw(:math_h);
# (setenv "PERL5LIB" "./exlib/lib/perl5/x86_64-linux:./exlib/lib/perl5")
my $connection = MongoDB::Async::Connection->new(host => 'localhost', port => 27017);
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@yyuu
yyuu / find-orphaned-snapshots.py
Created February 17, 2012 08:35
find snapshot which is not referenced from any AMIs
#!/usr/bin/env python
#
# find snapshots which is not referenced from any AMIs
#
import boto.ec2
import boto.ec2.image
import boto.exception
import os
import re
@makamaka
makamaka / gist:1161799
Created August 22, 2011 06:36
YAPC::Asia Tokyo 2011 上司の説得が必要な方へ

この文章は http://www.adobe.com/jp/joc/max2011/cyb/index.html (Adobe MAX 2011 : 上司の説得が必要な方へ)一般向けテンプレートが元ネタです。ネタを活かしきれていないですがご容赦を。(下記テンプレの文責はmakamakaに帰しますが、実際に使用した結果の責任は負いかねます)

#上司の説得が必要な方へ

「YAPC::Asia Tokyo 2011に参加したいが、上司が首を縦に激しく振ってくれない」という方のために、YAPC::Asiaに参加するメリットをアピールするための文章テンプレートを用意しました。ぜひ、カスタマイズしてご利用ください。っていうか、そのまま使うのはおやめください。

@hirose31
hirose31 / gist:1006095
Created June 3, 2011 09:32
bash completion for dotcloud
### dotcloud 0.3.1
# must be load .bash_completion (http://bash-completion.alioth.debian.org/)
# before load this file.
# expire_in filename expire_seconds
# expire_in foo.cache 300 # return true if go by 5min from last modification.
expire_in() {
local file=$1
local expire=$2
> package = stitch.createPackage({ paths: ['basecamp-mobile/lib'] })
> package.findRequires(function(err, requires) { console.log(requires) })
> [ 'cinco/application',
'cinco/date_time',
'cinco/collection',
'cinco/util',
'basecamp/collections/collection',
'basecamp/models/comment',
'basecamp/models/company',
'basecamp/models/milestone',
@samuel
samuel / backup.py
Created November 8, 2010 22:42
A script to automate freezing XFS and locking MongoDB and snapshotting EBS volumes
#!/usr/bin/env python
from __future__ import with_statement
import contextlib
import logging
import os
import sys
import urllib2
from boto.ec2.connection import EC2Connection
use inc::Module::Install;
use Module::Install::TestTarget;
name 'MyApp';
all_from 'lib/MyApp.pm';
requires 'DBI';
requires 'JSON';
test_requires 'Test::More';