Skip to content

Instantly share code, notes, and snippets.

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

anon anon5r

🏠
Working from home
View GitHub Profile
@anon5r
anon5r / mastodon-update.sh
Created May 29, 2017 01:45
マストドンのシンプルなアップデート手順。主にさくらのクラウドのスタートアップスクリプトを利用してインストールした場合を想定しています。
#!/bin/sh
# 無難な対応としては、最初にmastodonを一度停止した方が良いので停止する。
# systemctl stop mastodon-{web,sidekiq,stream}
# mastodonユーザー出ない場合は下記のコマンドでmastodonユーザーになる
# 一般ユーザーからの場合
# sudo su - mastodon
@anon5r
anon5r / letsencrypt.conf
Created June 30, 2017 09:43
Let's Encrypt common config file for nginx
location ^~ /.well-known/acme-challenge/ {
root /var/www/letsencrypt;
}
location = /.well-known/acme-challenge/ {
return 404;
}
@anon5r
anon5r / gitlab-update.sh
Last active November 22, 2017 17:08
Update script for GitLab omnibus docker
#!/bin/sh
#DOCKER_TAG=latest
SLEEP_SEC=30
DOCKER_TAG=${1:-latest}
GITLAB_PORT_HTTP=50080
GITLAB_PORT_SSL=443
GITLAB_PORT_SSH=22
echo -e "\e[1;37mPulling tag:\e[m \e[33m$DOCKER_TAG\e[m"
sudo docker pull gitlab/gitlab-ce:$DOCKER_TAG
@anon5r
anon5r / create_absolute_uri.php
Last active November 15, 2019 12:04
Generate absolute URL by relational path with base URL
<?php
/**
* 相対パスから絶対URLを返却する
*
* @param string $base ベースURL, 絶対URL
* @param string $relational_path 相対パス
* @return string 相対パスの絶対URL
* @link http://logic.stepserver.jp/data/archives/501.html
* @link http://blog.anoncom.net/2010/01/08/295.html
* @link https://blog.anoncom.net/2010/01/phpurluri.html
@anon5r
anon5r / osx-screenshot-change-config.sh
Created December 6, 2018 01:09
macOSのスクリーンショット設定の変更
#!/bin/sh
# スクリーンショットの保存先を変更する
defaults write com.apple.screencapture location ~/Downloads/ScreenShots/
# 保存場所を元に戻す
# defaults delete com.apple.screencapture location
# スクリーンショットのファイル名接頭辞を変更する
defaults write com.apple.screencapture name 'ScreenShot'
@anon5r
anon5r / phone_number_with_hash_csv.py
Last active May 26, 2020 07:26
Scripts to export hashed IP/mobile phone numbers in Japan as CSV text files
#!/usr/bin/env python
import hashlib
prefix = ['050','070','080','090'];
x = 1000; # mobile/IP phone number will be starts with 1, not 0
column = ['NUMBER','MD5','SHA1','SHA256','SHA384','SHA512'];
print(format('"%s"' % ('", "'.join(column))))
for p in prefix:
while x <= 9999:
@anon5r
anon5r / Progressbar.php
Last active May 26, 2020 07:24
Progressbar
<?php
class Progressbar
{
//private $cursor = ['|', '/', '-', '\\'];
private $cursor = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
private $spacer = '░';
private $indicator = "\033[7m \033[0m";
private $total = 0;
@anon5r
anon5r / mp3_specs.md
Last active August 14, 2019 05:12
MP3 Spec

規格種別

  • MPEG-1 Audio Layer 3
  • MPEG-2 Audio Layer 3
  • MPEG-2.5 Audio Layer 3

サンプリング周波数

|MPEG-1 Audio Layer-3|MPEG-2 Audio Layer-3|MPEG-2.5 Audio Layer-3|

@anon5r
anon5r / download_fgo_video.sh
Last active October 19, 2019 16:53
Download FGO video
#!/bin/sh
#
# Usage:
# sh ./download_fgo_video.sh https://extend.data.fate-go.jp/xXxx0Xxx/PathCRC
#
# PathCRC URL
TARGET_URL=$1
FGO_VER='2.2.0.1'
UA="fategrandorder/$FGO_VER CFNetwork/1120 Darwin/19.0.0"
HEADERS='X-Unity-Version: 2018.4.4f1'
@anon5r
anon5r / README.md
Last active September 17, 2021 06:14
nyarn : npm run as yarn

Nyarn : NPM run as YARN

What is this ?

This is joking code.

にゃ、にゃあ、にゃあん、にゃーん

Nya, Nyaa, Nyaan, Nyarn