RSS

Monthly Archives: June 2011

How to create your own private cloud

We used Ubuntu’s Enterprise Server, which is a freely downloadble solution to let you build your own IaaS based private cloud in your data center

BANGALORE, INDIA: Most discussions around Cloud Computing nowadays are either focused on the security issues associated with it, or providing basic definitions of the three different types of Cloud based services i.e SaaS, PaaS and IaaS. A third thing is of course the loud noise created by all the vendors around their own cloud based offerings.There’s hardly anybody talking about actual usage of cloud computing. Which public cloud service should you choose? What’s a private cloud and how to get started on it? What are the tools that would let me create my own private cloud? There are very few discussions on these aspects.

So while the public cloud based services have been covered elsewhere in our cover story, in this story we’ll focus on how to build your own private IaaS (Infrastructure as a Service) based private cloud. For this, we’ve used Ubuntu’s 10.04 Server Edition, which is completely free. We’ve given it on this month’s DVD, else you can download it from ubuntu.com/cloud/private.

The benefits of setting this up are many. It has the elasticity to grow or shrink your compute capacity based on your application’s needs. You can rapidly deploy new applications whenever required on your existing IT infrastructure. This way, you don’t end up investing in additional hardware resources. The Ubuntu Enterprise Cloud provides the same APIs as the popular EC2 cloud from Amazon, so if you’ve worked with that, this should be a piece of cake. What you create and run on Ubuntu, you can also run on EC2.

Let’s Implement
You need at least two servers for deploying the Ubuntu Cloud. One (Machine A) would act as the cloud, cluster, warehouse, and storage controller; while the other (Machine B) would be the node controller. One thing to keep in mind is that the node controller should support virtualization as virtual machines would be running on it.

By default a single virtual machine would run per core, therefore having a multi-core node controller is highly recommended. We configured Machine A on a Core2duo X6800 processor based machine with 2 GB DDR 2 RAM and 80 GB HDD. Machine B was running on an AMD Phenome II X4 965 processor with 4 GB DDR 3 RAM and 250 GB HDD.

To install the Ubuntu based Cloud, select ‘Install Ubuntu Enterprise Cloud’ from the first screen for installation on both Machines A and B.

http://www.ciol.com/Developer/Enterprise-Tools/Feature/How-to-create-your-own-private-cloud/140551/0/

 
Leave a comment

Posted by on June 29, 2011 in General

 

Messaging Instance Object for C#

This code, I have build to help C# developer to build multi-client applications can work together without refresh each data.

Please share your idea if you want to update this source code be better.

https://sourceforge.net/projects/cmessaginginsta/

 
Leave a comment

Posted by on June 24, 2011 in C#

 

Convert multiple rows into one row – SQL Server

As I need to send email to many people, i need to convert multiple emails into a single row delimited by semi-colon(;), i had lots of solutions, but which is an old type of solution which needs more lines of code. As i want to use one or two line code which would resolve, i found three methods for my solution which is very simple.

Method 1:

DECLARE @str varchar(4000)
SET @str = (SELECT CONTACT_EMAIL + ‘;’ FROM table FOR XML PATH(”))
SET @str = SUBSTRING(@str,1,LEN(@str)-1)
SELECT @str

Method 2:

DECLARE @str varchar(4000)
SELECT @str = COALESCE(@str + ‘;’, ”) + CONTACT_EMAIL FROM table
SELECT @str

Method 3:

DECLARE @str varchar(4000)
SELECT DISTINCT STUFF( (SELECT CONTACT_EMAIL + ‘;’   from table FOR XML PATH(”)),1,1,”)
SELECT @str

Multiple rows returned:

CONTACT_EMAIL
abc1@domain.com
abc2@domain.com
abc3@domain.com

3 row(s) affected.

After executing one of the methods, i got the result as

CONTACT_EMAIL
abc1@domain.com;abc2@domain.com;abc3@domain.com;

Referenced by: http://geekswithblogs.net/nagendraprasad/archive/2009/03/13/convert-multiple-rows-into-one-row—sql-server.aspx

 

 

 

 

 
4 Comments

Posted by on June 7, 2011 in SQL Server

 

How to get into LogIn form – if there isnt any key press in my C#

I have Login form and Main form in my C# WinForm program.

When I’m in the Main form and the user doesn’t press any key or move the mouse for 5 minutes – I want to go to Login form.

This example will raise message when user is not active for 5 minutes.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
static class Program
{

private static Timer _idleTimer;

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

_idleTimer = new Timer();
_idleTimer.Tick += new EventHandler(_idleTimer_Tick);
_idleTimer.Interval = (5 * 60) * 1000; // (5 minutes * seconds) * milliseconds

Application.AddMessageFilter(new MouseMessageFilter(UserIsActive));
Application.AddMessageFilter(new KeyboardMessageFilter(UserIsActive));

Application.Run(new Form1());
}

static void _idleTimer_Tick(object sender, EventArgs e)
{
MessageBox.Show("You are idle for " + _idleTimer.Interval.ToString() + " milliseconds");
}

static void UserIsActive(object sender, EventArgs e)
{
_idleTimer.Stop();
_idleTimer.Start();
}

public class MouseMessageFilter : IMessageFilter
{
private EventHandler _callback;

public MouseMessageFilter(EventHandler callback)
{
_callback = callback;
}

private const int WM_MOUSEMOVE = 0x0200;

public bool PreFilterMessage(ref Message m)
{
if (m.Msg == WM_MOUSEMOVE)
{
_callback(null, null);
}

return false;
}
}

private class KeyboardMessageFilter : IMessageFilter
{
private EventHandler _callback;

public KeyboardMessageFilter(EventHandler callback)
{
_callback = callback;
}

const int WM_KEYDOWN = 0x100;
const int WM_KEYUP = 0x0101;
const int WM_SYSKEYDOWN = 0x104;
const int WM_SYSKEYUP = 0x0105;

#region IMessageFilter Members

public bool PreFilterMessage(ref Message m)
{
if ((m.Msg == WM_KEYDOWN) || (m.Msg == WM_SYSKEYDOWN))
{
_callback(null, null);
}

if ((m.Msg == WM_KEYUP) || (m.Msg == WM_SYSKEYUP))
{
_callback(null, null);
}

return false;
}

#endregion
}

}
}

Referenced by: http://stackoverflow.com/questions/5477939/how-to-get-into-login-form-if-there-isnt-any-key-press-in-my-c-program

 
Leave a comment

Posted by on June 6, 2011 in C#, Window Application