*.dannyg

Take SQL Database out of Read Only/Stand By

Aug
20

Run this command

RESTORE DATABASE <db-name> WITH RECOVERY

 

Technorati Tags: ,,

OData ListData.svc issues on Sharepoint 2010

Aug
18

After deciding that I wanted to query the much reveled OData services offered by Sharepoint 2010 I ran into multiple issues (now which I’ve resolved).

This is the service endpoint

http://<hostname>/_vti_bin/ListData.svc

1) OData services do not work over HTTPS.  I’m assuming this is related to configuration of WCF.  This is a key point to remember. 

2) Installing of the ADO.NET Data Services v1.5 CTP2 on the Sharepoint 2010 Server.  Do an IISRESET or reboot after this.

3) Ensure that there are no corrupt lists on a site.  If there are you’ll be able to hit a specific list but not hit the endpoint.  You’ll keep getting prompted with the NTLM/Keberos login from your web browser and never get logged in.  To remove a corrupted list (mine happened from upgrading from Sharepoint 2007 to Sharepoint 2010 without installing custom list types), run the following command from the Sharepoint Powershell Prompt (thanks to Harold van de Kamp’s blog entry on this one.)

stsadm.exe -o forcedeletelist -url <url>

 

Technorati Tags: ,,,

 

Twitter widget changes

Aug
08

Below is the source code for my twitter widget as you see on the top of the page.  This makes a simple JSONP call to Twitter with JQuery.

The change I made today was to read Mentions, Lists, and URLs and convert them to respective URLs. 

 

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    var last_tweet;
    var twitterAccount = "dannygnj";
    var divClass = "twitterStatus"
    
    $(function() {
        $.getScript("http://twitter.com/statuses/user_timeline/"+twitterAccount+".json?callback=twitterCallback2&amp;;count=1");
    });
    
    function twitterCallback2(data) {    
        last_tweet = twitterize(data[0].text);
        $("." + divClass).html("<img src='/dannyg/pics/twitter_icon.png' style='vertical-align:text-top;'><a href='http://twitter.com/dannygnj' target='_blank'>Last Tweet:</a> " + last_tweet);            
    }
    
    function twitterize(str) {
        var final = str;
        var re = /http://[A-Za-z0-9_./]*/g;
        var result = final.match(re);    
        if (result != null) {
            for (var i = 0; i < result.length; i++) {
                final = final.replace(result[i], "<a href='" + result[i] + "' target='_blank'>" + result[i] + "</a>");                        
            }
        }
        var re = /@[A-Za-z0-9_]*/g;
        var result = final.match(re);
        if (result != null) {
            for (var i = 0; i < result.length; i++) {
                var xword = result[i].replace("@","");
                final = final.replace(result[i], "@<a href='http://twitter.com/" + xword + "' target='_blank'>" + xword + "</a>");                        
            }
        }
        var re = /#[A-Za-z0-9_]*/g;
        var result = final.match(re);    
        if (result != null) {
            for (var i = 0; i < result.length; i++) {
                var xword = result[i].replace("#","");
                final = final.replace(result[i], "#<a href='http://twitter.com/#search?q=%23" + xword + "' target='_blank'>" + xword + "</a>");                        
            }    
        }
        return final;    
    }    
    </script>     

Fiddler debugging a non-browser XMLHTTP application

Aug
01

Fiddler is an excellent application for observing and debugging internet traffic.  However I wanted to be able to monitor some non-browser traffic.  In this particular case a piece of VB code.  Here’s how I did it.  I have my simple XMLHTTP request here.

 
Set x = New ServerXMLHTTP60
Call x.Open("GET", "http://www.bing.com/", True)
x.Send()

So essentially I need some way to pass this request to a proxy server.  Fiddler “listens” on localhost port 8888.  Here is the final code with the modification to pass the request through Fiddler.

 
Set x = New ServerXMLHTTP60
Call x.Open("GET", "http://www.bing.com/", True)
Call x.setProxy(2, "127.0.0.1:8888")
x.Send()

You can also redirect all traffic from WinINET to Fiddler to, I thought this was a more granular way to control this.