Skip to content

Instantly share code, notes, and snippets.

@shinyaa31
shinyaa31 / read-notion-json.py
Last active August 6, 2021 15:19
Notionワークスペース配下の更新履歴作成用:生成されたソート済みJSONファイルをHTMLリスト形式で閲覧するための整形スクリプト
from pytz import timezone
from dateutil import parser
import datetime
import json
# HTMLファイルの作成.
f = open('notion_update_histories.html', 'w', encoding='UTF-8')
f.write('<html><title>Notion Update Histories.</title><body>\n')
f.write('<h2>Notion Update Histories.</h2>\n')
f.write('<p>Last Updated: ' + str(datetime.datetime.now()) + '</p>')
@shinyaa31
shinyaa31 / get-notion-update-histories.sh
Last active April 3, 2022 06:12
Notionワークスペース配下の更新履歴作成用:Notion APIを使って必要なデータをJSON形式で取得&最終更新日時で降順ソートするスクリプト
#/bin/sh
NOTION_API_TOKEN='secret_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
#######################################################
## ワークスペース直下のページ(最上位階層ページ).
#######################################################
curl -X POST 'https://api.notion.com/v1/search' \
-H "Notion-Version: 2021-05-13" \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shinyaa31
shinyaa31 / toc-from-html.py
Last active November 15, 2018 05:34
HTMLの見出しタグ情報から目次テキストを生成.
def processFile(InputFile):
"""
入力ファイルの内容を解析&目次部分の出力
"""
# それぞれの見出しを目次情報として活用するか否か.
useH1tag = False
useH2tag = True
useH3tag = True
useH4tag = True
@shinyaa31
shinyaa31 / cfn-create-vpc-and-subnets.parameters.json
Created September 18, 2017 00:03
CloudFormationパラメータファイル(JSON形式/VPC及びサブネットを作成)
[
{ "ParameterKey" : "ProjectDescription", "ParameterValue" : "Blog Verification for AWS Glue Project." },
{ "ParameterKey" : "PublicSubnet1Description", "ParameterValue" : "Public Subnet1 of Blog Verification for AWS Glue Project." },
{ "ParameterKey" : "PublicSubnet2Description", "ParameterValue" : "Public Subnet2 of Blog Verification for AWS Glue Project." },
{ "ParameterKey" : "PublicRouteTableName", "ParameterValue" : "Public Route Table of Blog Verification for AWS Glue Project." },
{ "ParameterKey" : "CIDRVpc", "ParameterValue" : "10.0.0.0/16" },
{ "ParameterKey" : "CIDRPublicSubnet1", "ParameterValue" : "10.0.0.0/24" },
{ "ParameterKey" : "CIDRPublicSubnet2", "ParameterValue" : "10.0.1.0/24" }
]
@shinyaa31
shinyaa31 / cfn-create-vpc-and-subnets.template.yaml
Last active September 18, 2017 00:02
CloudFormationテンプレートファイル(YAML形式/VPC及びサブネットを作成)
---
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ProjectDescription:
Description: Name of VPC Description.
Type: String
Default: xxxxxxx.
PublicSubnet1Description:
Description: Name of Public Subnet1 Description.
Type: String
@shinyaa31
shinyaa31 / setup-windows-os-setting.ps1
Created July 15, 2017 16:24
Windows環境の初期設定諸々を行うPowerShellスクリプト。
#########################################################################
## OS環境設定Powershellスクリプト
## 第1引数:コンピューター名
## 第2引数:AWSデフォルトリージョン
##
## ※実行前に以下コマンドを実行してスクリプトを実行出来るようにしておく事
## Set-ExecutionPolicy RemoteSigned
#########################################################################
Write-Host "** ComputerName:" $args[0]
#!/bin/sh
echo ""
echo "######################################################"
echo "EC2(Windows2012日本語版)インスタンス起動スクリプト."
echo "######################################################"
## ---------------------------------------------------------------------------
## 実行例
## $ ./run-windows-ec2-instance.sh \
## -i cs-blog-role \