Skip to content

Instantly share code, notes, and snippets.

View hoony-o-1's full-sized avatar
🐢
small, slow, and solid

hoony hoony-o-1

🐢
small, slow, and solid
View GitHub Profile

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&staging
@hoony-o-1
hoony-o-1 / psqlfix.txt
Created March 3, 2016 07:47
Change postgres default template0 to UTF8 encoding
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@hoony-o-1
hoony-o-1 / exercise.tour.go
Created October 26, 2015 09:59 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@hoony-o-1
hoony-o-1 / scraper.py
Last active August 29, 2015 14:08 — forked from cornchz/scraper.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from gevent import monkey; monkey.patch_all()
import re
from urlparse import urljoin
from gevent.pool import Pool
import requests