Skip to content

Instantly share code, notes, and snippets.

View tsub's full-sized avatar

Tsubasa Takayama tsub

View GitHub Profile
@tsub
tsub / sVimrc
Last active September 18, 2015 02:19
map "ctrl+d" scrollPageDown
map "ctrl+b" scrollPageUp
map "h" goBack
map "l" goForward
#!/bin/bash
set_ovs_settings() {
echo "set ovs settings"
sudo ovs-vsctl set-controller br0 tcp:127.0.0.1:6653
sudo ovs-vsctl set-fail-mode br0 secure
sudo ovs-vsctl set bridge br0 protocols=OpenFlow10
}

ccn-router getting started

Host Machine Required

  • Vagrant
  • Virtualbox

VMs

  • of-controller
  • of-switch
    • NODE1-1
@tsub
tsub / 0_reuse_code.js
Created January 26, 2016 07:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function history-fzf() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(history -n 1 | eval $tac | fzf --query "$LBUFFER")

Keybase proof

I hereby claim:

  • I am tsub on github.
  • I am tsub (https://keybase.io/tsub) on keybase.
  • I have a public key ASDvCT32kIM-W-kIJCn5ePMlvGNbd2DASrioCqY5dXQtaQo

To claim this, I am signing this object:

@tsub
tsub / github-subscribe-my-repositories.sh
Last active June 5, 2019 09:17
自分のリポジトリをまとめて watch するやつ
#!/bin/sh
PAGE=$1
SUBSCRIPTION_URLS=$(curl -s -H "Authorization: Bearer $GITHUB_API_TOKEN" "https://api.github.com/user/repos?affiliation=owner&page=$PAGE&per_page=100" | jq -r '.[] | select(.fork == false) | .subscription_url')
for url in $SUBSCRIPTION_URLS; do
RESPONSE=$(curl -s -H "Authorization: Bearer $GITHUB_API_TOKEN" "$url" | jq -r '.url')
if [ "$RESPONSE" = "null" ]; then
@tsub
tsub / .env.template
Last active July 2, 2019 13:12
esa の記事のカテゴリを整理するための雑スクリプト群
ESA_ACCESS_TOKEN=
ESA_TEAM=
@tsub
tsub / Gemfile
Last active March 15, 2020 17:42
Test codes to reproduce not thread-safe errors of Dynamoid
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'dynamoid'
gem 'pry-byebug', platforms: :ruby
gem 'rake'
function ghq-fzf() {
local selected_dir=$(ghq list | fzf --query="$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd $(ghq root)/${selected_dir}"
zle accept-line
fi
zle reset-prompt
}