Wednesday, December 26, 2007

the gizmos grabowski solution to stuck print jobs

http://worldcadaccess.typepad.com/gizmos/2006/09/tip_plugged_up_.html

works like a charm if you have a lot of print jobs and need to delete them quickly. be sure to use a command terminal when deleting or windows explorer will take forever to delete them.

Wednesday, December 19, 2007

Debugging tcp connection problems

Super cool article on debugging tcp problems on unix boxen.

http://prefetch.net/blog/index.php/2006/04/17/debugging-tcp-connections-with-tcptrace/

Wednesday, December 12, 2007

subversion install / requirements

1. The apache portable runtime libraries (apr and apr-util)
http://apr.apache.org/download.cgi

Installs by default to usr/local/apr


2. Download expat
http://sourceforge.net/projects/expat/

3. Download subversion from http://subversion.tigris.org

Use the following command, assuming above default installs in step 1 and 2:
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
make
make install

Tuesday, December 11, 2007

openbsd / too many open files /erro no 24

OpenBSD has a default open file descriptor limit of 64. As such, many of my web apps had been quitting on the "too many open files" error (error 24). To fix this, use the following steps:

1. Edit /etc/login.conf and make sure the openfile limit is set to a larger number than it currently is.

2. Use ulimit -n to set the maximum number of open files. To see current limit, use "ulimit -a".

Thursday, July 26, 2007

Creating ethernet aliases in Suse 9/10

This link says it all.

http://blog.tiensivu.com/aaron/archives/397-The-correct-way-to-add-IP-aliases-multiple-IPs-on-one-device-in-SuSe-Linux-10-and-below.html

Friday, July 06, 2007

Hardware Information from your linux box

use these commands:

# sysctl hw
# sysctl kern
# dmesg

Tuesday, July 03, 2007

Setting Date and Time Information on Linux

Kewl link

http://www.linuxsa.org.au/tips/time.html

Changing object/folder permissions on the fly, using runas

Here is a tip to get access to that folder without have to log off and log back in as somebody with admin privs.

Use runas to get to the command prompt:
runas /user:Administrator "cmd.exe"

In the privileged command prompt, use the below command for folder "xyz", granting user "thisuser" full access:
cacls xyz /E /G thisuser:F

For more info, read the man page for cacls.

Tuesday, May 08, 2007

Adding some content to the freshly created php page in KnowledgeTree DMS (KTDMS Series 2)

Carrying forward from the same example as described in series 1, you would obviously want to define and output some data out of the php page you created. In this series we will use the dispatcher and templating classes provided by Knowledgetree to output some simple data out of this page.

Pages in knowledge tree are created by extending the KTStandardDispatcher class. For every custom class you create, it should have at least one method "do_main" which is the first of your methods that gets called automatically when a web user tries to access this page. Additional methods can be defined in the format "do_" that can be called conditionally based on the http request variable "action" (HTTP POST/GET vars). For example, you can define a method "do_createnewrecord" and call the php page with a http request variable "action" of value "createnewrecord", and the page will then automatically look for and execute the "do_createnewrecord" method defined in the page class.

Assuming you are already well familiar with the plugins/pages/actions... concepts in ktdms, the following example creates a page plugin class called "MyTrainingRecords", by extending the KTStandardDispatcher class. KTDMS uses the smarty templating system, so I created a test template file called test.smarty that simply outputs a Hello World message. The do_main method calls some of the default variables defined in the KTStandardDispatcher class to instantiate the template and render its output.

//all required includes defined in series 1, plus
require_once KT_LIB_DIR . '/dispatcher.inc.php';

class MyTrainingRecords extends KTStandardDispatcher {
function MyTrainingRecords()
{
//lets add a breadcrumb detail for this page ;optional
$this->aBreadCrumbs = array(
array('action'=>'mytrainingrecords', 'name'=>_kt("My Traininig Records")),
);
return parent::KTStandardDispatcher();
}

function do_main()
{
$oTemplate =& $this->oValidator->validateTemplate('ktabr/test');
$this->oPage->setTitle('My Training Records Page');
return $oTemplate->render();
}
}

$oDispatcher = new MyTrainingRecords();
$oDispatcher->dispatch();

For a plugin page to be meaningful, its class has to be instantiated and dispatched by the dispatcher (by explicitly calling the dispatch method), which is what the last few lines of the above code do.

The below screenshot shows the output of the newly created php page, along with the breadcrumb detail as defined.

Friday, May 04, 2007

Creating and linking a fresh php page in KnowledgeTree DMS (KTDMS Series 1)

Creating a new php page and linking it on the main page (alongside the dashboard, browse and dms administration hyperlinks) involves several steps described below:




- Create a fresh new php page and make sure you include the following essential includes:

require_once 'config/dmsDefaults.php';
require_once KT_LIB_DIR . '/templating/templating.inc.php';
require_once KT_LIB_DIR . '/templating/kt3template.inc.php';
require_once KT_LIB_DIR . '/dispatcher.inc.php';
require_once KT_LIB_DIR . '/util/ktutil.php';

Let's say the new php page you created is "mytrainingrecords.php" and you want to link the action "mytrainingrecords" to this page. Go into the kt3template.inc.php file and scroll across until you come across the "initMenu" function. Populate the $this->menu array to include the following array item:
"mytrainingrecords" => $this->_actionHelper(array("name"=>_kt("My Training Records"), "action"=>"mytrainingrecords", "active"=>0))

That adds up the additional link on the main horizontal menubar alongside the dashboard and browse links. When somebody clicks on this link, the KTDMS will use the controller page (control.php) to figure out what page to call and it does that by following the mapping defined in the siteMap.php (located in the config directory). Open up the siteMap.php page and add the following php line anywhere:

$default->siteMap->addPage("mytrainingrecords", "/mytrainingrecords.php", "My Training Records", Guest, "mytrainingrecords");


That is pretty much it.

Monday, January 15, 2007

PHP Pear / Date Functions / Time Zone Conversions

Pretty good tutorial on using the Date class of the PEAR library to do various date manipulations:

http://articles.techrepublic.com.com/5100-3513_11-6122735.html

About Me

My photo
Princeton, New Jersey, United States
I am an Information Technology Analyst with extensive background in the Clinical Industry that includes working for CROs, Pharmaceutical and Medical Diagnostic companies.