Lazy bash belong here
Kill testrpc that use 8545
lsof -t -i tcp:8545 | xargs kill
DO_OPTION=$(cat <<EOF
'{
"name": "My-Droplet",
"region": "nyc2",
"size": "512mb",
"image": "ubuntu-14-04-x64"
}'
EOF)
system_profiler SPPowerDataType
# Create some .env
echo "FOO=123" > .env
# Use it
source .env; echo $FOO
# Create cert.key and cert.pem for a certificate that is valid for the next 10 years.
openssl req -x509 -newkey rsa:4086 \
-keyout key.pem -out cert.pem \
-days 3650 -nodes -sha256
>
or1>
Redirectsstdout
to file.2>
Redirectsstderr
to file.&>
Redirectsstdout
andstderr
to file./dev/null
is a blackhole.echo $'export NVM_DIR="$HOME/.nvm"\n. "/usr/local/opt/nvm/nvm.sh"' >> ~/.bash_profile
# Config
export [email protected]
export SSH_PUBKEY=~/.ssh/id_rsa.pub
# Add
ssh $SERVER sh -c "'cat >> .ssh/authorized_keys'" < $SSH_PUBKEY
# Verify
ssh $SERVER cat .ssh/authorized_keys
To fix
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
ssh-keygen -R YOUR_HOST_IP_OR_DOMAIN
src='Hello $FOO'
match='$FOO'
repl='BAR'
echo ${src/$match/$repl}
# Hello BAR
# Create template
echo "Hello {{FOO}}" > foo.conf.tmpl
# Replace {{FOO}} with FOO variable and output to new foo.conf file
sed -e "s|{{FOO}}|$FOO|g" foo.conf.tmpl > foo.conf
# Multiple replacement
sed -e "s|{{FOO}}|$FOO|g;s|{{BAR}}|$BAR|g" foo.conf.tmpl > foo.conf