Skip to content

Instantly share code, notes, and snippets.

View tanb's full-sized avatar
:shipit:
🐁🗯

Tomonori Tanabe tanb

:shipit:
🐁🗯
View GitHub Profile
@tanb
tanb / gist:6b27538e3d3e5d04a968c061adb401f0
Created November 1, 2023 10:58
setup tailscale amazon linux 2
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://pkgs.tailscale.com/stable/amazon-linux/2/tailscale.repo
sudo yum install tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
sudo tailscale up --advertise-exit-node
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

@tanb
tanb / hoge.swift
Created May 22, 2016 17:55
po (print object) Alamofire.Response.data as a String
po String.init(data: response.data!, encoding: NSUTF8StringEncoding)
@tanb
tanb / fetch.py
Created September 3, 2017 16:20
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click
@click.command()
@click.option('--outfile', '-o')
@click.argument('src')
def fetch(outfile, src):
import requests
@tanb
tanb / xhyve-nextbsd-tutorial.md
Last active June 10, 2017 06:37
NextBSD running on xhyve.

NextBSD Running on Xhyve.

  _   _           _   ____ ____  ____
 | \ | | _____  _| |_| __ ) ___||  _ \
 |  \| |/ _ \ \/ / __|  _ \___ \| | | |
 | |\  |  __/>  <| |_| |_) |__) | |_| |
 |_| \_|\___/_/\_\\__|____/____/|____/

                                              ```                        `
 s` `.....---.......--.``` -/

Install vagrant

 $ brew cask install vagrant
==> Downloading https://releases.hashicorp.com/vagrant/1.8.7/vagrant_1.8.7.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask vagrant
==> Running installer for vagrant; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is Vagrant
@tanb
tanb / Avoidance Of CocoaPods Installation Ambush.md
Last active June 2, 2016 17:34
Avoidance Of CocoaPods Installation Ambush
$ brew install rbenv
$ brew install ruby-build
$ brew install rbenv-gemset
$ brew install xcproj
$ rbenv install -l
$ rbenv install 2.3.1
$ rbenv versions
$ rbenv shell system
$ rbenv shell 2.3.1
@tanb
tanb / dev_android.md
Last active May 10, 2016 17:50
Android app development: Let's Get Started

Let's Get Started

  • install java
$ brew cask install java
  • .bash_profile

Keybase proof

I hereby claim:

  • I am tanb on github.
  • I am tanb (https://keybase.io/tanb) on keybase.
  • I have a public key whose fingerprint is D854 BC00 7352 C128 8FCB 4536 5825 714E 2349 64DC

To claim this, I am signing this object:

@tanb
tanb / gist:8051900
Last active December 31, 2015 22:09
.NET 4.5 async/awaitについて
  • Task typeを返す非同期メソッドを呼び出す
  • 非同期処理の戻り値はTaskクラスのResultにセットされる.awaitがそれを返している.
  • 非同期処理が終了するとawait以降のコードに処理が戻る
// これと
var worker = await TplWorker.DoWorkAsync();
ShowResult(worker);