Skip to content

Instantly share code, notes, and snippets.

View 42milez's full-sized avatar
🍵

Akihiro TAKASE 42milez

🍵
View GitHub Profile
#!/bin/bash
DOCKER_IMAGE=42milez/hanami:latest
DOCKER_WORK_DIR=/root
PROJECT_DIR=$(pwd)
DATABASE=postgres
docker run \
-w ${DOCKER_WORK_DIR} \
@42milez
42milez / auto_snapshot.py
Created July 11, 2018 02:07
Create snapshots and delete old snapshots
import boto3
import collections
import logging
import time
ec2 = boto3.client('ec2')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@42milez
42milez / install_amzndriver_centos.sh
Last active May 27, 2020 17:44
This script install the Linux kernel driver to provide ENA support for CentOS 7.x and 6.x.
#!/usr/bin/env bash
# https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/enhanced-networking-ena.html
amzn_driver_ver="1.5.3"
centos_ver=`sed -e 's/^CentOS\s\(Linux\s\|\)release\s\([0-9.]\+\)\s.\+$/\2/' /etc/centos-release`
# Install the appropriate kernel-devel and kernel-headers
# --------------------------------------------------
yum install -y perl
@42milez
42milez / install_amzndriver_rhel.sh
Created June 15, 2018 11:23
This script install the Linux kernel driver to provide ENA support for RHEL.
#!/usr/bin/env bash
# https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/enhanced-networking-ena.html
amzn_driver_ver="1.5.3"
# Install the appropriate kernel-devel and kernel-headers
# --------------------------------------------------
yum install -y kernel-headers-$(uname -r) kernel-devel-$(uname -r)
@42milez
42milez / find_pull_requests.sh
Last active December 12, 2017 08:59
This script reveals the pull requests which contain the unmerged commits between two branches.
#!/usr/bin/env bash
url_prefix='https://github.com/USER_NAME/REPOSITORY_NAME/pull/'
src_branch='branch-a'
dest_branch='branch-b'
pull_requests=()
# 1. Find the commit hashes which are only included in dest_branch.
<?php
/* Aug. 21, 2015 - Akihiro TAKASE
*
* 本ファイルにはハッシュを扱うユーティリティクラスの定義が含まれます。
*
*/
class Util_Hash {
<?php
/* Aug. 21, 2015 - Akihiro TAKASE
*
* 本ファイルは User テーブル用のマイグレーションスクリプトです。
*
*/
namespace Fuel\Migrations;
<?php
/* Aug. 21, 2015 - Akihiro TAKASE
*
* 本ファイルには User テーブルに対応するモデルの定義が含まれます。
*
*/
class Model_User extends \Orm\Model {
<?php
/* Aug. 21, 2015 - Akihiro TAKASE
*
* 本ファイルにはユーザー登録に関するアクションを扱うコントローラの定義が含まれます。
*
*/
use Fuel\Core\Security as Security;
<?php
/* Aug. 21, 2015 - Akihiro TAKASE
*
* 以下は Standard PHP Library の ArrayIterator を利用したサンプルコードです。
* Employee オブジェクトの配列が Department オブジェクトのプライベートプロパティとなっています。
* 本サンプルでは当該配列を ArrayIterator を利用して走査します。
*
*/