Skip to content

Instantly share code, notes, and snippets.

@zengpuzhang
zengpuzhang / centos-7-mirrors-aliyun.sh
Created April 14, 2025 02:46 — forked from rbpi/centos-7-mirrors-aliyun.sh
CentOS 7 mirrors&epel with aliyun
#!/bin/bash
set -e
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
echo "CentOS-Base.repo backup successful"
/bin/cat <<'EOF' > /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
@zengpuzhang
zengpuzhang / nginx.conf
Created September 12, 2023 02:33 — forked from sgnn7/nginx.conf
NGINX caching
# vim:ff=unix:ts=2:sw=2:ai:expandtab
# Cache location setup - this should be the NAS
proxy_cache_path /var/cache/nginx
levels=1:2
keys_zone=bundle-cache:8M
max_size=100000M
inactive=3M
loader_threshold=330
loader_files=1000;
@zengpuzhang
zengpuzhang / go.md
Last active May 7, 2020 07:22
Go Project
package main
import (
"fmt"
)
func main() {
x := []float64{0, 1, 0, 3}
y := []float64{0, 1, 1, 1}
p := pearsonCorrelation(x, y)
import React, { Component } from "react";
import "./App.css";
import { runInThisContext } from "vm";
class App extends Component {
constructor(props) {
super(props);
this.state = {
num: 0
@zengpuzhang
zengpuzhang / install_docker.sh
Created October 25, 2018 09:39
install_docker.sh
# step 1: 安装必要的一些系统工具
sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
mkdir .ssh; echo "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA45D8Xt/zPnyEbwy4Pz1Fv78bOfdzPYc9TuKGBGdMNRAsATteec9Nnia+dwTp8rtOjWKgaAUSaPX77ueFJYtHztb62Qkp8zyeRGUMczFla7T0tu+IZTLjgEfzXb+vWTzJWORlFQznd1zvnAz178w7C9FrFdRI4NOL/2eXaVxOkbrhiAWy7c+8Aceypp+l9kHbh/ggsEnjFNiNkNXrzsLClRxSvhcBwaZ8i+ZSyXaRATs1GnFed2Fu/tIwo+hxeg/DEs3fVs6j77pIWGzMh67FEaQa5k79gkTLu6c58EOY0ZKpxk8VAjoDMtO0ZHxjQusY5+hQqxK39jRPP036dKMgsQ== zhangzengpu@ketangce" >> .ssh/authorized_keys ; chmod 0644 .ssh/authorized_keys
VISUAL STUDIO CODE SETTINGS SYNC
Version: 2.8.2
Upload Summary
VISUAL STUDIO CODE SETTINGS SYNC
--------------------
Version: 2.8.2
GITHUB TOKEN: dbae81c9a4d1dbedc8221728d63ee0d9143a0689
@zengpuzhang
zengpuzhang / yii-phar.php
Created May 24, 2017 07:46 — forked from mindplay-dk/yii-phar.php
Package the Yii framework as a .phar archive
<?php
/*
Place this script in the Yii framework folder (yii-x.y.z.rxxx/yii-phar.php) and run it
to package the framework into a single phar file.
In the "index.php" of your application, assuming you placed the packaged framework under
your application's "protected" folder, add the following line at the top:
@zengpuzhang
zengpuzhang / nginx.conf
Last active August 29, 2015 14:19 — forked from morhekil/nginx.conf
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '