PostgreSQL

25 07 2008

This post is about postgresql commands and other stuffs about it. It will updated when I update it. :) )

Change PosgreSQL postgres user password

sudo -u postgres psql postgres
postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD 'a';
ALTER ROLE
postgres=# \q

Create a database with a user that have full rights on the database:

sudo -u postgres createuser -D -A -P myuser
sudo -u postgres createdb -O myuser mydb




Export Database Of Oracle XE 10.x On Ubuntu Linux

22 07 2008
oracle@bianca:~$ export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/
oracle@bianca:~$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/exp angelina@bianca

Export: Release 10.2.0.1.0 - Production on Wed Jul 23 04:47:59 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Password:

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Enter array fetch buffer size: 4096 >

Export file: expdat.dmp > alectra-dev-20080723.dmp

(1)E(ntire database), (2)U(sers), or (3)T(ables): (2)U >

Export grants (yes/no): yes > no

Export table data (yes/no): yes >

Compress extents (yes/no): yes >

Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
Note: grants on tables/views/sequences/roles will not be exported

About to export specified users ...
User to be exported: (RETURN to quit) > alectra

User to be exported: (RETURN to quit) >

. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user ALECTRA
...




Implementing SOAP Server on CakePHP

23 01 2008

My key concept is: create the SOAP server in the Controller and the methods in the Model. Why? Because controller is … (read this) and model is this.

As an example here we gonna make web service for Post of a Blog (see Blog Tutorial) using native SOAP in PHP version 5.

We’ll put the SOAP handler at URL: http://yourhost/posts/service and the WSDL (which is will be used by the SOAP consumer) at URL: http://yourhost/posts/wsdl.

  1. Create table Post (see the Blog Tutorial for details).
  2. Create Post model (models/post.php) as usual.
  3. Create Post controller (controllers/posts_controller.php), see bellow. You need RequestHandler component for create XML-type response on wsdl action.
  4. Create view for action “wsdl” (views/posts/wsdl.ctp) and define your service method in it. You can publish all of methods in Post model including from its parent (AppModel), eg. findById(), find(), findAll(), etc. Note: you should turning off “short_open_tag” in php.ini to avoid error on rendering the xml of wsdl view. And don’t forget to define your service address in the WSDL to http://yourhost/posts/service.
  5. Now your service consumer could consume your service by pointing to your WSDL URL (http://yourhost/posts/wsdl).

Here are the sample codes: Read the rest of this entry »





Disable AutoRun in Ms. Windows

23 01 2008

Via group policy:

  1. Go to Start > Run
  2. Type gpedit.msc & press Enter. You should see the Group Policy window.
  3. In the left-hand column, select Computer Configuration > Administrative Templates > System
  4. Next, look in the right-hand column for “Turn off Autoplay”, and double-click on that.
  5. Next, in the “Turn Off Autoplay Properties” window, select “Enabled”
  6. Then choose “All drives” from the dropdown menu in “Turn off Autoplay on:”
  7. Click OK.




How To Create Multiple Blog at WordPress.com

29 06 2007

Read this page, wrote by Matt (founder of wordpress.com):

http://wordpress.com/blog/2006/04/05/unlimited-blogs/








Follow

Get every new post delivered to your Inbox.