Skip to content

Instantly share code, notes, and snippets.

@lamanotrama
lamanotrama / rds-slowlog-to-text.pl
Created June 18, 2012 09:00
RDSのmysql.slow_logテーブルを通常のテキストのフォーマットに変換するやつ
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use DBI::Const::GetInfoType;
use Config::Pit;
::main();
exit;
@lamanotrama
lamanotrama / Net::Amazon::EC2::PaperboyAttributes
Created July 4, 2012 09:21
N::A::EC2 に色々生やすサンプル
package Net::Amazon::EC2::PaperboyAttributes;
use strict;
use warnings;
use Net::Amazon::EC2 0.18;
use JSON qw/decode_json/;
Net::Amazon::EC2::RunningInstances->meta->make_mutable();
Net::Amazon::EC2->meta->make_mutable();
@lamanotrama
lamanotrama / gist:3917925
Created October 19, 2012 12:07
tagとるやつ
sub _build_volume_name {
my $self = shift;
my $name_tag = $self->ec2->describe_tags(
"Filter.Name" => [ "resource-id", "key" ],
"Filter.Value" => [ $self->ebs->volume_id, "Name" ]
) or croak "Target EBS requires 'Name' tag: ". $self->ebs->volume_id;
return $name_tag->[0]->value;
}
@lamanotrama
lamanotrama / growthforecast.ini
Last active December 12, 2015 01:18
growthforecastユーザでplenvで入れたperl使って、growthforecastを動かす場合の、supervisordの設定
[program:growthforecast]
command = plenv exec growthforecast.pl --data-dir /home/growthforecast/data
user = growthforecast
environment = HOME=/home/growthforecast
directory = /home/growthforecast
process_name = %(program_name)s
redirect_stderr = false
@lamanotrama
lamanotrama / sgs_by_name.pl
Created February 14, 2013 01:36
インスタンスのNameタグから、そのインスタンスに付いてるsecurity groupの名前を得
my $ec2 = Net::Amazon::EC2->new(
AWSAccessKeyId => $config->{AWSAccessKeyId},
SecretAccessKey => $config->{SecretAccessKey},
region => $config->{region},
) or die;
my ($instance) =
grep {
grep { $_->value eq $name }
grep { $_->key eq 'Name' }
CLOUDFRONT() CLOUDFRONT()
NAME
cloudfront -
DESCRIPTION
AVAILABLE COMMANDS
o create-cloud-front-origin-access-identity

こんちわっっす

おれおれおれだよ!

そう

おれが

おれだ!

@lamanotrama
lamanotrama / Vgrantfile jenkins
Created November 2, 2013 14:44
jenkins on CentOS6
# -*- mode: ruby -*-
# vi: set ft=ruby :
# refs: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "CentOS6.4-x86-64"
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130427.box"
@lamanotrama
lamanotrama / hoge.md
Last active December 27, 2015 10:49
これにsahara plugin(sandbox)の補完を追加した。 https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/vagrant/_vagrant

test

てすてす

@lamanotrama
lamanotrama / bomb
Created November 20, 2013 07:09
bomb
:black_large_square: :bomb: :black_large_square:
:bomb: :runner: :bomb:
:black_large_square: :bomb: :black_large_square: