Skip to content

Instantly share code, notes, and snippets.

View microdog's full-sized avatar
😴
Sleeping...

Microdog microdog

😴
Sleeping...
View GitHub Profile
@microdog
microdog / migrate_bee_clef_keystore.sh
Created March 4, 2021 10:09
Migrate clef keystore generated by bee-clef to lightkdf
#!/bin/bash
set -e
parse_json() { echo "$1" | sed -e 's/[{}]/''/g' | sed -e 's/", "/'\",\"'/g' | sed -e 's/" ,"/'\",\"'/g' | sed -e 's/" , "/'\",\"'/g' | sed -e 's/","/'\"---SEPERATOR---\"'/g' | awk -F=':' -v RS='---SEPERATOR---' "\$1~/\"$2\"/ {print}" | sed -e "s/\"$2\"://" | tr -d "\n\t" | sed -e 's/\\"/"/g' | sed -e 's/\\\\/\\/g' | sed -e 's/^[ \t]*//g' | sed -e 's/^"//' -e 's/"$//'; }
chk_command() {
if ! command -v "$1" &>/dev/null; then
echo "missing clef: $1"
exit 1
fi
@microdog
microdog / gist:8ecbf76d585d4c313555cc6444505745
Created December 19, 2016 05:24 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7, also available from https://brouken.com/brouken-centos-7-repo/
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools
OPENSSL="openssl-1.0.2j"
NGINX_VERSION="1.11.6-1"
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-$NGINX_VERSION.el7.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-module-geoip-$NGINX_VERSION.el7.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-module-image-filter-$NGINX_VERSION.el7.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-module-njs-1.11.6.0.1.4-2.el7.ngx.src.rpm
@microdog
microdog / log
Created April 21, 2014 12:45
Log of installing Pintos on CentOS 6.5
1 sudo yum install make conf automake gcc g++
3 sudo yum install vim
4 git clone http://cs140.stanford.edu/pintos.git
6 sudo yum install git
7 git clone http://cs140.stanford.edu/pintos.git
9 cd pintos/
10 sudo bash -c 'echo -e "\nexport PINTOSDIR="`pwd`"/\n" >> /etc/profile' && source /etc/profile
12 echo $PINTOSDIR
13 cd ../
14 ls