Bloggin in the UK RSS 2.0
 Thursday, November 13, 2008

I have decided to put a shed in the garden this is an account of what was involved and what the various bits cost.



Here she is a 5m x 5m Conrad from Factory Cabins Direct. She cost £2300 inc vat with 44m thick walls and double glazing and took about four weeks to arrive. I notice the price has just gone up to £2700. The shed arrived on the back of a truck with a Hiab crane, the driver was able to hoist the pallet off the truck an on to our drive. As you would expect the pallet was about 5m long and 1m high by 1m wide.





Leveling the site and running services to the shed

I found man with a digger who came and spent a day leveling a 5.0m x 5.0m site, he also dug a trench and laid an armoured cable and water pipe from the shed to the house, for this he charged £180. I wasn't able to be on site when he was working which was a mistake as he did not do a great job of leveling the site. I should have put up some visual markers for him to work to.
Thursday, November 13, 2008 10:34:05 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Monday, October 13, 2008

I needed to automate the upload of csv files to an SFTP server for print fulfilment. It was a bit trickier than I thought it would be so I recorded what I did in case I need to do it again someday.

1)     Download and install WinSCP from here: http://winscp.net

2)     Create a folder where files will be uploaded from and a sub folder called Archive

3)     Open WinSCP go to Options Select Storage and Set Configuration Storage to INI file (WinSCP.ini), close WinSCP.

4)     Add a the PATH to the WinSCP install folder in the Environment Variables

5)     Create a file in the upload folder called SftpScript.txt

6)     Create a .cmd file and add the following command, modify the path to SftpScript.txt

      winscp.com /console /script=C:\Files\PrintFulfilment\SftpScript.txt >> SftpUpload.log

7)     Add the following code to SftpScript.txt, update the parameters highlighted in red.

 

# Automatically answer all prompts negatively not to stall the script on errors

option batch on

 

# Disable overwrite confirmations that conflict with the previous

option confirm off

 

# Connect using a password

open user:password@ftp.somewhere.com

 

# Force binary mode transfer

option transfer binary

 

# Change to home directory

cd

 

# Upload the file to current working directory

put C:\Files\PrintFulfilment\*.csv

 

# Disconnect

close

# Exit WinSCP

Exit

 

8)     To prevent the same file being uploaded next time the command runs add the following to the .cmd File, updating the file mask and archive folder path.

 

MOVE *.csv C:\Files\PrintFulfilment\Archive\

Monday, October 13, 2008 4:48:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Monday, September 29, 2008

I have recently changed job, I have moved from the relative safety of Tradeweb to Wonga an 18 month old startup. It's a very exciting place to work offering a very dynamic working environment.

The company is very focused on becoming the number one source of cash on demand. It offers cash direct to your bank account with in a few minutes of being accepted if you apply before 3pm. This presents a lot of challenges as nearly all customer scoring and verification has to done automatically.

The service is for people who need to borrow a small amount of cash for a short period of time (up to 30 days). It is only designed for use in emergencies. If you are accepted for a loan and repay on time your Wonga Trust rating increases and so does the amount you may borrow.

It's good to be back in a small company where I feel I can make a difference.

Monday, September 29, 2008 1:17:28 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Saturday, September 20, 2008

Every now and again I stumble across a tool that does exactly what I am looking for no if's or but's just exactly what I need. It is a rare moment and something to savour.

Today it happened and the tool is Microsoft's Log Parser. This is a tool that knows how to read IIS and Windows event logs out of the box, it allows you to specify filters and columns using a SQL-like syntax and dump the result straight into a SQL server database. How freakin amazing is that! To build this yourself would involve writing scripts that use WMI or .NET to interrogate the logs then produce text files in a BCP friendly format then shelling out to the BCP utility to import to a DB, in other words lots of work. This can now all be achieved in one line of code:

LogParser -i:EVT -o:NAT "SELECT * INTO c:\Output.txt FROM System"

