Skip to content

Instantly share code, notes, and snippets.

View jumbosushi's full-sized avatar

Atsushi Yamamoto jumbosushi

View GitHub Profile
jumbosushi / hiragana.rb
Last active June 28, 2020 20:31
Convert kanji to hiragana via Goo API
View hiragana.rb
require 'faraday'
require 'faraday-rate_limiter'
require 'openssl'
require 'pry'
require 'json'
# To avoid Faraday's OpenSSL error
kanji_1 = "ジャズシャンソン歌手
jumbosushi /
Last active June 26, 2019 00:51
Clone bare vim docker setup
git clone ~/.vimsetup
cp ~/.vimsetup/.vimrc_bare ~/.vimrc
cp ~/.vimsetup/.editrc ~/.editrc
cp ~/.vimsetup/.inputrc ~/.inputrc
cp ~/.vimsetup/.pryrc ~/.pryrc
cp ~/.vimsetup/.tmux.conf ~/.tmux.conf
jumbosushi /
Last active January 21, 2019 06:26
Automate UBC CS server git auth
#!/usr/bin/expect -f
# Steps to add it to your server:
# 1. Create in your home dir
# $ touch ~/
# 2. Change file permission of the file
# $ chmod 777 ~/
# 3. Add alias in your .bashrc (or .zshrc if you're using zsh)
# $ echo 'alias ap="~/autopass"' > ~/.bashrc
# 4. Reload your shell
jumbosushi /
Last active January 13, 2019 01:31
How to create shared directory with Windows VM from Ubuntu via Remmina

How to create a shared folder on Windows Remote Desktop accessed from Ubuntu via Remmina

As part of COMM335 at UBC, students use Microsoft Access via Remote Desktop if you use Mac. Unfortunately, they don't have a guide on Ubuntu (yet). I had some trouble creating a shared folder between faculty's Windows VM and my Ubuntu 16.04.

Specifically my local computer wasn't accessible from Access unlike how it was showed in the Mac guide.


(Picture taken from faculty's guide for Mac)

jumbosushi /
Created August 16, 2018 21:55
Copy gpg keys from backup
mv ~/.gnupg ~/.new_gnupg
cp -r /backup/.gnupg ~cd .gnupg/
gpg --export-secret-keys > sec.gpg
rm -r ~/.gnupg
mv ~/.new_gnupg ~/.gnupg
gpg --import sec.gpg
jumbosushi /
Last active August 16, 2018 21:52
Decrypt all files
for file in *
gpg -d -o ~/backup_ungpg/$file.tar.gz "$file"
jumbosushi / postman_collection_avg.rb
Created June 26, 2018 17:28
Get average from postman collection results json
View postman_collection_avg.rb
require 'json'
def get_avg(num_array)
avg = num_array.instance_eval { reduce(:+) / size }
in_sec_f = avg / 1000
in_sec_f.round(3).to_s + " sec"
# 'vendor_index_api_responses' is dir that all responses are saved
all_results = Dir["#{Dir.home}/Documents/vendor_index_api_responses/*"]
jumbosushi / get_322_files.rb
Last active April 10, 2018 01:33
Download all 2018S CPSC322 files
View get_322_files.rb
require "open-uri"
# Last lec is 23, first is 01
# Ex Assignment link:
# EX Lec link:
def get_as_link(num)
return "{num}/as#{num}.pdf"
def get_as_sol_link(num)

Keybase proof

I hereby claim:

  • I am jumbosushi on github.
  • I am jumbosushi ( on keybase.
  • I have a public key whose fingerprint is 8AE0 7956 6449 9F08 CB99 4B3F 3AE6 3A6A 5E2A 2F09

To claim this, I am signing this object:

jumbosushi / get-cfg
Last active October 30, 2017 22:18
Pull dotfiles
View get-cfg
git clone --bare $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
echo "Backing up pre-existing dot files.";