Skip to content

Instantly share code, notes, and snippets.

View jiahut's full-sized avatar
🎯
Focusing

zhijia,.zhang jiahut

🎯
Focusing
View GitHub Profile
@jiahut
jiahut / config.toml
Created March 11, 2024 03:48
配置 helix 作为 vim 的最小实现
[editor]
auto-info = false
[keys.normal]
# Quick iteration on config changes
# C-o = ":config-open"
# C-r = ":config-reload"
";" = "repeat_last_motion"
@jiahut
jiahut / SimpleHTTPServerWithUpload.py
Created November 24, 2023 03:33 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@jiahut
jiahut / shadowsocks-rust-server.sh
Created July 23, 2023 11:45 — forked from gpchelkin/shadowsocks-rust-server.sh
How to Setup shadowsocks-rust Server with v2ray-plugin or xray-plugin on Any Linux Host
#!/usr/bin/env bash
# https://github.com/shadowsocks/shadowsocks-rust/releases
export SSVERSION=v1.15.4
export SSPORT=143
export SSPASSWORD="CHANGEME"
export SSARCHIVE="shadowsocks-${SSVERSION}.x86_64-unknown-linux-gnu.tar.xz"
#export SSARCHIVE="shadowsocks-${SSVERSION}.aarch64-unknown-linux-gnu.tar.xz"
export PREFIX=/usr/local/bin
@jiahut
jiahut / vim_cheatsheet.md
Created January 13, 2022 08:08 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close

editor-mode

motion-mode

conceptkeyvim implemacs impl
snipes
matchit%matchup
jump<SPC>ojeasymotionavy
gotogf
@jiahut
jiahut / xmodmap.sh
Created January 5, 2021 10:06
linux modify keyboard to hhkb style
#!/bin/sh
/usr/bin/setxkbmap -option "ctrl:nocaps"
/usr/bin/xmodmap -e "keycode 51 = BackSpace"
/usr/bin/xmodmap -e "keycode 22 = backslash bar"
@jiahut
jiahut / turbovnc-service@1.service
Created December 24, 2020 07:42
turbovnc systemd service
[Unit]
Description=TurboVNC vncserver
After=network.target syslog.target
[Service]
User=ubuntu
Type=forking
ExecStartPre=/bin/sh -c '/opt/TurboVNC/bin/vncserver -kill :1 &>/dev/null || :'
ExecStart=/opt/TurboVNC/bin/vncserver -nohttpd -nthreads 8 -nevershared -disconnect -deferupdate 1 -idletimeout 0 -interframe -depth 24 -name zhijia-cloud-vnc :1
ExecStop=/bin/sh -c '/opt/TurboVNC/bin/vncserver -kill :1 &>/dev/null || :'
@jiahut
jiahut / duplication.rb
Created November 13, 2020 16:24
find duplication emacs-mode
#!/bin/ruby
# ls_1 = `ls -1`
# all = []
# ls_1.each do | mode |
# mode =~ /((\w|-)+?)-((\d+|\.)+)/
# end
@jiahut
jiahut / surfingkeys-vim.setting
Last active October 2, 2023 06:30
surfingkeys settings
// vim: set syntax=typescript:
// an example to create a new mapping `ctrl-y`
// mapkey('<Ctrl-y>', 'Show me the money', function() {
// Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
// });
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works.
// map('gt', 'T');
//reference
/**
* genpac 2.1.0 https://github.com/JinnLynn/genpac
* Generated: 2020-03-08 22:43:53
* GFWList Last-Modified: 2019-11-05 00:21:47
* GFWList From: online[https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt]
*/
var proxy = 'SOCKS5 127.0.0.1:10860';
var rules = [
[