The example above takes all the fields from the Windows System Event Log and places them into a text file called Output.txt. Once you have installed Log Parser you can copy that line of code into a command prompt on any windows machine and if you have the necessary permissions you will dump the entire system event log to a text file. It's quick too I processed ~2600 log entries to a text file in 0.7 secs on my laptop.

I am still investigating all the features, if you specify the SQL output format -o:SQL you have either to setup a DSN to your database or supply the Sql server & database (if using Sql Auth you also need username & password). After the INTO you specifiy the table name, when the command executes if the table does not exist it will be created for you using the columns in the input format. If want to import into an existing table the column names, data types and order of columns must match. Read the excellent help file that comes with the install. See the example below.

Finally there is one more cool feature I would like to mention, if you wish continually upload log entries from a log file as it grows but you wish ignore records you have already processed you are in luck! Use the iCheckPoint parameter and Log Parser will create a file where it stores the position it last read up to in the log file you are processing. This removes the need to clear out the database and reload everything which means a lot less horsepower will be required for processing your logs. You can reduce the intervals between log uploads to make your database more current.

It also has a Com+ api so you can call it directly from C# or VB. I can't believe it took me this long to discover such a useful tool.

SQL Server Example:
LogParser -i:EVT -o:SQL "SELECT * INTO EventLog FROM System" -server:Laptop\SqlExpress -database:Keeper -driver:"SQL Server" -createTable:ON

UPDATE:
If you have IIS set to create Daily log files (the default) then a bit of code is needed in your batch file to determine what the current filename will be. The following example will work on an XP/2003 server that has is local date format set to the UK. If you are deploying to a server with US date format you will need change code that sets the CurrentLogFile variable.

REM Use on servers set to UK date
SET CurrentLogFile=ex%date:~8,2%%date:~3,2%%date:~0,2%.log

REM SET the path to the IIS Log Files Folder. NOTE: If your IIS server has multiple Websites you may have to change the path.
SET LogFilesFolder=%SYSTEMROOT%\system32\Logfiles\W3SVC1\

ECHO Attempting to process IIS Log File: %LogFilesFolder%%CurrentLogFile%

PAUSE
LogParser -i:IISW3C -o:SQL "SELECT * INTO IISLog FROM %LogFilesFolder%%CurrentLogFile%" -server:Laptop\SqlExpress -database:Keeper -driver:"SQL Server" -createTable:ON
PAUSE

Update: Found a Gotcha
I discovered a gotcha with using the flag -createTable:ON when importing IISLogs into SQL server, this will set the column length to 255 max. Often columns like csReferrer, csUriQuery, csUriStem and csUserAgent will exceed 255 chars. To fix this problem simply increase the length of the columns.
I used csCookie: varchar(5000), csUriQueryString: varchar(5000), csUriStem: varchar(1000), csUserAgent: varchar(1000)


Saturday, September 20, 2008 7:28:36 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] -

I am a big fan of Mark Steel's, I loved the "Mark Steel Lectures" series that he did for the Open University. He is very good at explaining ideas in plain english, de-jargonising them and adding touch of humor to the learning experience. The majority of the series seems to be on you tube, just search for his name and you will find them.

In his latest book he talks mostly about the last ten years of his life, the birth of his two kids, his split with his partner and the end of his membership of the SWP. If your thinking what's so interesting about that well i'm 35 year old and he is 46 so I am just about to go through what he is talking about in his book (hopefully not splitting with my wife and I'm not an SWP member). My wife is eight months pregnant with our first child. The book is honest and amusing and very reasuring that my complete lack of preparedness for becoming a father is the norm.

The book is an entertaining read and well written, I took it on holiday and it only lasted three days a good sign for me. I don't share Mark's views on Capitalism but enjoy reading his arguments, which do have merit because they are well thought out.

4/5 for me.

Saturday, September 20, 2008 9:29:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Wednesday, August 13, 2008
These are the schema design commandments I live by, they are kept here purely for my reference.
Rules marked with * are absolute and if not implemented will result in karma so bad you will be reincarnated as a bottom feeder.

1.) Pluralise table names.
2.) *Every table in the db will have a primary key, without exception.
3.) Be consistent with Case and separators when naming tables and columns
4.) Enforce referential integrity with foreign keys.
5.) Avoid acronyms wherever possible when naming tables and columns.
6.) Avoid using the float datatype for columns that will store monetary values.
7.) Use varchar instead of char(n) unless specifically required.

If you have any rules you swear by then please comment with your reasoning.
This is a work in progress.

Wednesday, August 13, 2008 8:26:17 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
SQL Server
 Wednesday, July 30, 2008



I have a friend I'll call him Aaron because that's his name.

He has joined the company behind a new social networking site focused in the gaming community.

The have just revamped their site, it is still in beta though you wouldn't know it.

The have areas for all the major consoles and of course pc games.

Check Playfire out here.

The interesting thing about playfire from a developers point of view is that the platform is developed on Django a web development framework developed in Python. It is based loosely on the RoR MVC framework and seems to be gaining some traction. I intend to check it out soon.

Wednesday, July 30, 2008 5:33:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [2] -

 Tuesday, July 29, 2008
There is a new search engine on the block, you've got to admire someone who's got the balls to take google on!

Check CUIL out.

My first impressions are that it's fast, it doesn't have a geographical filter like google which might make looking for online stores in your country a problem, unless it handles this behind the scenes.

As you would expect it's index is not as complete as google, I have a three websites and it only found one of them but it may just take some time to get round to the others.

I'm hoping it will be Bot unfriendly, last time I trawled my weblog's live search was referring very open ended searchs to my site, i'm guessing this is bots submitting search words from a dictionary and then working through the list of results, but i'm not sure. One thing I know is that google does not show up in the logs in this way.

One thing I know is competition is healthy if this new site can steal some market share from google it will help to keep google honest.

Robert Scoble has posted on his blog about it.


Tuesday, July 29, 2008 8:19:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -

 Wednesday, July 16, 2008
Entity Definitions
==================
Center - An organisation that runs courses
Center Admin - A course administrator
Center Instructor - A course instructor
Organisation - An organisation that sends people on courses
Organisation Admin - An administrator at an organisation that sends people on courses
Attendee - A person that attends a course
 

Complete First Aid Course Bookings
==================================
- These will be administered by ProHealth to begin with
- Add certification duration to Course Types
- Add course attendee certificate issue date / expiry fields - This should be the same date that is on the certificate and will be used to trigger reminders to be sent out.

Nice to have's
==============
- Course Search Form - Search by category / date / type / status
- Upcoming Course list - set max in list / period i.e 3 months / both
- RSS / Email Notifications for upcoming courses
Enquiry form
- filled out by PH admin when enquiry is received by phone / email / fax
- Should allow searching for repeat bookings by existing customers by post code / company name
- Will track enquiries as they become bookings
- Sends an email to prospective customer containg a link to book on line / pdf to faxback
- PDF contains enquiry ref will be keyed by ph admin when fax is recieved will save time.
  
Expiry Tracking System
======================
Because a company would be nuts if it didn't chase repeat business
- Inteligent tracking of certificate expiry dates
- Issue reminder letters, calls, or emails to org's, companies and individuals.
-- Currently this is done once a year
-- Organised companies book an entire year in advance
-- Disorganised companies book at the last minute.
-- The system should try and make life easier for both types of company
- Optout/in facility will allow reminders to be turned off

Company Portal
===============
Will follow when all in house admin functionality is complete
- Customer will be issued a login and password

Wednesday, July 16, 2008 9:07:37 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
centro | monorail
Archive
<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Charlie Barker
Sign In
Statistics
Total Posts: 144
This Year: 25
This Month: 1
This Week: 0
Comments: 53
Themes
Pick a theme:
All Content © 2008, Charlie Barker
DasBlog theme 'Business' created by Christoph De Baene (delarou)