• Replace the New Item button on a SharePoint 2010 list with jQuery

    I have a SharePoint 2010 Business Data Catalog (BDC) pointing to our MS CRM 20111 back end. This is a good way to show paged views of the database. But at the top, there is still a “New Item” button. This does not make much sense for a BDC (or External list) without update queries. I wanted a workaround. I wanted to “hijack” this button – Make it do what I want. This is the jQuery code to do that!
    Basically I am hiding the existing button, and replacing it with what I want.

        $("#RibbonContainer").ready(function () {
            var imageRow = '<span class="ms-cui-ctl-large" onclick=\"window.location=\'/Destination/YouWant/NewForm.aspx?source=/Lists/BDCList/Default.aspx?InitialTabId=Ribbon.ListItem\'; \") > \
                <a class="ms-cui-ctl-a1 "  href="javascript:;" > \
                <span class="ms-cui-ctl-a1Internal" unselectable="on"> \
                <span class=" ms-cui-img-32by32 ms-cui-img-cont-float" unselectable="on"> \
                <img class="" style="left: -64px; top: -320px;" src="/_layouts/1033/images/formatmap32x32.png" /> \
                </span> \
                </span> \
                </a> \
                <a class="ms-cui-ctl-a2"><span class="ms-cui-ctl-largelabel"> New <br/> Item </span></a> \
                </span>'
            $("#s4-ribboncont .ms-cui-ctl-large:contains('New Item')").hide()
            $("#s4-ribboncont .ms-cui-ctl-large:contains('New Item')").before(imageRow)
        }); 
    

  • Quickly install the SQL powershell toolls on your local machine

    I wanted to quickly install the 2012 powershell tools on to my machine. I could’t find a simple summary, so here goes:

    Visit this site:
    http://www.microsoft.com/en-us/download/details.aspx?id=29065

    Download the following:

    Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012
    Microsoft® SQL Server® 2012 Shared Management Objects
    Microsoft® System CLR Types for Microsoft® SQL Server® 2012

    Wherever you downloaded the above files to:

    PS C:\Temp> .\SQLSysClrTypes.msi /qr /norestart
    PS C:\Temp> .\SharedManagementObjects.msi /qr /norestart
    PS C:\Temp> .\PowerShellTools.MSI /qr /norestart
    
    Import-Module SQLPS -DisableNameChecking 
    

    That should do it.


  • 2013 Year in review & Goals for 2014

    My blogging fell apart in 2013. I was doing well and reached a goal of 10,000 visitors in a month. Then it fell apart. I spent a lot of time trying to learn Cisco products, and I felt that I did to have anything interesting to add to the internets – it was stuff that all Cisco people already know.

    And, I got lazy.

    Goals for 2014:
    My goals for this year are about the same: 8 posts per month (two per week). I also want to get my Microsoft Certification updated to the new MCSE track.

    Anyway, here are my visits for the year:

    December      4034
    November      4424
    October       4964
    September     4600
    August        5106
    July          5502
    June          5934
    May           7409
    April         10913
    March         11440
    February      10312
    January       11256
    

    And my Summary:
    2013

    And my downwards traffic trend:
    Screen Shot 2014-01-14 at 10.29.22 AM


  • How to recursively find all files in OS X Finder

    I often want to find all files in a folder and all sub folders. I can never remember this:
    -kind:folder

    Seems backwards to me, but it works.


  • Quick PowerShell script to check DNS settings on all servers

    I wanted to decommission some old Domain Controllers. I needed to make sure that other servers weren’t pointing to theses old DCs for DNS. I wrote this quick PowerShell script to loop through all servers and get their DNS search order.

    $AllServers=Get-ADComputer -Filter {OperatingSystem -Like &quot;Windows Server*&quot;}
    ForEach ($Server in $AllServers){
    $Result=Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter &quot;IPEnabled = 'True'&quot; -Property DNSServerSearchOrder -ComputerName $Server.Name 
    $output = new-object PSObject 
    $output | add-member NoteProperty &quot;ComputerName&quot; $Server.Name
    $output | add-member NoteProperty &quot;DNSServerSearchOrder&quot; $Result.DNSServerSearchOrder
    $output
    }
    

    Hope that helps some one, or me when we moce to the next version of DCs.


  • Command to show all MySQL databases and their sizes

    I found this MySQL query to list all DBs and their sizes here. I wanted to blog it, so it is easier for me to find.

    mysql -e 'SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;'
    

  • mysql command to show a table’s column names <- Why can't i remember this?

    It is easy enough. Why can’t I remember this -> show columns from table name;


  • Just learned about /etc/resolver in OSX/BSD

    I just learned that OSX/BSD has “conditional DNS” built into the os! Thanks to this post.

    I wish I knew about this earlier! AND I wish the same thing existed for Windows machines!