May 14 2012

Multiple sites with SSL on IIS7

Category: IIS7Yung Sen Riady Budiman @ 07:10

 

To add:

C:\Windows\System32\inetsrv>appcmd set site /site.name:"<siteName>" /+bindings.[protocol='https',bindingInformation='*:443:<hostHeader>']

 

To update:

 

C:\Windows\System32\inetsrv>appcmd set site /site.name:"<siteName>" /bindings[protocol='https',bindingInformation='*:443:<oldHostHeader>'].bindingInformation:*:443:<newHostHeader>

 

 

 

Tags:

Apr 21 2012

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Category: C# | MVC3 | VS2010Yung Sen Riady Budiman @ 14:56

First you need to find out the missing .dll

                try
                {
                    //The code that causes the error goes here.
                   
                }
                catch (ReflectionTypeLoadException ex)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (Exception exSub in ex.LoaderExceptions)
                    {
                        sb.AppendLine(exSub.Message);
                        if (exSub is FileNotFoundException)
                        {
                            FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
                            if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
                            {
                                sb.AppendLine("Fusion Log:");
                                sb.AppendLine(exFileNotFound.FusionLog);
                            }
                        }
                        sb.AppendLine();
                    }
                    string errorMessage = sb.ToString();
                    Elmah.ErrorSignal.FromCurrentContext().Raise(new Exception(errorMessage));
                    //Display or log the error based on your application.
                }


Then check your elmah log.
My mistake was having 2 different versions of the same library on 2 different projects.

Tags:

Apr 9 2012

How to create UrlHelper within a controller

Category: Yung Sen Riady Budiman @ 07:55
 var httpContextBase = new HttpContextWrapper(System.Web.HttpContext.Current);
            var routeData = new RouteData();
            var requestContext = new RequestContext(httpContextBase, routeData);
            var urlHelper = new UrlHelper(requestContext);

Tags:

Mar 20 2012

Fixing Umbraco Data

Category: SQL | UmbracoYung Sen Riady Budiman @ 06:13

select                        
*  
from                        
umbracoNode node             
inner join cmsContent cc on cc.nodeId = node.id       
--inner join cmsContentVersion cv on cv.ContentId = cc.NodeId 
--inner join cmsContentType ct on ct.nodeId = cc.contentType       
--inner join umbracoNode ctNode on ctNode.id = ct.nodeId       
--left join umbracoUser nodeUser on nodeUser.id = node.nodeUser  

SELECT *
FROM cmsContentVersion

INSERT INTO [dbo].[cmsContentVersion]
           ([ContentId]
           ,[VersionId]
           ,[VersionDate])
SELECT nodeId, newID(), getDate()
FROM cmsContent

SELECT *
FROM [cmsContentVersion]


UPDATE cmsCV
SET cmsCV.VersionID = t1.versionId
FROM (
SELECT DISTINCT cpd1.contentNodeID , cpd1.versionId
FROM cmsPropertyData cpd1
WHERE cpd1.ID = (SELECT MAX(cpd2.ID)
    FROM cmsPropertyData cpd2
    WHERE cpd2.contentNodeId = cpd1.contentNodeId
)) AS T1 , [cmsContentVersion] AS cmsCV
WHERE cmsCV.contentID = t1.contentNodeID

Tags: ,

Mar 12 2012

Changing Schema for DB Items

Category: SQL ServerYung Sen Riady Budiman @ 01:32

SELECT 'ALTER SCHEMA dbo TRANSFER ' + s.Name + '.' + p.Name FROM sys.Tables p INNER JOIN
sys.Schemas s on p.schema_id = s.schema_id WHERE s.Name = '[OLD_SCHEMA]'

 

Tags:

Jan 18 2012

Paypal Documentation

Category: Yung Sen Riady Budiman @ 13:03

The best examples are listed on www.x.com within our SDK index found at "https://www.x.com/developers/paypal/documentation-tools/sdk

" Our Express Checkout documentation can be found below as well.

https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_ExpressCheckout_IntegrationGuide.pdf
https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_ExpressCheckout_AdvancedFeaturesGuide.pdf

 

Tags:

Jan 6 2012

Shop Online on Cecillicious

Category: Yung Sen Riady Budiman @ 11:01

Cecillicious is soft launching their online shop for corsets

Tags:

Dec 19 2011

Remotely Log Off Remote Desktop Users

Category: Windows | RDPYung Sen Riady Budiman @ 04:46

How to query for users on a machine

qwinsta /server:<serverName>

You can also use quser.exe:

quser /server:<serverName>

How to log a user off of a machine

logoff <sessionId> /server:<serverName>

http://www.danrigsby.com/blog/index.php/2008/08/26/remotely-log-off-remote-desktop-users/

Tags:

Dec 11 2011

Facebook App add to page

Category: FacebookYung Sen Riady Budiman @ 11:44

http://www.facebook.com/add.php?api_key=[APP-ID]&pages=1

Replace [APP-ID]

Tags:

Dec 6 2011

How to use Sass in VS2010

Category: Sass | VS2010Yung Sen Riady Budiman @ 04:47

 

  1. Install VS plugin
    1. http://visualstudiogallery.msdn.microsoft.com/2b96d16a-c986-4501-8f97-8008f9db141a
  2. Restart VS2010
  3. Create a new item, when you are on Web, you will be able to see a new Sass SCSS template:
    1.  

  1. Once you have created the SCSS file, you can right click and click on Run Custom Tool to generate the .CSS

 

Sample:

 

#navbar {

       width: 80%;

       height: 20px;

 

       ul { list-style-type: none; }

       li {

              float: left;

              a { font-weight: bold; }

       }

}

 

 

Output:

 

#navbar {

  width: 80%;

  height: 20px; }

  #navbar ul {

    list-style-type: none; }

  #navbar li {

    float: left; }

    #navbar li a {

      font-weight: bold; }

 

 

 

 

Tags: