Wednesday, April 25, 2007

PHP - LDAP over SSL

I recently had a great deal of difficulty authorizing users over a PHP site using LDAP with SSL.

The server would connect when not using SSL, but as soon as I added the port 636 to the ldap_connect() function as the second argument (ldap_connect("server1", 636)) I would get an error 81 Can't connect to ldap server.

After exhaustive research I tried using ldap_connect("ldaps://server1") and low and behold it connected perfectly.

If you are having similar problems, you may want to try above. If this also doesn't work, try changing your hostname to IP address, but keep the ldaps://

Sunday, April 15, 2007

OpenOffice - Getting Spellcheck to work properly.

You may find that when you initially try OpenOffice (http://www.openoffice.org) that the SpellCheck feature doesn't work properly. This is because the necessary dictionaries were not installed. You can install them by:

  1. Open OpenOffice Writer
  2. Open the file in your OpenOffice directory /share/dict/ooo/DicOOo
  3. Click on the button that says 'Start DicOOo'
  4. Follow the wizard to download the appropriate dictionaries.
Note: OpenOffice recommends only downloading the bare minimum number of dictionaries for performance reasons.

Tuesday, April 10, 2007

A Brief UNIX shell comparison

I remember when I was first learning UNIX (Solaris being my first in case anyone was wondering). One of the things I found confusing was the concept of shells and the variety of them that the UNIX world offered.



Most people who use UNIX will be perfectly content to use whatever shell is set as their default environment and never venture into anything else. For the rest of us I will list some of the more popular shells in alphabetical order (so as to not show favourtism and a brief description of each.



ASH - A fully functional shell with a very small footprint, used in systems where resources are at a premium.



BASH - Bourne Again Shell. A more robust version of the Bourne Shell.



Bourne Shell - The original UNIX shell. Still widely used and most likely is on your system somewhere.



CSH - C Shell. A shell which more closely resembles the C programming language.



KSH - Korn Shell. Similar to the Bourne shells. Very good scripting support.



TCSH - TENEX C Shell. A slightly more robust CSH.



ZSH - Z shell. A more modern Bourne variant. Almost endless options.

Sunday, April 8, 2007

What is PHP?

I was asked this question recently and thought I would post my answer. After all, if you are a geek that isn't into the web side of things you might have no idea, but would appreciate a brief description.

PHP stands for PHP Hypertext Processor and it is primarily used as a server side scripting language akin to ASP (Active Server Pages) or JSP (Java Server Pages). A server side scripting language allows someone to create a dynamic web page. Traditionally, web pages were/are created using static HTML. Server side scripting languages allow you to create a program that creates HTML on the fly, normally based on user input or back-end database queries.

PHP also allows you create stand-alone applications via a command line interface. PHP can be used through either IIS or Apache web servers and can be installed on a multitude of operating systems.

PHP is a pivotal part of the LAMP architecture as well. LAMP stands for (Linux Apache MySQL PHP) and refers to a set of free software that, when combined, gives a complete, enterprise worthy web server.

Being fortunate enough to know how to program in all three of the languages mentioned (ASP, JSP and PHP) I can say that PHP is my language of choice, both for it's ease of use and good learning curve. That being said, I have also found PHP to be the hardest of the three to install and properly configure.

Wednesday, April 4, 2007

Hard Lessons - Disconecting A Serial Terminal From A Sun Server

I was fortunate enough to recently get a brand new Sunfire v890 server. Oh how excited I was to see what this baby could do. I had to wait, unfortunately, until we could make space in our server room for it. Then the day finally came where I could power it on for the first time.


As you may, or may not, know Sun servers don't come with video cards out of the box and we had scheduled a rep to come down and install it for us. I am more than capable of this feat, but had not intention of taking the responsibility for it or possibly losing a warranty becuase it wasn't installed by a certified Sun installer. Nevertheless I wanted to see what it could do so I unplugged a laptop we were using as a serial terminal in an older v880 that we never put a video card in. That's where I learned the hard lesson.


NEVER UNPLUG A SERIAL TERMINAL FROM A RUNNING SUN SERVER


What could go wrong, I'm only unplugging a serial cable, I thought to myself. That's akin to disconnecting a vga cable right? WRONG. This apparently will make the server go down into single user mode. You won't be able to ping, telnet or do anything else with the server until it is plugged back in. Fortunately, this all occured at the end of the day and no one really seemed to notice.

Tuesday, April 3, 2007

Oracle SQLplus Copy Command - a DBA's best friend

Time and time again the copy command in SQL*Plus has proven itself to me. You can accomplish so much with such a very simple syntax. I've used it to copy/rename tables before I try something crazy, move tables from production to test or vice versa and rebuild the contents of a table without worrying if the operation will, at some point, drop the table and recreate it, thus losing all the permissions I've given to it. These are but a few of the many versatile uses of the copy command.


They syntax for the command is as follows:

COPY FROM [source database] TO [target database] [ACTION] [table name] USING [select statement]


Source Database - The database or sid you wish to retrieve information from (pretty self explanatory I know, but I figured I'd put it in there for good measure), you will also need to include the security credentials (ex. scott/tiger@orcl)
Target Database - The database or sid you will be putting information into (I know, I know....)


Action - The operation to be performed:
CREATE - create a new table

INSERT - put the rows from the select statement into the target database, if it exists.

APPEND - put the rows from the select statement into the target database, if it doesn't exist, create it as well.

REPLACE - drop the table and recreate it using the select statement


Table Name - Name of the table that the operation will affect, this is located in your target database
Select Statement - This statement is used to populate your specified table, the select statement is run against your source database.

NOTE: If you are only doing an operation within one database (ex. creating a backup table) then you don't need to specify the TO [target database] portion.


Lesson Learned: Don't try to use the copy command from an oracle 9 client when copying between two 10g databases, Oracle doesn't like that for some reason.

Once you've got the syntax down, you'll wonder how you did without it.

Monday, April 2, 2007

Microsoft Access - Fuzzy Text Search And An Empty Prompt Box

Here's an interesting dilemma....


Problem 1:


You've got a user that wants to run a report in Access and be prompted for a value to search on. Unfortunately, the thing that they are searching on is a really long string and they only want to type in part of it either due to laziness or forgetfulness.


Solution:


Create a query that the report will be based on. In the query designer type in the criteria for that column something like:


Like '*' + [Your Prompt Here] + '*'



This will look for your string inside the entire block of text.


Problem 2:
You would also like for the user to be able to just click OK on the prompt and get all of the results returned. For some reason Microsoft is thinking backwards on this one and a blank result returns no rows. Seriously, who wants to run a report with no results returned?

Solution:
In the OR section of the same row you were editing in your query designer, add the text:

[Your Same Prompt Here] is null

Now your query should perform all the functions you were looking for.


Check back tomorrow for another helpful hint from The Well Rounded Geek

Welcome!!!!!

Welcome to The Well Rounded Geek.

A blog dedicated to all of the completely random tasks that I.T. workers are expected to know/perform/excel in on a minute by minute basis. Obviously it is impossible for us to know off the top of our heads all of the, ever expanding, areas of I.T. but hopefully this blog will help you solve those pesky problems that can take hours to solve on your own.

This blog will touch on every area of I.T. imaginable (Hardware, Networking, Operating Systems, Databases, Applications, Business Intelligence, Project Management and Programming to name but a few). What would a well rounded geek blog be, however, if we also didn't touch on the fun things we do as well (Gadgets, Gaming and, quite frankly, anything else we feel like discussing).

So check back daily or subscribe to the RSS feeds because you never know when you might come across something that will save your day (or more importantly, your job)