Skip to content

Instantly share code, notes, and snippets.

View knwng's full-sized avatar
🐱

Kyle Wang knwng

🐱
  • Mountain View, CA
  • 05:09 (UTC -07:00)
View GitHub Profile
@knwng
knwng / config.toml
Created November 5, 2024 21:03
Atuin config file. Put it in ~/.config/atuin/config.toml
filter_mode = "host"
filter_mode_shell_up_key_binding = "session"
@knwng
knwng / .zshrc
Created September 27, 2024 19:12
zsh key bind
bindkey "^[[1;3C" forward-word
bindkey "^[[1;3D" backward-word
bindkey '^H' backward-kill-word

Oh my zsh.

Install Zsh

sudo apt-get install -y zsh

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
cmake -GNinja -Bbuild \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DPython3_FIND_VIRTUALENV=ONLY \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_EXTERNAL_PROJECTS="torch-mlir;torch-mlir-dialects" \
-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR=`pwd` \
-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR=`pwd`/externals/llvm-external-projects/torch-mlir-dialects \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
@knwng
knwng / .vimrc
Last active September 25, 2024 18:59
无插件版本vimrc,无注释(vimrc without plugins and comments)
set laststatus=2
set number
set hlsearch
set incsearch
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
@knwng
knwng / .vimrc
Last active September 27, 2024 22:18
无插件版本vimrc
set laststatus=2
set number "设置行号
set hlsearch "高亮搜索
set incsearch "增量搜索,即每次输入新字符都会触发搜索
set autoindent "自动缩进
set smartindent "智能缩进,基于autoindent
set tabstop=4 "设置一个tab占4个空格
set shiftwidth=4 "每层缩进4个空格
set expandtab "扩展tab为空格
set softtabstop=4 "使用退格键,每次将删除4个空格
@knwng
knwng / .tmux.conf
Last active February 2, 2025 02:08
my tmux configuration
# remap prefix key from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# increase history limit
set-option -g history-limit 30000
# close auto rename
set -wg allow-rename off
@cymruu
cymruu / main.go
Created June 26, 2018 12:06
Golang raw RSA encryption (no padding) RSA_NO_PADDING
package main
import (
"crypto/rsa"
"fmt"
"math/big"
)
var RSA_PublicKeyString string = "109120132967399429278860960508995541528237502902798129123468757937266291492576446330739696001110603907230888610072655818825358503429057592827629436413108566029093628212635953836686562675849720620786279431090218017681061521755056710823876476444260558147179707119674283982419152118103759076030616683978566631413"
var Public_RSA_Key = rsa.PublicKey{
N: fromBase10(RSA_PublicKeyString),
@fotock
fotock / nginx.conf
Last active February 3, 2025 15:03 — forked from plentz/nginx.conf
Nginx SSL 安全配置最佳实践.
# 生成 dhparam.pem 文件, 在命令行执行任一方法:
# 方法1: 很慢
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# 方法2: 较快
# 与方法1无明显区别. 2048位也足够用, 4096更强
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
@monkut
monkut / Ubuntu1604py36Dockerfile
Last active June 14, 2023 20:31
Base Docker image for ubuntu-16.04 & Python3.6
# docker build -t ubuntu1604py36
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv
RUN apt-get install -y git