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 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 / 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

@KEINOS
KEINOS / README.md
Created April 20, 2023 02:28
[Golang] Example of Fletcher16 implementation in Go.

Example of Fletcher16 (Fletcher's checksum) in Go

package main

import "fmt"

// Fletcher16 returns the checksum of the data using the Fletcher's
// checksum algorithm.
func Fletcher16(data []byte) uint16 {
@KEINOS
KEINOS / gist_comment.md
Last active March 12, 2023 12:54
[GitHub API v4] GraphQL API Example to retrieve/get comments in Gist.

GitHub GraphQL API (GitHub API v4) example to retrieve/get comments in Gist.

{
  viewer {
    gist(name: "78cc23f37e55e848905fc4224483763d") {
      comments(last: 100) {
        edges {
          node {
 author {
@KEINOS
KEINOS / README.md
Last active March 9, 2023 10:21
[Docker] [Alpine] 5 things you should try if the container fails to boot

5 things you should try if the container fails to boot

  1. Reboot the service.

    sudo systemctl restart docker.service
  2. Try "hello-world".

@KEINOS
KEINOS / mastodon-installer-for-CentOS7x-with-KUSANAGI-at-SakuraVPS.sh
Last active March 6, 2023 05:27
さくらのVPS+KUSANAGI+CentOS7でMastodonをインストールするシェルスクリプト。One-liner Mastodon Instance installer for CentOS7.2 with KUSANAGI on SakuraVPS.
#!/bin/bash
echo
echo "-----------------------------"
echo " ╔╦╗╔═╗╔═╗╔╦╗╔═╗╔╦╗╔═╗╔╗╔"
echo " ║║║╠═╣╚═╗ ║ ║ ║ ║║║ ║║║║"
echo " ╩ ╩╩ ╩╚═╝ ╩ ╚═╝═╩╝╚═╝╝╚╝"
echo " Installer for Sakura VPS"
echo " (CentOS7x with KUSANAGI)"
echo "-----------------------------"
echo
@KEINOS
KEINOS / README.md
Last active February 9, 2023 02:51
JSON file of Joyo kanjis(常用漢字) to facilitate the search for Japanese kanji readings.

Jōyō Kanjis 2010(常用漢字読み仮名)

In this gist we provide 2 JSON files.