This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
org=klaytn | |
since=2023-01-01 | |
until=2023-12-31 | |
# This public API only shows public repos. type=source excludes forks. | |
curl -sSL "https://api.github.com/orgs/$org/repos?type=source&per_page=100&page=1" -o repos.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _DEFER_H | |
#define _DEFER_H | |
/** | |
* @file defer.h | |
* @brief Golang-like defer in standard C++11. | |
* | |
* Original idea from https://stackoverflow.com/a/42060129/8939955. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# IMPORTANT! | |
# Dont work in Linux 4.8.0 | |
# Works in Linux 4.4.0 | |
# http://halobates.de/blog/p/410 | |
sudo sh -c "echo 'kernel.kptr_restrict=0' >> /etc/sysctl.conf" | |
# https://superuser.com/questions/980632/run-perf-without-root-rights | |
sudo sh -c "echo 'kernel.perf_event_paranoid=1' >> /etc/sysctl.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -ex | |
# Dependencies | |
sudo apt-get install -y wget unzip xz-utils build-essential openssl bc curl libssl-dev | |
# Install SDKs | |
sudo apt-get install -y ocl-icd-libopencl1 ocl-icd-opencl-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import sys | |
import re | |
import urllib | |
def sizeof_fmt(num, suffix='B'): | |
for unit in ['','K','M','G']: | |
if abs(num) < 1024.0: | |
return "%3.1f%s%s" % (num, unit, suffix) | |
num /= 1024.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bsearch(a, compare, match=None): | |
""" | |
Binary search under limited comarison capability | |
when match == None: | |
compare(y) returns | |
y > key => positive int | |
y = key => 0 | |
y < key => negative int | |
when match != None; |