Skip to content

Instantly share code, notes, and snippets.

hayajo hayajo

View GitHub Profile
@hayajo
hayajo / main.go
Last active Oct 19, 2018
chrootからの脱出
View main.go
package main
import (
"fmt"
"io/ioutil"
"os"
"syscall"
)
func main() {
@hayajo
hayajo / ecs_taskdefinition.yaml
Last active May 6, 2018
AWS::ECS::TaskDefinitionでリビジョンを含まないARNをエクスポートする
View ecs_taskdefinition.yaml
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
EnvironmentName:
Type: String
Default: "MyApp"
# ...
Resources:
ECSTaskDefinition:
@hayajo
hayajo / docker_default_config.json
Created Mar 29, 2018
Docker と runC のデフォルト config.json
View docker_default_config.json
{
"ociVersion": "1.0.1",
"process": {
"user": {
"uid": 0,
"gid": 0,
"additionalGids": [
0,
1,
2,
@hayajo
hayajo / gh_pr_issues.sh
Last active Jan 22, 2018
GitHubのPRとISSUEを取ってくる
View gh_pr_issues.sh
#!/bin/bash
set -eu
OWNER=${1:?"repo onwer required"}
URL_BASE="https://api.github.com"
REPOS_URL="/users/$OWNER/repos?per_page=100"
PULLS_URL="/repos/$OWNER/%s/pulls"
ISSUES_URL="/repos/$OWNER/%s/issues"
@hayajo
hayajo / main.go
Created Jan 16, 2018
[go] 環境変数からフラグをセットする
View main.go
package main
import (
"flag"
"fmt"
"os"
"strings"
)
const (
@hayajo
hayajo / clone_files.go
Last active Nov 7, 2017
CLONE_FILE と Cmd.ExtraFiles
View clone_files.go
package main
import (
"fmt"
"io/ioutil"
"os"
"syscall"
"time"
)
@hayajo
hayajo / .gitignore
Last active Apr 6, 2018
Keepalivedを使ったRedisのActive/Standby切り替え
@hayajo
hayajo / playbook.yml
Created Jun 22, 2017
ansbileでユーザープロンプトを表示してY/N入力を促すplaybook
View playbook.yml
---
- hosts: all
connection: local
gather_facts: no
vars:
ruby_an_api_base_path: /path/to/base/dir
ruby_an_api_version: 2.X.Y
sudo: no
tasks:
- name: confirm create a symlink
@hayajo
hayajo / netcat.pl
Last active Apr 19, 2018
perlでnetcat
View netcat.pl
use strict;
use warnings;
use Socket;
use Getopt::Long;
GetOptions(\my %opts, qw/x/);
if (scalar(@ARGV) < 2) {
print "usage: $0 [-x] HOST PORT\n";
You can’t perform that action at this time.