Skip to content

Instantly share code, notes, and snippets.

View mamemomonga's full-sized avatar

Shotaro Takahashi mamemomonga

View GitHub Profile
@mamemomonga
mamemomonga / MCP23017.md
Last active September 9, 2019 01:40
MCP23017メモ

MCP23017メモ

Raspberry Pi と i2c* コマンドでMCP23017の基本的な動作確認

  • i2cを有効にする
  • SDA,SCLを接続する
  • A0~A2 はプルダウン
  • /RESETはプルアップ
  • i2cのプルアップは不要

i2cデバイス検出

@mamemomonga
mamemomonga / jpchk.sh
Created August 26, 2019 03:42
mstdn.jp のリダイレクト状態の変化を検出してトゥートするツール
#!/bin/bash
set -eu
# go get -v github.com/mamemomonga/notebook-go/api/mastodon/easydon
easydon -t "[JP監視君] 起動しました。メンテが終了されると推測されると報告されます。"
while true; do
if [ -z "$( curl --verbose https://mstdn.jp/ 2>&1 | grep 'location: https://mastodon.cloud/@dsno' )" ]; then
easydon -t "[JP監視君] https://mstdn.jp/ のステータスが変わりました"
fi

Raspberry Pi 3 config.txt

Raspbianには /boot/config.txt, ARM64のUbuntuとDebian Busterは /boot/firmware/config.txt

# Pi 3B + RaspbianでUARTを有効にする
dtoverlay=pi3-miniuart-bt

# uartを有効にする(arm64用?)
@mamemomonga
mamemomonga / fastest-ext4.md
Created August 9, 2019 10:12
とにかく早いext4をつくる

とにかく早いext4をつくる

  • writebackモード
  • ジャーナリング無効

参考

TARGET_PART=/dev/sda1
mkfs.ext4 $TARGET_PART
tune2fs -o journal_data_writeback $TARGET_PART
tune2fs -O ^has_journal $TARGET_PART
@mamemomonga
mamemomonga / automount.md
Created August 9, 2019 10:00
Ubuntu 18.04 LTSで自動マウントを無効にする
@mamemomonga
mamemomonga / _README.md
Last active August 8, 2019 20:11
Volumio+HP-A3

Volumio2 + Raspberry Pi 3 + FOSTEX HP-A3

  • FOSTEX HP-A3を使用するとSpotify Connect Pluginがどうも不安定。時々再生がとまってしまうため、ALSAでdmixを経由することにする。
  • Volumio2でMIXERをSoftwareに変更する(このとき/etc/asound.confが生成される)
  • HP-A3はレートは96000Hz固定、解像度はS16_LE、S24_3LE固定。デフォルトだと96000/S16_LEとなるので、96000/S24_3LEに変換する
@mamemomonga
mamemomonga / raspbian.md
Last active July 25, 2019 11:24
Raspbianメモ
@mamemomonga
mamemomonga / nfs.md
Created July 22, 2019 19:10
NFSメモ

NFSメモ

サーバ(192.168.1.1/24)

nfs-kernel-server と rpcbindの起動が必要

$ sudo apt install nfs-kernel-server

$ sudo vim /etc/exports
/disk1/share 192.168.1.0/24(rw,sync,no_subtree_check,no_root_squash)
@mamemomonga
mamemomonga / mifa-a1.md
Last active July 21, 2019 16:39
MiFA A1 レビュー

MiFA A1 レビュー

MiFA A1 Bluetoothでの利用は多くのレビューがあるので、ここではとくにMicroSDに焦点を絞って調査する。

  • 米MiFA社の製品 中国製
  • 手のひらに載るBluetooth小型スピーカ、MicroSDからの再生、外部アナログ入力あり。
  • 一つ2000円前後と安価
  • 価格とサイズにしてはかなり頑張っている音質。
  • Bluetoothの場合2台組み合わせればTWSによるステレオ再生対応、MicroSDのステレオ再生には対応してない
@mamemomonga
mamemomonga / microsd.md
Last active July 21, 2019 05:27
MicroSD読み書きでよく使うコマンド

接続したストレージデバイスのデバイス名を確認する

$ lsblk -o NAME,SIZE,VENDOR,MODEL

進捗を確認しながらディスクイメージを書き込む

$ sudo dd if=IMAGEFILE of=DEVICE bs=64k oflag=dsync status=progress

パーティションを含むイメージファイルのループバックマウント