Best ways to redirect web pages….

301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection.
The code “301″ is interpreted as “moved permanently”.

Below are a Couple of methods to implement URL Redirection

IIS Redirect

* In internet services manager, right click on the file or folder you wish to redirect
* Select the radio titled “a redirection to a URL”.
* Enter the redirection page
* Check “The exact url entered above” and the “A permanent redirection for this resource”
* Click on ‘Apply’

ColdFusion Redirect
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

PHP Redirect
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect

JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

CGI PERL Redirect
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);

Ruby on Rails Redirect
def old_action
headers["Status"] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

How to Redirect HTML

Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted on a Windows Server.

VOIP: Ports pointers

If you plan on using phones or accessing the PBX from remote locations, it’s necessary to forward certain ports back to your PBX. www.portforward.com is a good resource for documentation on how to forward ports on most routers.

The following ports are used by the PBX.

TCP/UDP Port(s) description Used by Remote Phones
UDP 5060 SIP signaling port needed for phones outside your network
UDP 10000-10500 RTP audio ports needed for phones outside your network
Used for accessing the PBX web interface remotely
TCP 80 HTTP port for remote web voicemail access
TCP 443 HTTPS port for remote web admin access
TCP 5222 & 843 SMB Systems Only – ports for using the Switchboard remotely

US Units of Measure and Conversion Tables

Temperature

In the US temperature is measured according to the Fahrenheit scale.
To convert Celsius (Centigrade) to Fahrenheit, multiply by 1.8 (or
9/5) and add 32. Conversely, to convert Fahrenheit to Celsius, subtract
32 and divided by 1.8.

Temperature
Celsius (C)
(C) = (5/9) * ((F) – 32)
Fahrenheit (F)

(F) = ((9/5) * (C)) + 32

-17.8°
-10° 14°
32°
10° 50°
20° 68°
30° 86°
40° 104°
100° 212°

Normal Body Temperature: 98.6° F or 37° C

Weight

In the US weight is expressed in terms of “ounces” (oz.) and “pounds” (lbs.).

Weights
US System Metric System
1 oz. 30 g.
16 oz. or 1 lb. 450 g.
2.2 lbs 1000 g.=1 kilogram (kg.)
2000 lbs = 1 ton 900 kg

Length and Distance

In the US the metric system is only very slowly being adopted as the
standard of linear measure.

In the mean time, check the table below for the more widely used standards:

US Length/Distance Measurement
Term Abbreviation Symbol Equivalents
inch in. 1″
foot ft. 12″ = 1′
yard yd. (none) 36″ = 3′ = 1 yd.
mile mi. (none) 5280′ = 1 mi.
Length/Distance Conversion
US System Metric System
1 in. 2.54 cm
1 yd. 91.44 cm
1 mi. 1.609 km

Cooking Measures

Measurements for recipes in the US are in terms of volume rather than
weight for dry as well as liquid ingredients. The standards of measure
such as “teaspoon” or “cup” refer to cooking utensils you can buy at
any supermarket. The terms do not refer to the common household teaspoon
or cup.

Abbreviations Used in Cookbooks
Abbreviation Unit of Measurement
tsp. (or t) teaspoon
tbs. (or T) tablespoon
C. (or c.) cup
oz. ounce
pt. pint
qt. quart
lb. pound
Liquid Measurement
Spoons and Cups Liquid Ounces
1 tsp. 1/6 oz.
1 tbs. 1/2 oz.
6 2/3 tbs. 3 1/2 oz.
1 C. (16 tbs.) 8 oz.
2 C. (1pt.) 16 oz. (1 lb.)
4 C. (1 qt.) 32 oz. (2 lbs.)
4 1/3 C. 2.2 lbs.
Volume Conversion for Ingredients
US System Metric System
Liquid 1 liquid qt. 0.95 liter
1.06 liquid qts. 1 liter
Dry 0.91 dry qts. 1 liter
1 dry qt. 1.1 liter
Oven Temperature
  Farenheit Celsius
Cool 200 93
Low or very low 225 107
Slow 300 149
Moderate 350 177
375 191
Hot 400 or above 205 or above

qmail : purge outbound messages

Trick qmail into thinking the messages have been around too long, it will give up and discard the messages. This can be done using find in conjunction with touch:

find /var/qmail/queue/ -type f -depth 3 -exec touch -t 200001010101 {} ;

Once we’ve touched the messages we then need to signal qmail to re-run the queue :

killall -ALRM qmail-send

check mail logs..

/var/log/qmail …

Order of operation… Math operators in Excel

The math operators in Excel have an order of operation, just like in regular math. The order of operation is the order in which they’re processed when multiple operators appear in the same formula. Here are the rules that determine the order:

1. Any operations that are in parentheses, from left to right
2. Exponentiation (^)
3. Multiplication (*) and division (/)
4. Addition (+) and subtraction (-)

Parentheses override everything and go first. So, if you need to execute an operation out of the normal order, you place it in parentheses.

For example, suppose you have this formula:

=5+16/4^2

The order of operation looks like this:

1. The exponentiation (4^2 equals 16)
2. The division (16/16 equals 1)
3. The addition (5+1 equals 6)

The result of the formula is 6.

If you wanted the addition to occur first, you could put parentheses around the addition portion of the equation, like this:

=(5+16)/4^2

This time, the order of operation looks like this:

1. The part in parentheses (5+16 equals 21)
2. The exponentiation (4^2 equals 16)
3. The division (21/16 equals 1.3125)

The result of this formula is 1.3125.

If you wanted to perform the exponentiation last, you could add another set of parentheses, like this:

=((5+16)/4)^2

Now the order is this:

1. The inner parentheses (5+16 equals 21)
2. The outer parentheses (21/4 equals 5.25)
3. The exponentiation (5.25^2 equals 27.5625)

The result of this formula is 27.5625.

If you left off the inner set of parentheses and wrote it like this:

=(5+16/4)^2

The order would be as follows:

1. The division, because it’s the highest-ranking operation inside the parentheses (16/4 equals 4)
2. The rest of the parenthetical operations (5+4 equals 9)
3. The exponent (9^2 equals 81)

The result of this formula is 81.

The Types of Commands used for Managing IIS from the Command Line

The types of commands which you can use to manage IIS from the command line are:
Click here to find out more!

* IISReset, Windows Management Instrumentation (WMI) scripts, Active Directory Services Interface (ADSI), and the standard Windows commands and Support Tools utilities.

IISReset Command-line Utility

IISReset is a command-line utility that has been in existence from IIS 5, which you can use to stop IIS, restart IIS, and reboot the IIS server. Typical reasons for restarting IIS are:

* When problematic ASP.NET and ASP application exist, and you need to eliminate resource leaks, or initiate resource recycling.
* When certain IIS configuration changes are made, you would need to restart IIS so that the changes are applied. A few of these types of configuration settings changes are listed below:
o IIS needs to be restarted when the IIS isolation mode is changed.
o When you restore the metabase from a metabase history file manually, you need to restart IIS.
o You have to restart IIS when you change the Direct Metabase Edit feature’s property, EnableEditWhileRunning, directly in the metabase file.
o IIS also has to be restarted whenever changes are made to any global configuration settings located under HKLM\Software\Microsoft\InetMgr\Parameters.

Windows Management Instrumentation (WMI)

You can use WMI scripts for a few typical IIS management tasks:

* Create and delete Web sites and FTP sites
* Create and delete virtual directories
* Enable/disable web service extensions
* Backup and restore IIS configuration, and copy IIS configuration
* Import/export portions of the metabase, as well as other management tasks

A few WMI scripts are provided by Microsoft, and are located in the \Windows\System32 directory. These WMI scripts and their associated functions are listed below:

* iisweb.vbs: Used to perform the following management tasks from the command line:
o List Web sites
o Create/delete Web sites
o Start/stop Web sites
* iisvdir.vbs: Used for performing the following management tasks from the command line:
o Create/delete virtual directories for Web sites
o List virtual directories in a specified root.
* iisapp.vbs: For listing all Web applications which are running on the IIS machine.
* iisback.vbs: For backing up and restoring IIS configuration settings, and for deleting IIS backups.
* iiscnfg.vbs: Used to perform the following management tasks from the command line:
o Import and export IIS configurations as XML files
o Save IIS configuration to disk.
o Copy IIS configuration settings
* iisext.vbs: Used for performing the following management tasks from the command line:
o List applications
o Enable applications
o Add/remove application dependencies
o Enable/disable web service extensions
o List and add/remove web service extension files
o Enable/disable web service extension files
* iisftp.vbs: Used to perform the following management tasks from the command line:
o List FTP sites
o Create/delete FTP sites
o Start/stop FTP sites
o Set Active Directory user isolation for your FTP sites
* iisftpdr.vbs: Used to perform the following management tasks from the command line:
o Create and delete virtual directories in FTP sites
o List virtual directories in a specified root.

Active Directory Services Interface (ADSI)

Active Directory Services Interface (ADSI) was used in IIS 5 to manage IIS from the command line. Through ADSI, you can change IIS configuration settings, and configure websites, applications, and virtual directories from the command line. With IIS 6, it is recommended to use WMI scripts over ADSI. Any custom ADSI scripts previously used in IIS 5 should be tested to verify that they work in IIS 6.
Windows Commands and Support Tools Utilities

A few IIS specific Windows commands, such as the net commands, can be used to manage IIS from the command line:

* net start and net stop: Used to start and stop IIS services. The service name which you should use when utilizing the net command to start, or stop IIS services are listed below:
o FTP service = msftpsvc
o IIS Admin service = iisadmin
o NNTP service = nntpsvc
o SMTP service = smtpsvc
o WWW service = w3svc
* net localgroup: Used to add a user account to the IIS_WPG group. Accounts utilized as application pool identities are members of the IIS_WPG group.
* Cacls: Used to capture NTFS permissions on the IIS server.
* Convlog: Used to convert the IIS log files to the NCSA format.

You can also use the resource kit utilities listed below to manage certain elements of IIS:

* secedit: Used to administer security templates.
* auditpol: Used to change audit policies from the command line
* showmbrs: Used to list the members of security groups which have permissions on directories and files.

How to schedule IISReset.exe through Task Scheduler

IISReset is typically used when you need to recover from faulty application situations. You can use Windows Task Scheduler to schedule IIS to restart according to predefined parameters.

1. Open Control Panel.
2. Select Scheduled Tasks, and then select Add Scheduled Task.
3. Click Next for the Scheduled Task Wizard to start.
4. Click Browse and browse to Windows\System32 folder.
5. Double-click IISReset.exe.
6. Enter a task name, and select when the task should run. Click Next.
7. Enter the Administrator account details that should be utilized to run IISReset. Click Next.
8. If you want to configure advanced task scheduling properties, click the Advanced checkbox; or alternatively click Finish.
9. Open the Properties dialog box of the task you just configured, and click the Task tab.
10. Add any additional switches in the Run box.
11. Click OK.

How to use iisweb.vbs to manage Web sites

The iisweb.vbs utility is used to list Web sites, create and delete Web sites, and start and stop Web sites in IIS.

iisweb.vbs has the following main switches:

* /create, for creating a Web site.
* /delete, for deleting a Web site.
* /start, for starting a Web site.
* /stop, for stopping a Web site
* /pause, for pausing a Web site
* /query, for troubleshooting a Web site – displaying all the Web sites on the IIS machine

To create a Web site, use:

iisweb[.vbs] /create Path SiteName [/b Port] [/i IPAddress] [/d HostHeader] [/dontstart] [/s Computer [/u [Domain\]User [/p Password]]]

* Path, the physical location to the files for the Web site. When the directory does not exist, the script creates it.
* SiteName, the name of the new Web site. This is the name which will be displayed in IIS Manager.
* /b Port, the port on which the new Web site should listen for HTTP requests. The default value is port 80.
* /i IPAddress, the IP address that must be assigned to the Web site.
* /d HostHeader, the host header for the new site.
* /dontstart, used to indicate that IIS should not automatically start the Web site after it is created. IIS by default starts a newly created Web site.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to create the Web site on the remote computer.
* /p Password, the password of the account credentials (above).

To start, stop, delete, or pause a Web site, use:

iisweb[.vbs] {/delete | /start | /stop | /pause} WebSite [WebSite...] [/s Computer [/u [Domain\]User [/p Password]]]

* WebSite, the name of the Web site which should be deleted, started, stopped, or paused.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to delete, start, stop, or pause the Web site on the remote computer.
* /p Password, the password of the account credentials (above).

To query Web sites on your IIS servers, use

iisweb[.vbs] /query [WebSite [WebSite...]] [/s Computer [/u [Domain\]User [/p Password]]]
How to use iisvdir.vbs to manage virtual directories

The iisvdir.vbs command can be used to list virtual directories in a specified root, to create and delete virtual directories for websites, and to query virtual directories of an IIS server.

To create a virtual directory for a Web site, use:

iisvdir /create WebSite[/VirtualPath] Name PhysicalPath [/s Computer [/u [Domain\]User /p Password]]

* WebSite, the name of the Web site which you want to create the virtual directory for.
* VirtualPath, the virtual path under which this virtual directory should be created (optional)
* Name, the name of the new virtual directory.
* PhysicalPath, the name of physical directory where the virtual directory points.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to create the virtual directory for the remote computer.
* /p Password, the password of the account credentials (above).

To delete a virtual directory associated with a Web site, use:

iisvdir /delete WebSite[/VirtualPath] Name [/s Computer [/u [Domain\]User/p Password]]

* WebSite, the name of the Web site which is associated with the virtual directory that you want to delete.
* VirtualPath, the virtual path which holds the virtual directory (optional).
* Name, the name of the virtual directory that you want to delete.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to delete the virtual directory.
* /p Password, the password of the account credentials (above).

To query Web site specific virtual directories on your IIS servers, use

iisvdir /query WebSite[/VirtualPath][/s Computer [/u [Domain\] User/p Password]]

* WebSite, the name of the Web site which is associated with the virtual directory that you want to query.
* VirtualPath, the virtual path which holds the virtual directory (optional).
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to query for virtual directories.
* /p Password, the password of the account credentials (above).

How to use iisftp.vbs to manage FTP sites

The iisftp.vbs utility is used to perform management tasks from the command line that are specific to managing FTP sites on the IIS servers.

iisftp.vbs has the following main switches:

* /create, for creating a FTP site.
* /delete, for deleting a FTP site.
* /start, for starting a FTP site.
* /stop, for stopping a FTP site
* /query, for troubleshooting a FTP site – displaying all the FTP sites on the IIS machine
* /setadprop, for indicating that Active Directory properties should be used for a particular user accessing the FTP site.
* /getadprop, for obtaining Active Directory properties for the particular user.

To create a FTP site, use:

iisftp /create Path SiteName [/b Port] [/i IPAddress] [/dontstart] [/isolation {AD|Local} [/domain DomainName /Admin [Domain\]User /AdminPwd Password]] [/s Computer [/u [Domain\]User/p Password]]

* Path, the physical location to the files for the FTP site.
* SiteName, the name of the new FTP site. This is the name which will be displayed in IIS Manager.
* /b Port, the port on which the new FTP site should listen for FTP requests. The default value is port 21.
* /i IPAddress, the IP address that must be assigned to the FTP site.
* /dontstart, used to indicate that IIS should not automatically start the FTP site after it is created. IIS by default starts all newly created sites.
* /isolation, used to indicate the isolation mode that should be used.
* domain, when Active Directory is selected as the isolation mode, this is the domain for Active Directory.
* admin, when Active Directory is selected as the isolation mode, this is the admin account credentials for Active Directory.
* AdminPwd, when Active Directory is selected as the isolation mode, this is the password of the admin account for Active Directory (above).
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to create the FTP site on the remote computer.
* /p Password, the password of the account credentials (above).

To start, stop, delete, or pause a FTP site, use:

iisftp[.vbs] {/delete | /start | /stop | /pause} FTPSite [FTPSite...] [/s Computer [/u [Domain\]User [/p Password]]]

* FTPSite, the name of the FTP site which should be deleted, started, stopped, or paused.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to delete, start, stop, or pause the FTP site on the remote computer.
* /p Password, the password of the account credentials (above).

To query FTP sites on your IIS servers, use

iisftp[.vbs] /query [FTPSite [FTPSite...]] [/s Computer [/u [Domain\]User [/p Password]]]

To use /setadprop, and /getadprop use,

iisftp /SetADProp UserID {FTPDir|FTPRoot} PropertyValue [/s Computer [/u [Domain\]User/p Password]]

iisftp /GetADProp UserID [/s Computer [/u [Domain\]User /p Password]]

* UserID, the Active Directory user login ID
* FTPDir, indicates whether the modification is applicable at the directory level or at the root level.
* PropertyValue, indicates the home directory and relative path.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used for remote administration.
* /p Password, the password of the account credentials (above).

