start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/bash | |
| sudo su | |
| yum update -y | |
| yum install yum-plugin-copr -y | |
| yum copr enable @caddy/caddy -y | |
| yum install caddy -y | |
| printf ":80\nrespond \"Hello from $HOSTNAME\"" > /etc/caddy/Caddyfile | |
| caddy start --config /etc/caddy/Caddyfile |
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
| import java.security.Key; | |
| import java.util.Properties; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import javax.persistence.AttributeConverter; | |
| import javax.persistence.Converter; | |
| import org.slf4j.Logger; |
| import select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| from sqlalchemy import create_engine, text | |
| engine = create_engine("postgresql+psycopg2://vagrant@/postgres") |
| from ansible import playbook, callbacks | |
| # uncomment the following to enable silent running on the playbook call | |
| # this monkey-patches the display method on the callbacks module | |
| # callbacks.display = lambda *a,**ka: None | |
| # the meat of the meal. run a playbook on a path with a hosts file and ssh key | |
| def run_playbook(playbook_path, hosts_path, key_file): | |
| stats = callbacks.AggregateStats() | |
| playbook_cb = callbacks.PlaybookCallbacks(verbose=0) |