Skip to content

Instantly share code, notes, and snippets.

View KEINOS's full-sized avatar

KEINOS KEINOS

View GitHub Profile
@KEINOS
KEINOS / README.md
Created June 11, 2023 06:11
[Alpine Linux] Packages that "chromium" and "firefox" package will install.

The below list is the diff of apk list --installed between before and after apk add chromium firefox.

alsa-lib-1.2.9-r3
aom-libs-3.6.1-r0
at-spi2-core-2.48.3-r0
avahi-libs-0.8-r13
brotli-libs-1.0.9-r15
cairo-1.17.8-r2
cairo-gobject-1.17.8-r2
@KEINOS
KEINOS / README.md
Last active March 13, 2024 17:05
[NanoPi NEO2] Cronjob example to reboot Armbian machine by detecting the CPU temperature.

Auto Rebooting NanoPi NEO2 NAS Before Crash

This gist explains how to reboot the NanoPi NEO2 NAS before the CPU temperature rises too high and the device crashes.

Cron Job Setting Example

$ sudo crontab -l
# Check CPU temperature every 30 min (reboot if over 70°C)
*/30 * * * * /root/cron_jobs/onheat_reboot.sh > /root/cron_jobs/onheat_reboot.log 2>&1
@KEINOS
KEINOS / README.md
Created May 24, 2023 12:06
[Memo] CheatSheet for GitHub Actions Job step versions
@KEINOS
KEINOS / Proxmox.md
Last active October 9, 2023 02:50
[Memo] Hardware spec information to install Linux on iMac Late2009 and old PC.
@KEINOS
KEINOS / README.md
Created May 17, 2023 12:22
How to verify the SHA2-256 checksum file in macOS.

How to verify the checksum file?

TL; DR

Use -c or --check option of shasum or sha256sum command.

$ # The target ISO image and its hash file
$ ls 
alpine-extended-3.18.0-x86_64.iso alpine-extended-3.18.0-x86_64.iso.sha256
@KEINOS
KEINOS / README.md
Last active May 28, 2023 08:44
Identity file for Gistargazer, the badge service for number of stars in a gist. See: https://github.com/KEINOS/gistargazer

Example repo for Gistargazer API

This gist repository is an example of a Gistargazer API ID file deployment.

Notes

  • The only file required is "gistargazer.json", the others are ignored.
  • The gist ID (in this case "42f5f23053ab59ca480f480b8d01e1fd") is the Gistargazer API user ID.
  • After submitting the ID file "gistargazer.json" to the gist repository with "allow_badge" element as "yes", go to the following URL and check that the file appears:
  • https://gist.githubusercontent.com///raw/gistargazer.json
@KEINOS
KEINOS / MBP.md
Created May 14, 2023 23:45
[Memo] KEINOS' Hardware Information

Hardware information to prepare for Linux migration before Apple support ends.

$ date -R
Mon, 15 May 2023 08:41:18 +0900

$ sw_vers
ProductName:	macOS
ProductVersion:	12.6.5
BuildVersion:	21G531
@KEINOS
KEINOS / 20230512-1430.md
Created May 12, 2023 05:32
[Sample Post]
title description publishDate draft tags
Hoge
sample post
2023-01-11 23:13:22 +0900
false
sample

Hoge Hoge

@KEINOS
KEINOS / uint64_to_bytes.md
Created May 1, 2023 07:31
[Golang] Converting uint64 to byte slices.

Converting uint64 to []byte in Go

tl; dr

Using LittleEndian.PutUint64 function from encoding/binary package is much faster than bit shifting.

0.3468n/op vs 3.905n/op

import "encoding/binary"
@KEINOS
KEINOS / openpgp.md
Created April 22, 2023 00:43
[Keyoxide] Identity Proof for Keyoxide

openpgp4fpr:4FDD93EDA91BA3AD071ED4118B888AD8EDD27C2D