Sunday, August 9, 2009

Vi: Search and Replace

Change to normal mode with .

Search (Wraped around at end of file):

  Search STRING forward :   / STRING.
Search STRING backward: ? STRING.

Repeat search: n
Repeat search in opposite direction: N (SHIFT-n)

Replace: Same as with sed, Replace OLD with NEW:

First occurrence on current line: :s/OLD/NEW

Globally (all) on current line: :s/OLD/NEW/g

Between two lines #,#: :#,#s/OLD/NEW/g

Every occurrence in file: :%s/OLD/NEW/g

Manually configure the Oracle 10g EM dbconsole

Overview

When you choose to create a preconfigured database during the Oracle 10g installation, you can select the Oracle Enterprise Manager (OEM) interface that you want to use to manage the database. The following options are available:

  • Database Grid Control

This option is available only if an Oracle Management Agent is installed on the system. When the Installer detects an Oracle Management Agent on the system, it allows you to choose this option and specify the Oracle Management Service that you want to use to manage the database.

If an Oracle Management Agent is not installed, you must choose to use Database Control to manage the database. However, if you install Oracle Management Agent after you install Oracle Database, you can then use Grid Control to manage this database.

  • Database Control

This option is selected by default if an Oracle Management Agent is not installed on the system. However, even if a Management Agent is installed, you can still choose to configure Database Control to manage the database.

Custom installation

If you choose the Custom installation type or the Advanced database configuration option during the installation, the Installer does not display the OEM setup screens. Instead, it runs the Database Configuration Assistant (DBCA) in interactive mode, which enables you to create a custom database.

DBCA also enables you to specify the Oracle Enterprise Manager interface that you want to use. Furthermore, you can also use DBCA after the installation to configure Database Control for a database that was not previously configured to use it.

However, if you decide to setup your own Database, you must install the Database Control manually.

Setup your own Database and manually install the Database Control

The Database Control relies on various underlying technologies to discover, monitor, and administer the Oracle Database environment.

From the Database Control, you can monitor and administer a single Oracle Database instance.

The Database Control Framework consists of the Database Control and its underlying technologies:

  • A local version of the Oracle Management Service designed to work with the local database or clustered database.
  • A local Oracle Management Repository installed in the local database and designed to store management data for the Database Control.

The following steps have to be performed.

Create your own Database

More information to setup your own Database can be found here:

Create the Database Control Repository and setup the OC4J Application Server

Make sure, that you can connect to the Repository Database (Test it with SQL*Plus). Examples for Setup Files can be found here:

Windows

Linux

LISTENER.ORA listener.ora
SQLNET.ORA sqlnet.ora
TNSNAMES.ORA tnsnames.ora

Now start the Oracle EM dbconsole Build Script ($ORACLE_HOME/bin/emca for Linux and $ORACLE_HOME\Bin\emca.bat for Windows).

$ emca -repos create
$ emca -config dbcontrol db

STARTED EMCA at Fri May 14 10:43:22 MEST 2004
Enter the following information about the database
to be configured.


Listener port number: 1521
Database SID:
AKI1
Service name:
AKI1.WORLD
Email address for notification:
martin dot zahn at akadia dot ch
Email gateway for notification:
mailhost
Password for dbsnmp:
xxxxxxx
Password for sysman:
xxxxxxx
Password for sys:
xxxxxxx

---------------------------------------------------------
You have specified the following settings

Database ORACLE_HOME: /opt/oracle/product/10.1.0
Enterprise Manager ORACLE_HOME: /opt/oracle/product/10.1.0

Database host name ..........: akira
Listener port number .........: 1521
Database SID .................: AKI1
Service name .................: AKI1
Email address for notification: martin dot zahn at akadia dot ch
Email gateway for notification: mailhost
---------------------------------------------------------
Do you wish to continue? [yes/no]: yes
AM oracle.sysman.emcp.EMConfig updateReposVars
INFO: Updating file ../config/repository.variables ...

Now wait about 10 Minutes to complete!

M oracle.sysman.emcp.EMConfig createRepository
INFO: Creating repository ...
M oracle.sysman.emcp.EMConfig perform
INFO: Repository was created successfully
M oracle.sysman.emcp.util.PortQuery findUsedPorts
INFO: Searching services file for used port
AM oracle.sysman.emcp.EMConfig getProperties
...........
...........
INFO: Starting the DBConsole ...
AM oracle.sysman.emcp.EMConfig perform
INFO: DBConsole is started successfully
INFO: >>>>>>>>>>> The Enterprise Manager URL is http://akira:5500/em <<<<<<<<<<<>

Try to connect to the database Control

http://akira:5500/em

If you look at the installed schemas, you can now find the SYSMAN schema, which is the database Control Repository.

Troubleshooting

If you have troubles to connect, check your local configuration which can be found in $ORACLE_HOME/_. For Example our DbConsole Setup Directory looks as follows:

$ pwd
/opt/oracle/product/10.1.0/akira_AKI1/sysman/config

$
ls -l
-rw-r--r-- b64InternetCertificate.txt
-rw-r--r-- emagentlogging.properties
-rw-r--r-- emd.properties
-rw-r--r-- emomsintg.xml
-rw-r--r-- emomslogging.properties
-rw-r--r-- emoms.properties
-rw-r--r-- OUIinventories.add

The most important file is emoms.properties, where you can find all the configuration parameters.

#Fri May 14 10:54:49 CEST 2004
oracle.sysman.emSDK.svlt.ConsoleServerName=
akira_Management_Service
oracle.sysman.eml.mntr.emdRepPwd=0b878f6184e8319d
emdrep.ping.pingCommand=/bin/ping
oracle.sysman.eml.mntr.emdRepPort=1521
oracle.sysman.eml.mntr.emdRepDBName=AKI1.WORLD
oracle.sysman.emSDK.svlt.ConsoleMode=standalone
oracle.sysman.emRep.dbConn.statementCacheSize=30
oracle.sysman.db.isqlplusUrl=
http\://akira\:5560/isqlplus/dynamic
oracle.sysman.emSDK.svlt.ConsoleServerPort=5500
oracle.sysman.eml.mntr.emdRepRAC=FALSE
oracle.sysman.emSDK.emd.rt.useMonitoringCred=true
oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE
oracle.sysman.db.isqlplusWebDBAUrl=
http\://akira\:5560/isqlplus/dba/dynamic
oracle.sysman.emSDK.svlt.ConsoleServerHost=akira
oracle.sysman.emSDK.svlt.ConsoleServerHTTPSPort=5500
oracle.sysman.eml.mntr.emdRepServer=akira
oracle.sysman.eml.mntr.emdRepSID=AKI1
oracle.sysman.emSDK.sec.ReuseLogonPassword=true
oracle.sysman.eml.mntr.emdRepConnectDescriptor=
(DESCRIPTION\=(ADDRESS_LIST\=
(ADDRESS\=(PROTOCOL\=TCP)(HOST\=akira)(PORT\
=1521)))(CONNECT_DATA\=(SERVICE_NAME\=AKI1)))
oracle.sysman.eml.mntr.emdRepUser=SYSMAN
oracle.sysman.db.adm.conn.statementCacheSize=2
oracle.sysman.db.perf.conn.statementCacheSize=30

Automatically start and stop the DB-Console

$ emctl start dbconsole
$ emctl stop dbconsole
$ emctl status dbconsole

Oracle Enterprise Manager 10g Database
Control Release 10.1.0.2.0
Copyright (c) 1996, 2004 Oracle Corporation.
All rights reserved.
http://akira:5500/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.
---------------------------------------------------
Logs are generated in directory
/opt/oracle/product/10.1.0/akira_AKI1/sysman/log

Saturday, August 8, 2009

Hướng Dẫn nhận thanh toán bằng Chuyển Tiền Nhanh qua Western Union?

Để nhận thanh toán bằng Chuyển Tiền Nhanh qua Western Union, vui lòng hoàn tất các bước sau:

1. Truy cập vào http://www.payment-solutions.com/agent.asp để tìm Đại lý Western Union.
2. Gọi cho Đại lý Western Union để xác nhận rằng họ có cung cấp dịch vụ Chuyển Tiền Nhanh.
3. Mang theo các thông tin sau:

- ID có ảnh hợp lệ do chính phủ phát hành (Hộ chiếu, Giấy phép Lái xe, Chứng minh thư Quốc gia, v.v…)
- thông tin của người gửi: Google Inc. 1600 Amphitheatre Parkway, Mountain View, California 94043, USA. Số Điện thoại: 650-253-4000
- số tiền thanh toán, bạn có thể tìm thấy trên trang Lịch sử Thanh toán
- số MTCN (Mã số Chuyển Tiền) duy nhất mà bạn có thể tìm thấy bằng cách nhấp vào liên kết ‘chi tiết’ bên cạnh dòng Thanh toán đã được Phát hành trên trang Lịch sử Thanh toán

Khi bạn đi đến một đại lý Western Union, vui lòng cho họ biết rằng bạn muốn nhận thanh toán bằng Chuyển Tiền Nhanh. Ngoài ra, vui lòng nhớ đến nhận thanh toán Western Union trong vòng 35 ngày kể từ ngày thanh toán, nếu không số tiền đó sẽ được ghi có trở lại tài khoản AdSense.

------------------------------------------------------------------------------
Cách 2:

