Skip to content

Instantly share code, notes, and snippets.


Koichi Shiraishi zchee

View GitHub Profile
zchee /
Created May 24, 2020 — forked from mutin-sa/
List of Top Public Time Servers

Google Public NTP [AS15169]:

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 /
Created Apr 27, 2020 — forked from knightsc/
A script to build XNU version 6153.11.26 (macOS Catalina 10.15).
#! /bin/bash
# Scott Knight
# Based on the script by Brandon Azad
# A script showing how to build XNU version 6153.11.26 on macOS Catalina
# 10.15 with Xcode 11.13.1.
zchee /
Created Apr 26, 2020 — forked from phemmer/
bash defer function - just like go's defer()
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]}"
[[ "$opt" == *e* ]] && set -e
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>
zchee /
Created Feb 13, 2020 — forked from fnky/
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
View cuetype.go
Command cuetype like the front-end of a CUE compiler, parses and
type-checks a single CUE package. Errors are reported if the analysis
fails; otherwise cuetype is quiet (unless -v is set).
Without a list of paths, cuetype reads from standard input, which
must provide a single CUE source file defining a complete package.
With a single directory argument, cuetype checks the CUE files in
that directory, comprising a single package. Use -t to include the
zchee / spinnaker-rbac.yaml
Created Dec 10, 2019 — forked from rantav/spinnaker-rbac.yaml
Kubernetes RBAC for Spinnaker
View spinnaker-rbac.yaml
# Authorize read-write in the default namespace. Add this Role and the below RoleBinding to every namespace spinnaker deploys artifacts to
kind: Role
name: spinnaker-role
namespace: default
- apiGroups: [""]
resources: ["namespaces", "events", "replicationcontrollers", "serviceaccounts", "pods/logs"]
zchee /
Created Dec 5, 2019 — forked from pwnsdx/
Disable bunch of #$!@ in Catalina
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
zchee / go_1.13_error_migration.bash
Created Oct 16, 2019 — forked from Peltoche/go_1.13_error_migration.bash
Go 1.13 error format migration script
View go_1.13_error_migration.bash
echo "Migrate: $FILES"
sed -i "s/errors.Wrapf(\(.*\), \"\(.*\)\", \(.*\))/fmt.Errorf(\"\2: %w\", \3, \1)/g" $FILES
sed -i "s/errors.Wrap(\(.*\), \"\(.*\)\")/fmt.Errorf(\"\2: %w\", \1)/g" $FILES
sed -i "s/errors.Errorf/fmt.Errorf/g" $FILES
goimports -w .
You can’t perform that action at this time.