- Add
pbcopy.plist
to your~/Library/LaunchAgents/
folder. - Launch the listener with
launchctl load ~/Library/LaunchAgents/pbcopy.plist
. - Add
RemoteForward 2224 127.0.0.1:2224
in your~/.ssh/config
file under yourHost *
or specific hosts sections. - Add
[ -n "$SSH_CLIENT" ] && alias pbcopy="nc localhost 2224"
to your remote~/.bash_profile
or other shell profile. - Enjoy
pbcopy
remotely!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <qcow2 image>" | |
exit | |
fi | |
image=$1 | |
target=$(mktemp -d) | |
cleanup_on_exit() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 3 ]; then | |
echo "usage: $0 <unix socket file> <host> <listen port>" | |
exit | |
fi | |
SOCK=$1 | |
HOST=$2 | |
PORT=$3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -e "CREATE USER 'repl'@'%' IDENTIFIED BY 'slavepass'" | |
mysql -e "GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <uuid or name>" | |
exit | |
fi | |
get_ephymeral_port() { | |
LPORT=32768; | |
UPORT=60999; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user www-data; | |
worker_processes 4; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vpn_server=10.70.239.196 | |
vpn_tunnel_id=8 | |
vpn_ip_prefix=192.168.48 | |
vpn_monitor_port=50008 | |
ensure_tun_device() { | |
local host=$1 | |
local device=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <image name>" | |
exit | |
fi | |
image=$1 | |
rbd -p pool-beishu snap unprotect ${image}@snap | |
rbd -p pool-beishu snap rm ${image}@snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <image name>" | |
exit | |
fi | |
image=$1 | |
rbd -p pool-beishu snap unprotect ${image}@snap | |
rbd -p pool-beishu snap rm ${image}@snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <volume id>" | |
fi | |
volume_id=$1 | |
## check if volume exists | |
if cinder show ${volume_id} | grep -q 'No volume'; then |
OlderNewer