<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
	<ttl>15</ttl>
	<title>TechCrammer.com</title>
	<link>http://www.techcrammer.com/</link>
	<description>Straight to the point tech blog.</description>
	<pubDate>Fri, 03 Sep 2010 08:24:03 -0400</pubDate>
	<lastBuildDate>Fri, 03 Sep 2010 08:24:03 -0400</lastBuildDate>
	<generator>www.eggblog.net</generator>
	<item>
		<title>OsCommerce or ZenCart ?</title>
		<link>http://www.techcrammer.com/news.php?id=26</link>
		<description>There are alot of open source ecommerce applications out there today. And very feature rich. So how do you decide which is for you? I beta tested a couple of the more popular choices and here are my findings.&lt;br&gt;&lt;br&gt;osCommerce has recently added a v3.0 Alpha 5 which seems to rework alot of the foundation of the application. This is a good thing since it will make templating and other options easier to add, however since the v2.2 has been around for so long there are alot of contributions written for this platform. For example, I purchased a design template and it was written for the v2.2 of the program and I could not use it for the newer version. &lt;br&gt;&lt;br&gt;ZenCart also has alot of community following with a large number of modules and add-ons. Overall I found the two very close in the amount of features that \\\\\\\&quot;can be\\\\\\\&quot;. Though ZenCart seemed to have some features already included in the base code. Such as coupon codes and discounts.&lt;br&gt;&lt;br&gt;Once item that was missing from both applications was a way to perform county (not country) based taxing. We are in the state of Ohio and each county has a different percentage of tax added on to the state tax. I had to make my own lookup code to marry this custom tax into the total price.&lt;br&gt;&lt;br&gt;Templating seems easier in the Alpha release of osCommerce, though ZenCart\\\\\\\&apos;s current release makes this very easy as well.&lt;br&gt;&lt;br&gt;Ultimately, I had to make a decision to wait for awhile until the new osCommerce version is more widely accepted or just go with ZenCart. So I decided the latter and have been happy with ZenCart so far. However, I don\\\\\\\&apos; think either decision would be right or wrong, it just comes down to a personal preference and they both have a myriad of features to offer if you have your own Linux server to host on.&lt;br&gt;&lt;br&gt;Show me the e-commerce....&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=26</guid>
		<pubDate>Wed, 09 Jun 2010 13:58:08 -0400</pubDate>
	</item>
	<item>
		<title>We are working for Microsoft, Yes YOU!</title>
		<link>http://www.techcrammer.com/news.php?id=25</link>
		<description>I use the term &quot;we&quot; loosely, though if you are the famed goto computer guy or gal then you are probably shaking your head because you know exactly what I am saying.&lt;br&gt;&lt;br&gt;OK, with friends and family it is somewhat expected that you will lend some advise or help troubleshoot a problem. Though this actually extends into the workplace and that is where I think this topic is most interesting.&lt;br&gt;&lt;br&gt;I have worked several contracting jobs, have been on small start-up teams and large corporate environments. With this said, I have been wracking my brain to think of one single instance that I (or someone on my team or even in my office) has ever called Microsoft to ask a question. Not a call, not an online chat or an email sent to the company of the most widely used OS on the market. &lt;br&gt;&lt;br&gt;I can even extend this to using not just the OS and the standard MS Office products; however, many of the development teams I worked with also used Visual Studios, Sourcesafe, SQL Server, etc... I can even recall when we first started doing a large SQL Server replication implementation and scouring the web for information on how to make this all work back in the day when this was not so popular of a concept.&lt;br&gt;&lt;br&gt;Think about all the times that you have taught someone how to use Excel and Word or those calls from your boss when he was trying to get his PowerPoint presentation going. Think about all those blue screens on your clients workstation that you spent endless hours trying to salvage data or to re-load some oddball driver. Hmmm... here is a good one, Outlook and Outlook Express I have shown countless people how to setup an account or make rules, forward, vacation... you know the drill.&lt;br&gt;&lt;br&gt;I understand there are help guides, and online knowledgebases (MSDN was great when we were using it) and I am not saying people should be quick to just call Microsoft for something that they can get from a KB. However, what software or even hardware doesn&apos;t come with a manual and information of some sort, though this doesn&apos;t stop most end-users from calling the company to assist with issues. Good customer service is part of the price right? &lt;br&gt;&lt;br&gt;I guess we expect help from the manufacturer of the hardware first, which is probably why DELL and the other computer distributors probably have to spend a bundle in customer support. I believe that the Microsoft support site even states something to the instance that your computer manufacturer is your primary source for support. So I guess I am supposed to call DELL when my Outlook mailbox is corrupt, because I have a DELL PC?&lt;br&gt;&lt;br&gt;I am sure there are better examples, and maybe I am missing the big picture. Microsoft likely has a huge support demand, though I can say it would be alot larger if it wasn&apos;t for us techies and software/hardware providers that lend a helping hand to Microsoft users.&lt;br&gt;&lt;br&gt;Maybe that is why I have really shifted into Open Soure and Linux over the years. &lt;br&gt;&lt;br&gt;Here is to all of us computer geeks providing free (or maybe just a sixpack of cold brews) tech support!&lt;br&gt;&lt;br&gt;-Allan&lt;br&gt;&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=25</guid>
		<pubDate>Thu, 22 Jan 2009 23:20:42 -0500</pubDate>
	</item>
	<item>
		<title>Is it better to turn off your computer at night?</title>
		<link>http://www.techcrammer.com/news.php?id=24</link>
		<description>My family has been trying to do more &quot;green&quot; things and this includes powering off lights when leaving rooms and turning off unused electronics. This will likely save us a little &quot;green&quot; as well. &lt;br&gt;&lt;br&gt;I come from the old school and have always heard through my geek friends that computers are best left on and turning off/on causes undue stress on components and leads to shorter life. This sounds like it could be true for things like a hard drive, since you hear it hitting the drive the hardest when starting up, though doesn&apos;t seem to make sense from an electronics standpoint since you would think the longer a component has power flowing it would have less life.&lt;br&gt;&lt;br&gt;I have some personal experience with computer failure, though the servers we use at work are much higher-end and were made for longer life to begin with. So I don&apos;t think it would be fair to compare this equipment to a low-end home computer that also typically has more unexpected turnoffs, such as power failure. We also use an industrial UPS system at work that provides very clean power to our servers which I can only guess really adds to the life of the systems.&lt;br&gt;&lt;br&gt;I ran a quick search and saw this link which appears to be responses from computer manufactures on this question. &lt;br&gt;&lt;br&gt;&lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://www.energy.unsw.edu.au/unswitch/experts.html&quot;&gt;http://www.energy.unsw.edu.au/unswitch/experts.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;I would be interested to hear what others say about this.&lt;br&gt;&lt;br&gt;Powering down (at least for now)&lt;br&gt;-Allan&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=24</guid>
		<pubDate>Sun, 11 Jan 2009 23:49:40 -0500</pubDate>
	</item>
	<item>
		<title>PuTTY to Poderosa Tabbed Display</title>
		<link>http://www.techcrammer.com/news.php?id=23</link>
		<description>&lt;P&gt;Don&apos;t get me wrong, &lt;A class=&quot;&quot; href=&quot;http://www.chiark.greenend.org.uk/~sgtatham/putty/&quot; target=&quot;&quot;&gt;PuTTY&lt;/A&gt; is great and &quot;free&quot; and I have used it for years when connecting to our co-located Linux servers from my Windows PC. Yeah, I know I should be using a Linux desktop and would probably solve all my problems. As soon as I can get everyone using OpenOffice.org then I will... But for now... I am still doing Admin work via SSH. &lt;/P&gt;
