Skip to content

Instantly share code, notes, and snippets.

@tomjamescn
tomjamescn / init-vps-shell.sh
Last active March 23, 2020 06:53
sudo init-server.sh
!#/bin/bash
apt update
apt install vim vim-nox git zsh
curl https://get.docker.com | bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl https://gist.githubusercontent.com/tomjamescn/ccdcda091650ff1d34b496e4eeba123f/raw/62166ff7e7d6d31f6d3964a69a131f1264d38a95/custom_oh_my_zsh.sh | bash
@tomjamescn
tomjamescn / init-server.sh
Created February 28, 2020 13:00
sudo init-server.sh
!#/bin/bash
apt update
apt install vim vim-nox git zsh
curl https://get.docker.com | bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl https://gist.githubusercontent.com/tomjamescn/ccdcda091650ff1d34b496e4eeba123f/raw/62166ff7e7d6d31f6d3964a69a131f1264d38a95/custom_oh_my_zsh.sh | bash
@tomjamescn
tomjamescn / custom_oh_my_zsh.sh
Created February 28, 2020 00:52
custom oh-my-zsh
#!/bin/bash
if [[ -z "$ZSH" ]]; then
echo "还未安装oh-my-zsh!"
exit 1
fi
os=`uname`
cp "$ZSH/themes/robbyrussell.zsh-theme" "$ZSH/custom/themes/robbyrussell.zsh-theme"
@tomjamescn
tomjamescn / rclone-install.sh
Last active February 21, 2020 14:04
rclone
#!/bin/bash
# debian/ubuntu
sudo apt install unzip fuse
curl https://rclone.org/install.sh | sudo bash

Keybase proof

I hereby claim:

  • I am tomjamescn on github.
  • I am tomjamescn (https://keybase.io/tomjamescn) on keybase.
  • I have a public key ASCVXLKfU4pOGULqS3_JQChts4a1bnInoQ-qlshUWXaCvQo

To claim this, I am signing this object:

@tomjamescn
tomjamescn / install_golang_org_x_quickly.sh
Last active July 15, 2019 06:24
国内快速安装golang.org/x下的包
#!/bin/bash
# 网络环境会导致直接安装失败,使用此脚本可以避免这个问题
if [ -z $GOPATH ];then
echo "GOPATH not exists!"
exit 1
fi
dir=$GOPATH/src/golang.org/x
@tomjamescn
tomjamescn / install-tmux.sh
Created June 21, 2019 06:04 — forked from pokev25/install-tmux.sh
Install tmux 2.8 on centos 7
# Install tmux 2.8 on Centos
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
@tomjamescn
tomjamescn / handle_http_response.php
Created July 6, 2018 08:50
使用php处理http响应_兼容chunked和压缩的响应
<?php
function http_unchunk($data) {
$res=[];
$p=0; $n=strlen($data);
while($p<$n) {
if (preg_match("/^([0-9A-Fa-f]+)\r\n/",substr($data,$p,18),$m)) {
$sz=hexdec($m[1]); $p+=strlen($m[0]);
$res[]=substr($data,$p,$sz); $p+=$sz+2;
} else {

Installing Kubernetes on Proxox

For this example i shall be using a dedicated server from Hertzner.https://www.hetzner.de/en/. A shout out to hetzner if your looking for cheap and beefy dedicated hosting then these guys are your best bet.

Setting up the Hertzer server

This guide assumes your server has Debian 8 (Jessie installed)

Config when tested

Modified from the gist @https://gist.github.com/odiumediae/3b22d09b62e9acb7788baf6fdbb77cf8
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python3 python3-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim