Magic words:
psql -U postgres
If run with -E
flag, it will describe the underlaying queries of the \
commands (cool for learning!).
Most \d
commands support additional param of __schema__.name__
and accept wildcards like *.*
#!/usr/bin/env bash | |
# Variables | |
APPENV=local | |
DBHOST=localhost | |
DBNAME=dbname | |
DBUSER=dbuser | |
DBPASSWD=test123 | |
echo -e "\n--- Mkay, installing now... ---\n" |
import scrapy | |
import peewee | |
import re | |
import urllib | |
import cStringIO | |
from PIL import Image | |
from playhouse.db_url import connect | |
db = connect('mysql://root:@127.0.0.1/house') |
--- | |
- hosts: all | |
gather_facts: yes | |
tasks: | |
- name: Update /etc/hosts | |
become: true | |
tags: | |
- dns | |
lineinfile: | |
dest: /etc/hosts |
vagrant init centos/7
vagrant up
vagrant ssh
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/ | |
--- | |
- hosts: alpine_install | |
user: root | |
tasks: | |
# - name: create a complete empty file | |
# command: /usr/bin/touch /test/test.conf | |
- name: create a new file with lineinfile |
ufw [--dry-run] enable|disable|reload
ufw [--dry-run] default allow|deny|reject [incoming|outgoing]
ufw [--dry-run] logging on|off|LEVEL
toggle logging. Logged packets use the LOG_KERN syslog facility. Systems configured for rsyslog
support may also log to /var/log/ufw.log. Specifying a LEVEL turns logging on for the specified LEVEL.
#!/bin/bash | |
# Flushing all rules | |
iptables -F FORWARD | |
iptables -F INPUT | |
iptables -F OUTPUT | |
iptables -X | |
# Setting default filter policy | |
iptables -P INPUT DROP | |
iptables -P OUTPUT DROP | |
iptables -P FORWARD DROP |