&lt;P&gt;I found myself with a bunch of PuTTY sessions always minimized on my desktop until someone told me about the &lt;A class=&quot;&quot; href=&quot;http://en.poderosa.org/&quot; target=&quot;&quot;&gt;Poderosa&lt;/A&gt; Open Source terminal emulator; similar to PuTTY, though will allow for features liked tabbed SSH sessions and even cooler vertical/horizontal split windows. This helped me alot so I thought I would share with someone else who may not know.&lt;/P&gt;
&lt;P&gt;I am running this on Windows XP and the site doesn&apos;t mention Vista, though says it runs on .NET Framework 2.0. Also your default window will be a white background, which I didn&apos;t like. All you have to do is right click and choose &quot;Edit Display Profile...&quot; Then save this as a shortcut and you are all set.&lt;/P&gt;
&lt;P&gt;-Allan&lt;/P&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=23</guid>
		<pubDate>Tue, 06 Jan 2009 13:29:37 -0500</pubDate>
	</item>
	<item>
		<title>Migrating and/or backing up your email (IMAP) account</title>
		<link>http://www.techcrammer.com/news.php?id=22</link>
		<description>When I worked for a customer support help desk one of the requests I would get was &quot;Please provide me a backup of my email files&quot;. Either they just wanted to free up space through archiving, or to migrate to another email server completely.&lt;BR&gt;&lt;BR&gt;It was hard to explain that if I just gave you a &quot;backup&quot; of the files, say for instance in a &quot;tar&quot; format, that you probably wouldn&apos;t be able to do much with these. IMAP has its own internal database for flags (seen, unsen, dates, etc) so unless you were just looking at more of a disaster recovery plan, I would not recommend just tar&apos;ing the files and preferably doing an IMAP level synchronisation.&lt;BR&gt;&lt;BR&gt;Nowadays our email providers give us gigabytes of storage, though it still may happen that you find yourself wanting to migrate years worth of messages and folders from your current IMAP account to a different provider. &lt;BR&gt;&lt;BR&gt;There are an assortment of ways and software to do this, though I have personally used a Perl based script called plainly enough &lt;SPAN style=&quot;FONT-WEIGHT: bold&quot;&gt;IMAPSYNC&lt;/SPAN&gt; to do the work for quite awhile. The link below is to the Open Source site at Freshmeat where you can download it.&lt;BR&gt;&lt;BR&gt;&lt;SPAN style=&quot;FONT-WEIGHT: bold&quot;&gt;&lt;/SPAN&gt;&lt;A class=&quot;&quot; href=&quot;http://freshmeat.net/projects/imapsync/&quot; target=&quot;&quot; name=&quot;&quot; classname=&quot;&quot;&gt;http://freshmeat.net/projects/imapsync/&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;After installing, you can simply run your process from the command line. There are alot of options, though for a basic run, you will need to know a few things; such as the old/new IMAP server and the old/new passwords. Below is a sample I would run within the same network. If going outside you may want to enable the secure  methods.&lt;BR&gt;&lt;BR&gt;&lt;SPAN style=&quot;FONT-WEIGHT: bold; FONT-STYLE: italic&quot;&gt;imapsync --noauthmd5 --subscribe --syncinternaldates --host1 imap1.domain.com --user1 username1 --password1 &apos;password1&apos; --host2 imap2.domain.com --user2 username2 --password2 &apos;password2&apos;&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;There is a verbose output which shows processes along the way. I have used this to transfer mailboxes from an old system to a new one with around 100GB in a weekend. The first time it runs it will obviously pull all files, the when you run again it will &quot;synch&quot; them. Think of how you already use &quot;rsync&quot; with your regular files. Though with this process you keep all your message flags (seen, unseen, dates, etc) and looks just like your old mailbox.&lt;BR&gt;&lt;BR&gt;Anyway there are probably alot of these scripts out there, though I know this one worked well for us and being written in Perl was great it we ever needed to understand what it does underneath the hood, though never had to update anything.&lt;BR&gt;&lt;BR&gt;&quot;Synch&quot; On,&lt;BR&gt;Allan&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=22</guid>
		<pubDate>Mon, 05 Jan 2009 14:25:04 -0500</pubDate>
	</item>
	<item>
		<title>From Digg to Reddit and finally landed in Dzone</title>
		<link>http://www.techcrammer.com/news.php?id=21</link>
		<description>I am a self admitted amateur blogger... as in writing articles... though have been trolling &lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://slashdot.org&quot;&gt;Slashdot&lt;/a&gt; for many years and more recently over in Digg as well. Back in October I started this blog, &lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://techcrammer.com&quot;&gt;TechCrammer.com&lt;/a&gt;, just because I wanted a place to start putting down some of my experiences and perhaps build some meaningful discussions. I am always open to feedback and have been around long enough to realize there is always a better way to do something and you need to be open minded to find it.&lt;br&gt;&lt;br&gt;I was pretty good about adding my articles to &lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://digg.com&quot;&gt;Digg&lt;/a&gt; and after really being on Digg more frequently lately I see there is alot of discussion about change. I had thought (or more truly hoped) that my articles may get a few looks here and there from a community of fellow techies, though I seemed to be a little lost out there still and nobody was finding me. &lt;br&gt;&lt;br&gt;This means one of two things, that it was truly just too difficult to find me... a needle in a haystack... or my articles just stink? I feel like I put some real thought into most of the articles to have at least some decent, unique content. The other night I posted a very short article about the Linux &quot;watch&quot; command that I thought might be a good FYI tool to put in your back pocket. Nothing special so I didn&apos;t expect much, but that got the most exposure with 3 Diggs pretty quickly. Hmmm...&lt;br&gt;&lt;br&gt;So, I haven&apos;t ruled out my articles totally stinking yet, though I really was surprised this little one did better than the others? &lt;br&gt;&lt;br&gt;I had heard alot of people that like Digg were also using &lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://reddit.com&quot;&gt;Reddit&lt;/a&gt; (or vice versa) so I decided to give that a shot. I was quite pleased and it took me a little time, though I kind of like the simple layout of Reddit and it has grown on me. I haven&apos;t had alot of time on Reddit as of yet and just made some comments and posted most of my 10 articles over there. Still not too much of a grumbling on my content.&lt;br&gt;&lt;br&gt;OK, so last night I saw an article mentioning some other top spots for bloggers to submit and read information. As the name implies, my blog is catering more to the technical crowd, and one of the sites that jumped out to me on the list was called &lt;a name=&quot;&quot; target=&quot;&quot; classname=&quot;&quot; class=&quot;&quot; href=&quot;http://www.dzone.com&quot;&gt;Dzone.com&lt;/a&gt;. So last night I posted a couple of my articles over on Dzone and went to bed.&lt;br&gt;&lt;br&gt;I got into work today and the morning was really busy since we had New Years day off. However, when I finally got some time to look out on Dzone, I was completely amazed that not only had others looked at my articles, some had voted (good) and even commented on one of them! I proceeded to put some more of my articles (links) out there and have been really happy with the response from this community so far. &lt;br&gt;&lt;br&gt;I am trying to stay active at Dzone and have made some comments on others posts and have seen some great content there. Anyway, I definitely will spend some more time out on Dzone this weekend and hope this helps any other tech bloggers trying to find themselves out there!&lt;br&gt;&lt;br&gt;Cheers to Dzone,&lt;br&gt;-Allan&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=21</guid>
		<pubDate>Fri, 02 Jan 2009 23:13:30 -0500</pubDate>
	</item>
	<item>
		<title>Anyone still creating new apps in COBOL?</title>
		<link>http://www.techcrammer.com/news.php?id=20</link>
		<description>OK, it has been a long time since I have dug into some COBOL code and honestly, even then, I was only in training to do some routine maintenance and never  really had the initiative to create a full blown application. So lets just leave it that I am not an expert in any manner with COBOL. So why am I writing about it? &lt;br&gt;&lt;br&gt;Well for two reasons: The first being that I do find the language fascinating and kind of wonder why it is considered a dinosaur by most programmers I meet? I may have kept up with COBOL, but honestly it is a very niche programming field and I think have more exposure to Web related languages (Perl/ASP/PHP/CSS/JavaScript) allowed more doors to open for occupational choices.&lt;br&gt;&lt;br&gt;The second reason is that I am working with a company that has, over the past few years, been updating some segments of hardware/software and one of those was a legacy COBOL application that used a very slick (for its time) environment called ICHOST from a company called Envyr Corporation. Let me add that I am not affiliated with this company in anyway, though certainly appreciate their product. From their website it looks like the ICHOST platform (running on DOS) was discontinued back in 1997, though they have a new ICOBOL platform which has some fantastic features which I am going to get into.&lt;br&gt;&lt;br&gt;To get back to the migration to our new software, I guess I was kind of shocked when the developer told me the new application was also written in COBOL, which obviously explains why we are now also using an upgraded COBOL environment. I would have assumed it was just re-written in .NET or at least a Visual Basic application, so it took me awhile for this to sink in. I thought to myself, &quot;So on these newly acquired servers that we just spent thousands of dollars for, we are going to run this COBOL application?&quot; which just seemed odd at first.&lt;br&gt;&lt;br&gt;The developer which created the software we are using, was kind enough to fly down and speak more to us about his new application and also the new ICOBOL platform he was coding on, and I really got excited. The new environment allows me to get rid of my old &quot;dumb terminals&quot; and I can interface through a small runtime on any of my regular workstations. Also a quick comment, it is also supposed to run on Linux (yet another plus in my book) though we currently have it all in Windows.&lt;br&gt;&lt;br&gt;This also means that I don&apos;t need all those serial cables running everywhere, just my regular network. There is an add-on module (cgiCOBOL) that allows the developer to pass information to a CGI script and comes up in my IIS webserver. I am not sure how all this works and is just magic to me, though the developer said its pretty easy to code for. And the even better news is that you can get ODBC access into those COBOL database structures. So if you had an external ASP or PHP program you can get into the COBOL database through this driver.&lt;br&gt;&lt;br&gt;Some of the original cool features I remember from the older version are still there such as the print spooler and menu modification; and I am sure there are alot of new underlying code hooks that have been added to aid in programming. I don&apos;t have access to the source code of our application from our software vendor. Though it would be nice to write some sample code to just get a feel for it. I think he said you have to buy a separate developers license from Envyr as well.&lt;br&gt;&lt;br&gt;The other really nice feature is that you can use a graphical or text interface. Believe it or not, many people I work with prefer the nice clean, and fast, text interface.&lt;br&gt;&lt;br&gt;There are different pricing structures for the licensing of the enviroment and then we had to purchase the application that was written for us, using this platform. Though I think it was well worth it and a very stable platform from what we have experienced with our application.&lt;br&gt;&lt;br&gt;Long live COBOL!&lt;br&gt;&lt;br&gt;-Allan&lt;br&gt;&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=20</guid>
		<pubDate>Wed, 31 Dec 2008 02:14:27 -0500</pubDate>
	</item>
	<item>
		<title>Simple Load Monitor script (no database)</title>
		<link>http://www.techcrammer.com/news.php?id=19</link>
		<description>I created this simple little load monitor script over four years ago. Since then we have used &lt;a href=&quot;http://www.zabbix.com&quot;&gt;Zabbix&lt;/a&gt; and now a much more complex home brew monitor that also utilizes outside alerts from 3rd parties, such as &lt;a href=&quot;http://alertra.com&quot;&gt;Alertra&lt;/a&gt;. My objective was that I wanted to be able to check the loads of all of our Linux servers at any location with a browser. I had a bash script that I used with &lt;a href=&quot;18.html&quot;&gt;watch&lt;/a&gt; through a secure shell session, though I wanted this Web based (shouldn&apos;t everything be in a browser?). Of course you can adapt this concept to do much more, such as grabbing disk space usage, and this example is really just a quick hack.&lt;br&gt;&lt;br&gt;So with that in mind please use this at your own risk with NO WARRANTY provided. Also be aware this is not be the most security conscious script out there. At the very least keep the PHP files under a &lt;i&gt;.htaccess&lt;/i&gt; password protected directory, though also keep in mind reading/writing files can be dangerous and use this with caution or better yet fix any security flaws you see and post back and I can update for everyone. I stripped out some comments and other information that was specific to the site it was hosted on.&lt;br&gt;&lt;br&gt;We use two PHP files, reader.php and writer.php, and one bash script. We use a client/server type concept between the bash script sending out data, to the writer.php file accepting it. The reader.php is just for looking at the data collected.&lt;br&gt;&lt;br&gt;&lt;b&gt;writer.php&lt;/b&gt;&lt;br&gt;&lt;pre&gt;&lt;?&lt;br&gt;// List of valid server names&lt;br&gt;$server_list = &quot;server1,server2,server3&quot;;&lt;br&gt;&lt;br&gt;// Extra security precaution&lt;br&gt;if (strstr($server_list, $server)) {&lt;br&gt;&lt;br&gt;    // Querystring server name and .cfg&lt;br&gt;    $file = $server.&apos;.cfg&apos;;&lt;br&gt;&lt;br&gt;    // Write the new process load&lt;br&gt;    $fd = fopen($file, &quot;w&quot;);&lt;br&gt;    fwrite($fd, $load);&lt;br&gt;}&lt;br&gt;?&gt; &lt;/pre&gt;&lt;br&gt;You don&apos;t really need a list of server names though this gives me some more piece of mind from a security standpoint. The writer.php takes the querystring variables &quot;server&quot; and &quot;load&quot;. It creates a new file using the name of the server and adds a &quot;.cfg&quot; suffix and then inputs the load into the file as the only data. This seems a little odd and could be combined into one file, though if I was going to do that it might as well go into a database.&lt;br&gt;&lt;br&gt;&lt;b&gt;reader.php&lt;/b&gt;&lt;br&gt;&lt;pre&gt; &lt;?&lt;br&gt;// Header&lt;br&gt;echo &quot;&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;LoadMon&lt;/TITLE&gt;&quot;;&lt;br&gt;echo &quot;&lt;META HTTP-EQUIV=&apos;refresh&apos; content=&apos;25;URL=https://yoursite.com/protected/loadmon/reader.php&apos;&gt;&quot;;&lt;br&gt;echo &quot;&lt;/HEAD&gt;&lt;BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0&gt;&quot;;&lt;br&gt;echo &quot;&lt;font size=-2&gt;Current Time: &quot;.date(&quot;H:i:s&quot;).&quot;&lt;/font&gt;&quot;;&lt;br&gt;echo &quot;&lt;font size=-2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A HREF=&apos;https://yoursite.com/protected/loadmon/reader.php&apos;&gt;Refresh&lt;/A&gt;&lt;/font&gt;&quot;;&lt;br&gt;echo &quot;&lt;TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0&gt;&quot;;&lt;br&gt;&lt;br&gt;// Define the full path to the loadmon folder&lt;br&gt;$path = &quot;/www/path/loadmon/&quot;;&lt;br&gt;&lt;br&gt;// Open the folder&lt;br&gt;$dir_handle = @opendir($path) or die(&quot;Unable to open $path&quot;);&lt;br&gt;&lt;br&gt;// Loop through the files&lt;br&gt;while (false !== ($file = readdir($dir_handle))) {&lt;br&gt;&lt;br&gt;    // Prevent this file itself being shown&lt;br&gt;    if(substr($file,-3) != &quot;cfg&quot;)&lt;br&gt;    continue;&lt;br&gt;&lt;br&gt;    // Display the results&lt;br&gt;   $fd = fopen($file, &quot;r&quot;);&lt;br&gt;   $fstring = fread($fd, filesize($file));&lt;br&gt;&lt;br&gt;   echo &quot;&lt;TR&gt;&lt;TD BGCOLOR=#CCFFFF&gt;&lt;FONT SIZE=-2&gt;&quot;.str_replace(&quot;.cfg&quot;, &quot;&quot;, $file).&quot;&lt;/FONT&gt;&lt;/TD&gt;&quot;;&lt;br&gt;   echo &quot;&lt;TD BGCOLOR=#CCFFFF&gt;&lt;FONT SIZE=-2&gt;&quot;.$fstring.&quot;&lt;/FONT&gt;&lt;/TD&gt;&quot;;&lt;br&gt;   echo &quot;&lt;TD BGCOLOR=#FFFFFF&gt;&lt;FONT SIZE=-2&gt;&quot;.date(&quot;d/m/y H:i:s&quot;,filemtime($file)).&quot;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&quot;;&lt;br&gt;}&lt;br&gt;&lt;br&gt;// Close it&lt;br&gt;closedir($dir_handle);&lt;br&gt;&lt;br&gt;// Footer&lt;br&gt;echo &quot;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;&quot;;&lt;br&gt;?&gt;&lt;/pre&gt; &lt;br&gt;&lt;br&gt;The &quot;reader.php&quot; is the display part of the code and uses a meta refresh which you can adjust as you like. I use a link from another page to make it open in a small window with no toolbar. Something like the following:&lt;br&gt;&lt;pre&gt;&lt;span class=&quot;popup&quot; onClick=javascript:window.open(&quot;http://yoursite.com/protected/loadmon/reader.php&quot;, &quot;blank&quot;,&quot;toolbar=no,width=200,height=250&quot;)&gt;Load Monitor&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;Its job is to recurse through the directory and open the .cfg files and display the content. By all means you could be creative here and turn the string into an integer and show as red if it was a load higher than expected. A nice feature here is that it gives you the date of the file so you can be sure the script is getting new data.&lt;br&gt;&lt;br&gt;&lt;b&gt;loadmon.bash&lt;/b&gt;&lt;br&gt;&lt;pre&gt;#!/bin/bash&lt;br&gt;myserver=&quot;server1&quot;&lt;br&gt;myload=`cat /proc/loadavg |cut -f1 -d&apos; &apos;`&lt;br&gt;&lt;br&gt;curl --silent -u &quot;user:password&quot; -m 5 &quot;https://yoursite.com/protected/loadmon/writer.php?load=$myload&amp;server=$myserver&quot; -o /dev/null &lt;/pre&gt;&lt;br&gt;The last file is a bash script &quot;loadmon.bash&quot; that you need to place on each server that will report its load to you. It takes the current load from the proc directory (probably a better way to do this) and then uses curl to send it out to the writer.php file. I am using &lt;i&gt;.htaccess&lt;/i&gt; and have to specify the user and password. I remember this being a pain figuring this out though need the &quot;--silent&quot; option to get it to work, though was awhile back and may have changed. The &quot;-m&quot; option just gives it a timeout and is not mandatory.&lt;br&gt;&lt;br&gt;Of course you need a way to make this script happen and I just made a file in my &lt;i&gt;/etc/cron.d&lt;/i&gt; directory &lt;i&gt;/etc/cron.d/loadmon&lt;/i&gt; that runs the script every 5 minutes.&lt;br&gt;&lt;pre&gt;#Custom Load Monitoring&lt;br&gt;*/5 * * * * root /path/loadmon.bash&lt;/pre&gt;&lt;br&gt;You can run as often as you like. I just didn&apos;t want all the servers reporting too quickly that I am hitting the web server so much all at the same time. &lt;br&gt;&lt;br&gt;I realize this is just a rough concept, though I do hope you at least you may get some ideas for a launch pad to create your own custom load monitor.&lt;br&gt;&lt;br&gt;-Allan&lt;br&gt;&lt;br&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=19</guid>
		<pubDate>Tue, 30 Dec 2008 00:01:57 -0500</pubDate>
	</item>
	<item>
		<title>The watch command (Linux)</title>
		<link>http://www.techcrammer.com/news.php?id=18</link>
		<description>For many of you *nix (Linux and Unix) gurus may have already been using the &quot;watch&quot; program. Though I when I first saw someone else using it and asked if I could get the code for what I thought was a shell script he created. He said &quot;Dude! You never used watch, look at the man pages!&quot;. Of course I ran a &quot;man watch&quot; immediately to see the different arguments and options.&lt;br&gt;&lt;br&gt;Basically, it just runs a program and sleeps and runs the program again displaying to the screen. For instance &quot;watch -n 5 ls&quot; will run the &quot;ls&quot; command showing your directory listing every five seconds.&lt;br&gt;&lt;br&gt;Anyway, something basic to use though handy at times.&lt;br&gt;&lt;br&gt;How about we hear some of those other handy programs/scripts you use out there?&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Allan</description>
		<guid>http://www.techcrammer.com/news.php?id=18</guid>
		<pubDate>Sun, 28 Dec 2008 22:07:41 -0500</pubDate>
	</item>
	<item>
		<title>Reading from Serial Ports</title>
		<link>http://www.techcrammer.com/news.php?id=17</link>
		<description>&lt;P&gt;The &quot;old&quot; style serial ports (DB9 or DB25) do not seem to be included with many of the newer computers; mostly just a bunch of USB ports. However, if you are like me, you still have the need to interface legacy systems such as Timeclocks, PBX systems, Caller ID, UPS and other equipment. &lt;/P&gt;