How to use iisftpdr.vbsto manage virtual directories

The iisftpdr.vbs command can be used to list virtual directories in a specified root, and to create and delete virtual directories in FTP sites from the command line.

To create a virtual directory for a FTP site, use:

iisftpdr /create FTPSite[VirtualPath] Name PhysicalPath [/s Computer [/u [Domain\]User /p Password]]

* FTPSite, the name of the FTP site which you want to create the virtual directory for.
* VirtualPath, the virtual path under which this virtual directory should be created (optional)
* Name, the name of the new virtual directory.
* PhysicalPath, the name of physical directory where the virtual directory points.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to create the virtual directory on the remote computer.
* /p Password, the password of the account credentials (above).

To delete a virtual directory associated with a FTP site, use:

iisftpdr /delete FTPSite[VirtualPath]/Name [/s Computer [/u [Domain\]User /p Password]]

* FTPSite, the name of the FTP site which is associated with the virtual directory that you want to delete.
* VirtualPath, the virtual path which holds the virtual directory (optional).
* Name, the name of the virtual directory that you want to delete.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to delete the virtual directory.
* /p Password, the password of the account credentials (above).

To query FTP specific virtual directories on your IIS servers, use

iisftpdr /query FTPSite[/VirtualPath][/s Computer [/u [Domain\]User/p Password]]

* FTPSite, the name of the FTP site which is associated with the virtual directory that you want to query.
* VirtualPath, the virtual path which holds the virtual directory (optional).
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to query for virtual directories remotely.
* /p Password, the password of the user account (above).

How to use iiscnfg.vbs to manage IIS from the command line

You can use iiscnfg.vbs to import and export IIS configurations settings of the metabase as XML files.

To export IIS configuration settings, use:

iiscnfg /export /f [Path\]FileName.xml /sp SourcePath [/d EncryptingPassword] [/inherited] [/children] [/s Computer [/u [Domain\]User [/p Password]]]

* /f [Path\]FileName.xml, the name of the XML file that the configuration settings should be exported to.
* /sp SourcePath, the node of the metabase configuration settings.
* /d EncryptingPassword, the password of the XML file.
* /inherited, indicates that all inherited information should be exported.
* /children, indicates that subkeys of the node should be exported.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to run the script.
* /p Password, the password of the account credentials (above).

To import IIS configuration settings, use:

iiscnfg /import /f [Path\]FileName.xml /sp SourcePath /dp DestinationPath [/d EncryptingPassword] [/inherited] [/children] [/merge][/s Computer [/u [Domain\]User [/p Password]]]

* /f [Path\]FileName.xml, the name of the XML file that should be used to import IIS configuration settings to the server.
* /sp SourcePath, the node of the XML file.
* /dp DestinationPath, the destination node path in the metabase.
* /d EncryptingPassword, the password of the XML file.
* /inherited, indicates that all inherited information should be imported. This can only occur when the source node has properties that can be inherited.
* /children, indicates that subkeys of the node should be imported.
* /merge, merges different source keys to one metabase key through this value.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to run the script.
* /p Password, the password of the user account (above).

To copy the metabase.xml file and metabase XML file to a different IIS server, use:

iiscnfg /copy /ts TargetComputer /tu TargetUser /tp TargetPassword [/s Computer [/u [Domain\]User [/p Password]]]

* /ts TargetComputer, the name or IP address of the IIS computer to which these configuration settings should be copied.
* tu TargetUser, the user account for logging on the target computer.
* tp TargetPassword, the password of the account provided above.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to run the script remotely.
* /p Password, the password of the account (above).

To immediately save configuration changes to the metabase, use:

iiscnfg /save [/s Computer [/u [Domain\]User /p Password]]

* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to run the script.
* /p Password, the password of the account (above).

How to use iisback.vbs to back up IIS configuration settings and restore IIS configurations

You can use iisback.vbs to back up, and restore IIS configuration settings from the command line

To back up IIS configuration settings, use:

iisback /backup [/b BackupName] [/v {Integer | HIGHEST_VERSION | NEXT_VERSION}] [/overwrite] [/e EncryptingPassword] [/s Computer [/u [Domain\]User/p Password]]

* /b BackupName, the name of the back up.
* /v {Integer}, possible values are HIGHEST_VERSION or NEXT_VERSION. HIGHEST_VERSION creates a backup of the highest version number. The HIGHEST_VERSION value has to be utilized with /overwrite. NEXT_VERSION increments the existing version number by one.
* /overwrite, used to overwrite a current backup
* /e EncryptingPassword, used to enable password encryption for the backup.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to create backups for the remote computer.
* /p Password, the password of the account credentials (above).

To restore IIS configuration settings, use:

iisback /restore /b BackupName [/v {Integer | HIGHEST_VERSION}] [/e EncryptionPassword] [/s Computer [/u [Domain\]User/p Password]]

* /b BackupName, the name of the backup file that you want to restore.
* /v {Integer}, possible values are HIGHEST_VERSION or NEXT_VERSION.
* /e EncryptingPassword, the password for the backup.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to restore the backup file for the remote computer.
* /p Password, the password of the account (above).

To list all IIS backups for an IIS server, use:

iisback /list [/s Computer [/u [Domain\]User/p Password]]

* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to list all backups for the remote computer.
* /p Password, the password of the account credentials (above).

To delete an IIS backup, use:

iisback /delete [/bBackupName] [/v {Integer | HIGHEST_VERSION}] [/s Computer [/u [Domain\]User /p Password]]

* /bBackupName, the name of the backup file that you want to delete.
* /v {Integer}, possible values are HIGHEST_VERSION or NEXT_VERSION.
* /s Computer, used to indicate that the script should run on this remote computer. The local computer is used by default.
* /u [Domain\]User, the account credentials that must be used to delete the backup file for the remote computer.
* /p Password, the password of the account credentials (above).

What happened to HyperTerminal?

What happened to HyperTerminal?

Applies to all editions of Windows Vista.
Which edition of Windows Vista am I using?

HyperTerminal is no longer part of Windows. There are several options you can use to replace its functionality.

If you only need remote shell access, you can use WinRS (Windows Remote Shell), new in Windows Vista. To get help with WinRS, type winrs /? at the command prompt, and then press ENTER.

Telnet is a simple, text-based program that you can use to connect to another computer over the Internet.

If you previously used HyperTerminal to troubleshoot modem problems, use Phone and Modem Options instead:

Open Phone and Modem Options by clicking the Start button Picture of the Start button, clicking Control Panel, clicking Hardware and Sound, and then clicking Phone and Modem Options.
NoteYou might need to provide information, such as your country or region and any special phone dialing rules, in the Location Information dialog box before you can access the Phone and Modem Options dialog box.

If you previously used HyperTerminal to control serial devices, you can usually find a downloadable version of HyperTerminal on the Internet that is free for personal use.

How can I recover a bad superblock from a corrupted ext3 partition?

I’m getting following error:

/dev/sda2: Input/output error
mount: /dev/sda2: can’t read superblock

How do I fix this error?

A. Linux ext2/3 filesystem stores superblock at different backup location so it is possible to get back data from corrupted partition.
[Warning examples may crash your computer] WARNING! Make sure file system is UNMOUNTED.

If your system will give you a terminal type the following command, else boot Linux system from rescue disk (boot from 1st CD/DVD. At boot: prompt type command linux rescue).
Mount partition using alternate superblock

Find out superblock location for /dev/sda2:
# dumpe2fs /dev/sda2 | grep superblock
Sample output:

Primary superblock at 0, Group descriptors at 1-6
Backup superblock at 32768, Group descriptors at 32769-32774
Backup superblock at 98304, Group descriptors at 98305-98310
Backup superblock at 163840, Group descriptors at 163841-163846
Backup superblock at 229376, Group descriptors at 229377-229382
Backup superblock at 294912, Group descriptors at 294913-294918
Backup superblock at 819200, Group descriptors at 819201-819206
Backup superblock at 884736, Group descriptors at 884737-884742
Backup superblock at 1605632, Group descriptors at 1605633-1605638
Backup superblock at 2654208, Group descriptors at 2654209-2654214
Backup superblock at 4096000, Group descriptors at 4096001-4096006
Backup superblock at 7962624, Group descriptors at 7962625-7962630
Backup superblock at 11239424, Group descriptors at 11239425-11239430
Backup superblock at 20480000, Group descriptors at 20480001-20480006
Backup superblock at 23887872, Group descriptors at 23887873-23887878

