Skip to content

Instantly share code, notes, and snippets.

View krast's full-sized avatar
🇨🇳
I may be slow to respond.

Krast krast

🇨🇳
I may be slow to respond.
View GitHub Profile
@krast
krast / fix_onedrive.sh
Created December 20, 2023 08:08 — forked from drblue/fix_onedrive.sh
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@krast
krast / reinvent.md
Created December 29, 2022 03:25 — forked from pfeilbr/reinvent.md
link for reinvent slides
@krast
krast / standard.sh
Created September 23, 2019 03:37 — forked from hfossli/standard.sh
Standard bash script format
#!/bin/bash
CLEAR='\033[0m'
RED='\033[0;31m'
function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi
echo "Usage: $0 [-n number-of-people] [-s section-id] [-c cache-file]"
@krast
krast / lombok_check_generated_sources.txt
Created May 6, 2019 06:46
Lombok delombok 查看lombok生成的源码
参考链接
========
https://projectlombok.org/features/delombok
https://awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html
为什么需要查看lombok生成的源码?
===============================
主要原因有二:
@krast
krast / README.md
Created April 22, 2019 07:46 — forked from straker/README.md
Basic Snake HTML Game

Basic Snake HTML Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

@krast
krast / latency.txt
Created April 16, 2019 06:47 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@krast
krast / tmuxinst.sh
Created March 27, 2019 16:14 — forked from rsponholtz/tmuxinst.sh
install tmux on sles 12 sp 3
#!/bin/bash
zypper addrepo https://download.opensuse.org/repositories/home:/so_it_team:/12.x/SLE_12_SP3/home:so_it_team:12.x.repo
zypper addrepo https://download.opensuse.org/repositories/network:utilities/SLE_12_SP3/network:utilities.repo
zypper refresh
zypper install -y iperf tmux
@krast
krast / fluent-filebeat-comparison.md
Created February 28, 2019 03:15 — forked from StevenACoffman/fluent-filebeat-comparison.md
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@krast
krast / Quiver_HTML_importer.py
Created September 13, 2018 07:04 — forked from kspeeckaert/Quiver_HTML_importer.py
Quiver HTML importer
import json
import uuid
from pathlib import Path
from urllib.parse import urlparse
from datetime import datetime
import html2text
import requests
from bs4 import BeautifulSoup
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!