&lt;P&gt;I was happy to see that when I opened up one of our servers here at work to do some maintenance, that I saw there was a place on the motherboard where I could attach a ribbon cable (special trip to MicroCenter) for a native DB9 port. &lt;/P&gt;
&lt;P&gt;From my personal experience the USB to Serial converters may not always play nice with some. We have 4 different legacy hardware devices and use two different USB-Serial adapters since one may work for one device, but not the other. I bought one of the more expensive ones just to see if this makes a difference and found that one of the cheapest ones I bought was the only to work on this particular device. (I guess in this case it isn&apos;t &quot;You get what you pay for.&quot;) Very odd, and when you unplug them and put them back they may change COM ports in your Operating System which creates trouble for the emulation software we use.&lt;/P&gt;
&lt;P&gt;I have recently started using some of the Moxa (PCI multi-port serial expander) products which have worked pretty well for us and about the most cost effective solutions I could find without a bunch of USB to Serial adapters.&lt;/P&gt;
&lt;P&gt;I have used Open Source Python code in both Windows and Linux to send and receive serial data. I have used two different Python modules to accomplish this, both with equal success. I used to use the &lt;A class=&quot;&quot; href=&quot;http://pyserial.wiki.sourceforge.net/pySerial&quot; target=&quot;&quot;&gt;PySerial&lt;/A&gt; module, though have recently started using the &lt;A class=&quot;&quot; href=&quot;http://ibarona.googlepages.com/uspp&quot; target=&quot;&quot;&gt;USPP&lt;/A&gt; (Universal Serial Port Python) library just because I can take the files and include the code, versus installing a module; however they both worked well for what I was doing.&lt;/P&gt;
&lt;P&gt;Below is some Python code that I use at its simplest form. Just taking data from a &lt;A class=&quot;&quot; href=&quot;http://callerid.com/&quot; target=&quot;&quot;&gt;Whozz Calling&lt;/A&gt; caller-id system and logging it to a flat file. I have been meaning to insert this into a SQL database to allow for Adhoc queries, though for now I just tail the file or do a grep or pattern search for what I am looking for. Easy stuff!&lt;/P&gt;
&lt;pre&gt;&lt;P&gt;&lt;EM&gt;#!/usr/bin/python&lt;BR&gt;from uspp import *&lt;BR&gt;import time&lt;BR&gt;import sys&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;tty0 = SerialPort(&quot;/dev/ttyS0&quot;,0,9600)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;#OPEN FILE HANDLE&lt;BR&gt;FH = open(&quot;/var/log/caller-id.log&quot;, &apos;a&apos;)&lt;BR&gt;#print &quot;Starting Process...&quot;&lt;BR&gt;FH.write(&quot;Starting Process...\n&quot;)&lt;BR&gt;FH.flush()&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;while 1:&lt;BR&gt;        count0 = int(tty0.inWaiting())&lt;BR&gt;        if count0 &gt; 0:&lt;BR&gt;                mychar0 = tty0.read(count0)&lt;BR&gt;                FH.write(mychar0)&lt;BR&gt;                FH.flush()&lt;BR&gt;        else:&lt;BR&gt;                time.sleep(3)&lt;/EM&gt;&lt;/P&gt;&lt;/pre&gt;
&lt;P&gt;So, after including the USPP package, you simply open up the serial port at the baud rate you need. I open a file handle and loop through the data continuously. I also have a short sleep(3) just to make sure the load doesn&apos;t get crazy. The only odd thing that took me a few hours to final figure out, was I needed the &quot;flush&quot; statement which I hadn&apos;t used with PySerial.&lt;/P&gt;
&lt;P&gt;You won&apos;t believe it, though it is running on an old Pentium II with 64MB or memory and a 4GB hard drive. Can&apos;t remember the exact distro, running uname -a shows &quot;Linux debian 2.6.18-6-486&quot;. I don&apos;t think it has been rebooted or had issues for at least 6 months and counting.&lt;/P&gt;
&lt;P&gt;I use very similar code on my laptop running Windows XP to to intercept data that is destined for a dot matrix serial printer. Just a little fancier and allows you to change baud rates and output files on the fly. If anyone wants that code I will post&lt;BR&gt;it also.&lt;/P&gt;
&lt;P&gt;Happy Serial Sniffing,&lt;BR&gt;-Allan&lt;/P&gt;</description>
		<guid>http://www.techcrammer.com/news.php?id=17</guid>
		<pubDate>Fri, 05 Dec 2008 14:35:03 -0500</pubDate>
	</item>
</channel>
</rss>