Skip to content

Instantly share code, notes, and snippets.

View shuuji3's full-sized avatar
🌈
🌎 🌟 🦚 🌌 ✨

TAKAHASHI Shuuji shuuji3

🌈
🌎 🌟 🦚 🌌 ✨
View GitHub Profile
@shuuji3
shuuji3 / copy-calil-info-for-hpcs-ss-team.js
Last active February 10, 2019 04:07
「HPCS Lab. SS Team リソース一覧」の「書籍」シートのための情報をCalilのページから簡単にコピーするためのブックマークレット
// 動作確認: Google Chrome 73.0.3683.27(Official Build)beta (64 ビット)
var authors = [...$('[itemprop="author"]')].map(a => a.textContent.trim()).join(' / ').replace(/\s+/g, ' '); var title = $('.book_title').text().trim(); var pubdate = $('[itemprop="datePublished"]').text().replace(/[()]/g, '').trim(); var publisher = $('[itemprop="publisher"]').text().trim(); var isbn = [...$('[href*="isbn"]')][0].href.split('=')[1]; var text = [authors, title, publisher, pubdate, isbn].join('\t'); alert(text); console.log(text)
@shuuji3
shuuji3 / make-oui-list.sh
Created March 22, 2019 12:36
Trivial script to convert IEEE OUI list
#!/bin/sh
# LISENCE: GNU GPL v3
wget http://standards-oui.ieee.org/oui/oui.txt -O /tmp/oui.txt
grep -E '^[-0-9A-F]{8}' /tmp/oui.txt | unexpand -a | python -c 'while True: s = input(); print(s.split()[0].replace("-", ":"), " ".join(s.split()[2:]), sep="\t")' | sort > oui-format.txt
@shuuji3
shuuji3 / cannon.py
Last active July 1, 2019 10:07 — forked from Terminus-IMRC/cannon.py
Matrix-matrix multiplication: Cannon's algorithm
#!/usr/bin/env python3
import numpy as np
# Assume that P = N * N.
N = 4
A = np.arange(0, 2 * N * N, 2).reshape(N, N)
B = np.arange(1, 2 * N * N, 2).reshape(N, N)
C_gt = A.dot(B)
@shuuji3
shuuji3 / script.js
Last active July 7, 2019 15:54
Tampermonkey Script for あにてれ (https://ch.ani.tv): Add autoplay feature and keybindings (Space: Pause & Play / F: Toggle Fullscreen)
// ==UserScript==
// @name Add autoplay feature and keybindings (Space: Pause & Play / F: Toggle Fullscreen)
// @namespace http://github.com/shuuji3
// @version 0.1
// @description Add autoplay feature and keybindings (Space: Pause & Play / F: Toggle Fullscreen)
// @author You
// @match https://ch.ani.tv/episodes/*
// @grant none
// ==/UserScript==
@shuuji3
shuuji3 / style.css
Last active July 23, 2019 01:24
筑波大学 大学院「並行システム」ウェブサイト用のスタイルシート
/* ==UserStyle==
@name 筑波大学 大学院「並行システム」講義ページ
@namespace github.com/openstyles/stylus
@version 1.1.0
@description Refines website styles
@author TAKAHASHI Shuuji <shuuji3@gmail.com>
==/UserStyle== */
@-moz-document url-prefix("http://www.cs.tsukuba.ac.jp/~yas/cs/"),
url-prefix("https://www.coins.tsukuba.ac.jp/~yas/cs/") {
body {

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@shuuji3
shuuji3 / gen-ssh-config-for-multipass.fish
Last active November 10, 2020 01:19
Generate a dynamic SSH config file to ssh Multipass using fish shell.
function gen-ssh-config-for-multipass --description "Generate a SSH config for multipass."
echo 'Include ~/.ssh/config
Host mp-*
User multipass
'
set -l vms (multipass ls --format csv | grep Running)
for vm in $vms
set name (echo $vm | awk -F , '{ print $1 }')
set ip (echo $vm | awk -F , '{ print $3 }')
#!/usr/bin/env bash
alias k=kubectl
alias kg='kubectl get'
alias kga='kubectl get all'
alias kgn='kubectl get nodes'
alias kgp='kubectl get pods'
alias kgd='kubectl get deploy'
alias kd='kubectl describe'
alias krunpod='kubectl run --restart=Never --dry-run -o yaml'
@shuuji3
shuuji3 / extractChars.go
Created June 6, 2020 21:10
a disposable script to process a temporary text file
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)