Thursday, December 20, 2012

Vim search/replace

sure, you know about s/foo/bar/ which replaces bar where foo exists.

Let's say you want to find foo but only when it comes before bar, and you want to replace some but not all of it.

Will replace foobar with foogoo
will keep foodoo as  is.

You can use this to, for instance, insert something before a comma:
s/\([a-z]\),/\1 = 0,/
foo, is now foo = 0,
or insert something between foo and bar
s/\(foo\)\(bar\)/\1 nutty \2/
changes foobar to foo nutty bar

Saturday, December 1, 2012

Windows update error 80070005 quick resolution

If you've been infected by malware that "hides everything", don't forget to unhide the folders under c:\windows\SoftwareDistribution\
open an administrative level command prompt and type this:
cd \windows\SoftwareDistribution
attrib -r -s -h /s /d *.*

if you want to open the firehose (somewhat) safely, you might try this from c:\windows:
attrib -r -h /s /d *.*

You won't be able to unhide system files, but you will unhide everything that you otherwise have access to.

(Be very certain you're in the SoftwareDistribution folder prior to runnning the attrib command line, otherwise you just unhid/unreadonly/unsystem the entire folder you're in.)

This should quickly fix the WindowsUpdate_80070005 error and allow you to download Windows Updates as well as Microsoft Security Essentials updates if you're encountering 0x80070005 error.

There's no warranty about whether you try this stuff. It may make things work, but you should at least consider whether you're comfortable with this.

Blog Archive