Skip to content

Instantly share code, notes, and snippets.

@Twinuma
Twinuma / gist:6fc3ce3a24eca00be989d2c5df22b823
Created October 25, 2018 07:17
CloudWatch Logs設定サンプル
[general]
state_file = /var/lib/awslogs/agent-state
use_gzip_http_content_encoding = true
[/var/log/messages]
file = /var/log/messages
log_group_name = /var/log/messages
log_stream_name = {instance_id}
datetime_format = %Y-%m-%d %H:%M:%S
@Twinuma
Twinuma / gist:c2f714bd8f80e63de982cfcc17f137af
Created October 25, 2018 07:16
俺得Linuxコマンド集
# 俺得Linuxコマンド集
## CPU使用率TOP10を表示する
`ps -e aux | sort -r -k 3 | head -n 10`
## メモリ占有率TOP10を表示する
`ps -e aux | sort -r -k 4 | head -n 10`
## 項目名がウザい場合は以下の文字列を付与する
`ps --no-header`
- 1Password 7.app
- 1Password 7.app.zip
- AVGAntivirus.app
- AWS Schema Conversion Tool.app
- Adobe
- Adobe Acrobat Reader DC.app
- Adobe Creative Cloud
- Adobe Lightroom CC
- Airmail 2.app
- Alfred 3.app
Include */config
ServerAliveInterval 30
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_ricoh_github_rsa
User git
Host heroku.com
User git
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
@Twinuma
Twinuma / cfn-cwlogs-direct-firehose.yaml
Created October 25, 2018 05:08
CloudWatch LogsのデータをFirehoseを使ってS3に保存するCloudFormationのテンプレート
AWSTemplateFormatVersion: '2010-09-09'
Description: cloudwatchlogs to firehose direct (no lambda) 20180520
Parameters:
TargetLogGroup:
Description: 'Input target log group'
Type: String
Default: ''
TargetS3bucket:
Description: 'Input S3 bucket name to save'
Type: String
@Twinuma
Twinuma / gist:ebc22a9676e97d2b56def006468e4bb8
Created October 25, 2018 05:07
仕事用MBP Hombrewインストール一覧
adns
ansible
apr
apr-util
asciinema
aspell
auto-scaling
autoconf
autojump
automake
@Twinuma
Twinuma / ssm-peco.sh
Created September 15, 2018 06:34
pecoってAWS System Manager Session ManagerでEC2にアクセスする
#!/bin/bash
# Tags.Name取得
export NAME_SSM2EC2=$(aws ec2 describe-instances --profile $1 --region $2\
--query "Reservations[].Instances[].Tags[?contains(Key, \`Name\`)].Value[]" | \
sed -e 's/[]" ,\[]//g' | \
sed -e "/^$/d" | peco)
# instance-id取得
export ID_SSM2EC2=$(aws ec2 describe-instances --profile $1 --region $2 --query "Reservations[].Instances[?contains(Tags[].Value, \`${NAME_SSM2EC2}\`)].InstanceId[]" | sed -e 's/[]" ,\[]//g' | sed -e '/^$/d')
@Twinuma
Twinuma / vpc-eb-bestpractice-develop.template
Created March 30, 2016 01:56
elasticbeanstalk in vpc bestpractice template for development
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "ElasticBeanstalk in VPC Bestpractice Template For MonstarLab,Inc.",
"Parameters": {
"SSHLocation" : {
"Description" : " The IP address range that can be used to SSH to the EC2 instances",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"Default": "0.0.0.0/0",