So Wednesday I started my new job as a php developer. It’s been way awesome so far. One of the neat things I learned is the tertiary statement/operator which looks something like this ((condition_to_test)?if_true_do_this:if_false_do_this);. Here’s an example:
((isset($_POST[something]))?yes:no);
If the the above statement is true then it returns a yes, otherwise it returns a no. Can’t really think of a good example for it, but it works kind of like an IF statement, especially when you just need to test something boolean-like style.
This is a common problem which leads to a lot of side-effects. I’ve noticed that in some cases the firewall is still somehow running even though you cannot access settings from the control panel or start the service from services.msc. You instead get an error, unfortunately I forgot what the error says. This problem prevents Windows IM, OpenVPN, and other processes that need to access the network from functioning properly since these processes cannot bypass the firewall. Luckily there is an easy solution.
Start > Run > and type netsh winsock restart
You will have to reboot the computer. Once rebooted go into the control panel and turn the firewall OFF.
For the next week I work as a desktop support admin for a web-based software company (until I start my new development job). The recent release of Vista and the widespread use of Windows XP has created a scenario where the support staff must support two operating systems. We had an existing test workstation, but due to space limitations we did not have room for a second vista box. My initial idea for a solution was a dual boot. Unfortunately after investing an hour or two of my day I realized this would not work. I ran into some error where the machine was no longer able to recognize the hard drive. Strange I know. It must have completely whacked out the boot sector. The solution – vmware – and then I kicked myself for not thinking of it sooner.
Read the rest of this entry »
Usually I just use this blog to post technical information and the like. Today I’ll post some stuff more related to me as a human, though nothing too deep. I recently was offered a position as web developer in a LAMP environment. Sweet! It will be a lot better than performing desktop support and system administration, plus it pays better. I start there on the 18th of April so I expect the php and Linux sections to grow enormously and I may even need to add a mysql section.
Read the rest of this entry »
I often forget how to get the OS type and service type’s of remote servers. Here are a few commands that are quick, easy, and effective.
If curl is installed you can execute curl –head http://www.example.com to return web server and OS information. Note there are two dashes in front of head.
If nmap is installed nmap -p 80 -sV http://www.example.com will return the same information as above. The added benefit of using nmap is that you can change the port number parameter in front of -p to anything (25 for smtp, 21 for ftp, etc).
I’ve been reading this object oriented php book and here’s one of the cool things I’ve learned from it. Using php you can easily get rss feeds and parse the xml files output to your page with the simplexml_load_file() function. There are so many things you can do with this. You can keep your sites content fresh with a news section using this or you could even create a web-based feed manager, like feedme.com or something like that. Click here for the quick, dirty, and inelegant code.
The other thing you can do is set the $feed variable to a post. Then create an array of several different rss feeds, populate that array in a drop down box, and allow the user to select whatever feed. Pretty slick.