Skip to content

Instantly share code, notes, and snippets.

View ozaki-r's full-sized avatar

Ryota Ozaki ozaki-r

View GitHub Profile
@ozaki-r
ozaki-r / get_likes.py
Last active January 1, 2024 14:44
Get items from the playlist of Your Likes via YouTube Data API (See https://developers.google.com/youtube/v3/quickstart/python?hl=ja)
#!/usr/bin/python
import httplib2
import os
import sys
import json
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
@ozaki-r
ozaki-r / gist:356439eac313eb0fbf1afae54942587b
Last active February 3, 2023 06:25
詳解システム・パフォーマンス 差分
まえがき
1章 イントロダクション
1.1 システムパフォーマンス
1.2 職種
1.3 作業
1.4 分析の視点
1.5 パフォーマンスエンジニアリングの難しさと面白さ
1.5.1 主観的な性質
1.5.2 複雑さ
ip link add name tx-veth0 type veth peer name tx-veth1
ip netns add af_xdp
ip link set tx-veth1 netns af_xdp
ip link add name rx-veth0 type veth peer name rx-veth1
ip link set rx-veth1 netns af_xdp
ip link set up dev tx-veth0
ip link set up dev rx-veth0
ip a add 10.0.1.2/24 dev tx-veth0
ip a add 10.0.2.2/24 dev rx-veth0
@ozaki-r
ozaki-r / gce_idle_suspend.sh
Last active June 3, 2021 20:31
GCE: automatically suspend the underlying VM on idle
#!/bin/sh
if [ $# -lt 2 ]; then
echo "usage: $0 name zone [time]"
exit 1
fi
# TODO: check if authenticated and suggest 'gcloud auth login'
name=$1
@ozaki-r
ozaki-r / sys-papers.md
Last active April 20, 2021 00:34
システム系論文紹介のまとめ
@ozaki-r
ozaki-r / setup.md
Last active January 8, 2021 08:19
Setups for a newly created VM on GCP

Fill $vmname and $username with yours.

  • gcloud compute ssh $vmname -- tmux -u new-session -A -s main
  • git clone https://github.com/ozaki-r/dotfiles
    • cd dotfiles
    • sh setup.sh
  • sudo apt install zsh
  • sudo passwd $username
  • chsh
    • /usr/bin/zsh
@ozaki-r
ozaki-r / restore-vmstat.diff
Last active August 23, 2019 07:03
workaround rumphijck for vmstat
commit d8aa69b7abe780ed6778e23e3f68713f71d13d99
Author: Ryota Ozaki <ozaki-r@iij.ad.jp>
Date: Fri Aug 23 13:33:58 2019 +0900
Restore vmstat
diff --git a/tests/net/net_common.sh b/tests/net/net_common.sh
index 8b1790f9c5a..e224047b76c 100644
--- a/tests/net/net_common.sh
+++ b/tests/net/net_common.sh
commit a0b8622b34a7a865eee497dbb8e844f0e39383dd
Author: Ryota Ozaki <ozaki.ryota@gmail.com>
Date: Tue Aug 13 12:04:03 2019 +0900
fix tcp panic
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index c89dc0f4d57..fc0a7a3fd9d 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@ozaki-r
ozaki-r / KVM
Last active December 28, 2016 04:46
# $NetBSD: GENERIC,v 1.386 2014/04/21 16:35:38 chs Exp $
#
# GENERIC machine description file
#
# This machine description file is used to generate the default NetBSD
# kernel. The generic kernel does not include all options, subsystems
# and device drivers, but should be useful for most applications.
#
# The machine description file can be customised for your specific
# machine to reduce the kernel size and improve its performance.
@ozaki-r
ozaki-r / netbsd-cubieboard2.sh
Last active July 5, 2016 10:41
How to build a bootable SSD card with a NetBSD kernel on Cubieboard2
# working on Mac OS X :)
# You have a blank or unused SSD card.
# Get latest at http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/
wget http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/u-boot-sunxi-20140413T154240-9167f4b/u-boot-sunxi-cubieboard2.tar.xz
tar xvf u-boot-sunxi-cubieboard2.tar.xz
cd u-boot-sunxi-cubieboard2-20140413T154240-9167f4b/
# Follow the instructions written in http://docs.cubieboard.org/zh/tutorials/ct1/installation/install_lubuntu_desktop_server_to_sd_card
card=/dev/disk1