Pointers

This following is a basic break down of what a pointer is. These seems to cause a lot of confusion in the programming world.

A pointer is a variable which stores a memory address. This memory address contains some type of data. When declaring a pointer the compiler needs to know the data type stored at this address.

– Create pointer referencing an integer

int *ptr

prt will contain the memory location which contains an integer.

– Set an integer value at the memory location referenced by the pointer

*prt = 7

this will set the integer at memory location referenced by ptr to 7

– Get the actual value stored at pointer address

int test = *prt

this assumes prt is declared as an integer and contains a value

– Set pointer to address of an existing variable

int k =7

ptr = &k

& unary operator which gets the address of the variable.

Configure PHP on Windows Server 2003

These instructions were tested using PHP 5.2.9 on Windows Server 2003 sp2 with IIS 6 installed.

1. Download PHP from http://www.php.net, make sure you use the .zip package NOT the installer.

2. Extract .zip file, C:PHP is the recommended location

3. Add C:PHP to your path. Right click My Computer and select Properties. On the Properties dialog select the Advanced tab and click Environmental Variables. Under the System variables select the path entry and click edit. Find the last entry enter a semi colon (;) followed my C:PHP

4. Open the Internet Information Services (IIS) Manager from Administrative Tools.

a) Web Service Extension. Click down to the Web Service Extension folder. Right click the folder and select Add New Web Service Extension. Set Extension Name to .PHP and add C:PHPPHP5ISAPI.DLL to Required Files . Check Set Extension Status To Allowed.

b) Web Sites. Click down to Web Sites. Right click the folder and select Properties. From the Home Directory tab click the Configuration button. Click Add to add an Application Extension. Enter C:PHPPHP5ISAPI.DLL as Executable and PHP as Extension. Leave the rest as default and click Ok.

5. Finally set the correct file permissions the C:PHP folder. If left as default you will probably get a 401.3 error when trying to open php file.

6. You should now be able to execute php script from the C:INETPUBWWWROOT folder. To test this create an info.php file and add phpinfo() in a php scripting block.

Save, then navigate to http://localhost/info.php

Other things worth noting

– As you start using PHP, in the not too distant future you will probably need to make some changes to php.ini. PHP works fine without the php.ini file but you really should have one and it should be in your Windows directory. Copy C:PHPPHP.INI-RECOMMENDED to C:WINDOWSPHP.INI

– If you are going to use MySQL you will need to make sure to uncomment the line “extension=php_mysql.dll” in php.ini and copy C:PHPLIBMYSQL.DLL to C:WINDOWSSYSTEM32 (Simply setting the PATH won’t work as this is apparently hard coded in PHP5). If you don’t follow these steps you will get an error message similar to this: “Call to undefined function mysql_connect”

Manually Change Dock Background

This can only be done using a jailbroken iPhone. Navigate to the following location using SSH, Disk for iPhone or something similar.

/System/Library/CoreServices/SpringBoard.app/

Replace the SBDockBG.png file to one of your liking.

Finally restart the device.

Accessing HKEY_CURRENT_USERS remotely

When connecting to a remote registry you only have HKEY_LOCAL_MACHINE and HKEY_USERS available.

The profile is stored in the HKEY_USERS. The HKEY_CURRENT_USER key maps to the current user’s branch in HKEY_USERS.

By looking at HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList you can identify the SID for each profile.

Each SID has a ProfileImagePath key which points to the users profile in the Documents and Settings folder. You can use this information to identify the SID for a particular user.

Once you have the SID HKEY_CURRENT_USER settings can be changed under the appropriate branch in HKEY_USERS.

Windows Environment Variables

%ALLUSERSPROFILE% – C:Documents and SettingsAll Users
%APPDATA% – C:Documents and Settings{username}Application Data
%COMPUTERNAME% – {computername}
%COMSPEC% – C:WindowsSystem32cmd.exe
%HOMEDRIVE% – C:
%HOMEPATH% – Documents and Settings{username}
%PATH% – C:WindowsSystem32;C:Windows;C:WindowsSystem32Wbem
%PATHEXT% – .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH
%PROGRAMFILES% – Directory containing program files, usually C:Program Files
%PROMPT% – Code for current command prompt format. Code is usually $P$G
%SYSTEMDRIVE% – The drive containing the Windows XP root directory, usually C:
%SYSTEMROOT% – The Windows XP root directory, usually C:Windows
%TEMP% and %TMP% – C:DOCUME~1{username}LOCALS~1Temp
%USERNAME% – {username}
%USERPROFILE% – C:Documents and Settings{username}
%WINDIR% – C:Windows

Dynamic Environment Variables

%DATE% – Current date in the format determined by the Date command
%TIME% – Current time in the format determined by the Time command
%CD% – Current directory with its full path
%ERRORLEVEL% – Number defining exit status of a previous command or program
%RANDOM% – Random number between 0 and 32767