Skip to content

Instantly share code, notes, and snippets.

GedowFather GedowFather

Block or report user

Report or block GedowFather

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View general_log_dump.py
#!/bin/env python
#
# Usage:
# ./dump.py
# - It will stop after period specified seconds or after getting max size.
# - log is sent to s3 bucket.
# - notification
# > EC2 needed profile (s3 put)
# > You need edit INFRA s3 bucket policy.
#
@GedowFather
GedowFather / apt_package_update.py
Last active Mar 8, 2016
S3にDEBがアップロードされたらレポジトリを更新するLambdaスクリプト
View apt_package_update.py
import json
import urllib
import boto3
import os
import re
# constants
image_id = 'ami-a21529cc' # ubuntu-trusty-14.04-amd64-server-20160114.5
subnet_id = 'subnet-example'
instance_profile_name = 'InstanceProfileName'
@GedowFather
GedowFather / yum_package_update.py
Created Mar 7, 2016
S3にRPMがアップロードされたらレポジトリを更新するLambdaスクリプト
View yum_package_update.py
import json
import urllib
import boto3
import os
import re
# constants
image_id = 'ami-59bdb937' # Amazon Linux AMI 2015.09.2 x86_64 HVM GP2
subnet_id = 'subnet-example'
instance_profile_name = 'InstanceProfileName'
@GedowFather
GedowFather / CollectdClient.py
Last active Apr 30, 2016
AWS Lambda python script for sending metric value to collectd server.
View CollectdClient.py
#
# For sending metric value to collectd server.
#
# Usage:
# from modules.CollectdClient import CollectdClient
# COLLECTD_HOST = "collectd.example.com"
# COLLECTD_PORT = 25826
# client = CollectdClient(COLLECTD_HOST, COLLECTD_PORT)
# client.putval('example-web-01', 'service', 'gauge', 'metric', 300, 1.2345)
#
@GedowFather
GedowFather / ZabbixSender.py
Created Dec 7, 2015
AWS Lambda python script for sending metric value to zabbix.
View ZabbixSender.py
#
# For sending metric value to zabbix server.
#
# You must create item as "zabbix trapper" on server.
# Because the server must be connected to agent:10050, if it is selected "zabbix agent".
#
# Usage:
# from modules.ZabbixSender import ZabbixSender
# ZABBIX_HOST = "zabbix.example.com"
# ZABBIX_PORT = 10051
@GedowFather
GedowFather / ZabbixClient.py
Last active Dec 7, 2015
AWS Lambda python script for running zabbix api.
View ZabbixClient.py
#
# Zabbix API Client.
#
# Usage:
# from modules.ZabbixClient import ZabbixClient
# ZABBIX_HOST = "zabbix.example.com"
# ZABBIX_PORT = 80
# ZABBIX_USER = 'Admin'
# ZABBIX_PASS = 'zabbix'
# ZABBIX_PATH = '/api_jsonrpc.php'
@GedowFather
GedowFather / aws_vpn_between_vpcgw_and_debian_with_monit_for_non_nat.sh
Last active Jan 4, 2016
BashScript for connecting VPN between VPC G/W and Debian Linux. operating HA by monit.
View aws_vpn_between_vpcgw_and_debian_with_monit_for_non_nat.sh
#!/bin/bash
#
# Setup VPN between Debian Linux and VPC G/W.
# How to use : ./this_script.sh Generic.txt
#
# For connecting IPsec VPN, you need to allow these connections.
# If VPN has global address, you change FORWARD to OUTPUT.
#
# ex) iptables -A FORWARD -p udp --dport 500 -j ACCEPT
# iptables -A FORWARD -p tcp --dport 500 -j ACCEPT
@GedowFather
GedowFather / aws_vpn_between_vpcgw_and_debian_with_nat.sh
Created Jan 24, 2014
BashScript for connecting VPN between VPC G/W and Debian Linux. Connecting from Client to EC2, using NAT on VPN.
View aws_vpn_between_vpcgw_and_debian_with_nat.sh
#!/bin/bash
#
# Setup VPN between Debian Linux and VPC G/W.
# How to use : ./this_script.sh Generic.txt
#
# For connecting IPsec VPN, you need to allow these connections.
# If VPN has global address, you change FORWARD to OUTPUT.
#
# ex) iptables -A FORWARD -p udp --dport 500 -j ACCEPT
# iptables -A FORWARD -p tcp --dport 500 -j ACCEPT
@GedowFather
GedowFather / openstack-vm-summary.sh
Created Oct 7, 2013
BashScript for getting vm summary of OpenStack.
View openstack-vm-summary.sh
#!/bin/bash
#
# VMの利用状況を集計するスクリプトです。
#
# - jq コマンド必須です
# http://stedolan.github.io/jq/
# # How to install
# wget -O /usr/bin/jq http://stedolan.github.io/jq/download/linux64/jq
# chmod +x /usr/bin/jq
#
@GedowFather
GedowFather / openstack-retire-users-vm-list.sh
Last active Dec 24, 2015
BashScript for getting list of OpenStack deleted user's VM.
View openstack-retire-users-vm-list.sh
#!/bin/bash
#
# Keystoneから削除済みのユーザが所有者となっているVMのリストを表示します。
#
# * jq コマンド必須です
# http://stedolan.github.io/jq/
# # How to install
# wget -O /usr/bin/jq http://stedolan.github.io/jq/download/linux64/jq
# chmod +x /usr/bin/jq
#
You can’t perform that action at this time.