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] }’
Monthly Archives: August 2011
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 } }
PowerShell: Wait for SQL Server is ready for client connections
The useful PowerShell script waiting SQL server is ready. I found that waiting for starting service while((get-service MSSQL`$INSTANCENAME).Status -ne ‘Running’){Sleep 3} is not enough. Better to check the event log entry EventID = 17126: SQL Server is now ready for client connections. This is an informational message; no user action is required. $ew = new-objectContinue reading “PowerShell: Wait for SQL Server is ready for client connections”
PowerShell: Create CSV without Header
get-process | ConvertTo-CSV -NoTypeInformation | select -Skip 1