Now check and repair a Linux file system using alternate superblock # 32768:
# fsck -b 32768 /dev/sda2
Sample output:

fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
/dev/sda2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong for group #241 (32254, counted=32253).
Fix? yes

Free blocks count wrong for group #362 (32254, counted=32248).
Fix? yes

Free blocks count wrong for group #368 (32254, counted=27774).
Fix? yes
……….
/dev/sda2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda2: 59586/30539776 files (0.6% non-contiguous), 3604682/61059048 blocks

Now try to mount file system using mount command:
# mount /dev/sda2 /mnt
You can also use superblock stored at 32768 to mount partition, enter:
# mount sb={alternative-superblock} /dev/device /mnt
# mount sb=32768 /dev/sda2 /mnt
Try to browse and access file system:
# cd /mnt
# mkdir test
# ls -l
# cp file /path/to/safe/location

You should always keep backup of all important data including configuration files.

netstat: commands to find attackers…

This is useful to find out if your server is under attack or not. You can also list abusive IP address using this method.

netstat -nat | awk ‘{print $6}’ | sort | uniq -c | sort -n

Dig out more information about a specific ip address:

netstat -nat |grep {IP-address} | awk ‘{print $6}’ | sort | uniq -c | sort -n

Busy server can give out more information:

netstat -nat |grep 202.54.1.10 | awk ‘{print $6}’ | sort | uniq -c | sort -n

To print list of all unique IP address connected to server, enter:

netstat -nat | awk ‘{ print $5}’ | cut -d: -f1 | sed -e ‘/^$/d’ | uniq

To print total of all unique IP address, enter:

netstat -nat | awk ‘{ print $5}’ | cut -d: -f1 | sed -e ‘/^$/d’ | uniq | wc -l

If you think your Linux box is under attack, print out a list of open connections on your box and sorts them by according to IP address, enter:

netstat -atun | awk ‘{print $5}’ | cut -d: -f1 | sed -e ‘/^$/d’ |sort | uniq -c | sort -n

Display Summary Statistics for Each Protocol

Simply use netstat -s:

netstat -s | less

netstat -t -s | less

netstat -u -s | less

netstat -w -s | less

netstat -s

You can easily display dropped and total transmitted packets with netstat for eth0:

netstat –interfaces=eth0

Step-by-Step Procedure: Cisco Password recovery procedure

Step-by-Step Procedure
Follow the below.

Attach a terminal or PC with terminal emulation (for example, Hyper Terminal) to the console port of the switch.

Use the following terminal settings:

Bits per second (baud): 9600

Data bits: 8

Parity: None

Stop bits: 1

Flow Control: Xon/Xoff

Note: For additional information on cabling and connecting a terminal to the console port, refer to Connecting a Terminal to the Console Port on Catalyst Switches.

Unplug the power cable.

Power the switch and bring it to the switch: prompt:

For 2900XL, 3500XL, 2940, 2950, 2960, 2970, 3550, 3560, and 3750 series switches, do this:

Hold down the mode button located on the left side of the front panel, while you reconnect the power cable to the switch.

Catalyst Switch Series
LED Behavior and Mode Button Release Action

2900XL, 3500XL, 3550
Release the Mode button when the LED above Port1x goes out.

2940, 2950
Release the Mode button after approximately 5 seconds when the Status (STAT) LED goes out. When you release the Mode button, the SYST LED blinks amber.

2960, 2970
Release the Mode button when the SYST LED blinks amber and then turns solid green. When you release the Mode button, the SYST LED blinks green.

3560, 3750
Release the Mode button after approximately 15 seconds when the SYST LED turns solid green. When you release the Mode button, the SYST LED blinks green.

Note: LED position may vary slightly depending on the model.

Catalyst 3524XL

Catalyst 2950-24

For 2955 series switches only:

The Catalyst 2955 series switches do not use an external mode button for password recovery. Instead the switch boot loader uses the break-key detection to stop the automatic boot sequence for the password recovery purposes. The break sequence is determined by the terminal application and operating system used. Hyperterm running on Windows 2000 uses Ctrl + Break. On a workstation running UNIX, Ctrl-C is the break key. For more information, refer to Standard Break Key Sequence Combinations During Password Recovery.

The example below uses Hyperterm to break into switch: mode on a 2955.

