Once I had the code encode and pasted back into Blogger everything worked out as expected.
Thursday, November 20, 2008
How to post XML code on Blogger
Yes, my last post made me think for a little while. I wanted to post XML code on Blogger, but it could have been HTML for all Blogger cares. What I had to do was encode the code. Rather than do it the tedious way by hand I choose to use a site such as http://centricle.com/tools/html-entities/ http://htmlentities.net/ to encode it for me.
Windows Firewall Allow Remote Administration using the netsh command
This is a quick oneliner that I have used in the past. I forget it now and then and always have a hell of a time looking it up again. I use it to allow my Spiceworks monitoring software access to the PC's so it can do it's thing.
netsh firewall set service remoteadmin enable
You could also add this to a WPKG package with the following code.
You could also add this to a WPKG package with the following code.
<package id="XPFirewallRemoteAdmin" name="Allow Remote Admin" revision="1" reboot="false" notify="false" priority="2" execute="once">
<install cmd='netsh firewall set service remoteadmin enable' />
</package>
Friday, November 14, 2008
Adding a Virtual Host to Apache2 based on Port
Today I had to setup an internal testbed server for one of our websites. I didn't want to create a new host name for the site on our Apache server so I went with port based virtual hosts.
There are a few things you need to add for this to work. My first attempt to make this happed in Webmin didn't produce the results I wanted, so I turned to my trusty text editor vi.
vi /etc/httpd/conf/httpd.conf
Now I had to add in a line similar to:
Listen 8080
Also you have to tell apache to use name based virtual hosting. So add in the line:
NameVirtualHost *:8080
Then finally you can create the directives for your virtual host.
DocumentRoot /your/path/here
ServerName 1.2.3.4:8080
Wednesday, October 29, 2008
Using AT to schedule a command for later in Linux / CentOS
I know this should be one of those basic things ALL Systems Administrators knows but I just learned it today. I just re-installed a server with CentOS 5.2. While it is mostly up to date there are a bunch of packages that need to be updated. I didn't want to hog all of our bandwidth during production hours and I forget to do stuff once I get home, so I want this to happen with out me thinking about it too much.
From a command prompt I typed:
at midnight tomorrow [ENTER]
yum -y update [ENTER]
[CTLR + D]
This set up my command to update via my Yum repositories tonight at 12:00:00am (well technically tomorrow).
That is all.
Tuesday, October 28, 2008
Using nagios to check PHP script execution time
We want to record the execution time of some of our PHP scripts. I want to use nagios to do this but it is proving rather difficult.
Initially I was hoping I could provide some credentials to nagios for it to use and log into our web site, run a set of scripts, and then report back to us how long each script took. Since our site does not use basic authentication I cannot do it the intial way I wanted.
To work around the issues we are having and hopefully NOT have to write our own nagios plug-in here is what I am proposing.
Create a test directory that uses basic authentication so it is protected from the general public and has a set of scripts that we run with the execution time posted near the bottom. We then use the standard check_http plug-in from nagios to search for that string and parse it as normal.
Hopefully this approach to things won't take too long to develop and prototype. Also I hope to report back with a follow up on what I actually did (with code examples) to get this working.
Monday, October 27, 2008
Adding a calender to your BASH login script
You milage may vary, but on CentOS 5.2 I edited my .bash_profile to contain the line:
cal `date +"%m"` `date +"%Y"`This put a nice looking calendar on my screen when I logged in vi ssh. A small addition but handy non the less.Thursday, October 23, 2008
Nagios check_mysql_connections example
I had a little bit of trouble getting the check_mysql_connections working but once I figured it out on the command line I had to get it working in nagios. Still being a nagios noob I had a little trouble but also got it working in nagios.
The line below will work from the command line.
[user@host libexec]# ./check_mysql_connections -w 75 -c 90 -H 555.555.555.555 -u YOUR_USER -p YOUR_PASS
In the host file I setup the service as
define service{
host_name db1.mrswi.com
service_description MySQL Connections
check_command check_mysql_connections! -w 75 -c 90 -H 555.555.555.555 -u YOUR_USER -p YOUR_PASS
check_period 24x7
max_check_attempts 2
notification_interval 30
notification_options c,w
contact_groups mrsitis
}
Subscribe to:
Posts (Atom)