Archive for February, 2010

Telnet to test pop3

Friday, February 26th, 2010

I found an easy way to test a pop3 connection today. It is a little know tool called telnet (It’s not really little know, but I never though of using it for pop3 so in my mind it is little known for that purpose).

From a command line in windows:

telnet NameOfPop3Server 110

user username

pass password

list

You will see a list of email in your mailbox

retr msgNumber

You will see the email you requested

quit


More POP3 commands:

stat – Returns the number of messages in mailbox and size of mailbox

dele msgNumber – Marks message msgNumber for deletion.

noop – Doesn’t do anything, just returns a positive response.

rset – Unmarks any messages that are marked for deletion.

top msgNumber numLines – Returns the header info and numLines of the body of message msgNumber.

uidl msgNumber – Returns the message number and the messages Unique ID Listing.


Note: If the telnet session ends for any reason other than using the quit command, messages marked for deletion will not be deleted.

Unblock “unsafe” attachments in Outlook

Thursday, February 25th, 2010

So I went to open the .exe file that I sent myself yesterday and I found out that Outlook 2007 will not let you download “unsafe” attachments (unsafe meaning “Any file with an executable extension”). This bothered me, so I googled how to disable the feature.

Sadly you cannot completely disable it, you can only add file types that you want to download anyway.

Open the registry editor (Click Start->Run and type regedit)

• Browse to:

Outlook 2007

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security

Outlook 2003

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security

Outlook 2002

HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security

Outlook 2000

HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Outlook\Security


• Add a new String value named: Level1Remove

• Edit the value and add the extension(s) that you would like to allow (use a ‘;’ as a delimeter)

Ex: .exe or .bat;.exe;.mst


• Restart Outlook (You don’t need to restart the computer)

Date and Time in .bat

Wednesday, February 24th, 2010

I will skip right to the good stuff.

Here are some easy Date/Time variables for a batch file.

Will Output

Hope it helps.

Changing Hostname and IP in Red Hat linux

Monday, February 8th, 2010

So I am new to administrating linux servers so I am going to post about all the simple things that a noob linux admin would want to know.

I built a base linux vm in Microsoft Virtual Server 2005. If I copy the vhd file from that base install, what do I need to chage before I add it to the production environment?

** Note: I am using a Red Hat Linux OS (CentOS v5.3).

Change the Hostname

First we need to change the computer’s Hostname.

To change the computer’s Hostname, edit these files:

/etc/hosts:

/etc/sysconfig/network:

For the Hostname change to take effect, you need to reboot the computer.

Change the IP Address

To change the IP address of a CentOS 5.3 server, edit:

/etc/hosts:

/etc/sysconfig/network-scripts/ifcfg-eth*:

Add DNS Servers

Finally we need to add some DNS servers since we won’t get them from DHCP any more.

To add the DNS Servers, edit:

/etc/resolv.conf:

To make the changes take effect, you need to either reboot, or restart the network service.

To restart the network service:

or:

Well that’s it for today.

Pretty Code

Saturday, February 6th, 2010

So I am writing this blog to keep track of all my little coding/scripting projects. So, the first thing I need to do is figure out how to add pretty (Syntax Highlighting) to this webpage so that I can show you all my other usefull code.

I did some searching on the web and I found Goole’s Syntax Highlighter. It is amazingly easy to use and I think it looks good.

I think that this code is very easy to use.

1. Download the code.

2. Add this code segment to the <head> section of your webpage:

3. And surround your code with <pre> tags:

**The only troublesome part is that all the code inside the Syntax Highlighter that has an opening triangular bracket <, must be replaced with an HTML equivalent of &lt;


WordPress

Using the Google Syntax Highlighter with WordPress is extremely easy as well.

Just:
1. Download the plugin.
2. Extract it to the /wp-content/plugins directory.
3. Activate the plugin.
4. Add your code the the webpage.


Upgrading to version 2.1

Sadly, once I got the plugin working with my WordPress install, I realized that the plugin is running v1.5 of the Syntax Highlighter code, even though the code has been released up to v2.1.
Since I just did the install, there isn’t much more to change to reap the full benefits of this product.

1. Download the New Code
2. Extract it and update the files in the /wp-content/plugins/google-syntax-highlighter directory.
3. Edit the “google_syntax_highlighter.php” file to:

Well that’s all that I have for today. Thanks for reading this, I hope that it helps with all your source code highlighting needs in the future.