learned/learning/to learn RSS 2.0
# Saturday, December 15, 2012

As you know if you have WinHost $5 or $10 plans, you cannot backup databases from SSMS, you have to do it from the Web Control Panel. After getting tired of doing this manually, I decided to automate this… as I have always been a big fan of automating things. This is how you can do it:

Software Requirements:
1.
Selenium IDE
2. Visual Studio (if you’re going to use C#)
3. Java
4.
Selenium Server
5. Firefox browser

Steps involved:
1. Install Selenium IDE from
here, or open Firefox browser and install from the Add-On page. You should have Firefox installed in your machine.
2. Launch the IDE after installing. This is how the IDE looks:

image

3. The Selenium IDE starts in recording mode, the red button on the top right corner can be used to start or stop recording.
4. Open a Firefox window, and go to WinHost’s control panel page.
5. Enter your username, password, and follow all the steps that you do for manual database backup. The IDE will record every click event, and you should be able to see the events in the IDE getting added.
6. Once you are done with all the tasks, stop recording.
7. Go to File menu, Export Test Case As and choose C# / NUnit / Remote Control, which will generate a C# class.
8. Create a Console Application or a Service. Console Application works well for me.
9. You need to copy parts of code from the IDE generated class. You can put everything in a method, something like this:

   1:              ISelenium selenium;
   2:              StringBuilder verificationErrors;
   3:   
   4:              selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://cp.winhost.com/");
   5:              selenium.Start();
   6:              verificationErrors = new StringBuilder();
   7:   
   8:              selenium.Open("/login.aspx?ReturnUrl=%2fdefault.aspx");
   9:              selenium.Type("id=ctl00_cphMain_loginCP_UserName", "YourUserId");
  10:              selenium.Type("id=ctl00_cphMain_loginCP_Password", "YourPassword");
  11:              selenium.Click("id=ctl00_cphMain_loginCP_Login");
  12:              selenium.WaitForPageToLoad("30000");
  13:              selenium.Click("id=sites");
  14:              selenium.WaitForPageToLoad("30000");
  15:              selenium.Click("id=ctl00_cphMain_gvSites_ctl02_lbManage");
  16:              selenium.WaitForPageToLoad("30000");
  17:              selenium.Click("css=img[alt=\"Microsoft SQL Manager\"]");
  18:              selenium.WaitForPageToLoad("30000");
  19:              selenium.Click("id=" + labelName);
  20:              selenium.WaitForPageToLoad("30000");
  21:              selenium.Click("link=Backup");
  22:              selenium.WaitForPageToLoad("30000");
  23:              selenium.Click("id=ctl00_cphMain_btnBackup");
  24:              var confirmation = Regex.IsMatch(selenium.GetConfirmation(), "^Create backup\\. Are you sure[\\s\\S]$");
  25:              selenium.WaitForPageToLoad("30000");
 

10. Install Selenium related DLLs from Nuget. Open Visual Studio’s Package Manager Console, and install packages - Selenium.RC and Selenium.Support
11. Download Selenium Server from
here, you SHOULD have Java installed in your machine to start the server.
12. The server should be started before executing the above code, you can create a .bat file, with this line “java -jar D:\Utils\selenium-server-standalone-2.25.0.jar” in it.
13. You can execute the bat file like this - System.Diagnostics.Process.Start(@"D:\Utils\startSeleniumServer.bat");
14. Now, when you start the console app, it will repeat the recorded steps, and backup your database.
15. Remember, the database will be backed up in the app_data folder; and if the folder already has a backup file, you need to delete it. You could write a FTP module or use the FTP Utility that I wrote (attached) to delete and download the backup file.
16. You have to pass the file path and the credentials if you’re using my FTP utility. The file path will be something like this -
ftp://FTP_IP/app_data/SEE_WHAT_THE_MANUAL_BACKUP_GENERATES.bak

Note: You could use Selenium.WebDriver instead of RC Server, however, it doesn’t handle popup or confirmation window properly; as our process opens a confirmation window, I went with the RC Server.

Download FTP Utility

Saturday, December 15, 2012 5:07:48 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
.NET | Miscellaneous | Solutions
# Sunday, February 26, 2012

Some of the disadvantages of using MVC AJAX ActionLinks returning partial views are:
1.    We cannot bookmark the pages with AJAX returned content, as AJAX calls don’t change the URLs. For eg., say we have an AJAX actionlink on the home page called “contact”, and  when we click it returns a partial page that gets loaded inside a div tag. If the page is bookmarked, the URL is just going to render the home page without the contact information.
2.    If we want our users to view the AJAX actionlink returned content by directly entering the URL, then we have to create a full view, and in the controller we have to check whether it is an AJAX request (Request.IsAjaxRequest), and if so, return the partial view; else, return the full view.
3.    Browser back/forward button clicks will not do anything.

We can overcome all these problems using hash tags. Gmail is a very good example of an AJAX application; each and every left menu click event just changes hash tag and loads content asynchronously.

Say we are supposed to build a website to render shapes like circle, diamond and star asynchronously, and users should be able to use all the features mentioned above.

How to do?
1.    Create a MVC Application (I’m using MVC 3).
2.    Include jquery.js and jquery.unobtrusive-ajax.js files on the layout page.
3.    Download jQuery history plugin from
here, and include it too.

<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.history.js")" type="text/javascript"></script>
</head>   


Create 3 actions in the controller that returns 3 partial views based on the action.
[HttpGet]
public ActionResult GetCircle()
{
    return PartialView("Circle");
}

[HttpGet]
public ActionResult GetDiamond()
{
    return PartialView("Diamond");
}

[HttpGet]
public ActionResult GetStar()
{
    return PartialView("Star");
}

Add 3 views circle.cshtml, diamond.cshtml and star.cshtml. To keep things simple, just add a div tag in each view with appropriate css class.

Circle.cshtml file’s content:
<div class="circle"></div
>

Diamond.cshtml file’s content:
<div class="diamond"></div>

Star.cshtml file’s content:
<div class="star"></div
>

Get the styles from
here and add it to your layout page.

Now, add 3 action links:

@Ajax.ActionLink("Render Circle", "GetCircle", null, 
    new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "divContent", OnSuccess = "AddHashTag('circle')" }, 
    new { @id = "circle" })

