Tuesday, February 9, 2016

Get a custom GUID in Oracle

       

drop function get_custom_guid;

create function get_custom_guid
   return varchar2 is

     l_guid varchar2(36);

begin

   select substr(guid,0,8) || '-' || substr(guid, 9,4) || '-' || substr(guid, 13,4)|| '-' || substr(guid, 17,4) || '-' || substr(guid,21)<

    into l_guid from (select sys_guid() as guid from dual) ;

   return l_guid;

end;



select get_custom_guid() guid from dual;

       
 

Get external IP of a server machine in PHP




  1. $externalContent = file_get_contents('http://checkip.dyndns.com/');
    preg_match('/Current IP Address: \[?([:.0-9a-fA-F]+)\]?/', $externalContent, $m);
    $externalIp = $m[1];
    //AppleConnect Configuration
    $sugar_config['AppleConnectIpKey'] = $externalIp;  


  2.