This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$subject = $_SERVER['HTTP_ORIGIN']; | |
$subdomain1 = 'www'; | |
$subdomain2 = 'www1'; | |
$pattern = '/http(s)?:\/\/('.$subdomain1.'\.)?('.$subdomain2.'\.)?(example.com)$/'; | |
$regexResult = preg_match($pattern, $subject); | |
if($regexResult) | |
{ | |
header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']); | |
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--DROP TABLE PHP_DAVE1.MYTABLE; | |
CREATE OR REPLACE TABLE PHP_DAVE1.MYTABLE | |
( | |
NAME VARCHAR(150), | |
PRIMARY KEY( NAME ) | |
); | |
INSERT INTO PHP_DAVE1.MYTABLE (NAME) VALUES ('JOE SCHMOE'); | |
SELECT * FROM PHP_DAVE1.MYTABLE; | |
--Attempting to add journaling so that that NetBeans will not mark the table as read only? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In terminal | |
ssh -L 23470:localhost:3470 [email protected] | |
#in JDBC setup using JTOpen driver | |
jdbc:as400://spaces.litmis.com;proxy server=localhost:23470 | |
#jtopen driver: http://jt400.sourceforge.net/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In terminal (makes the ssh tunnel from local port 23470 to server port 3470) | |
My-Machine:~ phpdave$ssh -L 23470:localhost:3470 [email protected] | |
#::NOTE:: We connect to 3470 because the documentation says "If the Toolbox's Proxy Server feature is selected, and is enabled on the IBM i (iSeries or AS/400), only port 3470 is needed." | |
#in JDBC setup using JTOpen driver | |
jdbc:as400://spaces.litmis.com;proxy server=localhost:23470 | |
#jtopen driver: http://jt400.sourceforge.net/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In terminal | |
ssh -L 23470:localhost:3470 [email protected] | |
#in JDBC setup using JTOpen driver | |
jdbc:as400://spaces.litmis.com;proxy server=localhost:23470 | |
#jtopen driver: http://jt400.sourceforge.net/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$myFloat = (float)0.0; | |
for($i=0;$i<25000;$i++) | |
{ | |
$myFloat += 10000.10; | |
} | |
var_dump($myFloat); // float(250002499.9999) | |
//Try the BCMath Arbitrary Precision Mathematics extension | |
<?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get latest ibm_db2 php extension tarbal (can't use wget for https, using curl and ignoring ssl [we don't need this data encrypted]) | |
#and installs it to /usr/local/phpdave7/lib/php/extensions/no-debug-non-zts-20160303/ibm_db2.so | |
#note depending on how PHP is configured on your system their will be either be a debug build or Zend Thread Safety (ZTS) builds of the extension | |
#$PREFIX/lib/php/extensions/no-debug-non-zts-API_NO for release builds without ZTS | |
#$PREFIX/lib/php/extensions/debug-non-zts-API_NO for debug builds without ZTS | |
#$PREFIX/lib/php/extensions/no-debug-zts-API_NO for release builds with ZTS | |
#$PREFIX/lib/php/extensions/debug-zts-API_NO for debug builds with ZTS | |
joe /usr/local/phpdave7/lib/php.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#some things we may need: | |
wget http://www.oss4aix.org/download/RPMS/zlib/zlib-devel-1.2.8-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv zlib-devel-1.2.8-1.aix5.1.ppc.rpm | |
#nginx: [emerg] using regex "\.php$" requires PCRE library in /usr/local/nginx/conf/nginx.conf:72 | |
wget http://www.oss4aix.org/download/RPMS/pcre/pcre-8.35-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv pcre-8.35-1.aix5.1.ppc.rpm | |
wget http://www.oss4aix.org/download/RPMS/pcre/pcre-devel-8.35-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv pcre-devel-8.35-1.aix5.1.ppc.rpm | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#some things we may need: | |
wget http://www.oss4aix.org/download/RPMS/zlib/zlib-devel-1.2.8-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv zlib-devel-1.2.8-1.aix5.1.ppc.rpm | |
#nginx: [emerg] using regex "\.php$" requires PCRE library in /usr/local/nginx/conf/nginx.conf:72 | |
wget http://www.oss4aix.org/download/RPMS/pcre/pcre-8.35-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv pcre-8.35-1.aix5.1.ppc.rpm | |
wget http://www.oss4aix.org/download/RPMS/pcre/pcre-devel-8.35-1.aix5.1.ppc.rpm | |
rpm --ignoreos --ignorearch --nodeps --replacepkgs -hUv pcre-devel-8.35-1.aix5.1.ppc.rpm | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#DISCLAIMER: this is currently is a draft and is not meant to be used yet. Many things that I'm looking to clean up and simplify. There may be things that don't work so only do this on a development system that you aren't worried about it being fubar'd | |
#Download PHP source code and change directories to the downloaded src. This is a dev version of PHP. git.php.net is official. http://www.github.com/php/php-src is mirror | |
git clone http://git.php.net/repository/php-src.git && cd php-src | |
#Alternative get a certain branch (version), the default is the master branch which is development | |
#git clone -b PHP-5.6.7 http://git.php.net/repository/php-src.git | |
#specific to litmis space not having the includes on a fresh container | |
#local | |
scp qopensys-usr-include.tar.gz [email protected]:~ |