Skip to content

Instantly share code, notes, and snippets.

View anri-c's full-sized avatar
🌴
On vacation

MASAKI Asato anri-c

🌴
On vacation
View GitHub Profile

Keybase proof

I hereby claim:

  • I am anri-c on github.
  • I am asato (https://keybase.io/asato) on keybase.
  • I have a public key whose fingerprint is AB08 A15F 16FE 3AE8 DCC1 E17A 3775 4409 2AA7 815B

To claim this, I am signing this object:

from PIL import Image, JpegImagePlugin, ExifTags
import boto3
import os
import re
s3 = boto3.client('s3')
LARGE_RATIO = int(os.environ['LARGE_RATIO'])
MEDIUM_RATIO = int(os.environ['MEDIUM_RATIO'])
SMALL_RATIO = int(os.environ['SMALL_RATIO'])
import boto3
def lambda_handler(event, context):
connect = boto3.client("connect")
message = event['Records'][0]['Sns']['Message']
print(message)
connect.start_outbound_voice_contact(
DestinationPhoneNumber='+81xxxxxxxxxxxxxx',
ContactFlowId='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
InstanceId='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
@anri-c
anri-c / node_exporter.init.amazonlinux
Created January 4, 2018 04:04
node_exporter init script
#!/bin/sh
### BEGIN INFO
# Providers: NodeExporter
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Stert: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Node exporter for prometheus
### END INIT INFO
@anri-c
anri-c / gist:e05fe25495e2e132c45b56f9e4a30b0b
Last active October 10, 2017 08:03
exmaple nginx proxy_pass
location /hoge/ {
proxy_pass http://_upstream1;
# http://example.com/hoge/
# へのアクセスを
# http://_upstream/hoge/
# へ
location /hoge/ {
proxy_pass http://_upstream/;
@anri-c
anri-c / file0.txt
Created October 4, 2016 07:12
CentOS7.x で OSSEC マネージャとエージェントのインストール ref: http://qiita.com/anri-c/items/18a72fc2bd0d8b168c6e
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
@anri-c
anri-c / file0.txt
Created September 12, 2016 08:07
errBot を導入して Slack と連携させてみる ref: http://qiita.com/anri-c/items/95cd9e5fa01253a87410
$ mkvirtualenv -p `which python3` errenv
(errenv) $ pip install errbot
(errenv) $ mkdir mybot
(errenv) $ cd mybot/
(errenv) ~/mybot$ errbot --init
Your Errbot directory has been correctly initialized !
Just do "errbot" and it should start in text/development mode.
@anri-c
anri-c / file0.txt
Last active September 1, 2016 11:42
Selenium, Phantomjs & BeautifulSoup4 ref: http://qiita.com/anri-c/items/0177e21aa3dcff6cca06
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"
$ sudo aptitude install phantomjs xvfb
$ pip install selenium pyvirtualdisplay
# list.html
<html>
<head><title></title></head>
<body>
<a href="http://www.example.com/index.html" title="link title a">Example A</a>
<a href="http://wwww.example.org/" title="link title b" target="_blank">Example B</a>
<a href="http://www.example.net/" title="link title c">Example C</a>
</body>
</html>
@anri-c
anri-c / gist:23f8d612fa2987f15b58aecfd589f261
Created August 9, 2016 06:50
github api get user pubkey
ENDPOINT=https://api.github.com
TOKEN=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
USERS=(
user1
user2
user3
)
for NAME in ${USERS[@]}
do