Skip to content

Instantly share code, notes, and snippets.

View sko00o's full-sized avatar
☮️
Peaceful.

Wenyu.Li sko00o

☮️
Peaceful.
View GitHub Profile
@sko00o
sko00o / mac-terminal-setup.sh
Last active November 10, 2023 17:20
Make Mac Terminal Better
#!/bin/zsh
# Reference: https://www.youtube.com/watch?v=CF1tMjvHDRA
install_brew() {
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
}
setup_brew() {
(echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/shank/.zprofile
@sko00o
sko00o / clash-start
Last active January 3, 2024 14:12 — forked from akillcool/clash.service
clash auto start and update subcribe configuration
#!/bin/bash
# save this file to /usr/local/bin/clash-start
# save pid file
echo $$ > ${HOME}/.config/clash/clash.pid
CLASH_URL="your subscribe address" # NEED EDIT!
CLASH_REMOTE_CFG="${HOME}/.config/clash/config-remote.yaml"
CLASH_LOCAL_CFG="${HOME}/.config/clash/config-local.yaml"
CLASH_TMP_CFG="/tmp/clash-config.yaml"
@sko00o
sko00o / proxy.sh
Last active December 5, 2023 10:25
set proxy in wsl
#!/usr/bin/env bash
hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
wslip=$(hostname -I | awk '{print $1}')
port=7890
PROXY_HTTP="http://${hostip}:${port}"
proxy_set(){
export http_proxy="${PROXY_HTTP}"
@sko00o
sko00o / run.sh
Last active January 30, 2024 10:57
Install a1111 on wsl2
# https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs#windows-11-wsl2-instructions
# install conda (if not already done)
wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
chmod +x Anaconda3-2022.05-Linux-x86_64.sh
./Anaconda3-2022.05-Linux-x86_64.sh
# Clone webui repo
git clone -b v1.4.1 https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
@sko00o
sko00o / .env
Last active June 12, 2020 07:42
[MyGoProjectTemplate] #Go
PROJPATH := .
PROJECTNAME := demo
PROJECTVER := 0.0.1
FILES := README.md CHANGELOG.md
GO_ENV := CGO_ENABLED=0 GOPROXY=https://goproxy.io
GO_EXTRA_BUILD_ARGS := -trimpath
@sko00o
sko00o / Makefile
Last active October 10, 2022 07:30
Makefile for managing DST(don't starve together) server
CMDPKGURL := "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
CMDPATH := steamcmd
CMDFILE := steamcmd.sh
GAMEPATH := "Steam/steamapps/common/Don't Starve Together Dedicated Server/bin"
GAMEFILE := dontstarve_dedicated_server_nullrenderer
DATAPATH := $(PWD)/.klei
SAVEFILE := DoNotStarveServer
SAVEFILECAVE := DoNotStarveCaves
@sko00o
sko00o / 01-install-influxdb.md
Last active November 18, 2019 09:57
[Try InfluxDB] Try InfluxDB on Debian10 #Debian #InfluxDB #Docker

Add repository

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

Install and start

@sko00o
sko00o / proxy.go
Last active November 18, 2019 07:56
[Simple http proxy server] #Go
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
@sko00o
sko00o / Makefile
Last active December 30, 2023 14:56
Makefile for managing Minecraft server
BASEPATH=$(PWD)
EXEC=server.jar # forge-1.14.3-27.0.12.jar # you can change to forge
BACKUPNAME="world-$(shell date '+%F-%H%M').tar.gz"
BAKPATH=$(BASEPATH)/backup-worlds
MAKEFLAGS += --silent
all: help
## require: install required programs