changing passwd

Make sure the password is in /var/lib/pgsql/.pgpass

The format is as follows…

*:*:*:postgres:PASSWORD

Modify /var/lib/pgsql/data/pg_hba.conf

It should contain the following…

local all all md5
host all all 127.0.0.1 255.255.255.255 md5

Change ‘md5′ to ‘trust’ to disable authentication then restart postgres.

`/etc/init.d/postgresql restart`

Now you should be able to connect to postgresql as user ‘postgres’ without a password to modify the password.

`psql -u template1`

Run the following sql command.

“alter user postgres with password ‘NEW PASSWORD HERE’;”

Finally change /var/lib/pgsql/data/pg_hba.conf back to its original format and restart postgresql one more time. Now you should be able to authenticate using user postgres and the password you specified.

Add comment June 4, 2007

for vim user

If you use Vim, you can enable tabs to be automatically converted to four spaces so that you do not have to enter four spaces each time yourself. You can also enable smart indentation to allow automatic indentation for subsequent statements of the same block.

To enable these features, you can put the following lines in the .vimrc in your home directory:

" Indentation
set smartindent

" Tabs to 4-spaces
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab

Add comment May 26, 2007

Gentoo Experience

i wanna share some of my experience installing gentoo linux, coz failed to install successfully my LFS heheeh.. fustrating eh. Anyway, i just downloaded the live install cd at gentoo.org (600mb), typical installation.. boot from the CD, then the live CD will automatically load. What amazed me is the speed of the liveCD, as if your running the system on your HDD, anyway.. there’s two method of installation(other than the minimal CD which is LFS style installation). i choose the console based installation, follow the wizard, and puff.. after a couple of minutes, its done (chatting, surfing while installing is what im really amazed of.. u can do that on some other distro e.g. ubuntu, but u’ll experience some lagging).

after installation, i sync it, issuing the command #emerge –sync and took also a couple of minutes to sync, after syncing… i install a new kernel, download the source code, compile it, put it on my grub.. and reboot the computer, use the newly compiled kernel.

its really a worth trying.. :) though a little bit techie..

one thing, Gentoo uses Gnome as a default desktop(which i really loved)

here’s some screeny…

http://mmg007.files.wordpress.com/2007/04/screenshot.png

Add comment April 8, 2007

Java JTable

been a long time not updating my blog.. tsk tsk tsk.. heheeh but anyway.. after reading books, making some experiments, googling, i finally learn how to use Java JTable. here’s how i did it.

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import oracle.jdbc.pool.OracleDataSource;

public class myTable {

/** Creates a new instance of myTable */
public myTable() {

}

public void createTable() throws SQLException {

OracleDataSource ods = new OracleDataSource(); // create a new database connection instance
ods.setURL(url);
ods.setUser(user);
ods.setPassword(pass);
System.out.println(“Connected”); //print if the connection is susccessful
Connection conn = ods.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(“SELECT PRODUCTCODE, GENERIC, BRAND, DESCRIPTION from PRODUCT ORDER by GENERIC”);

Vector rowData = new Vector(); // this will be used as a parameter of your table

while (rs.next()) {
Vector row = new Vector();
row.addElement(rs.getString(“GENERIC”));
row.addElement(rs.getString(“BRAND”));
row.addElement(rs.getString(“DESCRIPTION”));
row.addElement(rs.getString(“PRODUCTCODE”));
rowData.addElement(row);

}

Vector columnName = new Vector();
columnName.addElement(“GENERIC”); //this is the header of the table
columnName.addElement(“BRAND”);
columnName.addElement(“DESCRIPTION”);
columnName.addElement(“PRODUCTCODE”);
JTable table = new JTable(rowData, columnName); // create the table
JScrollPane jsp = new JScrollPane(table); //create a scrollpane and add the table inside the scrollpane

JFrame myFrame = new JFrame(); //create a Frame
myFrame.add(jsp); // add the scrollpane to the frame
myFrame.setSize(800,600); //set the size of the frame
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setVisible(true); //display the table

}

public static void main(String args[]) throws SQLException {
myTable m = new myTable(); //create an instance of our myTable class
m.createTable();
}

private String url = “jdbc:oracle:thin:@//localhost:1521/database”;
private String user = “user”;
private String pass = “password”;

}

Add comment March 12, 2007

ISPConfig

finally.. i already finished my ISPConfig installation, and configurations, thank to the HOwTo’s and to the developer who gave it away…

follow this link first:

http://www.howtoforge.com/perfect_setup_ubuntu_6.06

then.. after that.. do the installations… very easy..

www.ispconfig.org

Add comment November 9, 2006

Open Sourcing Java

im very happy about this.. i just read an article from java.sun.com.. they are planning to use GPL as the license of Java :) this is cool.. Duke and Tux are going to be busy.. coding.. and having a cup of.. Java Coffee :) hehehe

Cheers

Add comment November 9, 2006

changing mysql root password

mysqladmin -u root password yournew password

#changing root password

login as root to mysql
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

3 comments November 7, 2006

installing Gnome Desktop on CentOs/RH/FC Server installation

using yum…

# yum groupinstall “X Window System” “GNOME Desktop Environment”

this should install GNOME Desktop on your System…

1 comment November 5, 2006

Found something Useful

The other day, when i was surfing the net, searching for a good API for my Java programs, in order for me to manipulate OpenOffice.org to be my Report Tool(i’ve been searching this API before), i stumbled into a website that answers my problem… http://jooreports.sourceforge.net/

I find it very useful for my Java Adventure.. even though im still learning the new Class i found.. but.. im so impressed. Thanks to the developer who made it _FREE_

If your a Java Developer(newbies).. you can try it too.. :)

Cheerz!

Add comment November 2, 2006

This is my FIRST.. BLOG… Ever… hehehehehe

Add comment November 2, 2006

Previous Posts


Meta

Blogroll

 

December 2009
M T W T F S S
« Jun    
 123456
78910111213
14151617181920
21222324252627
28293031