Skip to content

Instantly share code, notes, and snippets.

View hwakabh's full-sized avatar
🏠
Working from home

Hiroyuki Wakabayashi hwakabh

🏠
Working from home
  • Tokyo, Japan
  • 17:51 (UTC +09:00)
View GitHub Profile
@hwakabh
hwakabh / hello_sonic_pi.rb
Last active February 29, 2024 04:26
Hello World with Sonic Pi
# Welcome to Sonic Pi v3.1
live_loop :sonic do
sample :bd_haus, rate: 1
sleep 0.5
end
live_loop :ambi do
sample :ambi_choir, rate: 0.3
sleep 1
@hwakabh
hwakabh / http-tiny-client.js
Last active March 3, 2024 06:05
Simple REST Client with vanilla JavaScript
const request = require('request');
const headers = {
'Content-Type': 'application/json',
}
const url = "https://swapi.dev/api/people/1/";
const wrong_url = "https://localhost:8000";
console.log("Starting HTTP GET Request...");
@hwakabh
hwakabh / slackhooks-world-holidays.gs
Last active February 29, 2024 06:19
Slack Webhooks with GAS to notify global holidays
function main_function() {
console.log("Starting program ...");
const vietnam_calendar_id = "ja.vietnamese#holiday@group.v.calendar.google.com";
const indian_calendar_id = "ja.indian#holiday@group.v.calendar.google.com";
// Check Vietnam Holidays
get_holidays(vietnam_calendar_id, "ベトナム");
// Check Indian Holidays
get_holidays(indian_calendar_id, "インド");
}
@hwakabh
hwakabh / centos_docker_install.sh
Last active February 29, 2024 06:21
CentOS docker engine installer
#!/bin/bash
echo '>>>>>>> Starting Docker installation.'
echo '-----------------------------------------------------------------'
echo ''
echo '>>> Erase old packages and install dependencies'
yum -y remove docker docker-common docker-selinux docker-engine
yum -y install yum-utils device-mapper-persistent-data lvm2
echo '-----------------------------------------------------------------'
@hwakabh
hwakabh / centos_clivm_setup.sh
Last active February 29, 2024 06:13
CentOS Setup Script for Kubernetes workshop
#!/bin/bash
echo ">>> Runs on the host: $(hostnamectl |grep hostname)"
echo ''
echo '------------------------------------------'
echo '>>> Install base packages'
yum -y install wget vim emacs net-tools
echo ''
echo '>>> Checking path of installed packages'
echo " wget: $(which wget)"
@hwakabh
hwakabh / gitlab_scheduled_backups.sh
Last active February 29, 2024 05:51
GitLab backup utilities
#!/bin/bash
## Before you run the script:
## - Make sure the backup directories would have already created
## - Change variables below for your environments
## examples:
## BKDIR=/var/backup/gitlab.bk
## DEFDIR=/var/opt/gitlab/backups
BKDIR=PATH_TO_DIR_BACKUP_SAVED
DEFDIR=PATH_TO_TARGET_DIR_TO_BACKUP
@hwakabh
hwakabh / .selenium_googlemaps.py
Last active February 29, 2024 06:41
selenium_cafe_migrations: Migration from Tabelog to Google Maps
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
import os
import sys
import time
@hwakabh
hwakabh / github_wipeout_deployments.py
Last active February 29, 2024 05:56
Python snippete for cleaning up GitHub deployment
import json
import os
import sys
# TODO: Should be replaced with stdlib
import requests
gh_username = 'hwakabh'
gh_reponame = 'waseda-mochida'