Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
脑壳疼

Josta Yee jostyee

💭
脑壳疼
  • Singapore
View GitHub Profile
@jostyee
jostyee / goodreads_to_book_track.py
Created Aug 5, 2020 — forked from ahmedre/goodreads_to_book_track.py
Goodreads export to Book Track friendly Importer
View goodreads_to_book_track.py
import csv
import requests
import sys
"""
This script converts a Goodreads export csv into a Book Track friendly csv.
It does this by querying Google Books' api for each book and adding its id,
along with removing some of the other unnecessary fields in the original
export.
@jostyee
jostyee / go.xml
Created Jul 11, 2020 — forked from sha1sum/go.xml
GOlang File Format for Beyond Compare
View go.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Produced by Beyond Compare 4 from Scooter Software -->
<!--
This is an extension of the work done by Nate Finch:
https://npf.io/2014/05/diffing-go-with-beyond-compare/
The regular expressions for identifiers have been updated
to match on lowercase and allow numbers to be included anywhere
after the first character of the word.
@jostyee
jostyee / pi.status.sh
Created May 16, 2020 — forked from dchakro/pi.status.sh
Shell script to print stats about a Raspberry running pihole
View pi.status.sh
# Gather system details.
dt=$(date -R)
freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
volts=$(sudo /opt/vc/bin/vcgencmd measure_volts)
temp=$(sudo /opt/vc/bin/vcgencmd measure_temp)
gov=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
up=$(uptime)
# Print System details
echo " "
View pihole.blacklist
adss.video.qq.com
bugly.qq.com
dp3.qq.com
fusion.qq.com
pingtas.qq.com
huatuocode.weiyun.com
report.huatuo.qq.com
vd.l.qq.com
nex.163.com
sentry.music.163.com
@jostyee
jostyee / karabiner_merge.sh
Created Jun 11, 2019 — forked from narze/karabiner_merge.sh
Merge karabiner.json with complex modification rules
View karabiner_merge.sh
#!/usr/bin/env bash
# Requirements : goku, jq
# 1. Make sure goku runs
goku
# 2. Make temp json file
cp ~/.config/karabiner/karabiner.json ~/.config/karabiner/karabiner.tmp.json
@jostyee
jostyee / pi-hole.sh
Created Mar 27, 2019
Run pi-hole in macOS
View pi-hole.sh
#!/bin/bash
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
docker run -d \
--name pihole \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-p 443:443 \
-e ServerIP="$(ipconfig getifaddr en0)" \
View snell.service
[Unit]
Description=snell
After=network.target
[Service]
Type=simple
User=nobody
Group=nogroup
LimitNOFILE=32768
Restart=on-failure
View gomod_init.sh
GO111MODULE=on go mod init
GO111MODULE=on go mod vendor
git add go.mod go.sum vendor
git rm Gopkg.toml Gopkg.lock
@jostyee
jostyee / quantumult_filter.conf
Last active Oct 24, 2020
Rules for Quantumult app
View quantumult_filter.conf
// DEPRECATED, prefer https://gist.githubusercontent.com/jostyee/5d1f840bd8fd4ac53778a91ce13323b6/raw/quantumult_filter_select.conf
@jostyee
jostyee / build_nginx.sh
Created Sep 6, 2018
nginx_boringssl_tls1.3
View build_nginx.sh
#!/bin/bash
set -ex
NGINX_VERSION="1.15.3"
BUILDROOT="/home/yee/ng"
sudo add-apt-repository ppa:gophers/archive
sudo apt update
sudo apt install -y build-essential uuid-dev dpkg-dev unzip cmake make