Bạn ra bất cứ 1 chi nhánh hay văn phòng nào có treo bảng hiệu logo của Western Union.
Gặp nhân viên ở đó nói là tôi nhận $ WU.
Người ta sẽ đưa cho bạn 1 tờ khai thông tin, bạn cần điền đầy đủ những thông tin sau:
+ Tên người nhận + Địa chỉ: Nhận theo cách thông thường thì địa chỉ điền sao cũng được. Nhưng trường hợp của Adsense thì tốt nhất cứ khai đúng địa chỉ trong tài khoản. (+ số phone nếu có)
+ Dãy số MTCN: Bạn lấy từ trong tài khoản Adsense của mình.
+ Thông tin người gửi bạn điền đầy đủ thông tin sau: Google Inc. 1600 Amphitheatre Parkway, Mountain View, California 94043, USA.
+ Số tiền nhận: Điền số tiền payment issued.
+ Câu hỏi bảo mật: Bỏ qua trong trường hợp này.

Poll Write-In & Change Vote Hack

About this hack:
I developed this hack for my board after several polls were made by members that were short on options, especially since the poll creators are sometimes biased with the poll options. I am sure you have seen the same on your boards.

This hack allows the poll creator to allow "Write-In Votes" to a poll (single or multiple). I also added the feature to change your vote if the poll is a "write-in vote" poll, you can also allow vote changes on all polls through an admin option (ver 1.2+). This will allow a user to change their vote if they discover a better poll option written in by another user, or if they want to add one or more write-in votes to a multiple choice poll.

An admin/moderator/etc. who has permission to edit a poll can change a poll to make it a write-in poll or not. (ver 1.3+)

The cancel/change vote feature works with single and multiple choice polls.

This is my first hack but please don't let that scare you away, this is a very basic hack.

Permission Overview:


There are very few permission checks with my hack;

* If you can create a poll, you can make it a write-in vote poll.
* If you can vote on the poll, you can add a write-in vote to a write-in poll.
* If the poll is closed you cannot change your vote or add a write-in vote of course.
* You cannot add a write-in vote to a non write-in vote poll.
* If you can Edit a Poll you can remove a write-in choice.

Permission Settings:


Located in vBulletin Options "Poll and Thread Rating Options" section.

* Allow users to change their votes in ANY poll. (Default NO)
* Show the username after a write-in vote. (Default Yes)
* If NO a log entry is written to the moderator log as per a request, see pic below
* Since version 3.6.8 vBulletin has had the ability to filter by product in the moderator log so you can filter the write-in votes if you chose not to have the username displayed.

Install Info:

* Files edited: 0
* Templates edited: 3
* Files to install: 1
* Time to install: 5 minutes max

Install Procedure:

1. Install the Product (Download the XML file)

2. Edit Template polloptions_table

FIND

PHP Code - SELECT ALL
<input type="submit" class="button" value="$vbphrase[vote_now]" />
ADD ABOVE

PHP Code - SELECT ALL
condition="$pollinfo[writein]"><span style="float:$stylevar[right]"><a href="poll.php?$session[sessionurl]do=addwritein&pollid=$pollinfo[pollid]">$vbphrase[add_writein_vote]a>&nbsp;&nbsp;span>
3. Edit Template pollresults_table

FIND

PHP Code - SELECT ALL
<td class="tfoot" colspan="4" align="center"><span class="smallfont">condition="$show['multiple']">$vbphrase[multiple_choice_poll] $vbphrase[voters]: <strong>$pollinfo[numbervotes]strong>. $pollstatusspan>td>
REPLACE WITH

PHP Code - SELECT ALL
<td class="tfoot" colspan="4" align="center"><span class="smallfont">condition="$show['multiple']">$vbphrase[multiple_choice_poll] $vbphrase[voters]: <strong>$pollinfo[numbervotes]strong>. $pollstatuscondition="$vbulletin->options['allchangevote'] OR $pollinfo[writein]">condition="$uservoted AND $pollinfo[active]">&nbsp;&nbsp;<a href="poll.php?$session[sessionurl]do=changevote&pollid=$pollinfo[pollid]">$vbphrase[change_vote]a>span>td>
4. Edit Template editpoll

FIND

PHP Code - SELECT ALL
condition="$show['makeprivate']">
<
fieldset class="fieldset">
<
legend>$vbphrase[poll_options]legend>
<
table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<
tr>
<
td><label for="cb_public"><input type="checkbox" name="public" value="1" id="cb_public" tabindex="1" $pollinfo[public] />$vbphrase[make_votes_public]label>td>
tr>
table>
fieldset>

REPLACE WITH

PHP Code - SELECT ALL
<fieldset class="fieldset"><legend>$vbphrase[poll_options]legend><table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">$addwriteincondition="$show['makeprivate']"><tr> <td><label for="cb_public"><input type="checkbox" name="public" value="1" id="cb_public" tabindex="1" $pollinfo[public] />$vbphrase[make_votes_public]label>td>tr>table>fieldset>
5. Enjoy!


Attached Files
File Type: xml product-poll_write_in_vote_3.7.xml‎