Skip to content

Instantly share code, notes, and snippets.

View Triple-Z's full-sized avatar
🎯
Focusing

Zhenzhen Zhao Triple-Z

🎯
Focusing
View GitHub Profile
@Triple-Z
Triple-Z / mac_mount_ntfs.sh
Last active March 10, 2024 14:23
macOS mount ntfs
# dependencies
brew install --cask macfuse
brew install gromgit/fuse/ntfs-3g-mac
# create a new mounting point
sudo mkdir /Volumes/NTFS
# find your disk
diskutil list
@Triple-Z
Triple-Z / share_css__paper_dark_mode.css
Last active January 4, 2024 15:40 — forked from ysslang/share_css__paper.css
Trillium Sharing Theme (with Dark Mode)
body {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
background: #dfe6e9;
}
#layout {
display: flex;
margin: 0 auto;
}
@Triple-Z
Triple-Z / ape2flac.sh
Last active July 20, 2022 14:43
Transform APE lossless format to FLAC
#!/bin/bash
IFS='
'
files_arr=($(ls | grep .ape))
for file_name in ${files_arr[@]}; do
filename_without_extension=$(basename "$file_name" ".ape")
ffmpeg -i "$filename_without_extension".ape -map_metadata 0 "$filename_without_extension".flac
done
@Triple-Z
Triple-Z / PowerMock + Mockito = PowerMockito.md
Created May 26, 2021 07:53
PowerMock + Mockito = PowerMockito
@Triple-Z
Triple-Z / 504.lua
Created March 18, 2021 03:40
Count 404 and 504 in wrk.
threads = {}
setup = function (thread)
local counter_504 = 0
local counter_404 = 0
table.insert(threads,thread)
thread:set("counter_504",counter_504)
thread:set("counter_404",counter_404)
end
@Triple-Z
Triple-Z / sort_md_footnotes.py
Created February 23, 2021 05:22
Sorting Markdown footnote markers into their order of appearance in the text.
#!/usr/bin/python
import sys
import re
'''
Read a Markdown file via standard input and tidy the containing
Multimarkdown footnotes. The reference links will be numbered in
the order they appear in the text and placed at the bottom
of the file.
@Triple-Z
Triple-Z / by_lua.py
Created June 23, 2020 07:56
A crossplane plugin for *_by_lua directives.
# -*- coding: utf-8 -*-
from crossplane.analyzer import register_external_directives
from crossplane.lexer import register_external_lexer
from crossplane.parser import register_external_parser
from crossplane.builder import register_external_builder
from crossplane.ext.abstract import CrossplaneExtension
class LuaPlugin(CrossplaneExtension):
directives = {
@Triple-Z
Triple-Z / DoUKnowThis.java
Last active May 18, 2020 15:21
Can u get these stdout results?
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DoUKnowThis {
public static void main(String[] args) {
ArrayList<Integer []> a = new ArrayList<>();
ArrayList<Integer []> b = new ArrayList<>();
Integer []g = new Integer[2];
Integer []h = new Integer[2];
@Triple-Z
Triple-Z / Rancher-k8s.md
Last active September 25, 2019 17:00
Deploy a Rancher kubernetes environment in minutes.

Rancher Deployment Notes

[TOC]

What is Rancher?

For power users and beginners:

“For those who have tried, writing Kubernetes manifests in YAML is unforgiving if you get it wrong. With Rancher, you benefit from Kubernetes immediately, without worrying about YAML. You can launch your applications and wire them together quickly at production level. You won’t need to know everything there is to know about Kubernetes before you can even begin.” >

@Triple-Z
Triple-Z / install-docker-on-ubuntu.sh
Created April 14, 2019 12:31
Test passed on Ubuntu 18.04 & 16.04.
#!/bin/sh
# remove older versions
sudo apt-get remove docker docker-engine docker.io containerd runc -y
# Install docker via USTC mirror
# sudo apt-get update -y
# sudo apt-get install -y \
# apt-transport-https \
# ca-certificates \