This file contains hidden or 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
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
# このテンプレート実行時に実行者に入力させる内容の定義 | |
Parameters: | |
yourApplicationeName: | |
Description: use your Application Name as WAF ACL and Rules name prefix. | |
Type: String | |
Default: sampleApplication |
This file contains hidden or 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 python3 | |
# coding: utf-8 | |
import sys | |
import boto3 | |
import botocore | |
import json | |
from boto3.session import Session | |
from botocore.exceptions import ClientError |
This file contains hidden or 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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
# before | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
response = aws_client.describe_db_instances( | |
DBInstanceIdentifier = target_rds_instance_name, | |
) | |
if response['DBInstances'][0]['MultiAZ'] == True : | |
response2 = aws_client.reboot_db_instance( |
This file contains hidden or 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/python | |
# coding: utf-8 | |
import sys | |
import psycopg2 | |
def execute_sql_from_file(sqlfile): | |
try: | |
cnn = psycopg2.connect("dbname=my_db host=my_db_endpoint user=postgres password=my_password") | |
cur = cnn.cursor() |
This file contains hidden or 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
import logging | |
import datetime | |
logging.basicConfig(level=logging.DEBUG, | |
format="time:%(asctime)s \tseverity:[%(levelname)s] \tmessage:%(message)s ", filename='myapp.log') | |
logging.debug('This message should go to the log file') | |
logging.info('So should this') | |
logging.warning('And this, too') |
This file contains hidden or 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 | |
targetProcessWord="key-word-for-search-a-process-with-ps-command" | |
executionUserName="ex.root" | |
processSearchCommand="ps aux | grep "${targetProcessWord}" | awk '{if(\$1==\""${executionUserName}"\"){print \$2 }}' | head -n 1" | |
targetProcessID=`eval $processSearchCommand` | |
echo "${targetProcessWord} のOOM優先度は `cat /proc/${targetProcessID}/oom_adj` です。" | |
sudo -i echo -17 > /proc/${targetProcessID}/oom_adj | |
echo "${targetProcessWord} のOOM優先度を `cat /proc/${targetProcessID}/oom_adj` に変更しました。" |
This file contains hidden or 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
<!-- HTML内埋め込み --> | |
<style type="text/css"> | |
<!-- | |
#menu li { | |
position: relative; | |
float: left; | |
margin: 0; | |
padding: 5px; | |
width: 200px; |
This file contains hidden or 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
#引数定義 | |
Param ( | |
[string]$pathName = "", | |
[int]$targetSheetNumber = -1, | |
[string]$targetCollumn = "", | |
[int]$targetRow = -1 | |
) | |
#****************************************************************************** |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-16"?> | |
<StorableColorTheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<Keys> | |
<string>ErrorForegroundColor</string> | |
<string>ErrorBackgroundColor</string> | |
<string>WarningForegroundColor</string> | |
<string>WarningBackgroundColor</string> | |
<string>VerboseForegroundColor</string> | |
<string>VerboseBackgroundColor</string> | |
<string>DebugForegroundColor</string> |
This file contains hidden or 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
# トランスクリプト(ログ出力)の開始 | |
$yourLogfilePrefix = 'ログファイルにつけたい名前' | |
try { | |
Stop-Transcript | |
} | |
catch{ | |
Write-Output '既に実行されているトランスクリプトはありません。問題ありません。' | |
} | |
Start-Transcript -Path ( (split-path $MyInvocation.MyCommand.Path) + "\" + $yourLogfilePrefix + $tennant + "_" +(get-date -Format "yyyyMMddhhmmss") + ".log") |
NewerOlder