Skip to content

Instantly share code, notes, and snippets.

Avatar
😩
knowledge

Koichi Shiraishi zchee

😩
knowledge
View GitHub Profile
View Makefile.podman-bridge
ARCH ?= arm64
VERSION ?= 20.10
SPIN ?= live-server
vftool ?= ./vftool/build/vftool
DATA ?= ./data
ISO := ubuntu-$(VERSION)-$(SPIN)-$(ARCH).iso
MOUNTPOINT := /Volumes/Ubuntu
CD := $(DATA)/$(ISO)
@zchee
zchee / parse_yaml.sh
Created Jan 26, 2021 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
View parse_yaml.sh
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
View keybase.md

Keybase proof

I hereby claim:

  • I am zchee on github.
  • I am zchee (https://keybase.io/zchee) on keybase.
  • I have a public key ASCzoZj4UZALzFfabIEYE_o-jifJbuIQXekR_tyuhRUSyAo

To claim this, I am signing this object:

@zchee
zchee / install_jman.sh
Created Dec 16, 2020 — forked from ay65535/install_jman.sh
日本語manページをインストールするスクリプト (Mac用,というか自分用)
View install_jman.sh
#!/usr/bin/env bash
# 参考サイト: http://tukaikta.blog135.fc2.com/blog-entry-224.html
# ================各種設定================
# ダウンロードするファイル (GNU 日本語man)
#
# http://linuxjm.sourceforge.jp/ からダウンロードするファイルを指定します。
#export GNUJMAN=man-pages-ja-20120915.tar.gz
#export GNUJMAN=man-pages-ja-20150315.tar.gz
@zchee
zchee / process_names.txt
Created Dec 10, 2020 — forked from miguelmota/process_names.txt
macOS process whitelist
View process_names.txt
# not an exhaustive list
nsurlsessiond "icloud sync"
fseventsd "macos file system events"
WindowServer "macos windows"
DisplayLinkManager "macos driver"
configd "macos dynamic configuration"
displaypolicyd "macos process"
CommCenter "macos keychain"
kernel_task "macos kernel"
@zchee
zchee / Public_Time_Servers.md
Created May 24, 2020 — forked from mutin-sa/Public_Time_Servers.md
List of Top Public Time Servers
View Public_Time_Servers.md

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@zchee
zchee / fastaltmod.c
Created May 19, 2020 — forked from lemire/fastaltmod.c
fast alternative to the modulo reduction (code sample)
View fastaltmod.c
#include <iostream>
#include <cstdint>
using namespace std;
// we are going to generate random numbers using
// an xorshift generator
static uint32_t xorshift_y;
@zchee
zchee / build-xnu-6153.11.26.sh
Created Apr 27, 2020 — forked from knightsc/build-xnu-6153.11.26.sh
A script to build XNU version 6153.11.26 (macOS Catalina 10.15).
View build-xnu-6153.11.26.sh
#! /bin/bash
#
# build-xnu-6153.11.26.sh
# Scott Knight
#
# Based on the script by Brandon Azad
# https://gist.github.com/bazad/654959120a423b226dc564073b435453
#
# A script showing how to build XNU version 6153.11.26 on macOS Catalina
# 10.15 with Xcode 11.13.1.
@zchee
zchee / defer.sh
Created Apr 26, 2020 — forked from phemmer/defer.sh
bash defer function - just like go's defer()
View defer.sh
function _run_deferred() {
local _depth="$BASHPID.${#FUNCNAME[@]}"
[[ "$_depth" != "$_deferred_depth" ]] && return
local opt=$-
set +e
for (( i=${#_deferred[@]} - 1; i >= 0; i-- )); do
eval "${_deferred[i]}"
done
[[ "$opt" == *e* ]] && set -e
}
@zchee
zchee / EndpointSecurityDemo.m
Created Apr 3, 2020 — forked from Omar-Ikram/EndpointSecurityDemo.m
A demo of using Apple's new EndpointSecurity framework - tested on macOS Catalina 10.15 (19A583)
View EndpointSecurityDemo.m
//
// main.m
// EndpointSecurityDemo
//
// Created by Omar Ikram on 17/06/2019 - Catalina 10.15 Beta 1 (19A471t)
// Updated by Omar Ikram on 15/08/2019 - Catalina 10.15 Beta 5 (19A526h)
// Updated by Omar Ikram on 01/12/2019 - Catalina 10.15 (19A583)
//
#import <Foundation/Foundation.h>