Solution: How to install Service Pack 1 on Windows 7

January 19th, 2012 No comments

Your Service Pack fails to install error given 80246007 or may be 80070003.

See here for official Microsoft solution (but see my additional information in red) :-

To change or restart the Background Intelligent Transfer Service (BITS)

You must be logged on as an administrator to perform these steps.

Open Administrative Tools by clicking the Start button , clicking Control Panel, clicking System and Maintenance, and then clicking Administrative Tools.

RIGHT MOUSE CLICK  Services and SELECT RUN AS ADMINISTRATOR.

If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Right-click the Background Intelligent Transfer Service (BITS) service, and then click Properties.

On the General tab, next to Startup type, make sure that Automatic (Delayed Start) is selected. If it is not, select it and then click Apply.

Next to Service status, check to see if the service is started. If it is not, click Start.

 

Service Pack 1 will now install.

Categories: windows Tips Tags:

WordPress have your menus dropped to the bottom?

November 5th, 2011 No comments

This has happened to me several times and I’ve always blamed a WordPress update or Theme update so I’ve de-installed and re-installed etc etc, but in the end it has always been the same simple mistake namely An Unclosed DIV Tag in a Post! This usually or always causes chaos to your page structure. So next time this happens to you whether on your WordPress Blog or in the CSS of your Website always think to check for unmatched DIV Pairs <DIV>…</DIV>

Categories: css, wordpress Tags:

bash: Find specifying certain file extensions

November 2nd, 2011 No comments
I had terrible trouble finding a way to do this in bash, doesn’t seem to be possible using -name or -iname :-

find /var/www/html/ -regex “.*\(php\|js\|inc\)” -exec grep -i ‘tbl_title’ {} +

find /var/www/html/ -regex “.*\(php\|js\|inc\)” -exec grep -i ‘tbl_title’ {} \;

NB: the \; and + endings are different the + ending usefully displays the matching file name

Of course if you have a recent bash you will likely prefer:-

grep -ilR –include=*.{php,inc,js} ‘fn_main’ c:/inetpub/wwwroot

or

grep -iR –include=*.{php,inc,js} ‘fn_main’ c:/inetpub/wwwroot

Categories: shell tips Tags:

Vim, Cygwin, docx2txt, catdoc and antiword view Microsoft Word Documents as Text

October 10th, 2011 No comments

I wanted to quickly compare two versions of a Word document and realized I didn’t know how to do it. A quick Google revealed that catdoc was available with Cygwin (and I guess elsewhere) .

> catdoc report1a.doc > report1a.txt
> catdoc report1b.doc > report1b.txt
> diff report1*.txt

Alternatively use antiword
place the following 4 lines in your .vimrc file

” use antiword to allow VIM to view the text of a Word Document
autocmd BufReadPre *.doc set ro
autocmd BufReadPre *.doc set hlsearch!
autocmd BufReadPost *.doc %!antiword “%”

> vim -d report1a.doc report1b.doc

Remember neither catdoc or antiword allow you to update your word documents.

catdoc also works with PowerPoint etc.

Just found out that these don’t work with the XML based docs eg report.docx for these you need Perl based docx2txt

Categories: Cygwin, vim, windows Tips Tags:

Software Update Hell

July 18th, 2011 4 comments

Software seems to need constant updating these days here’s what I’m updating:-

  • Windows 7 service pack 1 : keeps refusing to install for various reasons
  • WordPress 3.2.1 but some of my sites only had Mysql 4.x so I had to first upgrade to MySQL5.x
  • Blackberry Curve 9300 : Although the phone is new, I’ve been downloading huge updates
  • Virus Checkers etc etc

I was also bedeviled by those warning screens “Are you sure you want to continue” which disappeared behind other windows and left me wondering why an update was taking so long!.

I always say yes to updates if only to get rid of them, but gosh I would actually like to use my Netbook, Blackberry etc!!

Categories: windows Tips Tags:

In Demand Web Skills

July 12th, 2011 No comments

What is currently in demand is PHP5 that means OOP, any framework eg CakePHP/Zend or CodeIgniter and Jquery (Javascript) or good enough or on its own the serious Drupal experience.
If you’ve got these you are gold dust, if not you are … dust …

