Skip to content

Instantly share code, notes, and snippets.

View nullne's full-sized avatar
🚎
go bootstrap

Le Yu nullne

🚎
go bootstrap
View GitHub Profile
@nullne
nullne / tmux.conf
Last active December 13, 2020 09:49 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@nullne
nullne / movie.sh
Last active November 1, 2020 03:13
build movie server on pi
set -x
# download Raspberry PI imager to burn cd
# openvpn
apt install openvpn -y
cat >> /etc/openvpn/movie.conf << EOF
openvpn config content here
# username on first line, password on second
@nullne
nullne / install_tmux_2.5_locally.sh
Last active June 22, 2020 04:43
install tmux 2.5
#!/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.5
@nullne
nullne / proxy_for_terminal.md
Created May 14, 2020 08:18 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@nullne
nullne / nginx
Created March 12, 2019 07:38
log rotation config
/var/log/nginx/*.log {
daily
missingok
rotate 3
compress
delaycompress
notifempty
create 640 root root
sharedscripts
postrotate
@nullne
nullne / tmux_local_install.sh
Created February 27, 2019 03:15
install tux 2.5 without root privilege
#!/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 / install-latest-vim.sh
Last active January 24, 2019 04:00
install latest vim with many features enabled from source
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
package main
import (
"bytes"
"context"
"crypto/md5"
"errors"
"flag"
"fmt"
"io"
@nullne
nullne / go_scp.go
Last active October 11, 2017 21:59 — forked from jedy/go_scp.go
an example of scp in golang
// 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`
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_