Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.


I may be slow to respond.
Block or report user

Report or block zsnmwy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
zsnmwy / add CA cert on CentOS Debian
Last active Jun 20, 2019 — forked from kekru/add CA cert on CentOS Debian
Add CA cert to local trust store on CentOS, Debian or Ubuntu
View add CA cert on CentOS Debian
  • 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
zsnmwy / gist:0a767e1c4617f3c3913e4ff3cd5eaeef
Last active May 28, 2019
View gist:0a767e1c4617f3c3913e4ff3cd5eaeef
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
View gist:1298de72b45425c6e4bcc904bd1ff0fc
if [[ $? -eq 0 ]];then
echo -e "${OK} ${GreenBG} $1 完成 ${Font}"
sleep 1
echo -e "${Error} ${RedBG} $1 失败${Font}"
exit 1
zsnmwy /
Last active Oct 10, 2018
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 /
Created Sep 16, 2018
create a crontab job through shell script
(crontab -l 2>/dev/null; echo "*/5 * * * * /path/to/job -with args") | crontab -
zsnmwy / use nvm insatll node && npm install pm2 .sh
Last active Sep 16, 2018
use nvm insatll node && npm install pm2
View use nvm insatll node && npm install pm2 .sh
wget -qO- | bash 1>/dev/null #This install nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/" # 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
You can’t perform that action at this time.