WordPress: replace some text in all your posts

This is a small piece of sql that replaces a string in all your posts.

Ensure that you have a backup of your database before modifying your database!

Call this command for instance in phpmyadmin:

Code Snippet
  1. update `wp_posts`
  2. SET `post_content` = REPLACE(`post_content`, "your old text", "your new text")
  3.   WHERE INSTR(`post_content`, "your old text") > 0;

Fix: Visual Studio Achievements and FxCop problem

Actually there is a problem with FxCop and Visual Studio Achievements (with Visual Studio Professional): the FxCop assemblies can’t be loaded.

Here is a workaround (note: you have to install FxCop 10.0 – not FxCop 1.36):

x86: You have to copy all files from "C:\Program Files\Microsoft Fxcop 10.0" to "C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop".

x64: You have to copy all files from "C:\Program Files (x86)\Microsoft Fxcop 10.0" to "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop".

LINQPad

LINQPad is a modern SQL query tool. Say goodbye to the old SQL Management Studio. LINQPad supports SQL Express, SQL 2008, SQL 2005, SQL 2000, SQLite, MySQL and Oracle.

LINQPad standard edition is free and can run without installation. The executable is 3MB and is self-updating. There is even a version that runs in Google Chrome.

Autocompletion is an optional extra. You can buy LINQPad Pro for $39.00 or LINQPad Premium for $58.00 (introductory price). The Premium Edition also unlocks LINQPad’s ability to write cross-database queries. Just control+drag additional databases from the Schema Explorer onto your query.

Here is the official LINQPad website: http://www.linqpad.net

Here is an example screenshot:

LINQPad

wget loop example

This example shows how to call wget ten times in a loop.

#!/bin/bash

for i in $(seq 10)
do
    ec=1
    while ((ec != 0))
    do
        wget_output=$(wget –retry-connrefused –output-document=/home/user/Downloads/$i.html –tries=30 http://www.test.com/?page=$i)
        if [ $? -ne 0 ]; then
            ec=1   
        else
            ec=0
        fi       
    done
done