Skip to content

Instantly share code, notes, and snippets.

Avatar
🚎
go bootstrap

Le Yu nullne

🚎
go bootstrap
View GitHub Profile
@nullne
nullne / vpn.sh
Created Oct 9, 2015
自动选择最佳vpn线路并连接
View vpn.sh
#!/bin/bash
PROG_NAME=$0
ACTION=$1
usage() {
echo "Usage: $PROG_NAME {list|ping|optimal|conn|close|status}"
exit 1
}
@nullne
nullne / centos_python_env_setup
Created Dec 8, 2015 — forked from hangtwenty/centos_python_env_setup
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
View centos_python_env_setup
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
View 优雅的安装python.md

###Centos下编译安装python

####准备 主要是一些开发工具和其他的依赖包

yum groupinstall "Development tools"
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

####注意事项

Unicode
@nullne
nullne / magic.sh
Created Dec 20, 2016
Some useful cmd
View magic.sh
|awk -FJSON '{print $2}'
|gawk 'match($0, /users\/([0-9]*)\/relationships\/([0-9]*).*AppVersion":"([0-9\.]*)"/, a) {print a[1],a[2],a[3]}'
View core-db.sql
CREATE OR REPLACE FUNCTION update_user_status_with_old_status_checked(user_id_ integer, status_old_ status, status_new_ status, check_old_status_ boolean)
RETURNS SETOF lon_lat_user AS
$$
DECLARE
BEGIN
RETURN QUERY
SELECT (user_to_lon_lat_user(users_full.*, 0)).*
FROM users u
JOIN users_full ON users_full.id = u.id
WHERE u.id = user_id_
@nullne
nullne / go_scp.go
Last active Oct 11, 2017 — forked from jedy/go_scp.go
an example of scp in golang
View go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
View minio.go
package main
import (
"bytes"
"context"
"crypto/md5"
"errors"
"flag"
"fmt"
"io"
@nullne
nullne / install-latest-vim.sh
Last active Jan 24, 2019
install latest vim with many features enabled from source
View install-latest-vim.sh
yum install gcc -y
yum install make -y
yum install ncurses-devel -y
yum install lua lua-devel -y
yum install ruby ruby-devel -y
yum install python python-devel -y
yum install perl perl-devel -y
git clone https://github.com/vim/vim.git
cd vim
@nullne
nullne / tmux_local_install.sh
Created Feb 27, 2019
install tux 2.5 without root privilege
View tmux_local_install.sh
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.8
@nullne
nullne / nginx
Created Mar 12, 2019
log rotation config
View nginx
/var/log/nginx/*.log {
daily
missingok
rotate 3
compress
delaycompress
notifempty
create 640 root root
sharedscripts
postrotate
You can’t perform that action at this time.