Skip to content

Instantly share code, notes, and snippets.

@rainly
rainly / virsh_destroy_network.adoc
Created June 12, 2018 10:38 — forked from gotnix/virsh_destroy_network.adoc
virsh 重启虚拟网络以后,虚拟机的虚拟机网卡不会自动重连,能不能搞成自动把虚拟机的网卡加到网桥里?
虚拟机有 2 台
» virsh list --title --all
 Id    Name               State      Title
--------------------------------------------------
 5     vm-01             running    192.168.2.110
 6     vm-02             running    192.168.2.111
@rainly
rainly / nginx.conf
Created June 8, 2018 06:16 — forked from terrywang/nginx.conf
nginx config file template for Debian and Ubuntu
# User and group used by worker processes
user www-data;
# Ideally # of worker processes = # of CPUs or cores
# Set to auto to autodetect
# max_clients = worker_processes * worker_connections
worker_processes auto;
pid /run/nginx.pid;
@rainly
rainly / config
Created June 8, 2018 06:15 — forked from terrywang/config
Secure Enhanced `$HOME/.ssh/config` OpenSSH client per-user configuration file
# User ssh configuration file ~/.ssh/config
# Gist https://gist.github.com/terrywang/3997931
# man ssh_config for more information
# Inspired by the blog post below to fight the NSA
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Github needs diffie-hellman-group-exchange-sha1 some of the time but not always
# Host github.com
# KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
sudo apt-get install libssl-dev
git clone https://github.com/proftpd/proftpd.git
cd proftpd
./configure --with-modules=mod_digest #开启这个模块可以支持xcrc远程快速比较
make
sudo make install
sudo vi /usr/local/etc/proftpd.conf
#在"Port 21"下面加上:
SocketBindTight on #因为通过kcptun通道走, 不需要监听外网ip, 只要127.0.0.1即可
DefaultAddress 127.0.0.1
library(tidyverse)
library(gganimate)
NUMPLAYERS = 45
ROUNDS = 5000
INITWEALTH = 45
#initialize the bank
#columns wealths of the NUMPLAYERS players
#rows show wealths of each of the ROUNDS ticks of the clocks
@rainly
rainly / .profile
Created March 2, 2017 14:24 — forked from developer88/.profile
Some PostgreSQL snippets
alias 'pg_sql_restore'='PGPASSWORD=SOMEPASSWORD psql -cO -U username -d dbname -h localhost -f ' # + set path to backup file
alias 'pg_tar_restore'='PGPASSWORD=SOMEPASSWORD pg_restore -cO -U username -d dbname -h localhost ' # + set path to backup file
@rainly
rainly / deploy.rb
Created March 2, 2017 14:10 — forked from developer88/deploy.rb
Deploy phpBB with Mina
require 'mina/bundler'
require 'mina/git'
set :application, "forum"
set :domain, '%SERVERNAME%'
set :deploy_to, "%PATH-TO-APPLICATION%"
set :repository, '%REPOSITORY-URL%.git'
set :branch, 'master'
set :login, "%LOGIN%"
@rainly
rainly / deploy.rb
Created March 2, 2017 14:10 — forked from developer88/deploy.rb
Deploy phpBB with Mina
require 'mina/bundler'
require 'mina/git'
set :application, "forum"
set :domain, '%SERVERNAME%'
set :deploy_to, "%PATH-TO-APPLICATION%"
set :repository, '%REPOSITORY-URL%.git'
set :branch, 'master'
set :login, "%LOGIN%"
@rainly
rainly / README.md
Created March 2, 2017 13:57 — forked from hofmannsven/README.md
My simply Git Cheatsheet