Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
@matsubo
matsubo / README.md
Last active October 17, 2023 04:34
Shell script to keep updated wordpress core and plugins.

Setup

Install wp command

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp

Setup cron

@matsubo
matsubo / router_restart.sh
Last active September 12, 2023 06:10
Restart NEC router when NAT buffer pool is overflow.
#!/bin/bash
# Reboot NEC router if NAT errors are saved in router status page.
# - Checks VoIP status.
# - Run as daemon.
# - Encoding have to be Shift-JIS.
#
# @copytright Yuki Matsukura
# @contact https://matsu.teraren.com/blog/
#
irb(main):001:0> require 'carmen'
=> true
irb(main):002:0> include Carmen
=> Object
irb(main):003:0> jp = Country.named('Japan')
=> <#Carmen::Country name="Japan">
irb(main):004:0> jp.subregions?
=> true
irb(main):005:0> jp.subregions
=>
@matsubo
matsubo / privacy_policy.md
Last active July 27, 2023 01:30
terms of service.md

プライバシーポリシー

________(以下,「サイト管理者」といいます。)は,本ウェブサイト上で提供するサービス(以下,「本サービス」といいます。)における,利用者の個人情報の取扱いについて,以下のとおりプライバシーポリシー(以下,「本ポリシー」といいます。)を定めます。

第1条(個人情報)

「個人情報」とは,個人情報保護法にいう「個人情報」を指すものとし,生存する個人に関する情報であって,当該情報に含まれる氏名,生年月日,住所,電話番号,連絡先その他の記述等により特定の個人を識別できる情報及び容貌,指紋,声紋にかかるデータ,及び健康保険証の保険者番号などの当該情報単体から特定の個人を識別できる情報(個人識別情報)を指します。

第2条(個人情報の収集方法)

@matsubo
matsubo / bank code curl sample.md
Last active July 7, 2023 08:42
銀行コード
% curl -s "https://bank.teraren.com/banks/0001.json?$(random)" | jq
{
  "code": "0001",
  "kana": "ミズホ",
  "name": "みずほ",
  "roma": "mizuho",
  "hira": "みずほ",
  "normalize": {
    "name": "みずほ銀行",
<?php
$result = [
0 => 0,
1 => 0
];
for ($i = 0 ; $i < 100000000 ; $i++) {
$rand_number = mt_rand();
diff --git a/Gemfile b/Gemfile
index ddc9c44..d824388 100644
--- a/Gemfile
+++ b/Gemfile
@@ -96,4 +96,6 @@ group :test do
gem 'capybara-screenshot'
gem 'rspec-rails'
+ gem "timecop"
end
@matsubo
matsubo / .tigrc
Last active February 15, 2023 15:34
.tigrc example for black background terminal.
# Tig default configuration
#
# Please see 'man tigrc' for a complete reference.
# Settings
# --------
# Most of these settings can be toggleable, either via the toggle-*
# actions or via the option menu (bound to `o` by default).
# View settings