Skip to content

Instantly share code, notes, and snippets.

View curipha's full-sized avatar
🕊️
Pray for peace

OKAMOTO Taichi curipha

🕊️
Pray for peace
  • Kyoto, Japan
  • 03:20 (UTC +09:00)
View GitHub Profile
@curipha
curipha / settings.json
Created November 4, 2020 15:48
Configuration for Windows Terminal
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"disabledProfileSources": [ "Windows.Terminal.Wsl" ],
"copyOnSelect": true,
"copyFormatting": false,
"largePasteWarning": false,
@curipha
curipha / docker-compose.yml
Created November 4, 2020 15:43
docker-compose.yml for mackerel-agent
version: "3.0"
services:
mackerel-agent:
image: mackerel/mackerel-agent:latest
container_name: mackerel-agent
hostname: ${HOSTNAME:?}
environment:
apikey: <APIKEY>
auto_retirement: 0
@curipha
curipha / az_provider.sh
Last active December 11, 2020 14:53
Register all Azure resource providers
az provider list --query '[].namespace' --output tsv | grep -iF microsoft | xargs -n1 az provider register -n
@curipha
curipha / create_subnets.sh
Last active May 25, 2022 12:15
AWS - Create default subnets to all AZs
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
aws ec2 describe-regions \
--query 'Regions[].{Name:RegionName}' \
--output text \
| while read -r region
do
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
@curipha
curipha / setup.md
Created June 4, 2020 15:31
How to set-up Ubuntu Server (20.04)

How to set-up Ubuntu Server (20.04)

Set-up SSH public key

Send SSH public key from your local computer to the remote server. Run this command at local.

@curipha
curipha / powercfg.bat
Last active June 11, 2020 13:26
Make Windows AlwaysOn (This script must be run as administrator)
:: 次の時間が経過後スリープする(なし)
powercfg /setacvalueindex SCHEME_BALANCED SUB_SLEEP STANDBYIDLE 0
powercfg /setdcvalueindex SCHEME_BALANCED SUB_SLEEP STANDBYIDLE 0
:: 次の時間が経過後休止状態にする(なし)
powercfg /setacvalueindex SCHEME_BALANCED SUB_SLEEP HIBERNATEIDLE 0
powercfg /setdcvalueindex SCHEME_BALANCED SUB_SLEEP HIBERNATEIDLE 0
:: カバーを閉じたときの操作(何もしない)
@curipha
curipha / wsl.conf
Last active March 10, 2020 13:19
/etc/wsl.conf - Configuration file for WSL (Windows Subsystem for Linux)
[automount]
enabled = true
options = "metadata,umask=22,fmask=111"
[interop]
enabled = false
appendWindowsPath = false
@curipha
curipha / spotlight.py
Last active November 4, 2020 15:34
Copy spotlight images to MyPicture directory - Use Task Scheduler to continuously get pictures!
#!/usr/bin/env python
import imghdr
import os
import shutil
import struct
sldir = os.path.expanduser('~\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets')
wpdir = os.path.expanduser('~\Pictures\wallpaper')
if not os.path.isdir(sldir):
@curipha
curipha / run.ps1
Last active March 10, 2020 13:18
Powershell script template to run the script with Administrator privileges
try {
$orig_eap = $ErrorActionPreference
$ErrorActionPreference = 'Stop'
$wp = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
if ($wp.IsInRole("Administrators")) {
# Put commands here for running with Administrator privileges
}
else {
throw "Administrator privilege required. Please run this script with an elevated PowerShell prompt."