Skip to content

Instantly share code, notes, and snippets.

Some content from http://www.thegeekstuff.com/2009/04/15-practical-postgresql-database-adminstration-commands/
1. How to change PostgreSQL root user password ?
$ /usr/local/pgsql/bin/psql postgres postgres
Password: (oldpassword)
# ALTER USER postgres WITH PASSWORD 'tmppassword';
$ /usr/local/pgsql/bin/psql postgres postgres
Password: (tmppassword)
@adeleinr
adeleinr / wisdom
Created August 15, 2012 20:55
How people work
Catherina Fake
==============
I like pencil and paper, probably more than most people in tech. I use a Field Notes 80 page steno notebook for taking notes, and a Clairefontaine 4.5"x6.5" notebook for my to-do list. I like to number each thing I accomplish, and when I get to the end of the notebook, the number of things I have done is close to 5,000. This is very analogue, but there's a really excellent pencil sharpener Lifehacker readers should know about: the Automatic Long Point, 2 phase KUM sharpener, made in Germany.
Wisdom is pretty plain and unimpressive. Be nice. Floss regularly. Do your best. Don't let the grass grow on the path to your friend's house. Wisdom is always simple, but not easy.
@adeleinr
adeleinr / Apache cheatsheet
Created November 3, 2011 18:10
Apache cheatsheet
MULTIPLE PORTS IN ONE HOST
---------------------------
Syntax:
Port [port]
NameVirtualHost *:[another_port]
Listen [another_port]
@adeleinr
adeleinr / Usability_Tips
Created July 26, 2011 19:06
Usability Tips
Source http://www.women2.org/10-usability-takeaways-for-web-developers-dont-make-me-think/
1. Behaviors of Web Users
We don’t READ, we SCAN.
We love to muddle through to figure things out.
We don’t make optimal choices, we love to guess and there’s no penalty when we guessed wrong.
2. Design Pages like Billboards
Pages should be designed for scanning, not reading.
@adeleinr
adeleinr / Python Cheatsheet
Created June 3, 2011 20:31
Python Cheatsheet
List Comprehensions
=====================
list = [each + 1 for each in range(10)]
Ternary Operator
=================
x if a > b else y
@adeleinr
adeleinr / fabric.py
Created April 20, 2011 21:21
fabric config for deploying a Django project
"""
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid
Author: Adelein Rodriguez, adeleinr@gmail.com
Note: This is an adaptation from a fabric script presented here:
http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p.html
Summary: This script:
@adeleinr
adeleinr / Django_Python_Twitter_Template_Tags.html
Created February 14, 2011 05:20
Django Python Twitter + CSS
<div id="twitter-icon" class="span-2">
<a href="http://twitter.com/adeleinr"><img alt="adeleinr" src="http://a0.twimg.com/profile_images/1115342278/me2_normal.jpg"></a>
</div>
<div id="twitter" class="span-16 last">
<ul>
{% for message in messages %}
<li class="{% cycle 'even' 'odd' %}
{% if forloop.last %}
last-row
{% endif %}
@adeleinr
adeleinr / Python-Twitter+Django.py
Created February 14, 2011 05:01
Django Python Twitter
user = 'adeleinr'
messages_to_display = 5
api = twitter.Api()
statuses = api.GetUserTimeline(screen_name=user, count=messages_to_display, include_entities=True)
messages = []
for status in statuses:
# Replaces the @username mentions with a URL
replaced_mentions = re.sub(r'(@[^ $]+)', r'<a href="http://twitter.com/\1">\1</a>',status.text);
# Replaces the #tag's with a URL
@adeleinr
adeleinr / gist:822911
Created February 11, 2011 20:03 — forked from Oshuma/gist:24803
Flush DNS Cache
Flush DNS Cache
OSX (10.5)
----------
dscacheutil -flushcache
Windows
-------
C:\>ipconfig /flushdns
@adeleinr
adeleinr / Ubuntu Cheatsheet
Created November 29, 2010 19:34
Ubuntu Cheatsheet
Hide all windows --> Ctrl + Alt + d