Skip to content

Instantly share code, notes, and snippets.

View zsnmwy's full-sized avatar
💭
I may be slow to respond.

zsnmwy

💭
I may be slow to respond.
View GitHub Profile
@zsnmwy
zsnmwy / crontab.sh
Created September 16, 2018 09:11
create a crontab job through shell script
(crontab -l 2>/dev/null; echo "*/5 * * * * /path/to/job -with args") | crontab -
@zsnmwy
zsnmwy / use nvm insatll node && npm install pm2 .sh
Last active September 16, 2018 09:12
use nvm insatll node && npm install pm2
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash 1>/dev/null #This install nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 8.11.1 # This install node v8.11.1
nvm use 8.11.1
node -v # Show node version
@zsnmwy
zsnmwy / Get_files_day_of_week.sh
Last active October 10, 2018 15:59
Use stat and date to get the file day of week
function Get_files_day_of_week() {
date -d $(stat "${1}" | grep Acc | grep -v '/' | awk '{print $2}' | sed 's/-//g') +%w
}
@zsnmwy
zsnmwy / bbr.sh
Last active January 27, 2019 18:17
bbr
#检测安装完成或失败
judge(){
if [[ $? -eq 0 ]];then
echo -e "${OK} ${GreenBG} $1 完成 ${Font}"
sleep 1
else
echo -e "${Error} ${RedBG} $1 失败${Font}"
exit 1
fi
}
@zsnmwy
zsnmwy / gist:1298de72b45425c6e4bcc904bd1ff0fc
Created February 22, 2019 18:20
update powershell version
先装这个
https://www.microsoft.com/zh-cn/download/details.aspx?id=53344
再装
https://www.microsoft.com/zh-cn/download/details.aspx?id=53323
再装
https://go.microsoft.com/fwlink/?linkid=839523
@zsnmwy
zsnmwy / gist:0a767e1c4617f3c3913e4ff3cd5eaeef
Last active May 28, 2019 23:51
vue循环输出图片-对象
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@zsnmwy
zsnmwy / add CA cert on CentOS Debian Ubuntu.md
Last active June 20, 2019 14:49 — forked from kekru/add CA cert on CentOS Debian Ubuntu.md
Add CA cert to local trust store on CentOS, Debian or Ubuntu
  • Open a webpage that uses the CA with Firefox
  • Click the lock-icon in the addressbar -> show information -> show certificate
  • the certificate viewer will open
  • click details and choose the certificate of the certificate-chain, you want to import to CentOS
  • click "Export..." and save it as .crt file
  • Copy the .crt file to /etc/pki/ca-trust/source/anchors on your CentOS machine
  • run update-ca-trust extract
  • test it with wget https://thewebsite.org
@zsnmwy
zsnmwy / cloudSettings
Last active December 31, 2019 02:40
vscode-settings
{"lastUpload":"2019-12-31T02:40:54.088Z","extensionVersion":"v3.4.3"}
@zsnmwy
zsnmwy / gist:d83d18a71e2224e9643927ca07c0efbf
Last active March 3, 2021 12:55
Steam workshop Download Tips

Open Console

steam://open/console

Download

download_depot   [] [] [] : download a single depot
// ENV Node
import axios, {
AxiosInstance,
AxiosRequestConfig,
AxiosResponse,
} from "axios";
declare module "axios" {
interface AxiosInstance {
(config: AxiosRequestConfig): AxiosPromise;