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 os | |
import smtplib | |
from email.mime.text import MIMEText | |
def lambda_handler(event, context): | |
to_addr = event.get('to_addr') | |
subject = event.get('subject') | |
body = event.get('body') | |
msg = MIMEText(body) | |
msg['Subject'] = subject |
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
#coding: UTF-8 | |
import os | |
import json | |
import boto3 | |
import urllib.request, urllib.parse | |
from datetime import date, timedelta | |
SPACE_URL = os.environ['SPACE_URL'] | |
API_URL = SPACE_URL + '/api/v2/issues?apiKey=' + os.environ['API_KEY'] |
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/sh | |
yum update -y | |
yum -y groupinstall "Development Tools" | |
yum -y install openssl-devel bzip2-devel readline-devel sqlite-devel libffi-devel | |
git clone https://github.com/yyuu/pyenv.git /opt/pyenv | |
echo 'export PYENV_ROOT="/opt/pyenv"' >> /root/.bash_profile | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> /root/.bash_profile | |
echo 'eval "$(pyenv init -)"' >> /root/.bash_profile | |
source /root/.bash_profile | |
pyenv install 3.8.2 |
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
yum update -y | |
amazon-linux-extras install -y lamp-mariadb10.2-php7.2 | |
yum install -y mariadb-server | |
yum install -y httpd php php-xml php-mbstring php-zip php-intl | |
cd /usr/local/src/ | |
wget http://downloads.ec-cube.net/src/eccube-4.0.4.zip | |
unzip eccube-4.0.4.zip | |
mv eccube-4.0.4 /var/www/html/ec | |
chown -R apache:apache /var/www/html/ | |
echo -e '<Directory "/var/www/html/ec">\n AllowOverride All\n</Directory>' > /etc/httpd/conf.d/ec.conf |
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 subprocess | |
import urllib, urllib2 | |
DOMAIN = 'https://[スペースID].backlog.jp' | |
API_KEY = '[APIキー]' | |
TICKET_ID = '[チケットID]' | |
API_URL = DOMAIN + '/api/v2/issues/' + TICKET_ID + '/comments?apiKey=' + API_KEY | |
contents = { | |
'content' : subprocess.check_output("date") |
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 subprocess | |
import urllib.request, urllib.parse | |
DOMAIN = 'https://[スペースID].backlog.jp' | |
API_KEY = '[APIキー]' | |
TICKET_ID = '[チケットID]' | |
API_URL = DOMAIN + '/api/v2/issues/' + TICKET_ID + '/comments?apiKey=' + API_KEY | |
contents = { | |
'content' : subprocess.check_output("date").decode() |
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/sh | |
if [ $# -ne 1 ]; then | |
echo "Params error." | |
exit 1 | |
fi | |
curl -F file=@$1 -F channels=$POST_SLACK_CHANNEL_ID -H "Authorization: Bearer $POST_SLACK_TOKEN_ID" https://slack.com/api/files.upload |
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 cv2 | |
import numpy as np | |
# 環境で変わると思うので変数として持つ | |
DEVICE_ID = 0 | |
# 高さ40幅120の切り取り画像の要素のうち一致している許容値 | |
THRESHOLD = 4600 | |
# 比較用画像を読み込み二値化しておく | |
hook_img = cv2.imread('hook.jpg', 0) |
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 cv2 | |
from tesserocr import PyTessBaseAPI, PSM | |
from PIL import Image | |
# 環境で変わると思うので変数として持つ | |
DEVICE_ID = 0 | |
# キャプチャの読み込み | |
cap = cv2.VideoCapture(DEVICE_ID) | |
# デフォルトの640x480だと文字認識で粗さがネックになるのでフルHDにしておく |
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 os | |
import urllib.request, urllib.parse | |
MESSAGE = 'sample message.' | |
POST_SLACK_TOKEN_ID = os.environ.get('POST_SLACK_TOKEN_ID') | |
POST_SLACK_CHANNEL_ID = os.environ.get('POST_SLACK_CHANNEL_ID') | |
URL = 'https://slack.com/api/chat.postMessage' | |
headers = { | |
'Authorization': 'Bearer ' + POST_SLACK_TOKEN_ID |