<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7657691563693584696</id><updated>2012-02-16T20:39:15.820-05:00</updated><category term='Coding'/><category term='PHP'/><category term='Tomcat'/><category term='MySQL apache'/><category term='Apache'/><category term='MySQL'/><category term='Linux Ubuntu Java'/><category term='Linux'/><title type='text'>Idiot Savant Geek</title><subtitle type='html'>A general dumping ground of random code and thoughts from a sysadmin/hacker of 15 years.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.hacktek.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-2050897032934296541</id><published>2010-05-19T10:32:00.000-04:00</published><updated>2010-05-19T10:32:14.013-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Apache Permanent Redirect</title><content type='html'>VirtualHost *&gt;&lt;br /&gt; ServerAdmin email@somedomain.com&lt;br /&gt; ServerName somedomain.net&lt;br /&gt; ServerAlias www.somedomain.net&lt;br /&gt;&lt;br /&gt; Redirect permanent / http://www.somedomain.com/&lt;br /&gt;&lt;br /&gt;  /VirtualHost&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-2050897032934296541?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/2050897032934296541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/apache-permanent-redirect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/2050897032934296541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/2050897032934296541'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/apache-permanent-redirect.html' title='Apache Permanent Redirect'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-5560904328021914913</id><published>2010-05-13T14:30:00.003-04:00</published><updated>2010-05-14T12:11:19.022-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>PHP Sockets Loop</title><content type='html'>$i=0;&lt;br /&gt;&lt;br /&gt;$jsonPing = "{\"c\":\"ping\",\"d\":{}}\0";&lt;br /&gt;&lt;br /&gt;while (1) {&lt;br /&gt;&lt;br /&gt;$i++;&lt;br /&gt;&lt;br /&gt;if($i == 1000) {&lt;br /&gt;        fwrite($socket,$jsonPing);&lt;br /&gt;        $i=0;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;$data =  "";&lt;br /&gt;$data .= @fread($socket, 4096);&lt;br /&gt;$data = str_replace("\x1f", " ", $data);&lt;br /&gt;$data = str_replace("part", " part", $data);&lt;br /&gt;$data = str_replace("join", " join", $data);&lt;br /&gt;$data = str_replace("said", " said: ", $data);&lt;br /&gt;$data = trim($data);&lt;br /&gt;&lt;br /&gt;$jsonData = json_decode($data,true);&lt;br /&gt;&lt;br /&gt;if ($jsonData['from'] == "ayt") {&lt;br /&gt;        $data="";&lt;br /&gt;        flush();&lt;br /&gt;&lt;br /&gt;}else{&lt;br /&gt;        if( ($jsonData['u']) &amp;&amp; ($jsonData['t']) &amp;&amp; (strpos($data, "said")) ) {&lt;br /&gt;        echo $jsonData['u']." : ".str_replace($jsonData['u'], "", $jsonData['t'])."&lt;br&gt;\n";&lt;br /&gt;        flush();&lt;br /&gt;        ob_flush(); }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}}&lt;br /&gt;&lt;br /&gt;fclose($socket);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-5560904328021914913?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/5560904328021914913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/php-sockets-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5560904328021914913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5560904328021914913'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/php-sockets-loop.html' title='PHP Sockets Loop'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-1929785351438244790</id><published>2010-05-10T17:34:00.000-04:00</published><updated>2010-05-10T17:34:52.811-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Check to see which server is which (XML output)</title><content type='html'>header("Content-type: text/xml");&lt;br /&gt;&lt;br /&gt;$getBeta = `/usr/bin/dig beta.sampledomain.com A +short`;&lt;br /&gt;$getBeta = trim($getBeta);&lt;br /&gt;&lt;br /&gt;$amIBeta = $_SERVER[SERVER_ADDR];&lt;br /&gt;$amIBeta = trim($amIBeta);&lt;br /&gt;&lt;br /&gt;if ($getBeta == $amIBeta) {&lt;br /&gt;        $IAmBeta = "true";&lt;br /&gt;}else{&lt;br /&gt;        $IAmBeta = "false"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-1929785351438244790?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/1929785351438244790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/check-to-see-which-server-is-which-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1929785351438244790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1929785351438244790'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/check-to-see-which-server-is-which-xml.html' title='Check to see which server is which (XML output)'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-9167750258620928445</id><published>2010-05-10T10:26:00.001-04:00</published><updated>2010-05-10T17:35:24.858-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>header.php</title><content type='html'>Quick header file to use include or require with in PHP:&lt;br /&gt;&lt;br /&gt;$mysql_user="mysqluser";&lt;br /&gt;$mysql_host="mysql.sample.com";&lt;br /&gt;$mysql_db="mydb";&lt;br /&gt;$mysql_pass = "mysqlpassword";&lt;br /&gt;&lt;br /&gt;mysql_connect($mysql_host,$mysql_user,$mysql_pass);&lt;br /&gt;@mysql_select_db($mysql_db) or die("Unable to connect to database...");&lt;br /&gt;&lt;br /&gt;foreach ($_REQUEST as $key =&gt; $value) {&lt;br /&gt;$_REQUEST[$key] = mysql_real_escape_string($value);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-9167750258620928445?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/9167750258620928445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/headerphp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/9167750258620928445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/9167750258620928445'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/headerphp.html' title='header.php'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-6429281663973290511</id><published>2010-05-06T16:46:00.000-04:00</published><updated>2010-05-06T16:46:15.199-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>XInetD config</title><content type='html'>Just a quickie so I don't have to go dig it up again...&lt;br /&gt;&lt;br /&gt;insert a new file under /etc/xinetd.d/ (under Ubuntu, anyway):&lt;br /&gt;&lt;br /&gt;# default: on&lt;br /&gt;# description: xinetd service to emulate Flash Remoting banner&lt;br /&gt;#&lt;br /&gt;service dummy&lt;br /&gt;{&lt;br /&gt;        disable         = no&lt;br /&gt;        type            = UNLISTED&lt;br /&gt;        id              = dummy&lt;br /&gt;        socket_type     = stream&lt;br /&gt;        protocol        = tcp&lt;br /&gt;        user            = root&lt;br /&gt;        server          = /usr/local/bin/dumbdumbdumbdumbdumb&lt;br /&gt;        wait            = no&lt;br /&gt;        port            = 843&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;contents of /usr/local/bin/dumbdumbdumbdumbdumb:&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;echo "Oh, fiddlesticks..."&lt;br /&gt;&lt;br /&gt;exit 0&lt;br /&gt;&lt;br /&gt;Make sure /usr/local/bin/dumbdumbdumbdumbdumb is +x&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-6429281663973290511?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/6429281663973290511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/xinetd-config.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6429281663973290511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6429281663973290511'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/xinetd-config.html' title='XInetD config'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-3302337618179048240</id><published>2010-05-06T16:07:00.001-04:00</published><updated>2010-05-06T16:55:37.981-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><title type='text'>Tomcat setup to only listen on localhost (for use with Apache Mod_Proxy)</title><content type='html'>server.xml changes:&lt;br /&gt;&lt;br /&gt;&lt; Connector port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443"&lt;br&gt;&lt;br /&gt;               address="127.0.0.1"/ &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note the "address" section....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-3302337618179048240?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/3302337618179048240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/tomcat-setup-to-only-listen-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/3302337618179048240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/3302337618179048240'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/tomcat-setup-to-only-listen-on.html' title='Tomcat setup to only listen on localhost (for use with Apache Mod_Proxy)'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-9032428952029424044</id><published>2010-05-06T15:59:00.000-04:00</published><updated>2010-05-06T15:59:00.947-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>httpd.conf for mod_auth_mysql</title><content type='html'>Auth_MySQL_Info                 MySQL.Server username password&lt;br /&gt;Auth_MySQL_General_DB           DB with auth info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-9032428952029424044?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/9032428952029424044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/httpdconf-for-modauthmysql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/9032428952029424044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/9032428952029424044'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/httpdconf-for-modauthmysql.html' title='httpd.conf for mod_auth_mysql'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-433108022052171139</id><published>2010-05-06T15:54:00.001-04:00</published><updated>2010-05-06T15:56:39.400-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache'/><title type='text'>Getting Mod_Proxy to bounce to Tomcat (FINALLY)</title><content type='html'>This particular problem has been plaguing me for months.&amp;nbsp; How to make HTTPD proxy to a Tomcat instance.&amp;nbsp; Finally got it figured out.&amp;nbsp; BONUS:&amp;nbsp; Also configured it to authenticate via MySQL before proxying the connection.&amp;nbsp; This is using a self-signed SSL cert.&lt;br /&gt;&lt;br /&gt;NameVirtualHost zookeeper.mydomain.com:443&lt;br /&gt;&amp;lt; VirtualHost zookeeper.mydomain.com:443 &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServerAdmin gene@mydomain.com&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSLEngine On&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSLCertificateFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /etc/apache2/ssl/server.crt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSLCertificateKeyFile&amp;nbsp;&amp;nbsp; /etc/apache2/ssl/server.key&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ProxyRequests Off&lt;br /&gt;ProxyPreserveHost On&lt;br /&gt;&lt;br /&gt;&amp;lt; Proxy * &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Order deny,allow&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow from all&lt;br /&gt;&amp;lt; /Proxy &amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProxyPass / http://127.0.0.1:8080/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProxyPassReverse / http://127.0.0.1:8080/&lt;br /&gt;&lt;br /&gt;&amp;lt; Location &amp;gt;&lt;br /&gt;AuthName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Level 4 Staff Tools Login"&lt;br /&gt;AuthType&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Basic&lt;br /&gt;AuthUserFile&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /dev/null&lt;br /&gt;AuthBasicAuthoritative&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Off&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Auth_MySQL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On&lt;br /&gt;Auth_MySQL_Password_Table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; users&lt;br /&gt;Auth_Mysql_Group_Table&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; staffGroups&lt;br /&gt;&lt;br /&gt;Auth_MySQL_Username_Field&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; userName&lt;br /&gt;Auth_MySQL_Password_Field&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password&lt;br /&gt;Auth_MySQL_Group_Field&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; groups&lt;br /&gt;Auth_MySQL_Empty_Passwords&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Off&lt;br /&gt;Auth_MySQL_Encryption_Types&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Plaintext Crypt_DES MySQL&lt;br /&gt;&lt;br /&gt;require&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group engineering art&lt;br /&gt;&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Order allow,deny&lt;br /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow from all&lt;br /&gt;&amp;lt; /Location &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ErrorLog /var/log/apache2/error.log&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-433108022052171139?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/433108022052171139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/getting-modproxy-to-bounce-to-tomcat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/433108022052171139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/433108022052171139'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/getting-modproxy-to-bounce-to-tomcat.html' title='Getting Mod_Proxy to bounce to Tomcat (FINALLY)'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-1494182057312337209</id><published>2010-05-05T18:02:00.002-04:00</published><updated>2010-05-05T18:07:40.173-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Post Vars as an Array</title><content type='html'>$result_storeList=mysql_query('SELECT * FROM stores');&lt;br /&gt;&lt;br /&gt;while($arrayStoreName=mysql_fetch_array($result_storeList)) {&lt;br /&gt;echo "".$arrayStoreName['name']."(put html checkbox here with $arrayStoreName['ID']).(other HTML here)\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Submit that to:&lt;br /&gt;&lt;br /&gt;$getStore = "SELECT * from stores";&lt;br /&gt;$getStoreQuery = mysql_query($getStore);&lt;br /&gt;while($getStoreArray = mysql_fetch_array($getStoreQuery)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $totalStoreNum = $getStoreArray['ID'];&lt;br /&gt;&lt;br /&gt;if(htmlspecialchars($_POST[$getStoreArray['ID']])) {&lt;br /&gt;&lt;br /&gt;$storeChoice = $getStoreArray['ID'];&lt;br /&gt;&lt;br /&gt;$sql_Query = "INSERT INTO storeItems (storeID,itemID) VALUES ('".$storeChoice."','".$recordID."')";&lt;br /&gt;&lt;br /&gt;mysql_query($sql_Query); }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-1494182057312337209?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/1494182057312337209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/post-vars-as-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1494182057312337209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1494182057312337209'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/post-vars-as-array.html' title='Post Vars as an Array'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-5629374501151767509</id><published>2010-05-05T14:36:00.000-04:00</published><updated>2010-05-05T14:36:47.103-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>File Uploading</title><content type='html'>// Where the file is going to be placed&lt;br /&gt;$target_path = "/tmp/";&lt;br /&gt;&lt;br /&gt;/* Add the original filename to our target path.&lt;br /&gt;Result is "uploads/filename.extension" */&lt;br /&gt;$target_path = $target_path . basename( $_FILES['itemUpload']['name']);&lt;br /&gt;&lt;br /&gt;if(move_uploaded_file($_FILES['itemUpload']['tmp_name'], $target_path)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "The file ".&amp;nbsp; basename( $_FILES['itemUpload']['name']).&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; " has been uploaded&lt;br /&gt;\n";&lt;br /&gt;} else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "There was an error uploading the file, please try again!";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$localFile = "/tmp/".basename( $_FILES['itemUpload']['name']);&lt;br /&gt;&lt;br /&gt;$remoteFile = "/var/www/push/".basename( $_FILES['itemUpload']['name']);&lt;br /&gt;&lt;br /&gt;$scp_connection = ssh2_connect('remotehost',22);&lt;br /&gt;ssh2_auth_password($scp_connection, 'username', 'password');&lt;br /&gt;&lt;br /&gt;ssh2_scp_send($scp_connection, $localFile, $remoteFile , 0664);&lt;br /&gt;&lt;br /&gt;Upload a file via HTTP, then SCP it to another server.&amp;nbsp; Been using the hell out of this so I can "sanitize" what files get uploaded to the production server (and force them to push it to Dev first).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-5629374501151767509?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/5629374501151767509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/05/file-uploading.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5629374501151767509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5629374501151767509'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/05/file-uploading.html' title='File Uploading'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-4598072883447020002</id><published>2010-04-28T11:53:00.001-04:00</published><updated>2010-05-06T16:09:01.760-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>PHP Authentication Vars</title><content type='html'>Just a quick one for me to remember:&lt;br /&gt;&lt;br /&gt;$_SERVER['PHP_AUTH_USER']&lt;br /&gt;$_SERVER['PHP_AUTH_PW']&lt;br /&gt;&lt;br /&gt;Get current auth info.&amp;nbsp; Going to be using this in later code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-4598072883447020002?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/4598072883447020002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/php-authentication-vars.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4598072883447020002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4598072883447020002'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/php-authentication-vars.html' title='PHP Authentication Vars'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-4915286652279924430</id><published>2010-04-28T11:51:00.001-04:00</published><updated>2010-05-05T14:33:19.431-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Coding'/><title type='text'>PHP and JSON</title><content type='html'>PHP's json_decode function works well, unless, of course, you get the JSON from a socket server and forget to trim it.&amp;nbsp; This kicked my butt for a while yesterday.&lt;br /&gt;&lt;br /&gt;Another important one to remember is var_dump (which kept showing up as NULL with json_decode before I started trimming the input).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-4915286652279924430?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/4915286652279924430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/php-and-json.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4915286652279924430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4915286652279924430'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/php-and-json.html' title='PHP and JSON'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-7777138869159223739</id><published>2010-04-19T17:16:00.001-04:00</published><updated>2010-04-19T17:17:36.128-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Something to do with a PHP Directory Listing (Make it an HTML Option on another server)</title><content type='html'>$fp = fopen('http://whereever/whoever.php','r');&lt;br /&gt;&lt;br /&gt;$content = '';&lt;br /&gt;&lt;br /&gt;while($line = fgets($fp,4096)) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $content = $line;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "\n".$content."\n\n"; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-7777138869159223739?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/7777138869159223739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/something-to-do-with-php-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/7777138869159223739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/7777138869159223739'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/something-to-do-with-php-directory.html' title='Something to do with a PHP Directory Listing (Make it an HTML Option on another server)'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-5627012045680525821</id><published>2010-04-19T17:14:00.003-04:00</published><updated>2010-04-19T17:18:00.325-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Quickie PHP Directory Listing</title><content type='html'>$path = ".";&lt;br /&gt;&lt;br /&gt;$dir_handle = @opendir($path) or die("Cannot open directory");&lt;br /&gt;&lt;br /&gt;while ($file = readdir($dir_handle)) {&lt;br /&gt;&lt;br /&gt;if (($file == ".") || ($file == "..") || ($file == "dropdown.php") || ($file == ".svn") || ($file == "old")) {&lt;br /&gt;&lt;br /&gt;}else{&lt;br /&gt;echo $file."\n"; }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-5627012045680525821?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/5627012045680525821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/quickie-php-directory-listing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5627012045680525821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/5627012045680525821'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/quickie-php-directory-listing.html' title='Quickie PHP Directory Listing'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-8219281396378681808</id><published>2010-04-08T17:14:00.001-04:00</published><updated>2010-04-08T17:15:53.464-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Quickie PHP Socket connection</title><content type='html'>$config = array(&lt;br /&gt;&lt;br /&gt;'server' =&amp;gt; 'serverName',&lt;br /&gt;'port' =&amp;gt; 'portNo' );&lt;br /&gt;&lt;br /&gt;$socket = fsockopen($config['server'], $config['port'], $errno, $errstr);&lt;br /&gt;&lt;br /&gt;if(!$socket) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; die("Error on page: ".$errno." ".$errstr); }&lt;br /&gt;//uncomment below if stream blocking is needed. &lt;br /&gt;//stream_set_blocking($socket, 1);&lt;br /&gt;$data .= fread($socket, 4096);&lt;br /&gt;&lt;br /&gt;echo $data."\n";&lt;br /&gt;&lt;br /&gt;fclose($socket);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-8219281396378681808?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/8219281396378681808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/quickie-php-socket-connection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/8219281396378681808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/8219281396378681808'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/quickie-php-socket-connection.html' title='Quickie PHP Socket connection'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-6181220781082397469</id><published>2010-04-06T16:10:00.000-04:00</published><updated>2010-04-06T16:10:22.630-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL apache'/><title type='text'>Apache MySQL Auth</title><content type='html'>.htaccess File:&lt;br /&gt;&lt;br /&gt;AuthName&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; "Title of Auth Popup"&lt;br /&gt;AuthType&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Basic&lt;br /&gt;AuthUserFile&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /dev/null&lt;br /&gt;AuthBasicAuthoritative&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Off&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Auth_MySQL&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; On&lt;br /&gt;Auth_MySQL_Password_Table&amp;nbsp;&amp;nbsp;&amp;nbsp; userTable&lt;br /&gt;Auth_Mysql_Group_Table&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; userGroups&lt;br /&gt;&lt;br /&gt;Auth_MySQL_Username_Field&amp;nbsp;&amp;nbsp;&amp;nbsp; userName&lt;br /&gt;Auth_MySQL_Password_Field&amp;nbsp;&amp;nbsp;&amp;nbsp; password&lt;br /&gt;Auth_MySQL_Group_Field&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; groups&lt;br /&gt;Auth_MySQL_Empty_Passwords&amp;nbsp;&amp;nbsp;&amp;nbsp; Off&lt;br /&gt;Auth_MySQL_Encryption_Types&amp;nbsp;&amp;nbsp;&amp;nbsp; Plaintext Crypt_DES MySQL&lt;br /&gt;&lt;br /&gt;require&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; group groupName(s)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-6181220781082397469?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/6181220781082397469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/apache-mysql-auth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6181220781082397469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6181220781082397469'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/apache-mysql-auth.html' title='Apache MySQL Auth'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-6010449676815208895</id><published>2010-04-06T13:34:00.002-04:00</published><updated>2010-04-07T16:03:08.681-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Just a MySQL statement I need to remember</title><content type='html'>select count(distinct userName) from userTracking where timeStamp &amp;gt;= '2010-03-30' AND status LIKE '%Logged into $%';&lt;br /&gt;&lt;br /&gt;counts unique userNames from userTracking between March 30th 2010 and now and looks for "Logged into $" in the status field.&lt;br /&gt;&lt;br /&gt;and even better:&lt;br /&gt;&lt;br /&gt;SELECT COUNT(DISTINCT userName) FROM userTracking WHERE timeStamp &amp;gt;= DATE(NOW()) - INTERVAL 11 DAY + INTERVAL 10 HOUR AND timeStamp &amp;lt;= DATE(NOW()) - INTERVAL 0 DAY + INTERVAL 10 HOUR AND status LIKE '%Logged into $%';&lt;br /&gt;&lt;br /&gt;between 11 days ago at 10am and today at 10am.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-6010449676815208895?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/6010449676815208895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/just-mysql-statement-i-need-to-remember.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6010449676815208895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/6010449676815208895'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/just-mysql-statement-i-need-to-remember.html' title='Just a MySQL statement I need to remember'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-2218488370912351950</id><published>2010-04-06T11:19:00.002-04:00</published><updated>2010-04-06T13:52:39.864-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Delete MySQL Records Older Than *BLAH*</title><content type='html'>DELETE FROM tableName WHERE columnName &amp;lt; DATE_SUB(NOW(), INTERVAL 14 DAY);&lt;br /&gt;&lt;br /&gt;DAY&lt;br /&gt;WEEK&lt;br /&gt;MONTH&lt;br /&gt;&lt;br /&gt;etc.&lt;br /&gt;&lt;br /&gt;Thanks to:&lt;br /&gt;http://benperove.com/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-2218488370912351950?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/2218488370912351950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/delete-mysql-records-older-than-blah.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/2218488370912351950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/2218488370912351950'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/delete-mysql-records-older-than-blah.html' title='Delete MySQL Records Older Than *BLAH*'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-1038132659903950249</id><published>2010-04-05T14:50:00.001-04:00</published><updated>2010-04-06T13:37:08.108-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux Ubuntu Java'/><title type='text'>My Reason to Despise Java</title><content type='html'>I understand it's a great language.  Portable, (supposedly) easy to write.  Also takes up a TON of file handlers on Linux.  Quick fix below:&lt;br /&gt;&lt;br /&gt;/etc/pam.d/common-session&lt;br /&gt;ADD:  session required            pam_limits.so&lt;br /&gt;&lt;br /&gt;/etc/sysctl.conf&lt;br /&gt;ADD:  fs.file-max = 1137875&lt;br /&gt;then RUN:  sysctl -p&lt;br /&gt;&lt;br /&gt;/etc/security/limits.conf&lt;br /&gt;ADD:&lt;br /&gt;* soft nofile 131070&lt;br /&gt;* hard nofile 131070&lt;br /&gt;* soft nproc 25000&lt;br /&gt;* hard nproc 65000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(This is for Ubuntu, and MY settings....yours may be different).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-1038132659903950249?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/1038132659903950249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/my-reason-to-despise-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1038132659903950249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/1038132659903950249'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/my-reason-to-despise-java.html' title='My Reason to Despise Java'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-4792745678747190346</id><published>2010-04-02T14:01:00.001-04:00</published><updated>2010-04-02T14:09:46.676-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='Coding'/><title type='text'>PHP Code for XML</title><content type='html'>At my current job I'm writing a lot of PHP scripts to take the load off of our programmers and pass that load to our art dept.  Much of the data gets passed as static XML files, which I'm converting to dynamic XML from MySQL via PHP, using the following code:&lt;br /&gt;&lt;br /&gt;?php&lt;br /&gt;&lt;br /&gt;//The big one to make PHP spit it out as XML&lt;br /&gt;&lt;br /&gt;header("Content-type: text/xml");&lt;br /&gt;&lt;br /&gt;$mysql_user="dbUser";&lt;br /&gt;$mysql_pass="dbPass";&lt;br /&gt;$mysql_host="dbHost";&lt;br /&gt;$mysql_db="dbDB";&lt;br /&gt;mysql_connect($mysql_host,$mysql_user,$mysql_pass);&lt;br /&gt;&lt;br /&gt;mysql_select_db($mysql_db);&lt;br /&gt;&lt;br /&gt;$sql_query="SELECT * FROM configTable";&lt;br /&gt;&lt;br /&gt;$sql_result=mysql_query($sql_query);&lt;appsettings\n";&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Not the cleanest code, I know, but it works.&lt;/appsettings\n";&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-4792745678747190346?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/4792745678747190346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/php-code-for-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4792745678747190346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/4792745678747190346'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/php-code-for-xml.html' title='PHP Code for XML'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7657691563693584696.post-8484803024572304030</id><published>2010-04-02T11:59:00.000-04:00</published><updated>2010-04-02T13:12:12.240-04:00</updated><title type='text'>FIRST POST!!!!</title><content type='html'>This blog is essentially a dumping ground for programming and thought snippets that I consider useful or entertaining.  I want a central area that I can come to when I run into a problem I've solved before, but can't remember how I did it (easily done with 15+ years in tech).  If you're reading these, I hope they help you as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7657691563693584696-8484803024572304030?l=blog.hacktek.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.hacktek.com/feeds/8484803024572304030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.hacktek.com/2010/04/first-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/8484803024572304030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7657691563693584696/posts/default/8484803024572304030'/><link rel='alternate' type='text/html' href='http://blog.hacktek.com/2010/04/first-post.html' title='FIRST POST!!!!'/><author><name>Gene Cronk</name><uri>http://www.blogger.com/profile/01328897536991624520</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
