Konstantin Vlasenko

An engineer is someone who can make for a dollar what any fool could make for two. – Alan Kay

O365 components for most plans

K1 – DESKLESSPACK

SHAREPOINTDESKLESS
EXCHANGE_S_DESKLESS

K2 – DESKLESSWOFFPACK

SHAREPOINTWAC
SHAREPOINTDESKLESS
EXCHANGE_S_DESKLESS

P1 – LITEPACK

MCOLITE
SHAREPOINTLITE
EXCHANGE_L_STANDARD

E1 – STANDARDPACK

MCOSTANDARD
SHAREPOINTSTANDARD
EXCHANGE_S_STANDARD

E2 – STANDARDWOFFPACK (?)

E3 – ENTERPRISEPACK

OFFICESUBSCRIPTION
MCOSTANDARD
SHAREPOINTWAC
SHAREPOINTENTERPRISE
EXCHANGE_S_ENTERPRISE

E4 – ENTERPRISEWITHSCAL

OFFICESUBSCRIPTION
MCOSTANDARD
SHAREPOINTWAC
SHAREPOINTENTERPRISE
EXCHANGE_S_ENTERPRISE

source: http://blog.c7solutions.com/2011/07/assign-specific-licences-in-office-365.html

[express/connect.static] Set ‘Last-Modified’ to now to avoid 304 Not Modified

Why do I need this? The right answer is: I don’t need that trick!

The example below is just to show how to use routes to intercept requests to a static file.

Put router before static.

app.use(app.router);
app.use(express.static(__dirname + '/static'));

Add ‘/*’ handler (don’t forget to call next())

app.get('/*', function(req, res, next){
  res.setHeader('Last-Modified', (new Date()).toUTCString());
  next();
});

AWS .NET SimpleDB uses https

So do not be afraid. You are secure.
Declaring Type: Amazon.SimpleDB.AmazonSimpleDBConfig
Assembly: AWSSDK, Version=1.3.8.0

public AmazonSimpleDBConfig()
{
    this.serviceVersion = "2009-04-15";
    this.serviceURL = "https://sdb.amazonaws.com";
    this.userAgent = AWSSDKUtils.SDKUserAgent;
    this.signatureVersion = "2";
    this.signatureMethod = "HmacSHA256";
    this.proxyPort = -1;
    this.maxErrorRetry = 3;
    this.fUseSecureString = true;
}

Using PowerShell for common AWS SimpleDB operations

#Create SimpleDB client

Add-Type -Path "C:\AWS SDK\1.3.8.0\bin\AWSSDK.dll"
$sdb=[Amazon.AWSClientFactory]::CreateAmazonSimpleDBClient('Key Id', 'Secret Key')

#Create Domain

$req = (new-object Amazon.SimpleDB.Model.CreateDomainRequest).WithDomainName('Contacts')
$sdb.CreateDomain($req)

#List Domains

$req = (new-object Amazon.SimpleDB.Model.ListDomainsRequest)
$sdb.ListDomains($req)

#Insert Item

$req = (new-object Amazon.SimpleDB.Model.PutAttributesRequest).WithDomainName('Contacts').WithItemName('user1');
$req.Attribute.Add((new-object Amazon.SimpleDB.Model.ReplaceableAttribute).WithName('FirstName').WithValue('Konstantin'))
$req.Attribute.Add((new-object Amazon.SimpleDB.Model.ReplaceableAttribute).WithName('LastName').WithValue('Vlasenko'))
$sdb.PutAttributes($req)

#Query All Items

$req = (new-object Amazon.SimpleDB.Model.SelectRequest).WithSelectExpression('select * from Contacts')
$sdb.Select($req)

#Query Item

$req = (new-object Amazon.SimpleDB.Model.SelectRequest).WithSelectExpression('select * from Contacts where itemName()="user1"')
$sdb.Select($req)

HTML5 chessboard

<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
	// draws a chessboard
	function drawChessboard() {
		// define the constants
		var baseX = 0.5, baseY = 0.5, width = 50;
		// get the 2D context from the "chessboard" canvas
		var context = document.getElementById("chessboardCanvas").getContext("2d");

		// draws the 8 by 8 chessboard
		for (var i = 0; i < 8; i++) {
			for (var j = 0; j < 8; j++) {
				var x = baseX + width * i, y = baseY + width * j;

				// draw the rectangle
				context.strokeRect(x, y, width, width);

				// fill the odd number rectangles
				if ((i + j) % 2 != 0) {
					context.fillRect(x, y, width, width);
				}
			}
		}
	}
	drawChessboard();
});
</script>
</head>
<body>
<canvas id="chessboardCanvas" width="401" height="401" class="block"/>
</body>

</html>

Cloud adds new statement to Manifesto for Agile Software Development

The cloud is not only a new way to more easily and cheaply get the computing power needed to do what companies and individuals are doing today…
This may be the most important benefit of the cloud—it enables companies of all sizes and in all sectors, as well as governments, non-profits, and individuals, to more quickly build new applications and services – http://goo.gl/uxQcT

Cloud is agility and efficiency of computing. Agile team should be in the cloud.

It means that you should do your job completely in the cloud whenever possible. Developing, Testing, Presenting, e.t.c.

BTW: Manifesto for Agile Software Development

node.js Allow access only for logged in users

The reference to isLoggedIn in the route is an connect route middleware. Control is passed to the middleware function before the route function is called. Use isLoggedIn to verify that we have a user token in the session before we send the client the requested route.
If we do not have a user token in the session, then we redirect the client to the ‘/login’ route. This effectively locks down our routes from unauthenticated access.

function isLoggedIn(req, res, next) {
    if(req.session['FedTokenCookie']){
      next();
    }else{
      res.writeHead(301, {"Location":'/login'});
      res.end();
    }
};
app.get('/mails', isLoggedIn, function(req, res, next){
  ...;
});
app.get('/docs', isLoggedIn, function(req, res, next){
  ...;
});

Getting IP address by using AWK

The AWK utility is a data extraction and reporting tool that uses a data-driven scripting language consisting of a set of actions to be taken against textual data (either in files or data streams) for the purpose of producing formatted reports.

ifconfig | awk '/inet addr:.* B/ {split($2,a,":"); print a[2] }'

Get Spot Price History by using aws-lib

We are going to get the pricing history for t1.micro instances by using aws-lib (Extensible Node.js library for the Amazon Web Services API):

var aws = require("aws-lib");
var ec2 = aws.createEC2Client(accessKeyId, secretAccessKey);
var iType = 't1.micro';
ec2.call('DescribeSpotPriceHistory', {'InstanceType.1':iType}, function(result) {
    console.log(result.spotPriceHistorySet.item);
  }
);

connect.bodyParser converts FORM data to JSON format

http://senchalabs.github.com/connect/middleware-bodyParser.html

Client:

Server:

Output:

login= {
  {
    name: Velaskec,
    password: Pa$$word
  }
}
Follow

Get every new post delivered to your Inbox.