@Ajax.ActionLink("Render Diamond", "GetDiamond", null, 
    new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "divContent", OnSuccess = "AddHashTag('diamond')" }, 
    new { @id = "diamond" })

@Ajax.ActionLink("Render Star", "GetStar", null, 
    new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "divContent", OnSuccess = "AddHashTag('star')" }, 
    new { @id = "star" })


These actionlinks will call the action methods on the controller, and replace the div tag “divContent” (should be added on the page) content with the returned content. These actionlinks will also call javascript method AddHashTag if the AJAX calls get executed successfully.

Add the script block mentioned below. The AddHashTag function adds “hashTag” parameter as the hash tag to the url. The other function (from jquery history plugin) checks for hash tag, and if found, triggers click event. In this example, I’m just passing the tag’s id to the AddHashTag function.

<script type="text/javascript">

    $(function () {
        $.history.init(function (hash) {
            if (hash.length > 0) {
                $("#" + hash).click();
            }
        },
        { unescape: ",/" });
    });

    function AddHashTag(hashTag) {
        window.location.hash = hashTag;
    }

</script>

Run the application.

image

When we click “Render Circle” link, circle.cshtml partial view will be returned and hash tag “circle” will be appended to the url.

image

To render star, we can click “Render Star” or enter http://localhost:60129/#star, which will render:

image

We can bookmark these links and use browser back/forward buttons.

We are done with the application, you can modify the AddHashTag function or the AjaxLinks according to your needs.

Please let me know if you have any questions.


