Skip to content

Instantly share code, notes, and snippets.

@kazu634
kazu634 / test.geojson
Created May 15, 2019 15:51
テスト用のGeojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kazu634
kazu634 / ec2-list.rb
Created November 29, 2016 09:16
AWS CLI related scripts
#!/usr/bin/env ruby
instances = `aws ec2 describe-instances | \
jq -r -c '.Reservations[].Instances[] | [.InstanceId, (.Tags[]? | select(.Key == "Name")).Value, .PrivateIpAddress , .State.Name ] | @csv'`
instances.split().each do |instance|
id, name, ip, state = instance.gsub('"', '').split(',')
name = "NONAME" if name.empty?
puts "#{name}\t#{id}\t#{ip}\t#{state}"
@kazu634
kazu634 / test.conf
Created March 1, 2016 13:38
Test configuration file for td-agent
<source>
type dstat
tag foo
option -cdnm --tcp --udp --load -gs
delay 5
</source>
<source>
type df
option -k
#!/opt/td-agent/embedded/bin/ruby
require 'growthforecast'
COLOR_CPU = {
'hiq' => '#77cc11',
'idl' => '#77cccc',
'siq' => '#77cc11',
'sys' => '#cc7711',
'usr' => '#cc77cc',
@kazu634
kazu634 / default
Created January 9, 2016 15:17
nginx configuration for HTTP/2
server {
# allow access from localhost
# listen 80 reuseport backlog=1024;
listen 443 ssl http2 backlog=1024;
server_name test.kazu634.com;
ssl_certificate /etc/letsencrypt/live/test.kazu634.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.kazu634.com/privkey.pem;
ssl_dhparam /etc/letsencrypt/live/test.kazu634.com/dhparams_4096.pem;
@kazu634
kazu634 / manifest.json
Created October 18, 2015 12:52
Chrome Extension Sample
{
"manifest_version": 2,
"name": "My 4th extension",
"version": "0.1",
"description": "testing purpose",
"permissions": [
"activeTab"
],
@kazu634
kazu634 / AutoUnattend.xml
Created August 31, 2015 15:05
AutoUnattend.xml for Windows2008r2.
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
#!/opt/sensu/embedded/bin/ruby
require 'open-uri'
require 'json'
END_POINT = 'http://localhost:4567/clients'
BASIC_AUTH = {:http_basic_authentication => ['admin', 'supersecret']}
response = open(END_POINT, BASIC_AUTH)
@kazu634
kazu634 / delete_graphs.rb
Last active August 29, 2015 14:15
`Serf`で管理していないノードのグラフを削除する
#!/opt/sensu/embedded/bin/ruby
require 'growthforecast'
# Create `Growthforecast` instance:
gf = GrowthForecast.new('localhost', 5125)
glist = gf.graphs()
glist.each do |graph|
@kazu634
kazu634 / serf_agent.json
Created January 18, 2015 05:30
Serf Configuration File
{
"retry_join": [ "sensu.kazu634.lan" ],
"retry_interval": "30s",
"retry_max_attempts": 10,
"snapshot_path": "/home/kazu634/src/serf_snapshot.dat",
"rejoin_after_leave": true,
"leave_on_terminate": true,
"skip_leave_on_interrupt": true,