Thursday, January 17, 2013

psql: FATAL: Ident authentication failed for user "username"

$ psql -d database -U username -W
psql: FATAL: Ident authentication failed for user "username"

fix
 # vi /var/lib/pgsql/data/pg_hba.conf
This file contains the hosts allowed to connect, clients  authenticatation, database users to use, which databases can be accessed

By default postgresql uses IDENT-based authentication. IDENT will never allow you to login via -U and -W options.
So append following lines to allow login from localhost :
 
local all all trust
host all 127.0.0.1/32 trust

esc -> wq -> enter

# service postgresql restart

$ psql -d database -U username -W
 now you can able to connect

Subversion backup and restore

Instruction

svnadmin dump repo and scp to other machine Do this for each repository you have.
$ svnadmin dump /path/to/reponame > /tmp/reponame.dump ; scp -rp /tmp/reponame.dump user@server.domain.com:/tmp/
On other machine install subversion
$ yum install subversion
Create the corresponding repositories. Do this for each repository you have.
$ svnadmin create /path/to/reponame
Load svn dump into new repo on new machine. Do this for each repository you have.
$svnadmin load /path/to/reponame < /tmp/repo1.dump
Setting Permissions.. This is the most common mistake when moving an svn repo. Do this for each repository you have.
chown -R svn:svnusers /path/to/reponame ; chmod -R g+w /path/to/reponame/db/

check your ENV like:
 bash-2.05b# env 
check where the svnserve binary is located:
 # which svnserve
/usr/local/bin/svnserve
ok our wrapper is going to have to fall in PATH prior to this location.. /sbin is a good place seeing its our 1st exec path on the system as root.
create wrapper:
touch /sbin/svnserve ; chmod 755 /sbin/svnserve 
now edit it to look like so:
 bash-2.05b# cat /sbin/svnserve 
#!/bin/sh
# wrapper script for svnserve
umask 007
/usr/local/bin/svnserve -r /path/to "$@"

You do not need to do: :/path/to/reponame.... this is the big trick here folks.
Start svnserve with new wrapper script like so:
$ /sbin/svnserve -d  ( start daemon mode )

To show hidden devices in device manager (windows)

Add a system variable in environment variables.

mycomputer-> properties->advanced-> environment variables -> system variables.

Variable name: devmgr_show_nonpresent_devices
variable value: 1

Device manager -> view -> show hidden devices
then you are able to see some hidden devices , uninstall the devices which are like hidden