any comments?

Categories: Uncategorized Tags:

CakePHP is a Piece of Cake!

July 6th, 2011 1 comment

I’ve recently become aware of how behind the times my skills are , in particular if you write PHP you are expected to use a framework . I’ve chosen CakePHP and have installed it on my local Apache Server with a few permission hiccups. I’ve then completed the create a blog tutorial and it’s stunning how easy it is. It uses the MVC or Model-View-Controller system for development. To quote their documentation it CakePHP takes the monotony out of web development. We provide you with all the tools you need to get started coding what you really need to get done: the logic specific to your application. Instead of reinventing the wheel every time you sit down to a new project, check out a copy of CakePHP and get started with the real guts of your application.

Categories: Coding Tips, PHP Tags:

How to Remove Home in the Title of New Coppermine Gallery

June 30th, 2011 No comments

Edit include/themes.inc.php

Find the function and modify as follows


function theme_page_title($section)
{
global $CONFIG;
$return = strip_tags(bb_decode($section)) . ' - ' . $CONFIG['gallery_name']; // original code
$return = $CONFIG['gallery_name']; // Section removed
return $return;
}

this change works for cpg1.5.x

Categories: Coding Tips, PHP Tags:

Using Perl for Complex Edits

June 24th, 2011 No comments

All I use Vim 99% of the time whenever I want to do a really complex multiple edit I tend to use Perl.

So what’s the script doing ? It reads in one text file line by line and then operates on certain lines , and then writes out each line to an output file. You are only limited by your imagination as to what you do in the loop.

With a Perl script you can use Perl variables for counts, you can use a hash to store all the text and loop through it as often as required.

#!/usr/local/bin/perl
# pedit.pl
# description : Use for complex edits on a single file, adapt as required
# this trivial example is just incrementing a count
# zzapper
# v1.0
if ($#ARGV >= 0) { $file = $ARGV[0]; }
else
{
print "enter file:"; $file=;
}
chomp $file;
open (R,"$file") or die ("could not open $file ($!)");
$out = "c:/aaa/out.txt";
$out = "$file.txt";
$cnt=100;

open (W,">$out") or die ("could not open $out ($!)",__LINE__);
{
for $l ()
{
$l=~s/david1/david$cnt/gi; # do what you want here
print W $l;
$cnt++;
}
}
close W; close R;
print "\nOutput in cnt: $cnt :: $out\n";

Categories: Coding Tips, vim Tags:

QuickBooks Simple Start saving invoices as PDF files

May 27th, 2011 2 comments

How can I save my QuickBooks Invoice as a PDF

As a freelancer I only need a simple bookkeeping package so QuickBooks Simple Start Free Edition is perfect.

Quickbooks is very quick to set up and I soon had my invoices entered and now wanted to email them but oops there is no way to save the invoice as a PDF. Never mind I can email them to my client but no QuickBooks Simple Start only recognizes either Outlook or Windows Mail as email client and these are not available on Windows 7. I download, install and configure their replacement Windows Live Mail but QuickBooks stubbornly refuses to acknowledge it. I now trawl through QuickBooks own community forum and see people moaning that Windows Live Mail is ignored; apparently it will be or is available in QuickBooks 2011 .

Finally breakthrough I install CutePDF Writer http://www.cutepdf.com/ it is completely free. Now all I have to do is print my Invoice and select CutePDF as the virtual printer, CutePDF asks me where I want to save the Invoice PDF. I can then manually email my invoices (PDFs) to customers using my conventional email client allowing to add a personal message and also with the advantage of leaving me with an audit trail.

CutePDF Instructions: Using CutePDF Writer to create PDF document:

Select Print to bring up Print dialog box.
Then select CutePDF Writer as the Printer to print.
You will get a Save As dialog box prompted for saving created PDF file.
Select a folder to Save in and enter a File name, then click on Save.
Go to that folder to find your PDF file.

CutePDF Writer supports Microsoft Windows 98/ME/2000/XP/Vista/7 (x32/x64).

Categories: windows Tips Tags: