Skip to content

Instantly share code, notes, and snippets.

@GedowFather
GedowFather / capacity-scheduler.xml
Created September 3, 2012 06:10
CDH4 configurations
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<!-- Setting up queues -->
<property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>default,tree</value>
@GedowFather
GedowFather / percona_backup.sh
Last active April 11, 2024 10:16
Backup & Restore Scripts for Percona XtraBackup
#!/bin/bash
#
# ============================================================
#
# @license This program is free software.
#
# @category Script for Percona Server
# @project Gedow Software
# @package Gedow Percona Utils
# @author GedowFather http://blog.father.gedow.net/
@GedowFather
GedowFather / openstack-retire-users-vm-list.sh
Last active December 24, 2015 06:39
BashScript for getting list of OpenStack deleted user's VM.
#!/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
#
@GedowFather
GedowFather / openstack-vm-summary.sh
Created October 7, 2013 02:30
BashScript for getting vm summary of OpenStack.
#!/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 / aws_vpn_between_vpcgw_and_debian_with_nat.sh
Created January 24, 2014 03:17
BashScript for connecting VPN between VPC G/W and Debian Linux. Connecting from Client to EC2, using NAT on VPN.
#!/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_monit_for_non_nat.sh
Last active January 4, 2016 08:19
BashScript for connecting VPN between VPC G/W and Debian Linux. operating HA by monit.
#!/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 / ZabbixClient.py
Last active December 7, 2015 06:52
AWS Lambda python script for running zabbix api.
#
# 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 / ZabbixSender.py
Created December 7, 2015 06:13
AWS Lambda python script for sending metric value to zabbix.
#
# 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 / CollectdClient.py
Last active April 30, 2016 05:05
AWS Lambda python script for sending metric value to collectd server.
#
# 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 / yum_package_update.py
Created March 7, 2016 03:24
S3にRPMがアップロードされたらレポジトリを更新するLambdaスクリプト
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'