This file contains 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
Copyright (c) 2023 fukasawah | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains 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 python | |
# env: | |
# SYSTEM_ACCESSTOKEN: $(System.AccessToken) | |
# usage) | |
# echo hello | python pull-request-comment.py | |
# test) | |
# # https://gist.github.com/fukasawah/d8ecaea8ac2b73f440b7193cdb295e92 | |
# python echo-http-server.py & |
This file contains 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 | |
# usage) python echo-http-server.py | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
class EchoHandler(BaseHTTPRequestHandler): | |
def do_POST(self): | |
self.send_response(200) | |
self.send_header('Content-type', 'text/plain; charset=utf-8') |
This file contains 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
- feed: https://blog.azure.moe/feed/ | |
tags: | |
- Japan | |
- MVP | |
- feed: https://jpaztech.github.io/blog/atom.xml | |
tags: | |
- Japan | |
- Microsoft | |
- feed: https://jpazpaas.github.io/blog/feed.xml | |
tags: |
This file contains 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
$ for file in vmftest*; do echo $file; grep 'rtt min/avg/max/mdev' "$file" | perl -ple 's/.* = ([^\/]+).*/$1/' ; done | |
vmftest1-4tqb.japaneast.cloudapp.azure.com.log | |
0.937 | |
1.979 | |
1.424 | |
0.571 | |
1.672 | |
2.009 | |
vmftest1-6keq.japaneast.cloudapp.azure.com.log | |
0.628 |
This file contains 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
{ | |
"now": "2022-01-18T04:43:11.5121004+00:00", | |
"utcNow": "2022-01-18T04:43:11.5121027Z", | |
"timezone": { | |
"Id": "Etc/UTC", | |
"DisplayName": "(UTC+00:00) GMT", | |
"StandardName": "GMT", | |
"DaylightName": "GMT", | |
"BaseUtcOffset": "00:00:00", | |
"AdjustmentRules": [ |
This file contains 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
''' | |
Usage) sudo python3 testserver.py 80 | |
''' | |
import sys | |
import http.server | |
class TestHttpRequestHandler(http.server.BaseHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(200) |
This file contains 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/sh | |
set -ue | |
# | |
# usage) bash lock-and-run.sh "echo" "hello lock world" | |
# | |
### **次の項目は適宜書き換える** ### |
This file contains 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
<?php | |
function encodeBase64Url($value) | |
{ | |
$value = base64_encode($value); | |
$value = strtr($value, '+/', '-_'); // https://datatracker.ietf.org/doc/html/rfc4648#section-5 | |
$value = rtrim($value, "="); // without padding, https://datatracker.ietf.org/doc/html/rfc7515#appendix-C | |
return $value; | |
} | |
function generateJwtHS256($payload, $tokenKeyB64) |
This file contains 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
# ### Usage ### | |
# mkdir data | |
# az account list-locations --query "[].name" --output tsv | tr -d "\r" | while read region; do az network list-service-tags --location "$region" > "data/list-service-tags-${region}.json"; done; | |
# python ip-check.py "data/list-service-tags-japaneast.json" "10.0.0.1" | |
import sys | |
import ipaddress | |
import json |
NewerOlder