Admins eHow SysAdmin Tips & Tricks

March 31, 2010

Check e-mail on a pop3 server using telnet

Filed under: General — Tags: , , , , , , , , , — admin @ 9:44 am

These steps show how to check your e-mail on a pop3 server using a telnet client.

Telnet to the pop3 server.

telnet 110

You should recieve a reply to this effect.

Trying A.B.C.D...
Connected to
Escape character is '^]'.
+OK (rwcrpxc13) POP3 server

if you want to connect to a pop3 SSL server use the following command on a linux shell :

openssl s_client -connect FQDN:PORT

for instance for gmail it is :

openssl s_client -connect

You will get a response like this :

depth=1 /C=US/O=Google Inc/CN=Google Internet Authority
verify error:num=20:unable to get local issuer certificate
verify return:0
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/
   i:/C=US/O=Google Inc/CN=Google Internet Authority
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority
Server certificate
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/
issuer=/C=US/O=Google Inc/CN=Google Internet Authority
No client certificate CA names sent
SSL handshake has read 1703 bytes and written 300 bytes
New, TLSv1/SSLv3, Cipher is RC4-MD5
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
    Protocol  : TLSv1
    Cipher    : RC4-MD5
    Session-ID: AF09D6024039D1F70D7A6518034EF3B2E1B949C15A71ED3D0E85BC89F7D4ADC2
    Master-Key: 58D4202B16256CA5715C45B2CDDDFDDC16ABCAEF2A0993D23F3817193AE3F4A4E5531EF13CA970BADD1F8EA273FD6871
    Key-Arg   : None
    Start Time: 1270025037
    Timeout   : 300 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
+OK Gpop ready for requests from a.b.c.d q9pf826547gve.29

Enter your username for the pop3 e-mail account using the “user” command.

user username_here

You should recieve the following reply.


Enter your password for the pop3 e-mail account using the “pass” command.

pass password_here

You should recieve the following reply.

+OK Maildrop ready

Stat your mailbox using “stat” command.


You will get response showing the number of messages on the server and total size of them.

+OK 2 9141

List the mail on the pop3 e-mail account using the “list” command.


You will see the list of messages on the server.

+OK scan listing follows
1 1489
2 7652

To see one of the messages issue the retrieve command “retr” and the message id.

retr 1

You will see the whole e-mail headers and all.

+OK 1489 octets
Received: from blah ( [a.b.c.d])
(iPlanet Messaging Server 5.2 HotFix 1.16 (built May 14 2003))
with ESMTP id <> for; Wed, 02 Jul 2003 23:54:23 -0400 (EDT)
Date: Wed, 02 Jul 2003 23:52:59 -0400
From: Me
Subject: test
Message-id: <>
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
Content-disposition: inline
User-Agent: KMail/1.5.1
Original-recipient: rfc822;


If you would like to delete the message issue the dele command with the message id.

dele 1

You will then see a delete confirmation.

+OK message deleted

To finish issue the quit command.


Response :

Connection closed by foreign host.

March 20, 2010

How to Disable Password Expiration on Windows Server 2008

Filed under: General,Security,Windows — Tags: , , , , , — admin @ 2:31 pm

If you’re not using Active Directory, your “Local Security Policy” dictates things like password complexity rules, account lockouts, and password expiration. To turn off password expiration:

1) Login as Administrator or a user with Administrator rights
2) Launch “Local Security Policy”: Start > Administrative Tools > Local Security Policy
3) Expand “Account Policies”
4) Select Password Policy
5) Set Maximum Password age to “0”

Source : Ryan’s Tech Notes

March 18, 2010

Prevent MySQL Injection in PHP

Filed under: General,MySQL,PHP,Security — Tags: , , , , — admin @ 5:21 pm

