Skip to content

Instantly share code, notes, and snippets.

View KornbergFresnel's full-sized avatar
🎯
Focusing

Ming Zhou KornbergFresnel

🎯
Focusing
View GitHub Profile
@KornbergFresnel
KornbergFresnel / disk_space_monitor.py
Created September 5, 2023 14:47
Start Disk Monitor Service
#! /opt/conda/bin/python
import requests
import subprocess
THRESHOLD = 85
DIR = "/mnt/nfs"
URL = "${Feishu_Hook_URL}"
u = subprocess.check_output(f"df -h {DIR}", shell=True).decode()
p = int(u.split()[-2][:-1])
@KornbergFresnel
KornbergFresnel / install_git_for_user.sh
Last active September 1, 2023 03:51
Install git from source
VERSION=$1
LOCAL_GIT=$HOME/git_local
echo "Install openssl locally ..."
cd $HOME
wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz --no-check-certificate
tar -xvzf openssl-1.0.2r.tar.gz
cd openssl-1.0.2r
mkdir builddir
./config --prefix=$HOME/openssl-1.0.2r/builddir --openssldir=$HOME/openssl-1.0.2r/builddir
@KornbergFresnel
KornbergFresnel / web-crawler.go
Last active June 21, 2020 09:47
Golang crawler (a simple case)
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
@KornbergFresnel
KornbergFresnel / sources.list
Created March 22, 2020 10:40
Tsinghua ubuntu18 sourcelist
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
@KornbergFresnel
KornbergFresnel / my_configs.vim
Created March 5, 2020 03:06
Configuration that helps you leverage vim for efficient development
set nu
set cursorline
colorscheme desert
autocmd Filetype vim let b:vcm_tab_complete='vim'
set cmdheight=1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""