Skip to content

Instantly share code, notes, and snippets.

@hawaku
hawaku / dynamic-dynamodb
Created March 10, 2014 14:22
EC2にDynamic-DynamoDBをインストールする ref: http://qiita.com/treeclad/items/138da162cf8bb9fecf08
#!/usr/bin/env bash
### BEGIN INIT INFO
# Provides: dynamic-dynamodb
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
NAME=dynamic-dynamodb
@hawaku
hawaku / dateloop.sh
Created March 11, 2014 07:35
linuxのシェルスクリプトで日付でループする ref: http://qiita.com/treeclad/items/2f0a8454bbead2f070d2
#!/bin/sh
#
# YYYY-MM-DD
#
STARTDATE=2014-02-20
ENDDATE=2014-03-02
CURRENTDATE=$STARTDATE
while [ 1 ] ; do
@hawaku
hawaku / file0.txt
Created November 8, 2014 23:14
AWS RDSの情報をAWS CLIで一括取得する ref: http://qiita.com/treeclad/items/312657d3da34b69926b7
#/bin/bash
# --profileで指定するプロファイル名
profile_list=`cat ~/.aws/config |grep profile|cut -d ' ' -f 2|sed 's/]//'`
for profile in ${profile_list[@]}
do
region_list=`aws --profile ${profile} ec2 describe-regions|jq -r '.Regions[].RegionName'`
for region in ${region_list[@]}
@hawaku
hawaku / file0.txt
Last active August 29, 2015 14:13
AnsibleでNTP脆弱性に対応する ref: http://qiita.com/treeclad/items/2814a96a7cb9ec6dc392
- hosts: all
sudo: yes
gather_facts: no
vars:
pkg: ntp
tasks:
- name: yum clean
shell: yum clean all
#!/bin/bash
SrcProfile=hoge
SrcRoleName=hoge_role
DestProfile=moge
DestRoleName=mode_role
getrole=`aws --profile $SrcProfile iam get-role --role-name $SrcRoleName`
assume=`echo $getrole|jq '.Role.AssumeRolePolicyDocument'`
cowsay -l | grep -v "^Cow" | tr ' ' '\n' | xargs -I{} cowsay -f{} I am a {}
<html>
<head>
<title>Contact</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"></script>
<script src="contact.js"></script>
<!-- Special version of Bootstrap that only affects content wrapped in .bootstrap-iso -->
{
"properties": {
"email": {
"type": "string"
},
"message": {
"type": "string"
},
"subject": {
"type": "string"
@hawaku
hawaku / AzureStorageDiag.bicep
Last active March 11, 2024 10:04
Diagnostic setting for Azure Storage
param appPrefix string = '${uniqueString(resourceGroup().id)}'
param logAnalyticsWorkspaceName string = 'log-${appPrefix}'
param storageAccountName string = 'st${appPrefix}'
param location string = resourceGroup().location
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2020-08-01' = {
name: logAnalyticsWorkspaceName
location: location
properties: {
sku: {