Here is the source code -

Sunday, February 26, 2012 9:11:27 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
.NET
# Monday, June 27, 2011

At last got some time to complete coding my hexapod to make it walk and sense obstacles. Click here to download the source code.



If you are beginner, and want to use MRDS to control your Lego Mindstorms NXT 2.0, refer to my previous posts:

1. Learn how to create DSS Service and use Manifest Editor
2. Lego Bot controlled using MRDS

Feel free to contact me if you have any questions or suggestions.

Monday, June 27, 2011 1:27:09 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET | Robotics
# Friday, April 29, 2011

I’ve been running the radio since 2006, I’ve spent a lot of time and money on it, and now it is going to come to an end. It is mainly because of my time constraints, I’m not having enough time to spend on it, I’ve become too busy these days Smile. Moreover, I recently upgraded my servers to Windows Server 2008, since then I’ve been having too many problems with the radio as server 2008 doesn’t have proper support for rdp audio redirection. I'm forced to do some changes whenever I rdp into the system, it's too time consuming... hence I’ve decided to stop the service.

If you are here, you should be one of my listeners, thanks for listening all these years, hope I’ll have some time in the future to build something better or at least continue what I’ve been doing.

Friday, April 29, 2011 3:20:28 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
Miscellaneous
# Saturday, March 19, 2011

My WCF Data Service worked fine in the VS Web Server, but when I deployed it to IIS (7.5), it stopped working. I was able to view the service page listing all the entities, but when I tried to access the entities in a RESTFUL manner, I wasn’t.

I found out the problem by setting

config.UseVerboseErrors = true; 
in
public static void InitializeService(DataServiceConfiguration config)

The problem was I was using windows authentication to connect to my database, after changing to SQL Server Authentication, everything worked fine.

Spent hours in figuring out this…

Saturday, March 19, 2011 3:57:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
.NET | Solutions
# Friday, November 05, 2010

In this article I’m going to explain about creating a fully computer controlled Lego Mindstorms NXT 2.0 Bot (with camera mounted on it) using Microsoft Robotics Developer Studio (MRDS). My previous article Microsoft Robotics Service for LEGO NXT 2.0 should be useful if you haven’t created any service using the Studio.

Requirements:
Lego Mindstorms NXT 2.0 Kit
Microsoft Robotics Developer Studio
Network/IP Camera (I used my iPhone with WiFi Camera app installed on it)
WPF Dashboard Controls

Download Source Code:
MyLegoCar.zip (388.43 KB)

Create a MRDS Service and add the partners - NxtDrive and NxtBattery.  Adding the partners will automatically declare and instantiate an object for BatteryOperations and an object for DriveOperations. Please add one more for DriveOperations as the code mentioned below.

        /// <summary>
        /// NxtBattery partner
        /// </summary>
        [Partner("NxtBattery", Contract = battery.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
        battery.BatteryOperations _nxtBatteryPort = new battery.BatteryOperations();
 
        /// <summary>
        /// NxtDrive partner
        /// </summary>
        [Partner("NxtDrive", Contract = drive.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExistingOrCreate)]
        drive.DriveOperations _nxtDrivePort = new drive.DriveOperations();
        drive.DriveOperations _nxtDriveNotify = new drive.DriveOperations();

Add a new class library project to the solution, and add an interface to it. This project needs to be referenced in the MRDS Service and the WPF UI projects (will explain the UI project later).

    public interface IMyLegoCarService
    {
        double GearPower { get; set; }
        
        long LeftEncoderCurrent { get; set; }
        long RightEncoderCurrent { get; set; }
 
        double LeftPowerCurrent { get; set; }
        double RightPowerCurrent { get; set; }
 
        double BatteryPower { get; set; }
 
        void Drive(DriveAction driveDirection);
        void StopEngine();
    }

Change the MRDS Service in such a way that it implements this interface. Values for all the properties but the first property (GearPower) will be set in the service, and they will be retrieved and used in the UI layer.

Now, add a new WPF project. VS will choose x86 as the targeted platform by default, change it to "Any CPU". Declare a property named Service of type IMyLegoCarService, and add a constructor, something like this.

         public Dashboard(IMyLegoCarService service) : this()
        {
            Service = service;
            Service.GearPower = 0;
            brsr_ipcamera.Navigate(new Uri("http://ipoftheiphoneorthewebserver/iphonecamera/index.htm"));
 
            UpdateInitialOdometer();
 
            uiTimer = new DispatcherTimer();
            uiTimer.Interval = TimeSpan.FromSeconds(1);
            uiTimer.Tick += uiTimer_Tick;
            uiTimer.Start();
        }

This constructor should be called from the Service’s constructor, so that the service and the UI will be on the same thread. Here “brsr_ipcamera” is the web browser control to display the ip camera’s image/video (in my case my iphone). I added an html page to my webserver displaying only the video from the camera. Add a timer control to display the information retrieved from the service periodically. Here I’ve used WPF Dashboard Controls’ dial controls as speedometers (for left motor front, left motor reverse, right motor front and right motor reverse), odometer control as odometer and progress bar control as fuel gauge.  Left/Right Power Current properties were used to initialize the speedometers. Left/Right Encoder properties were used to initialize the odometer, these properties basically give us the degrees that the servo motors rotated. Using the formula: distance = Convert.ToInt32(Math.Abs(currentEncoderCurrent) / 360 * 2 * 3.14 * 0.75, we can calculate the distance covered. Here, pi = 3.14 and 0.75 is the radius of the wheels.

CropperCapture[5]

Coming back to the service. Declare and/or instantiate the following classes.

        wpf.WpfServicePort _wpfServicePort;
        drive.SetDriveRequest _nxtSetDriveRequest = new drive.SetDriveRequest();
        battery.BatteryState _nxtBatteryState;

WpfServicePort is used toinvoke the WPF UI, SetDriveRequest to rotate the motors and the BatteryState to get the battery information.

Add a port named “TimerTick” to the service types similar to the automatically created ports “Get”, “Subscribe” etc. Now your serviceoperations class declaration will be something like this -

   [ServicePort]
    public class MyLegoCarServiceOperations : PortSet<DsspDefaultLookup, DsspDefaultDrop, Get, Subscribe, TimerTick>
    {
    }
    public class TimerTick : Update<TimerTickRequest, PortSet<DefaultUpdateResponseType, Fault>>
    {
        public TimerTick()
            : base(new TimerTickRequest())
        {
        }
    }
 
 
    [DataContract]
    public class TimerTickRequest
    {
    }

Modify the service’s start method something like this -
        protected override void Start()
        {
            SpawnIterator(DoStart);    
        }
 
        private IEnumerator<ITask> DoStart()
        {
            DispatcherQueue queue = new DispatcherQueue();
 
            this._wpfServicePort = wpf.WpfAdapter.Create(queue);
 
            // invoke the UI
            var runWindow = this._wpfServicePort.RunWindow(() => (Window)new Dashboard(this));
            yield return (Choice)runWindow;
 
            var exception = (Exception)runWindow;
            if (exception != null)
            {
                LogError(exception);
                StartFailed();
                yield break;
            }    
 
            // Subscribe to partners  
            var subscribe1 = this._nxtDrivePort.Subscribe(_nxtDriveNotify);
            yield return (Choice)subscribe1;
 
            _timerPort.Post(DateTime.Now);
            
            // Activate independent tasks
            Activate<ITask>(
                Arbiter.Receive<drive.DriveEncodersUpdate>(true, _nxtDriveNotify, DriveEncoderHandler),
                Arbiter.Receive(true, _timerPort, TimerHandler)
            );
 
            // Start operation handlers and insert into directory service.
            StartHandlers();          
        }
 
        private void StartHandlers()
        {
            // Activate message handlers for this service and insert into the directory.
            base.Start();
 
        }

Timerport is used to retrieve the battery information periodically.

       [ServiceHandler(ServiceHandlerBehavior.Exclusive)]
        public IEnumerator<ITask> TimerTickHandler(TimerTick incrementTick)
        {
            incrementTick.ResponsePort.Post(DefaultUpdateResponseType.Instance);
 
            battery.Get batteryGet;
            yield return _nxtBatteryPort.Get(GetRequestType.Instance, out batteryGet);
            _nxtBatteryState = batteryGet.ResponsePort;
            if (_nxtBatteryState != null)
            {
                BatteryPower = _nxtBatteryState.PercentBatteryPower;              
            }        
 
            yield break;
        }
 
        void TimerHandler(DateTime signal)
        {
            _mainPort.Post(new TimerTick());
            Activate(
                Arbiter.Receive(false, TimeoutPort(3000),
                    delegate(DateTime time)
                    {
                        _timerPort.Post(time);
                    }
                )
            );
        }

DriveEncoderUpdate to retrieve the information from the servo motors.

        private void DriveEncoderHandler(drive.DriveEncodersUpdate statistics)
        {
            LeftEncoderCurrent = statistics.Body.LeftEncoderCurrent;
            RightEncoderCurrent = statistics.Body.RightEncoderCurrent;
            LeftPowerCurrent = statistics.Body.LeftPowerCurrent;
            RightPowerCurrent = statistics.Body.RightPowerCurrent;
 
        }

Create an enum named “DriveAction” in the common class library project. This is to handle the keyboard or the click events from the UI Layer.
    public enum DriveAction
    {
        Front,
        Back,
        Left,
        Right,
        Stop
    }

Implement the Drive method in the service.
        public void Drive(DriveAction driveAction)
        {
            switch (driveAction)
            {
                case DriveAction.Front:
                    _nxtSetDriveRequest.LeftPower = -GearPower;
                    _nxtSetDriveRequest.RightPower = -GearPower;
                    _nxtDrivePort.DriveDistance(_nxtSetDriveRequest);
 
                    break;
                case DriveAction.Back:
                    _nxtSetDriveRequest.LeftPower = GearPower;
                    _nxtSetDriveRequest.RightPower = GearPower;
                    _nxtDrivePort.DriveDistance(_nxtSetDriveRequest);
                    break;
                case DriveAction.Left:
                    _nxtSetDriveRequest.LeftPower = -.4;
                    _nxtSetDriveRequest.RightPower = .4;
                    _nxtDrivePort.DriveDistance(_nxtSetDriveRequest);
 
                    break;
                case DriveAction.Right:
                      _nxtSetDriveRequest.LeftPower = .4;
                    _nxtSetDriveRequest.RightPower = -.4;
                    _nxtDrivePort.DriveDistance(_nxtSetDriveRequest);
                    break;
                case DriveAction.Stop:
                    _nxtDrivePort.AllStop(MotorStopState.Coast);
                    break;
                default:
                    break;
            }
        }


I suppose I’ve explained most of the important parts in the service. Please let me know if you have any questions.

My bot in action:

demo

Friday, November 05, 2010 4:08:10 PM (GMT Standard Time, UTC+00:00)  #    Comments [2] -
.NET | Robotics
# Saturday, September 04, 2010

I’ve explained here about creating Microsoft Robotics Service for LEGO NXT 2.0 and configuring its manifest. When I wanted to create my first robotics service, I had many difficulties and found very few resources over the internet for LEGO NXT 2.0 using Microsoft Robotics, so just thought of blogging about this.

Requirements
Microsoft Robotics Studio –
Click here to download. Click here to know more about the studio.
LEGO NXT 2.0

Installation
Microsoft Robotics Studio can be used as a stand-alone development environment or
it can be used with any of the Visual Studio 2008 or 2010 Editions, including the Express Editions.

How to create DSS Service?
1. After Installing Microsoft Robotics Studio, open Visual Studio IDE (I’m using 2010).
2. Click File/New Project, you should be able to see Microsoft Robotics under C# like this -

CropperCapture[2]

3. Create the project under Microsoft Robotics Studio installation folder (it will be mostly in c:\user\username\microsoft robotics dev studio 2008 r3\), so that the common robotics dlls will be referenced properly.
4. Click OK and you will be allowed to enter your service name, namespace and other details. The most important thing is – you will be allowed to choose your partners from here -

CropperCapture[5]

5. Choose the partners one by one from the list and click “Add as partner”. Check the “Add notification port” checkbox and leave the Creation Policy as it is. Lego NXT Brick (v2) should be selected as one of the partners, and the other partners can be selected based on the sensors that you will be using. In case if you want to edit or delete any of the added partners, you can choose the partner from the partner dropdown and perform your actions. Once all the partners are selected, click OK.
6. You should be able to see the auto-generated code now. Build your solution.

How to create manifest using DSS Manifest Editor?
1. Open DSS Manifest Editor.
2. Choose your service from the left, drag and drop it on the editor. You should be able to see this -

CropperCapture[6]

3. Search for your partners on the left, drag and drop on “Use service’s partner definition (UseExistingOrCreate)” boxes appropriately.
4. As the sensors in turn use the nxtbrick as their partner, another set of “Use service’s partner definition (UseExistingOrCreate)” boxes will be created for the brick.
5. You need to select nxtbrick service again and drop it on the boxes. If you see a pop like the one below, choose the already created service and NOT “Add a new instance”.

CropperCapture[7] 

6. To configure the service, click it and then press “Create Initial State” button on the properties window. For the NxtBrick, you need to set the serial port number used for bluetooth connection. For the sensors, you need to set the ports appropriately.
7. Replace this manifest with the manifest created by the service.
8. To start the service execute dsshost /port:50000 /manifest:"C:\Users\username\Microsoft Robotics Dev Studio 2008 R3\MyDemoService\MyDemoService.manifest.xml” in DSS Command Prompt.
9. You can also start the service from the DSS Control Panel. In order to view the control panel, start DSS Node and then go to http://localhost:50000 (default port is 50000, if you’ve changed it use it accordingly).
10. Switch ON your LEGO NXT 2.0 and then start the service. If everything is configured properly, you should be able to hear connecting sound from the NXT Brick.

This is it for now, in the next blog post, I’ll be explaining about adding handlers to the sensors and using the motors.

Saturday, September 04, 2010 4:51:21 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET | Robotics
# Monday, July 05, 2010

I have learned a lot on developing my website, about .NET, ASP.NET, Web Design, Servers, Database etc., it’s been a good platform to learn the new technologies and implement them. I have played and been playing many roles in its development, here are them:

Web Designer
Being a creative person, I’ve always liked web designing, graphics, animation etc. This pushed me to create my first version of my website (HTML based), spent a lot of time on it and at the same time learned (self-learned) a lot on designing, good and bad techniques :). When I started working closely with a designer in HHS, learned many good practices on HTML Designing from her. It eventually pushed me to redesign my website. Though I acquired decent designing skills, I didn’t spend much time on designing as I wanted it to be simple and neat. I just followed the good practices on designing, this made my site look consistent in most of the browsers, in different resolutions, colors, point sizes etc.

Network Administrator
Before setting up my site I just had a minimal knowledge on networking - to just share folders, open firewall/router ports, setup static ip etc. But, after setting up my site or in the process of setting up my site I learned a lot about networking technologies/methodologies like Virtualization, Domain Controllers, Backup Strategies, Re-routing Network Traffic, Security, Access Control etc. Initially, I had my site hosted on Godaddy’s Servers, and later on built my own servers and deployed everything on my servers. It was definitely worth spending extra bucks in building my own server and taking business connection (as I my ISP blocked port 80 for residential connections). Its advantages – installed softwares as I wished, and upgraded them as and when updates were released, opened ports in the firewall, changed security settings as per my needs, and many more. My responsibilities as a network admin:-
1. Instead of buying a  server machine, I just converted my desktop to a server by installing server 2003 r2, and added RAM (had 4 GB RAM, added another 4 GB) and hard drives (bought another hard drive for backup).
2. Thought Virtualization will serve me better in terms of security, availability, usage etc. So, I used VMWare Server to setup virtualized servers. Built a virtualized server in my main server machine (server 2003 r2), and another virtualized server in my personal computer (windows 7), thus got 3 servers (windows 2003 r2). Setup my server machine as the domain controller (just for reference, I’ll name it as “A”), the virtual machine in it as the web/ftp/file/shoutcast/sql servers (name - “B”), and the virtual machine in my PC as the backup server (or testing machine), clone of B (name - “C”). Just before major software updates or changes in the network settings or any other changes that was supposed to affect the web traffic in B, I rerouted my network traffic to C.
3. Synchronization Strategy – Synchronized servers B and C using SyncToy (for folders) and Backup/Restore feature in SQL Server (for database). I will explain this in detail in my next blog.
4. Backup Strategy – Scheduled nightly backup of windows folders, SQL server and few other settings, and monthly backup of virtual machines (manually copied virtual machine files) to a hard drive dedicated for backups.
5. At least at the time of writing this blog, I didn’t have anything to do with ASP.NET Sessions, so rerouting the web traffic was not a big deal – just opening and closing ports in my router took care of it. However, as I didn’t have a proper way to reroute my radio traffic, I just played some pre-recorded announcements saying “Server is going to be restarted, it will be back in X minutes” or “Server is unavailable due to maintenance, it will be back in few minutes (or hours)”
6. Domain Management – I added and modified @ and CNAME records, changed name servers etc.

Database Administrator/Developer
Godaddy’s ASP.NET Hosting was good (not great though), but their Database Hosting was ridiculous. They had an ASP.NET based interface, just to execute db scripts… running DDL scripts was not a problem; however, executing DML  or importing data was not easy. So, decided to host my SQL Server Database in a different place, and only when I found that Godaddy blocked remote SQL Server access. All these limitations and the price factor pushed me to setup my own database server. My responsibilities as a database administrator or developer:
1. I’ve never liked writing dynamic or inline queries in the frontend, so always followed stored procedure approach. Performed most of the database operations using stored procedures. Once I started using LINQtoSQL and Entity Framework, the usage of stored procedures got reduced, I used them only for complex operations.  
2. Created database, user accounts, roles etc., mapped user accounts or roles to data objects appropriately.
3. Built backup (full and differential) and restore strategy, and scheduled sql server jobs to perform these operations appropriately.
4. Created and used SSIS for routine GeoIP to Location data imports from MaxMind.

Tester
I used my server “C” as a backup or a testing server. I always applied patches or installed/upgraded softwares here, and only after thorough testing, I performed the same operations in my server “B” (my main server).

Web Developer
Working as a Web Developer, I created many Web 2.0 websites at my work, and at one point I found Web Development to be interesting than Windows Development. At that point, I felt I should convert my HTML site to Web 2.0 using all the latest web technologies. With all the experiences that I gained on web development from my job, I developed my website, and based on the experiences that I gained from developing my website, I did many things at my office – my work and my website served each other well. 
I developed the first .NET version of my site using VS 2005/.NET 2.0 Framework with SQL Server 2005. Later on, upgraded to .NET Framework 3.5/VS 2008, used LINQtoSQL and other new features in VS 2008. My current version (as of Aug 15 2010), uses .NET 4.0 and SQL Server 2008.

If you need any help on building your own server, feel free to contact me.

Link to my site – http://www.gokulnath.com

Monday, July 05, 2010 9:57:00 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET | HTML | Miscellaneous | SQL Server
# Saturday, May 15, 2010

Thirukural, written by Thiruvalluvar, in the form of couplets that convey noble thoughts. It is considered to be a book of ethics for the ordinary man, the administrator, the king and the ascetic. It is universal in perspective, and hence called "Ulaga Podhu Marai" meaning the Common Knowledge for the world. It is as timely today as when it was written more than 2000 years ago. Click here to know more about this book.

It has been translated to 80 languages (including many Indian languages).  However, as far as I know only few people from India, other than from Tamil Nadu (a southern state in India) have known about or read this book. It is one of the reasons, why I decided to add it to my site ... just an attempt to spread this book further, hope you will do the same.

Acknowledgements:
I took most of the content from -
Tamil.pdf (254.88 KB), English.pdf (351.65 KB) and TamilMeaning.pdf (972.86 KB). Thanks a lot to all those who have worked on these projects. A special thanks to B.Viswanathan, the creator of the software Azhagi, using which I generated reverse-transliterations. Thanks to Google for its Transliteration API. Last but not least, thanks to all others who have worked/are working/will be working on spreading this book.

Difficulties:
1. Spent a lot of time in collecting and importing the content to my database than designing the pages; used all sort of scraping techniques (programmatic) to fetch the content from the pdfs listed above. So, I cannot assure you that all the kurals, meanings (Tamil & English) and the Transliterations are 100% correct. In case if anything is wrong with any of the content, please report to me by following the report link.
2. Searched many places in Chennai for Thirukural CD with files separated by kurals, didn’t get one! However, I got 3 CDs for each section and files separated by adhigarams (chapters).
3. Had a tough time adding adhigaram mp3s in un-downloadable format. Shoutcast’s streaming content was easier compared to httphandlers, flash playlist etc. However, Shoutcast generated playlist in .pls format, and it didn’t work in Windows Media Player. So, wrote separate code to generate windows media playlist file (.wpl). If you have any problems in listening, download the playlist files and then try to open it in any of the players installed in your system.

Vazhga Tamil!!

Here is the link - http://www.gokulnath.com/thirukurals



Saturday, May 15, 2010 3:06:55 AM (GMT Daylight Time, UTC+01:00)  #    Comments [5] -
Miscellaneous
# Thursday, May 06, 2010

If audio is not working in your server, check whether Windows Audio service is started…

How to do:
1. On Windows Run (windows key + R key), type services.msc
2. Look for Windows Audio service and check whether it is started, if not, start it

If this doesn't resolve your problem, try updating your audio drivers.

If audio is not working only when remoting, try the following:

1. On Windows Run (windows key + R key), type gpedit.msc
2. Go to Local Computer Policy/Computer Configuration/Administrative Templates/Windows Components/Terminal Services/ClientServer redirection
3. Enable Allow audio redirection


and then do this too:
1. On Windows Run (windows key + R key), type tscc.msc
2. Open the Connections folder in the left sidebar
3. Right-click RDP-Tcp, select Properties
4. Click Client Settings tab
5. UNCHECK the "Audio mapping" checkbox under the section "Disable the following:"
7. Click OK, and close tscc
8. You may see a warning which says this change will not take effect for any currently-connected RDP sessions. Click out of that
9. Logoff
10. Login


If you are remoting from a Windows XP machine, try to remote into the console by typing "mstsc /console" on run window.
If you are remoting from a Windows 7 or a Vista machine, try to remote into the console by typing "mstsc /admin" on run window.

Thursday, May 06, 2010 11:53:56 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
Miscellaneous | Solutions
Navigation
Archive
<August 2014>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Gokulnath
Sign In
Statistics
Total Posts: 42
This Year: 0
This Month: 0
This Week: 0
Comments: 47
Themes
Pick a theme:
All Content © 2014, Gokulnath
DasBlog theme 'Business' created by Christoph De Baene (delarou)