Skip to content

Instantly share code, notes, and snippets.

View shufo's full-sized avatar

Shuhei Hayashibara shufo

View GitHub Profile
@shufo
shufo / gh_alias_importer
Last active July 26, 2022 21:40
gh cli alias importer
Currently there is no command to import gh alias easily, so this is workaround
1. Export the gh alias
```bash
$ gh alias list > gh_aliases.txt
```
2. create import script
@shufo
shufo / keybase.md
Created January 26, 2020 01:52
Keybase proof

Keybase proof

I hereby claim:

  • I am shufo on github.
  • I am shufo (https://keybase.io/shufo) on keybase.
  • I have a public key ASAmcjzVKI98QJly5YwUYbJzq84QgyzSt5R0jwgGIG1hPwo

To claim this, I am signing this object:

import json
import boto3
from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.row_event import (
DeleteRowsEvent,
UpdateRowsEvent,
WriteRowsEvent,
)
@shufo
shufo / config.h
Last active November 18, 2018 07:56
A keymap and config for my let's split rev2
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
defmodule LogViewer do
use Application
require Logger
def start(_type, _args) do
import Supervisor.Spec, warn: false
children =
[
defmodule LogViewer.Server do
def start_link() do
dispatch = :cowboy_router.compile([
{:_,
[
{'/websocket', LogViewer.WebSocketHandler, []},
{"/", :cowboy_static, {:priv_file, :log_viewer, "index.html"}},
{"/_nuxt/[...]", :cowboy_static, {:priv_dir, :log_viewer, "_nuxt"}},
{"/[...]", :cowboy_static, {:priv_file, :log_viewer, "index.html"}}
]}
@shufo
shufo / websocket_handler_cowboy2.ex
Created November 14, 2018 14:54
Websocket handler for Cowboy 2
defmodule MyApp.WebSocketHandlerCowboy2 do
def init(req, state) do
opts = %{idle_timeout: 60000}
{:cowboy_websocket, req, state, opts}
end
def websocket_init(state) do
{:ok, state}
end
@shufo
shufo / kinesis-firehose-process-cloudwatch-logs-record.py
Created October 17, 2017 11:33
processing cloudwatch logs to put kinesis firehose
from __future__ import print_function
import base64
import gzip
import StringIO
import json
def lambda_handler(event, context):
output = []
@shufo
shufo / keymap.cson
Created January 19, 2017 14:14
IntelliJ like keybinding for Atom
'.platform-win32, .platform-linux':
'alt-f1': 'tree-view:reveal-active-file'
'.platform-linux, .platform-linux .command-palette atom-text-editor':
'ctrl-shift-a': 'command-palette:toggle'
'.platform-linux':
'ctrl-shift-n': 'fuzzy-finder:toggle-file-finder'
'.platform-linux atom-text-editor':
<source>
type tail
path /usr/local/WowzaStreamingEngine/logs/wowzastreamingengine_access.log
tag wowza
format tsv
keys date,time,tz,x-event,x-category,x-severity,x-status,x-ctx,x-comment,x-vhost,x-app,x-appinst,x-duration,s-ip,s-port,s-uri,c-ip,c-proto,c-referer,c-user-agent,client-id,cs-bytes,sc-bytes,x-stream-id,x-spos,cs-stream-bytes,sc-stream-bytes,x-sname,x-sname-query,x-file-name,x-file-ext,x-file-size,x-file-length,x-suri,x-suri-stem,x-suri-queri,cs-uri-stem,cs-uri-query
pos_file /tmp/fluentd--1466642855.pos
</source>