Skip to content

Instantly share code, notes, and snippets.

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# default value
# 127.0.0.1 localhost
# ::1 localhost
# 1. WSL2 の IP を取得(最初の1つだけ)
$wsl_ip = wsl sh -c "hostname -I | cut -d' ' -f1" | Out-String | ForEach-Object {
$_.Trim()
}
@nansystem
nansystem / pre-commit
Last active January 12, 2025 06:36
Git Hook Script for Credential Scanning with Secretlint (Windows-Compatible)
#!/bin/bash
source "$(dirname "$0")/_local-hook-exec"
declare FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0
echo " ▶ Checking for credentials using secretlint..."
declare TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TEMPDIR"' EXIT
# Secretlint all staged files
@nansystem
nansystem / my.cnf
Last active August 14, 2021 02:28
MySQLのmy.cnfの設定内容を理解する
[mysqld]
server-id=1
# https://gist.github.com/fevangelou/fb72f36bbe333e059b66
datadir = /var/lib/mysql
# よく使われるログの種類
# ログの種類  ログの内容
# error サーバーから出力されるエラーメッセージ
# slow query 処理に時間のかかったクエリ
@nansystem
nansystem / gist:181a4d06f87aebe5aa7e405871297ed2
Last active December 16, 2017 10:58
prerequisites docker-scraping
https://github.com/akirakoyasu/docker-scraping
docker-compose run --rm scraping app/scraping/by_chromedriver.py
-- Prerequisites
-- install docker in ubuntu14.04
-- https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#supported-storage-drivers
-- https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce