Categories
Geeky/Programming

Server Move: Hosting My Own Site(s)

Well, I have been on HostMySite for a few years now, and I just wasn’t liking it. I didn’t have control, and couldn’t do everything I wanted to. Last week I signed up with ServerBeach and I have my own dedicated server. I am running Windows 2003, IIS, SQL, MySQL, PHP, etc.

I changed for now my DNS to GoDaddy from Active-Domain, since GoDaddy has SPF records (for Google talk federation, etc). I might change that up here in the future as well.

Transferring a domain takes way to long! Took like 4 days overall. Also, I first went with EasyCGI , a VPS solution, but the box couldn’t get to the Internet! I put in tickets, etc, they just wouldn’t fix it, so I canceled and went to ServerBeach. I am liking them so far, they had the server provisioned in about 4 hours.

One thing I can do now as well, is write a site for myself and import all the log files (Firewall, SMTP, All the Sites, FTP, etc) and have a nice little reporting solution.

ServerBeach is good, very professional. If you want to sign up, use referrer code BW27Q37B6D  (http://www.serverbeach.com/)

To get PHP/MySQL/WordPress, I loosely followed these three tutorials

How to Install PHP on IIS 6.0
How to Install MySQL On IIS 6.0
How to Install WordPress on IIS 6.0

For my ASP.NET Site, it was just copying over files and configuring IIS a little. For my blog, I used this dbbackup plugin (http://www.ilfilosofo.com/blog/wp-db-backup/) and then once I had my WordPress files over, and MySQL/PHP running, I connected to the instance of a DB I created and ran the SQL backup script, which created everything the way I needed it for WordPress.

For Mail, I use the built in SMTP in Windows 2003. I just had to turn on relaying, but yeah, spammers, so I just allowed the local server to send mail, and it works. Tested it using this (http://support.microsoft.com/kb/323350) and it worked.

Other than that, its pretty much basic server admin stuff. Firewall, FTP, etc. Everything is running smooth… for now 🙂

I will just have to make sure I have backups!

 

Categories
Geeky/Programming

Google Apps For Your Domain – Google Talk, Federation, SRV Records, Domain Transfers, DNS

Well, I want my Google Apps (GAFYD) account to be able to use Google Talk with other users (using Federation) besides Gmail and GAFYD (ex: Twitter, Meebo, etc). To do this, you need to add SRV records to your DNS (http://www.google.com/support/a/bin/answer.py?answer=34143) – no problem right?

Well, my current hosting (hostmysite) doesn’t allow SRV records, so after going at it with Tech Support the answer was to "switch to another DNS provider". Yikes. My current registar is active-domain, which doesn’t support SRV records either (from what I can tell). GoDaddy does, so I will transfer my domain there. Another no problem, right?

I initiate the transfer from active-domain to GoDaddy, but then read in the FAQ on active-domain I have to manually request to be transferred to get the auth code. Still waiting for that. Then I will have to make sure GoDaddy is set up as active-domain was so my stuff still works. Then, I can finally change GoDaddy to run all the DNS for the domain instead of just pointing to hostmysite’s nameservers.

I tell ya, nothing can be easy. 🙂

Categories
Geeky/Programming SQLServerPedia Syndication

SQL DBA: Function To Get Database Last Restore Time (From Log Shipping Filename)

If you need to get the last time that a database is restored from log shipping based off the transaction log file name, here is a function to do so. It parses out the date from the "last_restored_file" column, then converts it from UTC to your regular time.

 

CREATE FUNCTION [dbo].[GetLogShippingFileDate]
(
    @DatabaseName varchar(100)
)
RETURNS smalldatetime
AS
BEGIN

    DECLARE @Result smalldatetime

    SELECT  @Result =
    CAST(SUBSTRING(fds,5,2)+’/’+SUBSTRING(fds,7,2)+’/’+LEFT(fds,4) + ‘ ‘ + SUBSTRING(fds,9,2) + ‘:’ + SUBSTRING(fds,11,2) AS SMALLDATETIME)
    FROM (
    SELECT secondary_database AS  ‘DatabaseName’,
    LEFT(RIGHT(last_restored_file,18),14) AS ‘fds’
        FROM  
        msdb.dbo.log_shipping_secondary_databases
    ) a
    WHERE DatabaseName = @DatabaseName

    — convert the UTC file time to regular time
    SELECT @Result = DATEADD(HOUR,DATEDIFF(HOUR,GETUTCDATE(),GETDATE()),@Result)

    RETURN @Result

END

 

Categories
Geeky/Programming

Visual Studio 2005/2008 Web Application Projects: Profile Class Auto Generation Workaround

I have been doing some coding with VS2008, and have been playing with the .NET Membership, Role, and Profile providers. I don’t use "Web Sites" when I create projects, instead I use "Web Applications" – what is the difference? Web Sites don’t really act like a first class application, there are some weird things with references, the bin directory, etc. Web Application act like a console app, or windows form app, the way you can reference assemblies, etc. There are a ton more differences I am sure, but those are the ones that stand out for me.

Now, with the Profile stuff in ASP.NET, you can use a Login control, and CreateUserWizard control, and then hook up your site to a SQL backend using the ASP.NET Membership provider. Everything works great. But you can also add custom properties (ex: First Name, Last Name, etc) to your user’s "Profile". You add these settings in the Web.Config

<profile enabled="true">
    <properties>
        <add name="FirstName" type="string"/>
        <add name="LastName" type="string"/>
        <group name="Address">
            <add name="Address1" type="string"/>
            <add name="Address2" type="string"/>
            <add name="City" type="string"/>
            <add name="State" type="Int32"/>
            <add name="Country" type="Int32"/>
            <add name="PostalCode" type="string"/>
        </group>
        <add name="PhoneNumber" type="string"/>
    </properties> 
</profile>

and then when you build your project, Visual Studio is supposed to auto create a class behind the scenes with those properties. This works fine if you use a "Web Site", but fails to do so when you have a "Web Application"

In VS2005, there was an add in you could install that would auto create this class on build, and there is one as well for VS2008 – Web Profile Builder.

You can use the Web Profile Builder which just creates a class for you, or you can create your own, or you can just code around it, like this:

CreateUserWizard cuwWiz = (CreateUserWizard)lgnView.FindControl("CreateUserWizard1");

ProfileBase p = ProfileBase.Create(cuwWiz.UserName, true);

p.SetPropertyValue("FirstName", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtFirstName")).Text);
p.SetPropertyValue("LastName", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName")).Text);

p.GetProfileGroup("Address").SetPropertyValue("Address1", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtAddress1")).Text);
p.GetProfileGroup("Address").SetPropertyValue("Address2", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtAddress2")).Text);
p.GetProfileGroup("Address").SetPropertyValue("City", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtCity")).Text);
p.GetProfileGroup("Address").SetPropertyValue("State", Globals.IntParse(((DropDownList)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("ddlState")).SelectedValue));
p.GetProfileGroup("Address").SetPropertyValue("PostalCode", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtPostalCode")).Text);
p.GetProfileGroup("Address").SetPropertyValue("Country", Globals.IntParse(((DropDownList)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("ddlCountry")).SelectedValue));

p.SetPropertyValue("PhoneNumber", ((TextBox)cuwWiz.CreateUserStep.ContentTemplateContainer.FindControl("txtPhone")).Text);

p.Save();

Using ProfileBase lets you get around the use of the auto generated class, or the hand created class you might make. It does make it a little harder to set and get the properties though. If you did have the WebProfile or ProfileCommon class, you could just say

wp.FirstName = "Steve";

I wrestled with this profile stuff here for a good hour or two before I finally found on the net that Web Applications don’t auto create the class, etc. The class that it does generate though is derived from ProfileBase, so you can just use that and be OK. It would be nice if Web Application Projects did create the class though, it would have saved me a couple of head scratching hours. 🙂

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SSAS 2005: Cube Perspectives Are Good, But Something Is Missing…

In SQL Server Analysis Services 2005, you can create "perspectives" on cubes. What a perspective can do, is allow you hide different dimensions, measure groups and attributes. This works great but I still think there are a few things that are missing.

The first thing is that the cube itself is a perspective, one that is always there and you cannot hide. In a scenario where you want to build a cube but then have multiple perspectives, but you don’t want end user clients to see the main cube, or use the main perspective, you can’t do it, or at least I cannot find a way to do it. 🙂

The second thing is, which really is more to do with linked objects, is that when you link in a dimension, for instance, you cannot hide or show attributes, you are stuck with what is in the main dimension in your source cube. So what do you do? Use a perspective. But if SSAS let you hide attributes, etc on the dimension, it would let you forgo the use of perspectives.

The third thing is just security in general. You cannot secure a perspective. If you want Accounting to see XYZ perspective, and HR to see ABC perspective, but you don’t want them to see each other’s perspectives, you are out of luck, and need to come up with a new solution, which probably involves crazy security in your cube, or creating new cubes that link in dimensions and measure groups from the main cube.

Don’t get me wrong, SSAS 2005 is a vast improvement over SSAS 2000, but there are just a few things that I feel are missing, or , I might not know about how to enable some of the things I want to do. 🙂 I know SSAS 2008 has more improvements and that will be a good change, hopefully there are some cool things that let you manage your cubes and perspectives a little better.

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

Reporting Services: Can't Uninstall – The setup failed to read IIsMimeMap table. The error code is -2147024893

Ran into this error tonight trying to uninstall SQL Server Reporting Services. Not sure if it is just Vista, or XP and other OS’s as well, but the fix is to stop IIS and then re-run the Uninstall.

Categories
Geeky/Programming

FTP and Windows 2008

Wow, another Windows 2008 post. 🙂

Was having to FTP some stuff today, and I use FileZilla, which was working fine. I wanted to do a Beyond Compare with a folder and the FTP and it was erroring out. WTF. So I try Windows FTP (Start->Run: cmd, ftp)

I could connect, but couldn’t list anything, it would just hang. The fix: turn off Windows built in firewall.

 

Categories
Geeky/Programming

iPhone and Windows 2008

The iPhone doesn’t do anything with Windows 2008 by default. Usually when you plug it in, it will charge it, and it will show up as a digital camera in your My Computer. Windows 2008 , it just sits there, fails driver install, and does nothing.

If you install iTunes (ugh) , then at least you can charge your iPhone in Windows 2008, still the camera doesn’t work. I wonder if the Desktop Experience add on needs to be installed in Windows, not sure yet. For now though, at least it will charge 🙂

Technorati Tags: ,,,
Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SSAS: Changing Object Id's Breaks Report Builder Reports

Ugh. Found this one out the hard way. Usually when you change underlying object id’s in SQL Server Analysis Services, it shouldn’t cause any harm. You might have some XMLA to process dim’s and measure groups, if so you would have to change those, etc. But all reporting services reports and excel 2007 pivot tables, and MDX should keep working. What breaks? Report Builder reports.

You can build reports with Report Builder (the link is in Reporting Services to open Report Builder) off a cube model. They are paired down reports, you can’t do as much as you can with SSRS, but for advanced end users, they do the trick.

Thing is, the use SemanticQuery XML behind the scenes for the query and data source is to the model, and the XML is build off the object id’s of the cube. Ugh again. Even worse is that all parameters that were set as drop down lists (in this list) type are converted to IN formulas, and all the other params are converted to formulas. Graphs break. Matrix Reports break. Tabular Reports break. It just sucks. They shouldn’t build the query off the underlying id’s of objects, they should build them off the displayed names, like everything else does. Whew 🙂

 

Categories
Geeky/Programming Random

HTC Shift – I Want/Need One

image

Another mobile related post. Has anyone taken a look at the HTC Shift? Wow. This thing looks awesome. It is a UMPC, but can boot up Vista Business OR Windows Mobile 6. So you can use it as a cell phone, or a laptop. This thing looks like it would be .. better than the iPhone? One downside is it is a tad big to fit into your pocket. But this could replace your phone/laptop. Looks pretty much money to me.

Technorati Tags: ,,,