Skip to content

Instantly share code, notes, and snippets.

View wey-gu's full-sized avatar
🥝
Believe in OpenSource and build in public w/ magic to help others do the same.

Wey Gu wey-gu

🥝
Believe in OpenSource and build in public w/ magic to help others do the same.
View GitHub Profile
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 7, 2025 01:38 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@karolyi
karolyi / osx_keyboardspeed.sh
Created November 19, 2015 20:54
Mac OS X super fast keyboard speed
#!/usr/bin/env bash
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/
#echo "Disable press-and-hold for keys in favor of key repeat"
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 0.02
@dolph
dolph / keystone_apache.conf
Last active November 29, 2022 08:18
Keystone OpenID Connect + Authorization Code Flow
<VirtualHost *:5000>
...
OIDCClaimPrefix "OIDC-"
OIDCResponseType "code"
OIDCScope "openid email profile"
OIDCProviderMetadataURL http://<keycloak_host>:8080/auth/realms/master/.well-known/openid-configuration
OIDCClientID <client_id>
OIDCClientSecret <client_secret>
@rafaeltuelho
rafaeltuelho / linux-shell-docker-cli.sh
Last active July 12, 2024 09:30
Some useful shell aliases and function for Docker command line
# Docker aliases
alias di='sudo docker images'
alias dps='sudo docker ps -a'
# useful Docker functions
dock-run() { sudo docker run -i -t --privileged $@ ;}
dock-exec() { sudo docker exec -i -t $@ /bin/bash ;}
dock-log() { sudo docker logs --tail=all -f $@ ;}
dock-port() { sudo docker port $@ ;}
dock-vol() { sudo docker inspect --format '{{ .Volumes }}' $@ ;}
@kukat
kukat / aria2.conf
Last active May 4, 2019 09:50
aria2 startup script for synology
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
rpc-allow-origin-all=true
#允许非外部访问
rpc-listen-all=true
#RPC端口, 仅当默认端口被占用时修改
#rpc-listen-port=6800
#最大同时下载数(任务数), 路由建议值: 3
max-concurrent-downloads=5
@iacchus
iacchus / socket.io-1-0-apache-2.4-ssl.conf
Last active September 21, 2022 18:45
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@ipedrazas
ipedrazas / gist:2c93f6e74737d1f8a791
Created September 18, 2014 22:13
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@junaid18183
junaid18183 / haproxy_socat
Last active November 4, 2020 09:29
Haproxy stats with Socat
#Source - http://www.haproxy.org/download/1.5/doc/configuration.txt
# Section - 9.2. Unix Socket commands
#show stat [<iid> <type> <sid>]
# Dump statistics in the CSV format. By passing <id>, <type> and <sid>, it is
# possible to dump only selected items :
# - <iid> is a proxy ID, -1 to dump everything
# - <type> selects the type of dumpable objects : 1 for frontends, 2 for
# backends, 4 for servers, -1 for everything. These values can be ORed,
# for example:
@yuuichi-fujioka
yuuichi-fujioka / install package to qcow image.sh
Created April 17, 2014 04:14
install apt-get package to qcow2 image
sudo apt-get install qemu-utils
sudo modprobe nbd
sudo qemu-nbd --connect=/dev/nbd0 /full/path/to/qcow2/image/file
sudo mkdir /mnt/ubuntu
sudo mount /dev/nbd0p1 /mnt/ubuntu