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 | |
set -e | |
if [ $# != 3 ] || [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]; then | |
echo -e "Three parameters are required | |
1st - string: Hosted Domain Name on Route 53 (e.g. example.com) | |
2nd - string: Domain Name for Certificate (e.g. sub.mexample.com) | |
3rd - string: Target Region (e.g. us-east-1) | |
example command |
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
package main | |
import ( | |
"context" | |
_ "embed" | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/aws/aws-sdk-go-v2/aws" |
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 glob | |
import os | |
import re | |
from typing import Final | |
HOME_DIR: Final[str] = "/Users/hoge" # change to your home directory | |
FILE_TYPE: Final[str] = "jpg" # or "png" | |
NEW_FILE_PATTERN: Final = r".*(\d{4})-(\d{2})-(\d{2})_\d{5,6}([^\/]+)?\." + FILE_TYPE | |
SC_DIR: Final = f"{HOME_DIR}/Pictures/__ss_tmp" | |
SC_OUT_DIR: Final = f"{HOME_DIR}/Pictures/000_ScreenShot" |
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 json | |
import traceback | |
from datetime import datetime, timezone, timedelta | |
from urllib.request import Request, urlopen | |
SLACK_WEBHOOK_URL = '<your-slack-incomming-webhook-url>' | |
SLACK_CHANNEL = '<your-slack-channel>' | |
TEST_EVENT_FILE = './sample__CodeBuild.json' | |
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 | |
if [ $# != 2 ] || [ $1 = "" ] || [ $2 = "" ]; then | |
echo "Two parameters are required" | |
echo "" | |
echo "1st : string for API Key name (ex. user1)" | |
echo "2nd : string for Usage Plan ID (ex. abc123)" | |
echo "" | |
echo "example command" | |
echo "\t$ sh ./generate_api_key.sh user1 abc123" |
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
"""Delete old Slack messages at specific channel.""" | |
from datetime import datetime | |
from time import sleep | |
import json | |
import re | |
import sys | |
import urllib.parse | |
import urllib.request | |
DELETE_URL = "https://slack.com/api/chat.delete" |
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
from time import sleep | |
from urllib.request import Request, urlopen | |
import argparse | |
import json | |
import traceback | |
GITHUB_REPOS_API = 'https://api.github.com/users/{user_name}/repos?per_page=100&page={page}' | |
PRINT_LINE = '{repo_name: <40}:{star_cnt: >6}' | |
p = argparse.ArgumentParser() |
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" | |
Description: "API Gateway - usage plan template." | |
Parameters: | |
TargetApiId: | |
Type: String | |
Resources: | |
UsagePlan: | |
Type: "AWS::ApiGateway::UsagePlan" |
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
function () { | |
const _d = document; | |
const imgElemList = _d.querySelectorAll('ol.pg-photo__webImageList a img'); | |
if (imgElemList.length == 0) { | |
alert('Images not found.'); | |
return; | |
} | |
imgElemList.forEach((e, i) => { | |
let imgSrc = e.getAttribute('src'); | |
imgSrc = imgSrc.slice(0, imgSrc.indexOf('?')); |
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
function handler(event) { | |
var host = '<REPLARE_TO_YOUR_HOST>'; // e.g. https://michimani.net | |
var request = event.request; | |
var requestUri = request.uri; | |
// do not anything when requesting to top page | |
if (requestUri == '' || requestUri == '/') { | |
return request; | |
} |
NewerOlder