C2955 Boot Loader (C2955-HBOOT-M) Version 12.1(0.0.514), CISCO DEVELOPMENT TEST
VERSION
Compiled Fri 13-Dec-02 17:38 by madison
WS-C2955T-12 starting…
Base ethernet MAC Address: 00:0b:be:b6:ee:00
Xmodem file system is available.
Initializing Flash…
flashfs[0]: 19 files, 2 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 7741440
flashfs[0]: Bytes used: 4510720
flashfs[0]: Bytes available: 3230720
flashfs[0]: flashfs fsck took 7 seconds.
…done initializing flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4

*** The system will autoboot in 15 seconds ***
Send break character to prevent autobooting.

!— Wait until you see this message before
!— you issue the break sequence.
!— Ctrl+Break is entered using Hyperterm.

The system has been interrupted prior to initializing the flash file system to finish
loading the operating system software:

flash_init
load_helper
boot
switch:Issue the flash_init command.

switch: flash_init
Initializing Flash…
flashfs[0]: 143 files, 4 directories
flashfs[0]: 0 orphaned files, 0 orphaned directories
flashfs[0]: Total bytes: 3612672
flashfs[0]: Bytes used: 2729472
flashfs[0]: Bytes available: 883200
flashfs[0]: flashfs fsck took 86 seconds
….done Initializing Flash.
Boot Sector Filesystem (bs:) installed, fsid: 3
Parameter Block Filesystem (pb:) installed, fsid: 4
switch:

!— This output is from a 2900XL switch. Output from
!— other switches will vary slightly.

Issue the load_helper command.

switch: load_helper
switch:Issue the dir flash: command.

Note: Make sure to type a colon “:” after the dir flash.

The switch file system is displayed:

switch: dir flash:
Directory of flash:/
2 -rwx 1803357 c3500xl-c3h2s-mz.120-5.WC7.bin

!— This is the current version of software.

4 -rwx 1131 config.text

!— This is the configuration file.

5 -rwx 109 info
6 -rwx 389 env_vars
7 drwx 640 html
18 -rwx 109 info.ver
403968 bytes available (3208704 bytes used)
switch:

!— This output is from a 3500XL switch. Output from
!— other switches will vary slightly.

Type rename flash:config.text flash:config.old to rename the configuration file.

switch: rename flash:config.text flash:config.old
switch:

!— The config.text file contains the password
!— definition.

Issue the boot command to boot the system.

switch: boot
Loading “flash:c3500xl-c3h2s-mz.120-5.WC7.bin”…###############################
################################################################################
######################################################################
File “flash:c3500xl-c3h2s-mz.120-5.WC7.bin” uncompressed and installed, entry po
int: 0×3000
executing…

!— Output suppressed.
!— This output is from a 3500XL switch. Output from other switches
!— will vary slightly.

Enter “n” at the prompt to abort the initial configuration dialog.

— System Configuration Dialog —
At any point you may enter a question mark ‘?’ for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets ‘[]‘.
Continue with configuration dialog? [yes/no]: n

!— Type “n” for no.

Press RETURN to get started.

!— Press Return or Enter.

Switch>

!— The Switch> prompt is displayed.

At the switch prompt, type en to enter enable mode.

Switch>en
Switch#Type rename flash:config.old flash:config.text to rename the configuration file with its original name.

Switch#rename flash:config.old flash:config.text
Destination filename [config.text]

!— Press Return or Enter.

Switch#Copy the configuration file into memory.

Switch#copy flash:config.text system:running-config
Destination filename [running-config]?

!— Press Return or Enter.

1131 bytes copied in 0.760 secs
Sw1#The configuration file is now reloaded.

Overwrite the current passwords that you do not know. Choose a strong password with at least one capital letter, one number, and one special character.

Note: Overwrite the passwords which are necessary. You need not overwrite all of the mentioned passwords.

Sw1# conf t

!— To overwrite existing secret password

Sw1(config)#enable secret

!— To overwrite existing enable password

Sw1(config)#enable password

!— To overwrite existing vty password

Sw1(config)#line vty 0 15
Sw1(config-line)#password

Sw1(config-line)#login

!— To overwrite existing console password

Sw1(config-line)#line con 0
Sw1(config-line)#password

Write the running configuration to the configuration file with the write memory command.

Sw1#write memory
Building configuration…
[OK]
Sw1#