Categories
Operating System Server Configuration

Internet Auto Dialer: PPPoE Dialer

I need to configure a autodialer for windows 2008 server. Although the PPPoE dialer within windows have “dial on line drop” but for some unknown reason that function wasn’t working for my cause. Also, if a User through which I start/dial connect gets logout the connection gets disconnect.

Someone suggest to use 3rd party dialer, but I am not very keep to install anything “else” on server and I believe that there should exists some method to do it within available windows resources. But when I read article on “10 default things windows should adopt from Linux” where I read about crone feature I got an idea, that why not schedule the RASPHONE through scheduler ? So here is what I do:
I create a batch script that simply ping google.com, if ping is unsuccessful it call rasphone with “-d” switch and dial the connection. now I schedule it to run every 5 minutes after ssytem startup for indefinate time. Simple 2 line batch script and work is done.

Edit (code of Batch file):

@echo off
ping -n 2 -l 1 google.com
if %errorlevel%==1 rasphone -d "MyDialupConnectionName"

Edit: 01-10-2011

I change the file to use RASDIAL command instead of rasphone, as when my Internet line has disturbance or my ISP is not available then my schedule keep adding rasphone.exe in Active task like which consume 2.5MB per instance and since I schedule it to run every 10 minutes, it keep consume 2.5MB every 10 minutes and finally my server was doomed when my ISP went down for 2 days during weekend. So new file is

 

@echo off
ping -n 2 -l 1 google.com
if %errorlevel%==1 rasdial "MyDialupConnectionName" Username Password
Categories
Bookmarked Links Server Configuration

ImageMagic on Rackspace Cloud server (linux)

Just a reminder for myself ,Imagemagic is available on Rackspace cloud at following name/location

/usr/bin/mogrify

I have use it in one of my poject, and works great for image resizing better than GD in PHP.

Categories
Article Operating System PHP Server Configuration

Finally wordpress permalinks works

After a long time, finally Microsoft add the ability to work with URL Rewriting in IIS, finally Godaddy start supporting it with their hosting, and finally I try the service to found it working first shot.

You will find detail guides at

http://learn.iis.net/page.aspx/466/enabling-pretty-permalinks-in-wordpress/   (IIS official article)

http://codex.wordpress.org/Using_Permalinks (WordPress official Article)

My unofficial web.config content

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”Main Rule” stopProcessing=”true”>
<match url=”.*” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
<add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
</conditions>
<action type=”Rewrite” url=”index.php” />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Hope it helps other.
Categories
Server Configuration SQL

MySQL “Server has gone away” error

A useful like to know the reason of “Server has gone away” error of MySQL.

http://blog.taragana.com/index.php/archive/mysql-tip-mysql-server-has-gone-away-or-lost-connection-to-server-during-query-fix/

It has very good information on why it happens, so you can check and correct the error.

Categories
Links Networking Server Configuration

Subnet Mask Calculator

Every need to calculate subnet mask, you will need this site if you are system administrator:

http://www.subnet-calculator.com

Calculate the subnet mask with ease.

Categories
Bookmarked Server Configuration

Good Password

Ever since I got company server to manage and create user account, email account. I found it very hard to do so as thinking a new password is not that easy. But my quest end when I landed on http://www.goodpassword.com, where they generate password for us and that too for free. Give it a try a must for admins.

Categories
Server Configuration

IMAP from Command line

Often I need to query IMAP server to test the mail server. For this I usually Telnet the IMAP serivce on server, and pass commands to check if it works fine or not.
Following are few commands that I need to test such servers.

To quickly test an imap server using telnet use:
telnet server 143
01 LOGIN username password
02 LIST “” *
03 SELECT mailbox

Line 02 shows you all available mailboxes.

To show the information about a mailbox:
04 STATUS mailbox (MESSAGES)

Between () you can place one or more of the following: MESSAGES, UNSEEN, RECENT UIDNEXT UIDVALIDITY
And one of the following commands to view the a message 1 is the first message * is wildcard for all:

05 FETCH 1 ALL # All IMAP headers
05 FETCH 1 FULL # Full headers and body info
05 FETCH 1 BODY # Body
05 FETCH 1 ENVELOPE # Envelope
05 FETCH * FULL # All email

To fully retrieve a message use:
06 UID fetch 1:1 (UID RFC822.SIZE FLAGS BODY.PEEK[])

This is a bookmark Post for my small memory 🙂