Welcome to Gary Han's den on the web.
This portal records Gary's everyday thoughts and notes on programming and life.
Please enjoy...

Monday, September 22, 2014 - 2:15pm

  • Monday, September 22, 2014 - 2:15pm

    We can go on and on about feature differences on Oracle and Mysql. Table locking, stored proc, recovery, transaction control blah blah blah...
    As a software user (yes, they are just regular software we use) I don't really care as long as it works and does what I need.

    So today I want to get to the point and take note of the performance differences in Oracle and Mysql.

    The key difference in Oracle over Mysql is its ability to perform fast CRUDs even under large number of threads and transactions.

Wednesday, April 9, 2014 - 11:36am

  • Wednesday, April 9, 2014 - 11:36am

    Since so many people are talking about this issue, I will join too.

    Openssl has a very simple yet dangerous flaw in the programming when they implemented the heartbeat feature.

    Heartbeat is used to keep the session alive by having client server send a request over and the hosting server sends a response back.

    But the issue with that is the request contains both the package and the package size.

    and openssl simply echos back the original package and append anything after it with whatever package size it was specified?
    REALLY? SERIOUSLY?

Tuesday, October 8, 2013 - 12:50pm

  • Tuesday, October 8, 2013 - 12:50pm

    Websphere is a pain in the butt to deal with.

    So whenever you have issues deploying a war file or any kind of issues,

    first thing to try is to clear the websphere cache! I will do the trick 99% of the time!

    to do so:

    shut down websphere server.

    /{websphereInstallPath}/IBM/WebSphere/AppServer/bin/clearClassCache.sh
    rm -rf /{websphereInstallPath}/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/*
    rm -rf /{websphereInstallPath}/IBM/WebSphere/AppServer/profiles/AppSrv01/wstemp/*
    rm -rf /{websphereInstallPath}/IBM/WebSphere/AppServer/profiles/AppSrv01/temp/*

Wednesday, August 21, 2013 - 3:43pm

  • Wednesday, August 21, 2013 - 3:43pm

    If you are putting your database to maintenance, and you want to kill off all sessions from connecting your db so you can do whatever you want with it.

    Do the follow for a quick clean up:

    STARTUP FORCE;
    ALTER SYSTEM ENABLE RESTRICTED SESSION;

    now you are free to do whatever you want with your database.

    when you are done:

    ALTER SYSTEM UNQUIESCE;

    now all other connections can start hitting your database again.

Wednesday, June 5, 2013 - 12:14pm

  • Wednesday, June 5, 2013 - 12:14pm

    simple reminder to enable ftp on server:

    yum -y install vsftpd

    vi /etc/vsftpd/vsftpd.conf

    ensure a line listen_port=21 is added to the config file,
    and remove #connect_from_port_20=YES

    vi /etc/vsftpd/ftpusers
    remove root as not allowed user

    vi /etc/vsftpd/user_list
    remove root as not allowed user

Tuesday, April 23, 2013 - 11:21am

  • Tuesday, April 23, 2013 - 11:21am

    When working with special characters we sometimes run into the issue where the string is not recognizing these characters.
    Especially when trying to parse files from one platform from another.

    I had the following line in a txt file on windows: (saved as ANSI)

    éèêë

    I had the following code that parses and replaces these characters:
    (Java file is saved as UTF-8)
    -------------------
    File file = new File("/windowsPathMappedOnLinux");
    FileInputStream fis = null;
    BufferedInputStream bis = null;
    DataInputStream dis = null;
    String fileContent = "";

Tuesday, August 9, 2011 - 5:56pm

  • Tuesday, August 9, 2011 - 5:56pm

    When you get a database dump from a server and try to import it to one another, often u will face errors like:

     DEFAULT '1753-01-01 00:00:00', "end_date" DATE DEFAULT '1753-01-01
    ORA-39083: Object type TABLE failed to create with error:
    ORA-01861: literal does not match format string

     

    This indicates that the database dump might be using a string format which is different from your server.

    To prove this, login to sqlplus, and do:

    select sysdate from dual;

    if the result is not of:

Thursday, March 3, 2011 - 11:00am

  • Thursday, March 3, 2011 - 11:00am

    Many of us might have came to the probelm where in IE or Chrome, when visiting the secure pages an alert message pops up saying that some of the content of the page is not encrypted.
    This is usually due to non-relative links on our page.
     
    i.e.:
    in: https://www.garyhan.com/secure but some how all your images and css are showing up as http.
    This is because usually when setting up a load balancer, the encryption is handled on the balancer(LB) level, then the LB transfers requests to each of your servers on http port.

Wednesday, November 3, 2010 - 4:49pm

  • Wednesday, November 3, 2010 - 4:49pm

    Just a reminder,
     
    when you have connection failures trying to connect to localhost, while everything else seems fine.
     
    First thing is try 127.0.0.1
    because sometimes the application does not know how to resolve localhost.
     
     

Thursday, October 28, 2010 - 12:41pm

  • Thursday, October 28, 2010 - 12:41pm

    This is just a reminder that when you go to a Oracle database and when u do:
    select * from table_name;
    it returns view or table not exist
     
    yet the table does exist.
     
    Please try:
     
    select * from "table_name";
     
    In Oracle, if you create a table with case sensitive (the " " around your table name) you must also reference it by " " when u run queries.
     
    if you create table table_name (without the " ")
    then you may do: