Skip to content

Instantly share code, notes, and snippets.

View xiexianbin's full-sized avatar

xiexianbin xiexianbin

View GitHub Profile
@xiexianbin
xiexianbin / nginx.conf
Created March 19, 2023 08:56 — forked from dctrwatson/nginx.conf
Caching PyPi packages locally with nginx
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
#!/bin/bash
# Destription: test cpu usage
# Example : sh cpu_usage.sh consume 8 | sh cpu_usage.sh release
FILE_NAME=`basename $0`
cpunum=$2
pid_array=()
function usage()
{
echo "Usage:$FILE_NAME consume cpu_number|release -----the value of cpu_number is an integer,such as 1,2,3"
{"lastUpload":"2022-03-20T13:56:49.641Z","extensionVersion":"v3.4.3"}
[SwitchyOmega Conditions]
; Require: SwitchyOmega >= 2.3.2
; Date: 2018/8/11
; Usage: https://github.com/FelisCatus/SwitchyOmega/wiki/RuleListUsage
*.google.com
*.github.com
*.gitbooks.io
*.golang.org
*.facebook.com
# vim:ft=sh
#本文定义通用函数, 与业务逻辑无关的通用函数(任意任务均可使用)
#所有函数, 返回值为1表示异常
get_lan_ip () {
#
ip addr | \
awk -F'[ /]+' '/inet/{
split($3, N, ".")
#!/bin/bash
ssh-keygen -t rsa -b 2048 -N "" -f $HOME/.ssh/id_rsa
cat $HOME/.ssh/id_rsa.pub >$HOME/.ssh/authorized_keys
chmod 600 $HOME/.ssh/authorized_keys
for ip in $(awk '{print $1}' install.config); do
rsync -av -e 'ssh -o StrictHostKeyChecking=no' $HOME/.ssh/authorized_keys root@$ip:$HOME/.ssh/

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装
#! /bin/bash
SITE_PATH='/export/Data/aotu.jd.com/index/cnt1992.github.io'
USER='admin'
USERGROUP='admin'
cd $SITE_PATH
git reset --hard origin/master
git clean -f
git pull
git checkout master
chown -R $USER:$USERGROUP $SITE_PATH
@xiexianbin
xiexianbin / delete-dockerhub-images.sh
Created March 22, 2018 08:08
Delete Docker images on DockerHub
#!/bin/bash
# Based on kizbitz/dockerhub-v2-api-organization.sh at https://gist.github.com/kizbitz/175be06d0fbbb39bc9bfa6c0cb0d4721
# Example for the Docker Hub V2 API
# Returns all images and tags associated with a Docker Hub organization account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username, password, and organization
UNAME=""
UPASS=""

Keybase proof

I hereby claim:

  • I am xiexianbin on github.
  • I am xiexianbin (https://keybase.io/xiexianbin) on keybase.
  • I have a public key whose fingerprint is B5A1 B728 A2FD 170F E0E6 C4E2 D6B7 1988 603A 67D2

To claim this, I am signing this object: