Wednesday, March 28, 2012

Test your apache config file

Test your apache config file

This is a quick note to remind you about the command to test your apache config file before actually restarting apache:

You can check your configuration files for syntax errors without starting the server by using apachectl configtest or the -t command line option.

Source: Apache Docs

Friday, March 23, 2012

Here is some basic iptable rules.  Thanks goes to the cloud support team at Rackspace.  

This rule appends the rule.  This particular rule  opens inbound port 5432 to the ipaddress

iptables -A RH-Firewall-1-INPUT -p tcp -s --dport 5432 -j ACCEPT

This rule inserts the rule at the start of the chain.  

iptables -I RH-Firewall-INPUT -s -p tcp -m tcp --dport 5432 -j ACCEPT

After adding rules you need to issue this command to save the rules.

service iptables save

After saving you need to issue the restart command
service iptables restart

If you want to see the available chains in your firewall use this command:
iptables -L

Thursday, March 22, 2012

How to do a cfdump in cfscript

Today I needed to do a cfdump in cfscript.

Turns out this is easy in Coldfusion 9:

WriteDump (var, output, format, abort, label, metainfo, top, show, hide, keys, expand, showUDFs);

My Example:

WriteDump (var=results,output=true,format="html",abort=true);

Adobe Help

Using Vacuumdb in PostgreSQL

I read in the PostgreSQL docs that vacuumdb or vacuum should be used on the databases every day. I have been running it manually the last couple of days and it has made a difference on query response times. I highly recommend using it.

To vacuum one database from the command line.

vacuumdb -d MyDB -v  -z -U postgres 

To vacuum one database from the command line.

vacuumdb -a -v  -z -U postgres 

-d = database name
-v = verbose output
-z = analyze
-U = username
-a = vacuum all databases

Tuesday, March 20, 2012

How to create a database in PostgreSQL

Today I needed to create a database with SQL_ASCII encoding.

Here is the command I used:

I had to use template0 because template1 was set to UTF8.

I still need to dig in on the templates and what they are all about.

Monday, March 19, 2012

How to resume a ctrl-z stopped job

Today before I knew how to exit a psql command prompt in PostgreSQL I used ctrl-z to exit. I wanted to get back into psql so I went to Google to find out how. This time came to my rescue.

It is as simple as this:


Read the post for other options, but the above is what I needed.  Worked like a charm

How to exit a psql command prompt

I had trouble figuring out how to exit the psql command prompt today in PostgreSQL. After reviewing the docs I found it rather easy. \q (back slash q)

How to Find and Uninstall a Package Using RPM

Today I needed to be able to find a package and uninstall the package.  HowToForge saved the day with a great forum post

To find packages:

rpm -qa | grep -i webmin

To unistall the package:

rpm -e <package name>

If you need to uninstall more than one package at a time

rpm -e <package name> <package name> <package name>

Installing PostgreSQL Server

I found this article today when looking for an install guide of PostgreSQL Server on CentOS 5.  I had to switch the install commands to 91 but it went smoothly.

An Almost Idiots Guide To Install PostgreSQL 9.0 With YUM

Saturday, March 17, 2012

PostgreSQL on the command line

I am just getting back into PostgreSQL.  Here are the things I had to learn today:

1.  Command line usage:
  • su - postgres
  • psql
  • select version();
2.  Dumping data for import on another server
  • pg_dump -o mydb -U postgres -W > mydb.sql
  • -o has to do with oids (Not sure if I need this yet)
  • -U is for user
  • -W is for password.  It prompts when you run the command

Friday, March 16, 2012

IIS 7 Coldfusion 500 error

This is a reminder to people that might be getting a 500 error when creating a site in IIS7 with coldfusion support.  I used the Coldfusion web config tool but was still getting a 500 error.  I then remembered it was a 64bit machine but it was Coldfusion was 32bit.  I had to go into the advance settings for the application pool and set Enable 32-bit Applications to true.