Linux Disable Hardware Beep Sound For Terminal

July 8, 2009 · Posted in linux · Comment 
  • If you are using xterm, open ~/.xsession file
    $ cd
    $ vi .xession
    Append the following line:
    xset b off
    Save and close the file.
  • If you are using bash shell, open ~/.inputrc file
    $ cd
    $ vi .inputrc
    Append following line:
    set bell-style none
    Save and close the file.
  • If you want to turn off beep for VIM text editor, open vim config file ~/.vimrc
    $ cd
    $ vi .vimrc
    Append following line
    set vb
    Save and close the file.

Remove .svn folders

July 8, 2009 · Posted in linux · Comment 

In order to clean up the SVN checkout, you can do

#deletes all .svn files/folders
find . -name ".svn" -exec rm -rf {} \;

OR

#deletes all .svn folders
find . -name ".svn" -type d -exec rm -rf {} \;

Oracle connection with JDBC – JNDI

January 14, 2009 · Posted in java, oracle · Comment 
  1. Using JNDI
    javax.naming.Context context = new
    javax.naming.InitialContext();
    javax.sql.DataSource ds =  (
    javax.sql.DataSource) context.lookup("java:comp/env/jdbc/XXXJNDINAMEXXX");
    java.sql.Connection con = ds.getConnection();

TOP 25 Most Dangerous Programming Errors

January 13, 2009 · Posted in general web, linux, Windoze · 2 Comments 
  1. CWE-20:Improper Input Validation
  2. CWE-116:Improper Encoding or Escaping of Output
  3. CWE-89:Failure to Preserve SQL Query Structure
  4. CWE-79:Failure to Preserve Web Page Structure
  5. CWE-78:Failure to Preserve OS Command Structure
  6. CWE-319:Cleartext Transmission of Sensitive Information
  7. CWE-352:Cross-Site Request Forgery
  8. CWE-362:Race Condition
  9. CWE-209:Error Message Information Leak
  10. CWE-119:Failure to Constrain Operations within the Bounds of a Memory Buffer
  11. CWE-642:External Control of Critical State Data
  12. CWE-73:External Control of File Name or Path
  13. CWE-426:Untrusted Search Path
  14. CWE-94:Failure to Control Generation of Code
  15. CWE-494:Download of Code Without Integrity Check
  16. CWE-404:Improper Resource Shutdown or Release
  17. CWE-665:Improper Initialization
  18. CWE-682:Incorrect Calculation
  19. CWE-285:Improper Access Control
  20. CWE-327:Use of a Broken or Risky Cryptographic Algorithm
  21. CWE-259:Hard-Coded Password
  22. CWE-732:Insecure Permission Assignment for Critical Resource
  23. CWE-330:Use of Insufficiently Random Values
  24. CWE-250:Execution with Unnecessary Privileges
  25. CWE-602:Client-Side Enforcement of Server-Side Security

Full story

oracle XE “cannot access http://127.0.0.1:8080/apex”

December 26, 2008 · Posted in linux, oracle · Comment 

I had installed oracle XE on CentOS and was not able to connect to web admin for past two days. Finally after a long two days of search, found this.

Thanks!

Recover MySQL root password

December 26, 2008 · Posted in mysql · Comment 

You can recover MySQL database server password with following five easy steps.
Step # 1: Stop the MySQL server process.
Step # 2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password
Step # 3: Connect to mysql server as the root user
Step # 4: Setup new root password
Step # 5: Exit and restart MySQL server

Here are commands you need to type for each step (login as the root user):
Step # 1 : Stop mysql service
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld.

Step # 2: Start to MySQL server w/o password:
# mysqld_safe --skip-grant-tables &
Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to mysql server using mysql client:
# mysql -u root
Output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql>

Step # 4: Setup new MySQL root user password
mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

Step # 5: Stop MySQL Server:
# /etc/init.d/mysql stop
Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended

[1]+ Done mysqld_safe –skip-grant-tables

Step # 6: Start MySQL server and test it
# /etc/init.d/mysql start
# mysql -u root -p

original post

Oracle XE Tuning

December 4, 2008 · Posted in oracle · Comment 

In order to use Oracle XE under normal load, database sessions and processes need to be increased. This could be some as follows:

SQL> show parameters sessions
SQL> alter system set sessions=250 scope=spfile;

SQL> show parameters processes
SQL> alter system set processes=200 scope=spfile;

In case you are unable to access apex website remotely, run the following command as sys
exec dbms_xdb.setListenerLocalAccess(false);

Access parent window from modalDialog

August 15, 2008 · Posted in general web, javascript · Comment 

When you call showModalDialog() you need to pass “self”, without the quotes, as the second argument.

You can then access the parent(opener) with:
var opener = window.dialogArguments;

You can then access any function declared in parent window with:
opener.myFunction();

Resize image in PHP

July 27, 2008 · Posted in php · Comment 

Uploaded images from user can be of any size.  If you need to use these images, they need to be resized upon upload. Here is a helper class to manage resizing of the images.

Let me know if you find any bugs.

Enable register_global through .htaccess

June 17, 2008 · Posted in apache, php · Comment 

I would not recommend to enable register_globals, but if you need to enable the register_globals for a particular web folder, you can edit the .htaccess file and append the following to it

php_flag register_globals on

Restart apache and you are on your way.

« Previous PageNext Page »

  • Calendar

    May 2012
    M T W T F S S
    « Jan    
     123456
    78910111213
    14151617181920
    21222324252627
    28293031