|
If you ever compile Nagios successfully on Solaris 10 (trust me, it’s a beast to get working properly), beware if you get the following errors: [Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] ld.so.1: histogram.cgi: fatal : libgd.so.2: open failed: No such file or directory, referer: https://nagiostest.domain.tld/nagios/side.html [Tue Jul 01 18:15:37 2008] [error] [client 192.168.0.100] Premature end of script heade rs: histogram.cgi, referer: https://nagiostest.domain.tld/nagios/side.html [Tue Jul 01 18:16:03 2008] [error] [client 192.168.0.100] ld.so.1: statusmap.cgi: fatal : libgd.so.2: open failed: No such file or directory, referer: https://nagiostest.domain.tld/nagios/cgi-bin/status.cgi?hostgroup=all&style=grid [Tue Jul 01 18:16:03 2008] [error] [client 192.168.0.100] Premature end of script heade rs: statusmap.cgi, referer: https://nagiostest.domain.tld/nagios/cgi-bin/status.cgi?hostg roup=all&style=grid I’ve been getting our Solaris environment setup in the College of Architecture, and one of the things I quickly realized with zones is that I’m going to need to setup LDAP to have any sort of efficient way of managing user accounts. Once this was setup, I quickly realized the need for NFS to be setup and thought that it’d be fairly straight-forward to setup (like it is on Linux). This turned out to not be the case. A friend of mine passed over the following blog entry, which I found quite to my liking. J.P. Boodhoo (a leader in the .Net development community) has found some plugins and tools which enable vim in certain applications in Windows. Those being:
Check out the article. It’s awesome. I remembered when I first started doing systems administration. One of the first (and simplest) things I had to do was learn how to generate a self-signed SSL certificate because I didn’t want to pay for one. Well, since my first time doing it, I’ve done the process about 2^18 times now, so it’s second nature to me. But, to some folks who don’t want to read the lengthy explanation on what each step does, here’s a breakdown of what commands you’ll issue on a Linux server. Explanation about the steps will follow.
And you’re done. Now, if you had a Certificate Authority key and certificate and wanted to sign your new certificate request with that, instead of self signing it, you’d issue the following final command: #> openssl x509 -req -CAkey cakey.key -CA cacert.crt -in host.domain.tld.csr -out host.domain.tld.crt -set_serial <serial number> -days <# of days this cert is valid> Click read more below to get the explanation of how this works. Howdy all, I made a post below relating to PHP, and the caching engine is not deleting the cache, so the post is showing up with < and > characters as literals, thus showing text boxes and other things that’s supposed to be straight code. Give it about 24 hours, and if it isn’t fixed, I’ll look into what’s causing the problems. Update (3/28/2008): I thought it was a problem with wpsupercache, but in fact it wasn’t. It was a problem with the Wordpress plugin Google Code Prettify and/or something internal to Wordpress. I say this because my code snippets, which originally had < and > characters inline were rendering the HTML as literal HTML - not what I wanted. But when I figured that I’d change the snippets to use < and > instead, it _still_ got rendered as literal < and > characters. Weird - no? Well, check out the most previous post prior to this, and I’ll (hopefully) update my archives with the syntax used in the wp-syntax plugin. One of my friends who has used PHP in the past, but hasn’t touched it in a while, recently asked me what the best was to handle mass edits and deletions on a page. To understand more what he’s talking about, he has a form with a table of data, each containing checkboxes in a column labeled as Delete? He wants to know how he should handle the deleting multiple rows in a fast and efficient way. How it may have been done (and you may be doing it right now) might look like this: <form action="deleteCategories.php" method="post"> <input type="checkbox" name="deleteCategory1" /> Category 1<br /> <input type="checkbox" name="deleteCategory2" /> Category 2<br /> <input type="checkbox" name="deleteCategory3" /> Category 3<br /> </form>
The above code is highly inefficient, and if you’re dealing with database records, I honestly don’t see how your application would survive. You would have to add lines to deal with other records, which would make your application severely crippled, or extremely difficult to maintain - one of the two. The solution to this is simple: use an “HTML Array”. When I say this, some people who have spent their lives working in HTML are going to say that HTML doesn’t have arrays. Of course they don’t. It’s PHP, though, that does. However, you have to pass to PHP the “array” in a certain fashion so that when it loads up it’s scripts, it knows its an array. Here’s how it works. In PHP, arrays are usually written to and read from like this:
So, in HTML, how on earth do you do arrays? You don’t have an <form action="deleteCategories.php" method="post"> <input type="checkbox" name="delete[category][]" value="1" />Category 1<br /> <input type="checkbox" name="delete[category][]" value="2" />Category 2<br /> <input type="checkbox" name="delete[category][]" value="3" />Category 3<br /> </form> What you see is I’ve named the checkbox fields the same name. In normal HTML land, this would be a no-no, and there’s a way to get around it if it doesn’t validate. That is, you simply switch to the following: <form action="deleteCategories.php" method="post"> <input type="checkbox" name="delete[category][1]" />Category 1<br /> <input type="checkbox" name="delete[category][2]" />Category 2<br /> <input type="checkbox" name="delete[category][3]" />Category 3<br /> </form> Now each checkbox has it’s own name and doesn’t overlap with others. We’ll consider the first HTML set case 1 and the second case 2. Here’s where the true PHP “magic” takes over and makes this a really powerful solution. You don’t have to then check and delete with the following code:
The above code is horrible. If you’re currently writing code like that above, slap yourself in the face with a nice wet fish. You’re about to get a rude awakening. Here’s how you’re actually going to use it:
In either case, only the checkboxes that are selected come through as the array, but in either case, PHP converts what looks like a name with special characters in HTML to an actual PHP array. It’s very powerful and you can script code to handle what you need to and not have to worry about adding or changing it as your database grows. Okay, so apparently things didn’t go as smoothly as I had thought they would when converting from Serendipity to Wordpress. Many of my posts took advantage of the “extended” posting feature (which basically required a user to click “Read More” and see the rest of my entry). However, the converter that I used did not convert these “extended” entries, so many of my posts are without content. I apologize for this, and look to getting them back up soon! Update (3/30/2008): I’ve restored all of my old extended entries, so they’re saved! Have fun reading! So, I’ve obviously failed in terms of trying to make more posts as I had said I would. But, I’m so busy with everything right now that I don’t have much time to sit down and make lengthy (and frequent postings). Heck, even some of the regular events that I’ve been trying to start up at work (such as the Weekly Digest) has turned out to be not so weekly because I haven’t been able to schedule them. However, it’s about time that I give an update on my life situation and then a short tech talk on a really cool idea that has been around, but I haven’t started using until now. Meetings At CIS, my work load has finally diminished from what it had been the previous semester. Last semester (for roughly the entire duration of the semester) I had a schedule timeline that was roughly 8 rows long (ie: I had to split my time evenly across 8 different projects). This was inefficient, but I brought it on myself because I like to be involved in many different things. I was one who was responsible for the maintenance of a web service we use in-house that I was looking forward to rewriting using the .Net WCF model and was also involved in several different initiative programs to help improve the quality of work that we put out from Customer Applications. These initiatives put me in the meeting room with my managers quite often as we discussed the importance and various aspects of how Customer Applications does business. It got me really great exposure in terms of what we actually are supposed to be doing and gave me better insight on how to plan for change. But, the meetings ended up bogging me down so much that it felt that roughly 75-80% of my time was spent doing business-related work (which included customer interaction) and then 20-25% of my time was spent coding (again, it felt like this, but may not have been the literal case). Now, mind you, I have a very strong passion to want to see Customer Applications succeed. Everyone was in acknowledgment that change was necessary and that we are behind in the times of development strategies. However, as the result of a project that failed miserably last semester, we have to be extra cautious and be that much more attentive to strategic planning to help ensure that we succeed. This I’m in complete agreement with: you cannot expect to change things overnight and have it work. Such a mindset will surely lead to dramatic failure, which is something we want to avoid. I did a lot of research on Gartner for the information that I’m looking for and found that typical business plans and timelines project that these changes take anywhere between 1 and 3 years to occur and bring chaos to the group. This makes sense, especially the chaos part because of the fact that there’s almost complete change occurring, and it’s very hard for everyone to deal with this. Fortunately and unfortunately, I never have written a business plan for something like this. I was expecting to only take a couple of weeks to have it, but having to do research, analysis, and come up with a sound business plan is difficult when you have other customer projects going on at the same time, makes it extremely difficult. I had been working on the business plan for a few weeks (roughly until the beginning of February) when things changed. We managed to convince a customer of ours that everything they wanted to get completed would not be so unless they upped their support contract time. We recommended throwing an additional 40 hours a week at their project, but they could only find the budget for an additional 20 hours a week. Because I was the technical and project leader for this customer, and the one with the most available time (because it was a lot of overhead), I had my time increased from 10 hours a week to 30 hours a week for this customer. This knocked off probably at least 4 rows on my schedule, putting me at 4 different projects to maintain. Then, just last week, I managed to finish another customer project that had gone on longer than had been anticipated. Their project involved some upgrades that made the application more secure and robust as well as some aesthetic changes they had requested. However, they were an ad-hoc customer, and could only be worked on when I had applicable time, which had not been much at all last semester. This eliminated another row on my schedule, but was quickly replaced by another customer coming back and asking for contracted PHP support. In short, what has happened is my schedule has become more blocky, meaning that it’s not spread so thin. I actually really enjoy this because then I can dedicate good chunks of time throughout the day and make progress on projects and other work as necessary. Unfortunately, most of my overhead time that was allowing me to develop the business plan to help revamp the way Customer Applications works is now on standby because I have to work on customer projects. Further, the managers that were helping me are also extremely busy managing their employees and working on other projects to help further this business plan. In short, this leaves Customer Applications in the state it is for however much longer. I only wish that our Associate Director would realize that we’ve maxed out our resources and that more positions should be opened within our group so that we could relieve the stress on everyone. But, because I’m not privileged to the information that goes on at the high-level, I don’t know whether he sees this and can’t hire new employees for other reasons, but the frustration of projects being shifted around and the realization that more projects are quickly on their way, but no relief, is starting to show among the developers. Presentations Well, I gave a couple of additional presentations recently at BarCamp Texas. I have to give kudos to Cody Bailey and the crew at the Creative Space, as well as everyone else that helped to put on this event, as it was truly an amazing informal conference that I will certainly be attending in the future. For those unfamiliar (and too lazy to check out the link), the gist of the event is technical enthusiasts, designers, and those whom are creative thinkers gather and create a schedule of talks/presentations they want to give by writing the name of the talk on a whiteboard. This is done on the day of the event, so it’s very impromptu (if the speaker hasn’t prepared for it ahead of time, which most seemed to). Then, the events begin and it’s kind of like any other conference, where there’s 30 minutes dedicated to a talk/presentation and then they move on. The idea is to network everyone together and get creative thinking and discussions going on whatever topic they feel like. I ended up giving two talks. One was with Daniel Cousineau over PHP and MVC. This particular talk had a good turnout with many people posing different questions. Mind you, I won’t get mad at Daniel for practically dominating the talk, but I pretty much was in agreement with everything. I managed to throw in points that he missed out on, or was able to extend many of the sections he was talking about, but felt bad because we were unable to provide a code sample to our readers. The second talk (which did not contain a slide set, as it was strictly a code sample and talk) was given by both myself and Ben Floyd. The talk was over LINQ, expanded as Language INtegrated Query. It’s a new feature in the .Net 3.5 Framework release that brings a psuedo-ORM (Object-Relational-Mapping) model to .Net applications. Further, it helps developers write strongly-typed and secure SQL queries in their code, so they get compile-time notifications of changes instead of runtime errors. However, it’s not just for data access, but also extends to XML and iterating over in-memory sets of data (anything that implements the IEnumerable interface). Short of having to convince developers to look at it, it’s a damn awesome technology and I give kudos to Microsoft for implementing it. I will attempt to post the code samples online, but it’s a bit difficult because the project was geared towards actually showing you how to convert old code to new code. Furthermore, most people won’t really be able to utilize the code samples because you have to have Visual Studio 2008 to open the solution. However, this presents an interesting idea…maybe a Camtasia video? Perhaps. In any case, getting to finally present in front of two audiences and share the knowledge that I have (and put myself forward as an upcomping expert in these fields) was a thrilling experience. One of the goals I’ve set for myself is to be able to become one of those that gives frequent talks at conferences and user groups around the world. I want to be an author of a software development book that breaks new grounds and puts me in there with the high-rollers (really just the highly technically proficient individuals). This is one of the things I aspire to do, because I love to be in a position to share my knowledge with everyone. Mind you, it’s not my intent to push down onto everyone the idea that “I know much more than you.”. Rather, my determination is driven by the desire to see everyone succeed. I’ve seen so many software developers and so many applications that are pieces of shit because people don’t really know all there is to know about software development. However, with enough of a push and enough knowledge sharing, we may be able to start seeing the rapid increase in software quality quicker than we currently are seeing. OpenID Okay, because this post is so long already, I’ll try to keep this short. I didn’t just stumble onto this technology, as I had known about it for quite some time. However, I just never had the opportunity to look at it because I was so busy learning other things. However, now that I’ve had the chance to play with it, the technology and idea is quite thrilling, really. In a nutshell, OpenID is all about decentralization of authentication (AuthN) and consolidation of identity. Woah, what? Lemme explain further. If you go to 5 completely non-interrelated web sites that are publicly available, how many usernames, passwords, and accounts do you have to manage? Usually the answer is 5 usernames, 5 passwords, 5 accounts. This starts to get really old as that number goes up. It becomes particularly hard when you register for a site you hardly visit, and then have to remember that god forsaken username/password combination for it. Another problem for this model is that sometimes your typical username is already taken at these websites. This is where we start to see derivatives such as ‘kittysmear1432′ or ‘dragonsblood87392′, as examples. So, when you usually expect to only have to remember passwords for sites, you now may have to remember “what’s that number I put at the end of my username”? OpenID combats both of these problems. With OpenID, the decentralization of AuthN means that you can have an unlimited number of what we call identity providers on the internet. These providers don’t share information with one another (like some big centralized authentication system would) and are all really individuals. You can run your own identity provider if you’d like, but there are many others that have robust infrastructures that you should probably consider. In fact, you may be using services online that already are providers (such as LiveJournal, Wordpress, etc.). The idea is that you register for an account with only one provider (again, LiveJournal, Wordpress, SignOn, MyOpenID, etc.). When you register for an OpenID with them, this provider gives you, effectively, your identity for the internet. This is realized through a URI (URL, however you like to call it). A typical URI will look like “chris.myopenid.com”. So, now that you have your identity established on the internet, how do you use it? It’s simple. You go to your favorite website. When you’re asked to login, you don’t do the typical type your username and password to get access. Instead, you give the web site that URI and nothing more, then click login. What happens is the website you are trying to login to takes the URI and sends you to the identity provider you got it from. The identity provider asks you to login and verify that you are who you purport to be. If you can provide your username and password in this one central location (where every OpenID web site sends you to), then you login to the web site without a problem. Let me take this further from a technical point-of-view and actually present it on a very simplified level. Imagine you go to your local DMV office to get yourself a driver’s license, which is typically used to affirm your identity. The state in which you reside (which operates this DMV) is the Identity Provider. They provide you with a card (equivalent to the URI) that identifies who you are. Suppose for arguments sake, however, that the card contains no real identifying information (such as Date of Birth, etc.) Now, imagine you are trying to get into a location which requires you to have a valid ID (say a bar). The doorman would look at your driver’s license and would then call the DMV to ask if the person standing in front of him is who he claims he or she is. The doorman would hand the phone then to you which the DMV officer would ask you for a piece of information that was not on the card (say SSN # and Date of Birth, which we said was stripped from the card). Also assume that the doorman cannot hear the conversation you are having. You hand the phone back to the doorman, and the DMV proceeds to state that you are who you say you are. The doorman rights your card ID # (URI) down on a list for future reference. This is how OpenID works, in very simplistic terms. Now, the other thing that OpenID helps combat is this whole username and identity issue. Because only one URI can ever identify one person, there’s no having to fight for usernames at multiple sites. Your OpenID URI will be guaranteed to be unique at different web sites, unless your identity has been compromised. Additionally, OpenID makes it possible for you to claim resources or pieces of information on the internet that are your own, and actually be able to prove that it is yours! You can now identify blogs, and other pages (perhaps even MySpace, Facebook, and other social networking sites in the future) as your own by adding your OpenID URI and identity provider address into the page itself. Now, these things are not visible to the naked eye, but are done through 2 lines of HTML which are rather simple. However, this is a topic of another conversation, but know that you can finally genuinely mark a blog as your own and be able to prove to others that it is, if requested. This enables aliasing of identities, so you can go back to having multiple names for yourself. The difference than how its done now, however, is that all aliases actually tie back to a parent name, as opposed to being completely anonymous aliases. I’m out of time for today. Feel free to comment, but make sure you login with your OpenID account first! As I had mentioned I was going to do a little bit ago, I have converted my blog from Serendipity to Wordpress. I find it easier to use, easier to configure, etc. In any case, I apologize for the way it looks, but give me a bit of time and I’ll have a nice style applied to it. BackgroundWell, as many of you have known, I’ve been working on projects that involve the dark side - that being Microsoft projects. Yes, this means I’ve been working on .Net applications in both Visual Basic and C#. The C# applications are kinda fun to work with, but I still maintain that VB is a ridiculous language, despite the fact that both VB and C# compile to the same intermediate code. In any case, I’ve been working on a legacy application that uses Crystal Reports to handle it’s reporting. For anyone looking for an opinion on Crystal Reports - don’t get it and don’t even think about touching it with a 10 foot pole. It’s nasty, bulky, and extremely difficult to install and configure with applications appropriately. This is the whole purpose of this post. EnvironmentThis application is being run on a Windows Server 2003 w/ Service Pack 2 server behind a firewall accessible only through VPN. Visual Studio .Net and Crystal Reports 8 and 10 are installed on the server (read below why this is, I won’t explain here). This project has no project or solution file, as it was written in 2003 and the developer in-charge had a certain way of running projects for the web, which was not the most ideal. Needless to say, he’s no longer with the group. The ProblemWhen trying to run the application, I get the following nice 500 level error message from IIS: Server Error in '/' Application. Cannot find KeycodeV2.dll, or invalid keycode. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: CrystalDecisions.CrystalReports.Engine.InternalException: Cannot find KeycodeV2.dll, or invalid keycode. Fun. So, I spent about 4 hours yesterday and an hour this morning looking up what the possible answer could be. One of the first things I see on Google is people mentioning the addition of certain Merge Modules to the solution for the project. Such an example can be found on the vbCity/devCity.Net Forums. However, this solution doesn’t apply in my case because of the following reasons:
Please refrain from making comments regarding all of the atrocities listed above. I understand that this project is awry and should be scrapped, remade, yadda yadda. However, I have voiced these concerns to the appropriate individuals and we have to get approval from our customer before proceeding with said fix. So, what other possible solutions for this problem could exist, I wonder? More Googling yields a potentially worthwhile solution which requires access to the registry. That’s fine with me, as I’m used to working in the registry. This BusinessObjects Knowledgebase article stated that I need to modify the following 2 registry keys and give access to the user that ASP.NET is running as. The keys are:
When I gave the ASP.NET user read access to the files, I then reloaded the page and got the same error message. Reading the article further revealed that I had to register the keycodev2.dll file via regsvr32. Well, upon issuing the following command: Regsvr32 "C:\Program Files\Common Files\Crystal Decisions\1.0\bin\keycodev2.dll" I get the following error message: DllRegisterServer in C:\Program Files\Common Files\Crystal Decisions\1.0\bin\keycodev2.dll failed. Return code was: 0x8002801c The knowledgebase article then stated that I needed to look at another Knowledgebase Article which turned out to be total nonsense. So, back to Google. I then found this absolutely brilliant article that discussed a potential solution to the error listed above. However, this sent me jumping through hoops to try to look at the dependencies of the keycodev2.dll file and then try to monitor the registry entries that were being hit, only to reveal no such luck. So, I continued looking for another solution online and found yet another Knowledgebase article that discussed a fix when deploying a Crystal Reports application. This didn’t resolve or even come close to the overall issue, but I finally found a PDF article that was right up the alley of what I was trying to do, especially in terms of hosting the application. Unfortunately, it contained the same bit of information that the first knowledgebase article had in it. But, there was something in the article that made me realize what the problem was - access to the registry. Potential SolutionI had known this entire time that my user account had Administrative privileges. Unfortunately, Administrative privileges doesn’t always mean that everything is readable and writable by the Administrator. Sure enough, when I looked back at those registry keys listed above, neither had even read access for the Administrator. I quickly gave the Administrator account Full Control and made sure it permeated to all subkeys under each of those keys listed above. I reran the regsvr32 command listed above and v’oila! The DLL registered successfully! |