Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / rds.md
Last active September 26, 2016 02:34
aws cli まとめ (rds|aurora)

RDSの最新の自動取得 snapshot を取得する

$ aws rds describe-db-snapshots --snapshot-type automated | jq '.DBSnapshots | sort_by(.SnapshotCreateTime) | reverse | .[0]'
{
  "Engine": "mysql",
  "SnapshotCreateTime": "2016-09-25T18:46:55.366Z",
  "AvailabilityZone": "ap-northeast-1a",
  "PercentProgress": 100,
  "MasterUsername": "root",
@hnakamur
hnakamur / kingpin_repeat_arg_example.go
Created January 7, 2016 03:14
An example of parsing a repeated argument like '-vvv' with kingpin
package main
import (
"fmt"
"gopkg.in/alecthomas/kingpin.v2"
)
var (
verbose = kingpin.Flag("verbose", "Enable verbose mode.").Short('v').Counter()
@acidlemon
acidlemon / 01_ListenAndServe.go
Created December 16, 2014 09:05
net/http workshop
package main
import (
"fmt"
"io"
"log"
"net/http"
)
func Handler(w http.ResponseWriter, req *http.Request) {
@acidlemon
acidlemon / parallel.go
Last active August 29, 2015 14:10
embedded Perl in Go /w goroutine
package main
/*
#include <EXTERN.h>
#include <perl.h>
#include <stdio.h>
void init_perl() {
// PerlのCランタイムの初期化(全体で1回)
int argc = 0;
@fumiyas
fumiyas / getaddrinfo-name2addr.c
Created October 24, 2014 08:37
Testing DNS stub resolver (getaddrinfo(3))
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
int main(int argc, char **argv)
{
struct addrinfo hints, *ai, *ai_p;
const char *name;