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
@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
@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
@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 }}' $@ ;}
@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>
@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
@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 窗口名]

恢复会话:

@aranega
aranega / uml2python.mtl
Last active October 31, 2022 10:13
UML to Python Generator written in Acceleo
[**
*
* -=( Python Code Generator )=-
*
* This script will generate one file per packages.
* It also support following things:
* - classes/interfaces (as classes)/enumerations
* - inheritance/interface realization (as inheritance)
* - attributes/associations
* + cardinility {x...*} -> generated as list
@juliojsb
juliojsb / iptables-multicast.sh
Last active October 15, 2024 13:12
Allow multicast communications in iptables
Run the following:
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A FORWARD -m pkttype --pkt-type multicast -j ACCEPT
iptables -A OUTPUT -m pkttype --pkt-type multicast -j ACCEPT
Or:
iptables -A INPUT -s 224.0.0.0/4 -j ACCEPT
iptables -A FORWARD -s 224.0.0.0/4 -d 224.0.0.0/4 -j ACCEPT
@cmabastar
cmabastar / haproxy.conf
Created June 17, 2016 06:08
Haproxy for flask-socketio
global
daemon
defaults
mode http
log global
option httplog
option http-server-close
option dontlognull
option redispatch