Skip to content

Instantly share code, notes, and snippets.

View hiroakis's full-sized avatar

Hiroaki Sano hiroakis

View GitHub Profile
@hiroakis
hiroakis / status.rb
Created April 11, 2017 06:12
mkr command wrapper
require 'json'
service = ARGV[0]
role = ARGV[1]
status = ARGV[2]
roleFullnames = "#{service}:#{role}"
hosts = JSON.parse(`mkr hosts`)
target_host_ids = []
@hiroakis
hiroakis / main.go
Created December 14, 2018 12:19
ast
package main
import (
"bytes"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io"
"log"

Keybase proof

I hereby claim:

  • I am hiroakis on github.
  • I am hiroakis (https://keybase.io/hiroakis) on keybase.
  • I have a public key ASBKQZEisRZCgOs-Cr_5JFfXL-A6nahRyh5F-S_k46tGuAo

To claim this, I am signing this object:

@hiroakis
hiroakis / fsnotify_example.go
Last active April 21, 2022 10:56
fsnotify example: Detect file changes in real time.
package main
import (
"log"
"os"
"time"
"github.com/fsnotify/fsnotify"
)
@hiroakis
hiroakis / example_rabbitmq_api.py
Last active August 21, 2023 13:33
Calling the RabbitMQ api from Python sample
#!/usr/local/bin/python
import requests
import json
def call_rabbitmq_api(host, port, user, passwd):
url = 'http://%s:%s/api/queues' % (host, port)
r = requests.get(url, auth=(user,passwd))
return r