Content tagged as database

PostgreSQL 8.3 root login as postgres

PostgreSQL Logo

I am writing some backup scripts for a server, and I needed a way to let the root user on the machine to login to PostgreSQL as 'postgres' user to perform some administrative operations.

To do so, I had to make a few changes to the configuration file, to let the root user to authenticate via local-socket without providing a password (the script is launched automatically by cron, no user interaction needed).

/etc/postgresql/8.3/main/pg_hba.conf

1
2
# TYPE  DATABASE    USER        CIDR-ADDRESS    METHOD
local           all             postgres                                        ident rootaspg

PostgreSQL Commands Editor

PostgreSQL logo

..quante volte capita di dover usare pg_dump e pg_restore per operazioni sui database postgres ma non ricordarsi la sintassi e doverla andare a cercare?

Ecco qua un paio di scriptini php per creare automaticamente i comandi da eseguire..

In funzione qui: http://stuff.hackzine.org/utils/pgcommands/
Codice su svn: http://svn.hackzine.org/misc/utils/pgcommands/

Drupal database backup

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python
 
"""
 
    MySQL Database Backupper
    Copyright (C) 2008  Samuele ~redShadow~ Santi - http://hackzine.org
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

awstats (3) code (3) documentation (2) apt (1) development (11) camera mia (1) backup (3) como lake rovers (1) 3d (3) circuits (1) address book (2) Drupal Forms (1) dmcrypt (1) audio (1) algorythms (1) archive (1) arduino (1) bash (11) alcool (1) e-mail (2) caos (1) doku (1) blender (3) curl (1) cars (1) aircrack (1) aoe (1) 2v (1) apache (1) C++ (2) database (3) Drupal (21) debug (1) blogroll (7) cocktails (1) contact manager (1) citroen (1) debian (1) cartoons (1) cryptography (1)