$ db_info.sh -d test_db -c hoge_column%
+------------+--------------+-------------+-------------+----------------+
| TABLE_NAME | COLUMN_NAME | COLUMN_TYPE | IS_NULLABLE | COLUMN_DEFAULT |
+------------+--------------+-------------+-------------+----------------+
| table_1 | hoge_column1 | int(11) | NO | NULL |
| table_3 | hoge_column1 | int(11) | NO | NULL |
| table_10 | hoge_column2 | int(11) | NO | NULL |
+------------+--------------+-------------+-------------+----------------+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "1", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:DeleteObject", | |
"s3:GetObject", | |
"s3:PutObject" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function db_truncate_tables { | |
database=$1 | |
/usr/local/bin/mysql -u root -D $database -e 'show tables;' | \ | |
cut -f 2 | grep -v Tables_in_ | \ | |
xargs -I "@@" mysql -u root -D $database -e "set foreign_key_checks=0; DROP TABLE \`@@\`; set foreign_key_checks = 1;" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== grid(@posts_grid) do |g| | |
- g.column attribute: 'title' | |
- g.column name: 'body' do |u| | |
- u.truncated_body |
- S3の'Static Website Hosting'を有効にする
- 'Edit Redirection Rules'を編集する
- 'bucket policy'を編集する
- CLoudFrontのOriginにS3の'Static Website Hosting'のEndpointを指定する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REGIONS=( \ | |
"us-east-1" \ | |
"us-west-1" \ | |
"us-west-2" \ | |
"eu-west-1" \ | |
"sa-east-1" \ | |
"ap-southeast-1" \ | |
"ap-southeast-2" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REGIONS=( \ | |
"us-east-1" \ | |
"us-west-1" \ | |
"us-west-2" \ | |
"eu-west-1" \ | |
"sa-east-1" \ | |
"ap-southeast-1" \ | |
"ap-southeast-2" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/10 * * * * /sbin/mount | grep 'Time Machine' | [ `wc -l` -eq 0 ] && osascript -e 'tell app "System Events" to display dialog "Time Machine のディスクが外れています"' > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
to_ref='00000000000000000000000000' | |
channel='private-group' | |
username='stash' | |
text="*branch name* has new commits by *user name*" | |
icon=':stash:' | |
attachments='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# https://github.com/ruby/rake/blob/master/lib/rake/application.rb#L291 | |
values = %w(Our star is an enormous thermonuclear furnace more than a million times as big as Earth) | |
width = values.map(&:length).max || 10 | |
values.each do |v| | |
printf("%-#{width}s # this is a pen.\n", v) |