As it is explained everywhere on the web , the general solution to prevent mysql injection attacks in php is to use mysql_real_escape_string function , there are many guides on how to use it in conjunction with sprintf to escape dangerous characters before executing a mysql query, but I found a very innovative solution in a comment on website , it recommends to escape all variables sent by user by get or post method in the beginning of every page which executes mysql queries :
first make sure magic_quotes_gpc is turned off on your php configuration , it can be checked on php info page.
this step makes sure your variables are not escaped twice.
This article explains how to disable magic quotes : Disabling Magic Quotes Guide
put the following code in the beginning of every page executing mysql queries :

	include ('mysql_connect.php');
	//This stops SQL Injection in POST vars
	foreach ($_POST as $key => $value) {
		$_POST[$key] = mysql_real_escape_string($value);

	//This stops SQL Injection in GET vars
	foreach ($_GET as $key => $value) {
		$_GET[$key] = mysql_real_escape_string($value);

mysql_real_escape_string needs you to be connected to your mysql database when you call it , so I have placed include (‘mysql_connect.php’); in the beginning of script , you can replace it with your own mysql connect commands.

March 13, 2010

Shell script to show network speed

Filed under: CentOS,Debian,DreamBox,General — Tags: , , , , , , , , , — admin @ 11:37 am

The following shell script shows current download and upload speeds for the network interface you choose.

Copy the shell script in a file named, i.e:

Then after setting execution permissions:

chmod a+x

You can run the shell script passing as the first argument the network interface you want to monitor:

./ eth0

You will get a line like that:
eth0 DOWN:15 KB/s UP:880 B/s

This script works parsing /proc/net/dev file and calculating the difference between current transmitted or received bytes and their values one second ago.


# This shell script shows the network speed, both received and transmitted.

# Usage: interface
#   e.g: eth0

# Global variables

# This function parses /proc/net/dev file searching for a line containing $interface data.
# Within that line, the first and ninth numbers after ':' are respectively the received and transmited bytes.
    line=$(cat /proc/net/dev | grep $interface | cut -d ':' -f 2 | awk '{print "received_bytes="$1, "transmitted_bytes="$9}')
    eval $line

# Function which calculates the speed using actual and old byte number.
# Speed is shown in KByte per second when greater or equal than 1 KByte per second.
# This function should be called each second.

    let vel=$value-$old_value
    let velKB=$vel/1024
    if [ $velKB != 0 ];
 echo -n "$velKB KB/s";
 echo -n "$vel B/s";

# Gets initial values.

# Shows a message and waits for one second.
echo "Starting...";
sleep 1;
echo "";

# Main loop. It will repeat forever.
while true; 

    # Get new transmitted and received byte number values.

    # Calculates speeds.
    vel_recv=$(get_velocity $received_bytes $old_received_bytes)
    vel_trans=$(get_velocity $transmitted_bytes $old_transmitted_bytes)

    # Shows results in the console.
    echo -en "$interface DOWN:$vel_recv\tUP:$vel_trans\r"

    # Update old values to perform new calculations.

    # Waits one second.
    sleep 1;


Source : Linux Clues

March 12, 2010

Axel download manager for dreambox (dm800)

Filed under: DreamBox — Tags: , , , , — admin @ 4:57 pm

From Axel Project official site :

Axel tries to accelerate HTTP/FTP downloading process by using multiple connections for one file. It can use multiple mirrors for a download. Axel has no dependencies and is lightweight, so it might be useful as a wget clone on byte-critical systems.

I found a working compiled version of axel download manager for my dm800.
You can download it from here : Click here to download axel mipsel
First decompress the zip file then put it in /usr/bin folder of your dreambox and make it executable and enjoy 🙂

March 8, 2010

Workaround to Run Windows Vista Bar Style Sidebar in Windows 7

Filed under: General,Windows — Tags: , , , , , — admin @ 1:23 pm

There is a workaround to get back the Windows Vista Sidebar in Windows 7. Follow these steps:
1. Close the Windows 7 sidebar by killing the sidebar.exe in the task manager
2. Download this zip file:
3. Extract the zip content to your Windows Sidebar folder C:\Program Files\Windows Sidebar (overwrite existing files)
4. Run the sidebar.exe from C:\Program Files\Windows Vista Sidebar
5. Add your gadgets and have fun with the Windows Vista Sidebar!

Clipboard Manager Gadget with Customized Height

Filed under: Windows — Tags: , , — admin @ 12:29 pm

I am a fan of Clipboard manager gadget from Jan Zeman
It is a very useful gadget and lets you to use your clipboard very efficiently.
I have created a customized version of this gadget for myself with Height 260 ( instead of 160 ) which shows 13 last items of clipboard ( instead of 7 ).
You can download it here :

March 5, 2010

How to sync dreambox date and time automatically

Filed under: DreamBox — Tags: , , , — admin @ 9:37 am

I could not find rdate or ntpclient packages for dreambox , so I came up with another solution to sync my dreambox date and time when it boots up.
First you need another server with synced date and time , so we can read the correct date and time from it. also we need a webserver and php installed on it.
Create a script named “dreambox-date.php” on root folder of your web server with following content :

echo date("Y.m.d-G:i:s");

Create another file named “03datesync” in “/etc/network/if-up.d” folder of your dreambox with following content :

date -u -s `wget -O - http://IP_OR_FQDN/dreambox-date.php`

Change IP_OR_FQDN to your own hosting IP and domain name.
Also make it executable :

chmod +x 03datesync

All done 🙂 Now when dreambox boots up and its network interface is up , the above script would be called and it syncs your dreambox date and time.

How to change timezone on Debian

Filed under: Debian,General — Tags: , , , — admin @ 8:40 am
dpkg-reconfigure tzdata

March 4, 2010

How to run multiple instances of yahoo messenger

Filed under: General,Windows — Tags: , , , , — admin @ 1:46 pm

It is possible to run several instances of Yahoo! Messenger using a tiny registry tweak.
Create a file named “yahoo.reg” and copy and paste the following inside it :



Save the file and double click on it , windows asks for a confirmation to write the data inside windows registry , click on Yes.
We are all set 🙂

Older Posts »

Powered by WordPress