Skip to content

Instantly share code, notes, and snippets.

View mu373's full-sized avatar

Minami Ueda mu373

View GitHub Profile
@mu373
mu373 / docker-bitcoin-suite.md
Last active November 27, 2023 12:00
Docker Bitcoin Suite: Run Bitcoin softwares on Docker independently

Docker Bitcoin Suite

Run various Bitcoin software in Docker containers, independently

Setup

  • All of the following software that I introduce here will run individually as a Docker service, respectively
    • Some may include multiple containers (e.g., mempool)
  • Needless to say, the fundamental software is the bitcoind.
  • All containers would belong to the network named bitcoin-nw, so that they can communicate with each other
  • Traefik, which functions as a reverse proxy, is used to host services under your custom domain with HTTPS
  • e.g., https://mempool.example.com
@mu373
mu373 / _twitter2scrapbox.md
Last active March 18, 2023 16:26
ツイートをScrapboxに貼るためのブックマークレット

ツイートをScrapboxに貼るためのブックマークレット

概要

ツイートページでこのブックマークレットを実行すると、Scrapbox貼り付け用のテキストがクリップボードにコピーされます。 例:

>[https://twitter.com/github/status/1634195404173524993 @github]:
>Our previous in-memory solution for site-search on GitHub Docs couldn't scale with us, so we recently implemented Elasticsearch. Here's how.
@mu373
mu373 / kuline-isbn.md
Created November 24, 2022 04:48
KULINEでISBN検索

KULINEでISBN検索する

URL

  • KULINEでISBN検索をしたい場合は、以下のURLの{_____ISBN_____}を実際のISBNにすればよい
  • AlfredやChromeのカスタム検索エンジン, ブックマークレットなどで使うとよい

https://kuline.kulib.kyoto-u.ac.jp/index.php?action=pages_view_main&active_action=v3search_view_main_init&block_id=251&tab_num=0&search_mode=detail&op_param=gcattp_flag=all%26holar_flag%3Dall%26srhclm4%3Dpub%26isbn_issn%3D{_____ISBN_____}%26sortkey%3Dstitle%252Csyear%252Csauth%252FASC%252CDESC%252CASC%26listcnt%3D10%26fromDsp%3Dcatsrd%26searchDsp%3Dcatsrd%26initFlg%3D_RESULT_SET%26holar%3D%23v3search_view_main_init

@mu373
mu373 / New mail message from selected text.applescript
Created October 28, 2022 08:01
CotEditor script to compose new mail message from selected text
(*
New mail message from selected text.applescript
Description:
Make a new mail message from selected text
Subject of the mail message can be specified by entering "subject:" in the first line (optional)
written by mu373 on 2022-10-28
*)
--
@mu373
mu373 / Dockerfile
Last active September 14, 2022 05:58
AWS Lambda container on Docker template
FROM public.ecr.aws/lambda/python:3.9
# Copy function code
COPY app.py ${LAMBDA_TASK_ROOT}
# Install the function's dependencies using file requirements.txt
# from your project folder.
COPY requirements.txt .
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
@mu373
mu373 / finalize-latex-for-submission.md
Last active July 3, 2022 14:07
Finalize LaTeX projects for submission

latex-finalize.sh

A script to prepare LaTeX source files for submission

What it does

  • Copies all source files into single destination directory
  • Flattens LaTeX files that were included inline into main.tex
  • Flattens BibTeX bibliography into main.tex
  • Compiles LaTeX to PDF in destination folder
  • Archives and compresses all TeX sources into ZIP file
#cloud-config
# install docker engine
apt:
sources:
docker.list:
source: deb [arch=arm64 signed-by=$KEY_FILE] https://download.docker.com/linux/ubuntu $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
packages:
@mu373
mu373 / isbn-univ-coop-books.md
Last active October 21, 2021 01:39
ISBNから大学生協オンライン書籍注文サイトで検索するブックマークレット

ISBNから大学生協オンライン書籍注文サイトで検索するブックマークレット

概要

WebページでISBNを選択した状態で、このブックマークレットを実行すると大学生協オンライン書籍注文サイトで一発で検索できます。

使う

下のソースをコピーして、ブックマークに追加してください。

ISBNを選択した状態で実行するバージョン

ISBNを選択してからでないと、正しく動きません。

@mu373
mu373 / Unifi-Controller-on-Docker.md
Last active September 3, 2021 17:40
Unifi Controller on Docker

Unifi Controller on Docker

  • Start container: docker-compose up -d
  • Access to controller from browser: https://localhost:8443
    • If it shows certificate error, type thisisunsafe
  • Stop container: docker-compose down
  • Updating image: docker pull
@mu373
mu373 / hashRename.sh
Created July 7, 2021 10:31
ファイルのハッシュ値を計算してリネームする
#/bin/zsh
set -e
IFS=$'\n'
filePath=$1
fileDir=`dirname $filePath`
fileName=`basename $filePath`
fileExt=`echo $fileName | sed -r 's/(.*)(\.[^\.]*$)/\2/'`