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 *.*
# method 1 | |
$ echo $(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
# method 2 | |
$ echo $(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }') |
#!/usr/bin/env python | |
""" | |
Basic script to create an empty python package containing one module | |
""" | |
from skeleton import Skeleton, Var | |
class BasicModule(Skeleton): | |
""" | |
Create an empty module with its etup script and a README file. |
#!/bin/bash | |
PATHOK="`grep myprog /etc/environment`" | |
if [ -z $PATHOK ]; then | |
sed -e '/^PATH/s/"$/:\/usr\/lib\/myprog\/bin"/g' -i /etc/environment | |
fi |
vim ~/.zshrc
ZSH_THEME="clean"
HIST_STAMPS="dd.mm.yyyy"
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') |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provider "virtualbox" | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 512 |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.provider "virtualbox" | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 512 |
- name: 1st | |
tags: debug | |
debug: var=hostvars['{{ item }}']['ansible_eth1']['ipv4']['address'] | |
with_items: "{{ groups['master'] }}" | |
- name: 2nd | |
tags: debug | |
debug: var=hostvars['{{ item }}']['ansible_default_ipv4']['address'] | |
with_items: "{{ groups['master'] }}" |