Redirect all requests (including POST) from one Apache server to another

In order to test POST callbacks made by a payment gateway without having to work via FTP on a publicly-accessible server, I needed a simple solution to redirect all requests from said server to my workstation, that is on the same network as the server, but is not accessible from outside.

The easiest thing to do was to use the mod_rewritemod_proxy and mod_proxy_http Apache modules. You can easily activate all of them in Ubuntu with:

1
sudo a2enmod rewrite proxy proxy_http

I created an empty folder on the server and placed a .htaccess file with the following lines in it:

1
2
RewriteEngine On
RewriteRule ^(.*)$ http://10.4.2.155/$1 [NC,P]

The [P] at the end of the RewriteRule specifies that the request should be handled by the proxy module so all GET and POST data are preserved. Therefore, all requests made in that directory will be automatically forwarded to my machine.

Reset / change Windows 7 / Vista / XP password using a Ubuntu CD

So you forgot your Windows password, and want to reset it? No problem. All you need is a Ubuntu CD (download ISO file here, instructions on how to burn the image to a CD here).

Step 1: Boot from Ubuntu CD

Insert the Ubuntu CD, restart your computer. At the boot screen, select the language and then the first option, “Try Ubuntu without any change to your computer.”

Step 2: install chntpw

chntpw is a Linux utility to (re)set the password of any user that has a valid (local) account

Go to Administration / Software Sources, and make sure the “Community maintained Open Source software (universe)” option is checked. Press “Close”.


You will be prompted to reload the package information. Press “Reload”

Open a terminal (Applications / Accessories / Terminal):

Once the terminal is opened, type the following command in it and press enter:

1
sudo apt-get install chntpw

Step 3: Reset password

Once chntpw is installed, you have to mount the Windows partition. The easiest way to do this is to click the Windows drive in the Places menu (usually the first HDD in the list):

When the Windows drive is opened, make sure to copy the location where the drive was mounted from the address bar, and paste it in the following command:

1
cd /media/A854C956382E2B62/WINDOWS/system32/config/

Now you have the following options:

Reset / change the Administrator password:

1
sudo chntpw SAM

Reset / change another user’s password:

1
sudo chntpw -u your_username SAM

Whichever you type, you will be presented with a list of options:

1
2
3
4
5
6
7
- - - - User Edit Menu:
 1 - Clear (blank) user password
 2 - Edit (set new) user password (careful with this on XP or Vista)
 3 - Promote user (make user an administrator)
(4 - Unlock and enable user account) [seems unlocked already]
 q - Quit editing user, back to user select
Select: [q] >

Pressing 1, enter, y and another enter will remove the user’s password, and allow you to restart the computer and logon to Windows.