PythonのWebフレームワークであるFlaskを使って簡単なWebアプリケーションを作ってみます。
$ mkdir work_flaskapp
$ cd $_
$ python3 -m venv env
provider "aws" { | |
region = "ap-northeast-1" | |
} | |
resource "aws_iam_role" "iam_for_lambda" { | |
name = "iam_for_lambda" | |
assume_role_policy = <<EOF | |
{ | |
"Version": "2012-10-17", |
/var/log/nsd.log | |
{ | |
notifempty | |
rotate 60 | |
daily | |
dateformat .%Y%m%d | |
copytruncate | |
nocompress | |
olddir nsd.old | |
su nsd nsd |
#!/bin/bash | |
# [how to use] | |
# 1. put this file as a /etc/ssh/sshrc | |
# 2. change file permission with "chmod 755 /etc/ssh/sshrc" | |
PATH=/usr/bin:/bin:/sbin:/usr/sbin | |
TIME=`LANG=C date "+%Y/%m/%d %X"` | |
USER=`whoami` | |
IP=`who | tac | head -n 1 | cut -d'(' -f2 | cut -d')' -f1` |
#!/bin/bash | |
# [how to use] | |
# 1. put this file as a /etc/ssh/sshrc | |
# 2. change file permission with "chmod 755 /etc/ssh/sshrc" | |
PATH=/usr/bin:/bin:/sbin:/usr/sbin | |
TIME=`LANG=C date "+%Y/%m/%d %X"` | |
USER=`whoami` | |
IP=`who | tac | head -n 1 | cut -d'(' -f2 | cut -d')' -f1` |
from urllib import request | |
import json | |
def main(): | |
url = 'https://api.github.com/users/tomoyk/gists' | |
req = request.Request(url) | |
with request.urlopen(req) as res: | |
res_body = res.read().decode('utf-8') | |
dict_res = json.loads(res_body) |
from urllib import request | |
import json | |
import time | |
def send_metric(service_name, api_key, payloads): | |
req_url = 'https://api.mackerelio.com/api/v0/services/{}/tsdb'.format(service_name) | |
req_body = json.dumps(payloads).encode('utf-8') | |
req_method = 'POST' | |
req_headers = { |
yubikey-piv-managerはdeprecateでオワコンらしい。
https://developers.yubico.com/yubikey-piv-manager/
yubikey-manager-qtかyubikey-manager(cli)を使うべきらしい。