Expanding on a tip from the previous post, I quite often will have conversations over msn messenger in the morning and forgett to mail myself the logs of how to do things. Heres one way to access your logs or attach a file system.

On the server, create a Share with write permissions in my instance I have named the folder ShareMSMessengerLogs
On the client machine execute the following command.

NET USE H: \\70.84.243.42\Share

This will then prompt you for a username and password, enter the credentials for the server, although I wouldn’t recommend using your administrator account and also it does not matter what drive you attach this too as long as it is not taken, in this instance I have used drive H:

The password or user name is invalid for \\70.84.243.42\Share.

Enter the user name for '70.84.243.42': Administrator
Enter the password for 70.84.243.42:
The command completed successfully.

Now set the path in MSN Messenger to the path of the network drive H:

I just came across this about Friends Reunited web site for £120 million on informitv, not bad considering it was a established from their back room :)

ITV acquires Friends web site for 120 million pounds
ITV, the UK commercial television company, has acquired the Friends Reunited web site from its founders for £120 million in cash and shares.

Friends Reunited, a web site that links people through their former schools, colleges and employers, was originally established by Steve and Julie Pankhurst from the spare bedroom of their suburban semi in north London.

The company expects to turnover £12 million in the year 2005, with earnings of £6 million before tax.

Random Quick Tips

In: General

19 Dec 2005

Everyone has their own way of doing things, whether its through one short cut or another, anyway heres some quick tips. If you have any submit them below, i’m sure I we all still have plenty to learn.

Minimise Outlook to Systray…

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Preferences]
"MinToTray"=dword:00000001

MAP Network drives, including Samba from the command line.

NET VIEW
\\PC192
\\PC193
\\SVR50
\\SVR51
\\SVR52
\\SVR57
\\SVR59
NET USE P: \\127.0.0.1/Projects

Get general SystemInformation command line

systeminfo

Copy local DNS from a server, if you don’t have a DNS server from the command line.

copy  \ \SVR69 \netlogon \hosts %systemroot% \system32 \drivers \etc \hosts

Running admin commands on a workstation from the command line

runas /u:127.0.0.1 \administrator cmd.exe

Lookup Name Server information including TTL from the command line.

nslookup
Default Server:
Address:  192.168.2.1

> set d2
> set domain=ajohnstone.com
> set type=all
> ls
Server:
Address:  192.168.2.1

------------
SendRequest(), len 35
    HEADER:
        opcode = QUERY, id = 2, rcode = NOERROR
        header flags:  query, want recursion
        questions = 1,  answers = 0,  authority records = 0,  additional = 0

    QUESTIONS:
        ls.ajohnstone.com, type = ANY, class = IN

------------
------------
Got answer (97 bytes):
    HEADER:
        opcode = QUERY, id = 2, rcode = NOERROR
        header flags:  response, want recursion, recursion avail.
        questions = 1,  answers = 1,  authority records = 2,  additional = 0

    QUESTIONS:
        ls.ajohnstone.com, type = ANY, class = IN
    ANSWERS:
    ->  ls.ajohnstone.com
        type = A, class = IN, dlen = 4
        internet address = 70.85.198.202
        ttl = 86371 (23 hours 59 mins 31 secs)
    AUTHORITY RECORDS:
    ->  ajohnstone.com
        type = NS, class = IN, dlen = 16
        nameserver = ns.aplosmedia.com
        ttl = 86166 (23 hours 56 mins 6 secs)
    ->  ajohnstone.com
        type = NS, class = IN, dlen = 6
        nameserver = ns2.aplosmedia.com
        ttl = 86166 (23 hours 56 mins 6 secs)

------------
Non-authoritative answer:
ls.ajohnstone.com
        type = A, class = IN, dlen = 4
        internet address = 70.85.198.202
        ttl = 86371 (23 hours 59 mins 31 secs)

ajohnstone.com
        type = NS, class = IN, dlen = 16
        nameserver = ns.aplosmedia.com
        ttl = 86166 (23 hours 56 mins 6 secs)
ajohnstone.com
        type = NS, class = IN, dlen = 6
        nameserver = ns2.aplosmedia.com
        ttl = 86166 (23 hours 56 mins 6 secs)
>

Display DNS Cache, Flush DNS, Release IP Address, and Renew IP Address from the command line.

ipconfig /displaydns
ipconfig /flushdns
ipconfig /release
ipconfig /renew

Alternative to Tracert

PathPing

DNSLint [Description of the DNSLint] (Download)
DNSLint is a Microsoft Windows utility that helps you to diagnose common DNS name resolution issues.

I was browsing through google for any new information on large scale PHP deployments, and to my surprise I got a message telling me my machine had been infected! Considering I am very careful what I run on my machine, and haven’t had a virus on my computer in over two or more years I was quite surprised. Admitedly I have installed applications that do contain spyware, and I quite promptly physically remove them from the registry, the file system, and ensuring that any application hooks are also removed.

I immediately ran an antivirus program and a number of other applications to ensure nothing was ary, which picked up nothing. Anyway heres the amusing little picture :) .

Google Virus/Spyware

MySQL 3

In: MySQL

17 Dec 2005

Lately i’ve been developing with MySQL3, and it’s almost like hitting your head against a brick wall with its limitations and specific documentation is difficult to find.

Some of the limitations:

  • Subqueries. ’select id from t where grp in (select grp from g where u > 100)’
  • Add DISTINCT to Aggregates
  • JOINs with ambiguous columns causes a MySQL error.
  • Foreign Key Definition Ignored on MyISAM.
    • In MySQL Server 3.23.44 and up, the InnoDB storage engine supports checking of foreign key constraints, including CASCADE, ON DELETE, and ON UPDATE. See Section 14.2.6.4, “FOREIGN KEY Constraints”.

      For storage engines other than InnoDB, MySQL Server parses the FOREIGN KEY syntax in CREATE TABLE statements, but does not use or store it. In the future, the implementation will be extended to store this information in the table specification file so that it may be retrieved by mysqldump and ODBC. At a later stage, foreign key constraints will be implemented for MyISAM tables as well.

  • Function CASE
  • Add a handler interface for table information so one can use it as a system table. This would be a bit slow if one requested information about all tables, but very flexible. One should also implement ’show info from table’ for basic table information.
  • Reordering columns. E.g. ALTER TABLE FormObjects MODIFY COLUMN FormFieldRuleID INT(11) AFTER FOLID;
  • JOINS on UPDATE’s.

Other limitations

  • Don’t add automatic DEFAULT values to columns. Give an error when using an INSERT that doesn’t contain a column that doesn’t have an DEFAULT.
  • Multiple SQL in a query commands
  • LOCK DATABASES.
  • NATURAL JOIN

fairly recently started a new position, and have come from developing on all the latest versions to developing with MySQL 3, and PHP 4, which is quite a step back from MySQL 5, (PHP 5.0.4) or even MySQL 4. In general I take many aspects of MySQLs features as being rather trivial and it makes my job that much more difficult to discover why there is syntax errors, which is valid in later versions of MySQL.

As to why MySQL 3 is still being used is due to support an application.

Sharepoint & PHP

In: PHP

8 Dec 2005

I was interested in integrating PHP and SharePoint services, and using Microsoft Word 2003 (Or other MS Office Products) to upload documents directly to PHP, here are some of my observations.

There are two processes winword.exe itself pyshically POST’s the word document on the server, another process called dssm.exe (Microsoft Office Document Update Utility), which manages updates.

Sharepoint Document

Analyzing the http protocol, whilst utilizing shared workspaces in Microsoft Word 2003 initialially authenticates via NTLM and the following protocols are listed in OPTIONS: [GET, POST, OPTIONS, HEAD, MKCOL, PUT, PROPFIND, PROPPATCH, DELETE, MOVE, COPY, GETLIB, LOCK, UNLOCK]; Which means Apache would have to be configured to accept some of the protocols.

Once authenticated the following occurs:

WinWord.exe Upload to SharePoint

WinWord.exe Update to SharePoint

Some example requests.

POST

POST /SharePoint%20Services(1)/_vti_bin/_vti_aut/author.dll HTTP/1.1
Accept: auth/sicily
Content-Length: 20207
Content-Type: application/x-vermeer-urlencoded
X-Vermeer-Content-Type: application/x-vermeer-urlencoded
Connection: Keep-Alive

method=put+document%3a6%2e0%2e2%2e6356&service%5fname=%2fSharePoint+Services%281%29&document=%5bdocument%5fname%3dShared+Documents%2fSharePoint+Services%2edoc%3bmeta%5finfo%3d%5b%5d%5d&put%5foption=edit&comment=&keep%5fchecked%5fout=false

method=put+document:6.0.2.6356&service_name=/SharePoint+Services(1)&document=%5Bdocument_name=Shared+Documents/SharePoint+Services.doc;meta_info=%5B%5D%5D&put_option=edit&comment=&keep_checked_out=false

Response

HTTP/1.1 200 OK
Connection: close
Date: Tue, 08 Nov 2005 21:26:55 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 6.0.2.6411
Content-type: application/x-vermeer-rpc

<html><head><title>vermeer RPC packet</title></head>
<body>
<p>method=put document:6.0.2.6356
<p>message=successfully put document 'Shared Documents/SharePoint Services.doc' as 'Shared Documents/SharePoint Services.doc'
<p>document=
<ul>
<li>document_name=Shared Documents/SharePoint Services.doc
<li>meta_info=
<ul>
<li>vti_approvallevel
<li>SR|
<li>vti_categories
<li>VW|
<li>vti_filesize
<li>IR|19968
<li>vti_assignedto
<li>SR|
<li>Checked by
<li>SW|Andrew M. Johnstone
<li>Department
<li>SW|Development
<li>vti_modifiedby
<li>SR|C22586_40180\administrator
<li>vti_timecreated
<li>TR|08 Nov 2005 21:26:56 -0000
<li>vti_title
<li>SR|SharePoint Services
<li>vti_timelastmodified
<li>TR|08 Nov 2005 21:26:56 -0000
<li>_SharedFileIndex
<li>SW|0000020000000000{54AD31DF-B8AF-4070-A579-F3A63D6C202F}http://sharepoint.hostelhost.com/SharePoint Services(1)/Shared Documents/SharePoint Services.doc
<li>vti_author
<li>SR|C22586_40180\administrator
<li>vti_sourcecontrolversion
<li>SR|V1
<li>vti_sourcecontrolcookie
<li>SR|fp_internal
</ul>
</ul>
</body>
</html>

POST

POST /SharePoint%20Services(1)/_vti_bin/dws.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: http://schemas.microsoft.com/sharepoint/soap/dws/GetDwsMetaData
X-Office-Version: 11.0.6408
User-Agent: Microsoft Office/11.0 (Windows NT 5.1; Microsoft Office Word 11.0.6408; Pro)
Host: sharepoint.hostelhost.com
Content-Length: 363
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: HELM=Username=&Interface=standard%5FXP&ThemeColour=XP&NonSecureReturnURL=&Password=&LanguageCode=EN
Authorization: NTLM 

<?xml version='1.0' ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <GetDwsMetaData xmlns="http://schemas.microsoft.com/sharepoint/soap/dws/">
      <document>http://sharepoint.hostelhost.com/SharePoint%20Services(1)/Shared%20Documents/SharePoint%20Services.doc</document>
      <id></id>
      <minimal>false</minimal>
    </GetDwsMetaData>
  </s:Body>
</s:Envelope>

Response

HTTP/1.1 200 OK
Date: Tue, 08 Nov 2005 21:26:59 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 6.0.2.6411
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 6367

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <GetDwsMetaDataResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/dws/">
      <GetDwsMetaDataResult>
      <Results>
        <SubscribeUrl>http://sharepoint.hostelhost.com/SharePoint Services(1)/_layouts/1033/SubNew.aspx</SubscribeUrl>
        <MtgInstance />
        <SettingUrl>http://sharepoint.hostelhost.com/SharePoint Services(1)/_layouts/1033/settings.aspx</SettingUrl>
        <PermsUrl>http://sharepoint.hostelhost.com/SharePoint Services(1)/_layouts/1033/EditPrms.aspx</PermsUrl>
        <UserInfoUrl>http://sharepoint.hostelhost.com/SharePoint Services(1)/_layouts/1033/UserEdit.aspx</UserInfoUrl>
        <Roles>
          <Role Name="Reader" Type="Reader" Description="Has read-only access to the Web site." />
          <Role Name="Contributor" Type="Contributor" Description="Can add content to existing document libraries and lists." />
          <Role Name="Web Designer" Type="WebDesigner" Description="Can create lists and document libraries and customize pages in the Web site." />
          <Role Name="Administrator" Type="Administrator" Description="Has full control of the Web site." />
        </Roles>
        <Schema Name="Tasks">
          <Field Name="Title" Type="Text" Required="True"><Choices /></Field>
          <Field Name="Attachments" Type="Attachments" Required="False"><Choices /></Field>
          <Field Name="Order" Type="Number" Required="False"><Choices /></Field>
          <Field Name="Priority" Type="Choice" Required="False"><Choices><Choice>(1) High</Choice><Choice>(2) Normal</Choice><Choice>(3) Low</Choice></Choices></Field>
          <Field Name="Status" Type="Choice" Required="False"><Choices><Choice>Not Started</Choice><Choice>In Progress</Choice><Choice>Completed</Choice><Choice>Deferred</Choice><Choice>Waiting on someone else</Choice></Choices></Field>
          <Field Name="PercentComplete" Type="Number" Required="False"><Choices /></Field>
          <Field Name="AssignedTo" Type="User" Required="False"><Choices /></Field>
          <Field Name="Body" Type="Note" Required="False"><Choices /></Field>
          <Field Name="StartDate" Type="DateTime" Required="False"><Choices /></Field>
          <Field Name="DueDate" Type="DateTime" Required="False"><Choices /></Field>
        </Schema>
        <Schema Name="Documents" Url="Shared Documents">
          <Field Name="FileLeafRef" Type="Invalid" Required="True"><Choices /></Field>
          <Field Name="_SourceUrl" Type="Text" Required="False"><Choices /></Field>
          <Field Name="_SharedFileIndex" Type="Text" Required="False"><Choices /></Field>
          <Field Name="Order" Type="Number" Required="False"><Choices /></Field>
          <Field Name="Title" Type="Text" Required="False"><Choices /></Field>
        </Schema>
        <Schema Name="Links">
          <Field Name="Attachments" Type="Attachments" Required="False"><Choices /></Field>
          <Field Name="Order" Type="Number" Required="False"><Choices /></Field>
          <Field Name="URL" Type="URL" Required="True"><Choices /></Field>
          <Field Name="Comments" Type="Note" Required="False"><Choices /></Field>
        </Schema>
        <ListInfo Name="Tasks">
          <Moderated>False</Moderated>
            <ListPermissions>
              <InsertListItems />
              <EditListItems />
              <DeleteListItems />
              <ManageLists />
            </ListPermissions>
          </ListInfo>
          <ListInfo Name="Documents">
            <Moderated>False</Moderated>
            <ListPermissions>
              <InsertListItems />
              <EditListItems />
              <DeleteListItems />
              <ManageLists />
            </ListPermissions>
          </ListInfo>
          <ListInfo Name="Links">
            <Moderated>False</Moderated>
            <ListPermissions>
              <InsertListItems /><EditListItems /><DeleteListItems /><ManageLists /></ListPermissions>
            </ListInfo>
            <Permissions>
              <ManageSubwebs /><ManageWeb /><ManageRoles /><ManageLists />
              <InsertListItems /><EditListItems /><DeleteListItems />
            </Permissions>
            <HasUniquePerm>True</HasUniquePerm>
            <WorkspaceType>DWS</WorkspaceType>
            <IsADMode>False</IsADMode>
            <DocUrl>http://sharepoint.hostelhost.com/SharePoint%20Services(1)/Shared%20Documents/SharePoint%20Services.doc</DocUrl>
            <Minimal>False</Minimal>
            <Results>
              <Title>SharePoint Services</Title>
              <LastUpdate>632670820194565000</LastUpdate>
              <User>
                <ID>1</ID>
                <Name>C22586_40180administrator</Name>
                <LoginName>C22586_40180administrator</LoginName>
                <Email>andrew@ajohnstone.com</Email>
                <IsDomainGroup>False</IsDomainGroup>
                <IsSiteAdmin>True</IsSiteAdmin>
              </User>
              <Members>
                <Member>
                  <ID>1</ID>
                  <Name>C22586_40180administrator</Name>
                  <LoginName>C22586_40180administrator</LoginName>
                  <Email>andrew@ajohnstone.com</Email>
                  <IsDomainGroup>False</IsDomainGroup>
                </Member>
              </Members>
              <Assignees>
                <Member>
                  <ID>1</ID>
                  <Name>C22586_40180administrator</Name>
                  <LoginName>C22586_40180administrator</LoginName>
                </Member>
              </Assignees>
              <List Name="Tasks">
                <ID>{A9D58464-55C3-477F-A18E-B18A75732A9F}</ID>
              </List>
              <List Name="Documents">
                <ID>{E133F72B-8ECB-436B-8916-CD331678AC75}</ID>
                <z:row ows_FileRef="Shared Documents/SharePoint Services.doc" ows_Title="SharePoint Services" ows_FSObjType="0" ows_Created="2005-11-08T21:26:55Z" ows_Author="1;#C22586_40180administrator" ows_Modified="2005-11-08T21:26:55Z" ows_Editor="1;#C22586_40180administrator" ows_ID="1" ows_ProgID="" xmlns:z="#RowsetSchema" />
              </List>
              <List Name="Links"><ID>{51BF4716-E5B7-4C0D-A6AE-93EF0645FF38}</ID></List>
            </Results>
          </Results>
      </GetDwsMetaDataResult>
    </GetDwsMetaDataResponse>
  </soap:Body>
</soap:Envelope>

I’ll post an example up when I get some free time…

It’s been a little while since I published something, so I’ll make something live. I tend to forgett about a silly quirk in internet explorer that I continually bump into, which generally takes me time to figure out why page does not load… Usually this is when downloading documents and is a very simple fix by calling session_cache_limiter(‘none’); after the session has been started.

Also something worth looking into is the QCodo Framework, which I have recently come across. It seems very effective from the demonstrations, and they also have a interesting article, Code Generation vs. Metaprogramming.

I have come across a few Ajax applications or implentations of Ajax that has impressed me due to their simplicity and clean designs, what Ajax implementations have impressed you lately?

I’ve been using Zend Studio for Eclipse (beta) for several weeks in a rewrite of a framework and numerous sites at work and overall I really like the IDE. Its got some great features and being based on the eclipse project makes it really extensible and customizable. With debugging, profiling, code completion, code formatting and more enabled can help with productivity.

A complete list of features can be found at Zend.

Zend Studio for Eclipse consumes quite a lot of memory and the recommended amount of RAM for eclipse based applications is 2GB, however you can control the amount of memory that eclipse will use by editing the zendStudio.ini file.

Whilst I do like the IDE I have found a number of issues with Zend Studio:

Bugs

  • 1. There have been a number of issues revolving around the SVN implementation in Zend Studio for Eclipse which causes the application to hang (SVN support is provided to eclipse by a 3rd party plugin (a company called Polarion)):
    • a) When committing files it locks entire directories and often hangs making Zend Studio for Eclipse unusable, if you have files that are not saved and attempt to do so it queues it as a users pending tasks and because the commit has stalled you cannot save the file.To resolve this I have to kill the process for Zend Studio, shell into the server and cleanup the the projects src, and sometimes have to re-checkout the directories in a project
  • 2. When developing via a samba share, it prompts with an incorrect error and does not attempt to re-authenticate when the samba share needs to re-connect and/or does recognise that it is talking via a remote device.
  • 3. Auto format adds extra braces to statements, causing syntax errors, strips all comments out of files!
  • 4. Importing an auto format does not seem to work correctly.
  • 5. When working with multiple open files it can overwrite the contents with another, I believe this is the case with files of a similar name (I’ve only had this occur once, however a colleague experiences this quite frequently).
  • 6. Modified file names are prefixed with “>” and when searching for files by pressing a character will not go to that file in PHP Explorer
  • 7. Templates do not always get replaced e.g. If the system is slow or you type fnc real quick it doesn’t replace with the template for a function.
  • 8.
    If you cause a syntax error, whether deliberate or not, a number of items such as auto formatting does not work, or you cannot open the php manual from the contexts menu for a php function. For example if I type “str_shuffle” then use a context menu to it does not open a manual. Context Menu With Syntax Error and Attempting to open PHP Manual
  • 9. introducing a syntax error and then removing the syntax error doesn’t clear until you save the document.Invalid Syntax Error

Resolved

  • 1. There was a bug in automatically updating eclipse, which never seemed to work however in the latest release (beta 2) this has now been resolved.

Zend Studio For Eclipse

I was playing around trying to bind Multiple Websites in IIS5.1 on Windows XP, however after trying to find information on why trying to start up both services resulted in the following error “The request is not supported”, despite being bound to different IP addresses. I finally came across Kristofer Gäfvert site, which states this is not possible :( and the only solution appears to upgrade to windows 2003 server, after trawling through lots of documentation. Regardless, when developing you tend to really only work on one project at a time so you can start and stop the projects Website as and when needed.

MetaBase Explorer
MetaBase Explorer.Resize
Bind Multiple Websites in IIS5

Bind Multiple=

About this blog

I have been a developer for roughly 10 years and have worked with an extensive range of technologies. Whilst working for relatively small companies, I have worked with all aspects of the development life cycle, which has given me a broad and in-depth experience.