Skip to content

Instantly share code, notes, and snippets.

View estshorter's full-sized avatar

estshorter estshorter

View GitHub Profile
@estshorter
estshorter / mpd.conf
Last active November 25, 2017 14:12
My mpd.conf
# Files and directories #######################################################
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/tag_cache"
#log_file "/var/log/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
#state_file "/var/lib/mpd/state"
#sticker_file "/var/lib/mpd/sticker.sql"
###############################################################################
@estshorter
estshorter / raspi-autosetup.md
Last active August 16, 2021 07:04
Auto-setup of Minimum Raspbian for Music

Assumption

  • Raspberry Pi 3 only (due to optimization option)
  • OS: Raspbian stretch (2017-11-29)
  • Music format: mp3, m4a, flac (no dsd)
  • Play music stored in a NAS via wired lan (no usb)
  • Scrobble to last.fm
  • I2S DAC: Hifiberry DAC+ Pro compatible board
  • For Japanese (NTP, timezone and language setting)
  • Network: dhcp, wired lan
  • Write the raspbian image on Windows
#!/bin/bash -eu
# Specify software version
MPD_MAJOR_VER=0.20
MPD_MINOR_VER=.15
MPD_VER="${MPD_MAJOR_VER}${MPD_MINOR_VER}"
ALSA_VER=1.1.5
FLAC_VER=1.3.2
MPG123_VER=1.25.8
@estshorter
estshorter / download.sh
Last active February 4, 2018 03:04
Raspbianを音楽サーバ化するビルドレシピ ref: https://qiita.com/estshorter/items/8ca0327f6d7e6ea9cd01
mkdir ~/setup
cd ~/setup
wget https://raw.githubusercontent.com/estshorter/raspi-autosetup/master/setup.sh -O ./setup.sh
chmod u+x ./setup.sh
@estshorter
estshorter / install-openssl.sh
Last active April 13, 2024 20:42
Install openssl on raspberry pi
#!/bin/bash -eu
OPENSSL_VER=1.1.0g
mkdir openssl
cd openssl
wget https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz
tar xf openssl-${OPENSSL_VER}.tar.gz
cd openssl-${OPENSSL_VER}
./config zlib shared no-ssl3
@estshorter
estshorter / update-musicbee.py
Last active January 5, 2020 06:19
Python script for downloading and applying MusicBee Patches from https://getmusicbee.com/patches/
from datetime import datetime, timezone
import os
from pathlib import Path
import subprocess
from urllib import request
from zipfile import ZipFile
from bs4 import BeautifulSoup
import pytz
@estshorter
estshorter / settings.json
Last active January 5, 2020 06:23
settings.json for VS Code
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.lintOnSave": true,
"python.linting.flake8Args": [
"--max-line-length",
"88",
"--ignore=E203,W503,W504"
],
"python.formatting.provider": "black",
@estshorter
estshorter / keybindings.json
Last active December 31, 2019 00:44
keybindings.json for VS Code
// 既定値を上書きするには、このファイル内にキー バインドを挿入しますauto[]
[
{
"key": "ctrl+f9",
"command": "python.execInTerminal",
"when": "editorLangId == 'python'"
},
{
"key": "ctrl+;",
"command": "workbench.action.terminal.focus",
@estshorter
estshorter / toml-test.py
Created December 31, 2019 05:05
script for testing toml
import toml
import logging
# なんとなくloggingで出力する
logging.basicConfig(level=logging.DEBUG, format="{message}", style="{")
# 文字列としてパスを与えると読み込める
# pathlib.Pathクラスでも可
params = toml.load("./parameter/nominal.toml")
# dictクラスとしてロードされる
@estshorter
estshorter / test-logging.py
Last active January 3, 2020 11:39
script for logging
import contextlib
import datetime
import time
import logging
from logging.handlers import MemoryHandler
import sys
from typing import Any, Callable, Iterator, MutableMapping
from tqdm import tqdm
import toml