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
import time | |
import sendgrid | |
import os | |
from datadog import statsd | |
from sendgrid.helpers.mail import * | |
sq = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) | |
from_email = Email("") | |
subject = "Hello" | |
to_email = Email("") |
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
#メモリ領域をマウントして使う | |
pi@raspberrypi:~/Code$ sudo cat /etc/fstab | |
proc /proc proc defaults 0 0 | |
/dev/mmcblk0p6 /boot vfat defaults 0 2 | |
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1 | |
tmpfs /tmp/motion tmpfs defaults,noatime,size=20M 0 0 | |
# a swapfile is not a swap partition, no line here | |
# use dphys-swapfile swap[on|off] for that |
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
# Pythonのバージョン指定があったので、pyenvで入れてから以下の対応する | |
$ pyenv install 3.4.5 | |
$ pip install oauth2client | |
$ gcloud components update | |
--- | |
mba13:RaspberryPi aya$ gcloud auth application-default login | |
Your browser has been opened to visit: |
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
# -*- coding: utf-8 -*- | |
# | |
import re | |
import io | |
from datadog import initialize, api | |
import csv | |
options = { | |
'api_key': 'hogehoge', | |
'app_key': 'foobar' |
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
Datadog Agent | |
- ソフトウェア | |
- ソースコードはGithub | |
- プロキシーがある場合は設定が必要 | |
- オープンソース | |
- 開けておくべきポート: 17123/tcp, 17124/tcp, 8125/udp | |
要素 | |
- Collector: 一般的なシステムメトリックスを習得(CPUやメモリ、インテグレーション情報等) | |
- Dogstatsd: アプリケーションやコマンドラインスクリプトからカスタムメトリックスを送信するstatsdのサーバ | |
- Forwarder: 上記二点からデータを受け取りqueueの順番にしたがってDatadogに送信する |
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
import json | |
import urllib.request | |
request_data = {'name': 'User'} | |
request_url = 'https://my-api-id.execute-api.region-id.amazonaws.com/test/mydemoresource' | |
req = urllib.request.Request(request_url) | |
req.add_header('Content-Type', 'application/json; charset=utf-8') | |
jsondata = json.dumps(request_data) | |
jsondataasbytes = jsondata.encode('utf-8') | |
req.add_header('Content-Length', len(jsondataasbytes)) |
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
#cloud-config | |
apt_upgrade: true | |
apt_sources: | |
- source: "ppa:ansible/ansible" | |
packages: | |
- software-properties-common | |
- ansible | |
#!/bin/sh | |
DD_API_KEY={鍵情報こちらに} bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/dd-agent/master/packaging/datadog-agent/source/install_agent.sh)" |
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 | |
sudo apt-get install software-properties-common | |
sudo apt-add-repository ppa:ansible/ansible | |
sudo apt-get update | |
sudo apt-get install ansible |
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
大喜多 | |
鈴木 | |
大削 | |
永淵 | |
天野 | |
荒井 | |
西島 | |
画像貰ってない | |
小島 |
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
#Wheey-backportsの設定をする | |
$ sudo vi /etc/apt/sources.list | |
#backport | |
deb http://ftp.jaist.ac.jp/debian wheezy-backports main | |
$ sudo apt-get update | |
$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php | |
$ sudo vi /etc/apache2/conf.d/zabbix | |
#時間設定をする |