Thursday, November 13, 2014

Microsoft released .NET Core as open source. Find out what's inside!

Microsoft announced that .NET Core will be open source, including the runtime and the framework libraries.
There are several open source Microsoft .NET projects on GitHub and CodePlex:

So what's in this stuff, anyway? Let's dissect it using sloccount and cloc (count lines of code) and find out!

Grab the code for Roslyn:
$ GIT_CURL_VERBOSE=1 git clone -v https://git01.codeplex.com/roslyn

Cloning into 'roslyn'...
error: RPC failed; result=56, HTTP code = 200
GnuTLS recv error (-9): A TLS packet with unexpected length was received.

Whatever - no time to rebuild git against OpenSSL. Let's use a workaround:
$ mkdir roslyn; cd roslyn; git init
$ git remote add origin https://git01.codeplex.com/roslyn
$ git checkout -B master origin/master

Great. Now let's grab the .NET Core dev stack, libraries and build tools (github clones fine):
$ git clone https://github.com/dotnet/corefx.git
$ git clone https://github.com/dotnet/buildtools.git

Analyze the .NET Core 5 (corefx) and buildtools

$ cloc --xsl=1 --xml corefx/ buildtools/

Language Files Blank Comment Code
C# 565 17312 24750 104192
XML 2 0 7 4456
MSBuild scripts 15 54 90 1820
SKILL 2 11 0 52
Visual Basic 1 17 1 43
ASP.Net 6 0 0 32
C/C++ Header 1 5 1 7
DOS Batch 1 0 0 5
Total 593 17399 24849 110607


Analyze Roslyn
$ cloc --xsl=1 --xml roslyn/Src


Language Files Blank Comment Code
C# 4138 186147 131956 1173792
Visual Basic 1767 178277 140738 981301
XML 4 1870 1920 12451
MSBuild scripts 74 0 216 10066
C/C++ Header 15 1607 428 7361
SKILL 33 888 0 4954
C++ 12 322 186 1698
XSD 3 74 217 401
ASP.Net 44 4 0 351
XAML 3 3 1 128
DOS Batch 6 22 11 79
PowerShell 3 7 0 13
Total 6102 369221 275673 2192595


$ sloccount roslyn/Src

Total Physical Source Lines of Code (SLOC)                = 1,205,824
Development Effort Estimate, Person-Year (Person-Month) = 343.86 (4,126.29)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 4.93 (59.14)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 69.78
Total Estimated Cost to Develop                           = $ 46,450,431
 (average salary = $56,286/year, overhead = 2.40).
So - what have we learned?
  • sloccount COCOMO estimates are just that - estimates;
  • We have over one million lines of C# to play around with;
  • Porting this thing will likely depend on Mono and will require quite a lot of work;
  • It still doesn't make up an ecosystem - there's work to be done here to turn this into a cross-platform .NET environment;
  • Microsoft is most likely pushing for the clouds - this open source seems consistent with their recent partnership with Docker.

Thursday, February 21, 2013

Set up a highly available firewall and load balancer in the IBM cloud

http://www.ibm.com/developerworks/cloud/library/cl-setupfirewalloncloud/index.html
Summary:  Set up a highly available (Virtual Router Redundancy Protocol) firewall and load balancer (Linux Virtual Server IP Virtual Server) using Keepalived for Linux and the IBM SmartCloud Enterprise virtual IP and anti-collocation features.

Saturday, October 20, 2012

QEMU and kpartx to perform bare metal recovery or forensics on cloud instances

Using qemu or kpartx to perform "bare metal" instance recovery or forensics on KVM cloud instances:


Use QEMU on IBM SmartCloud Enterprise to recover images after system disasters




Sunday, December 11, 2011

HP to Contribute webOS to Open Source

Looks like after killing their TouchPad tablet, HP open sources WebOS:

Might mean the TouchPad will make a comback. We'll see.

Review: 1Q84


1Q84
1Q84 by Haruki Murakami

My rating: 5 of 5 stars



I can't quite put my finger on it, but this books keeps reminding me of things I've forgotten or ignored.

I must say I've enjoyed Book 3 the most.

Well, that's it. For now at least - I'm out of Murakami :-(.



View all my reviews

Tuesday, October 25, 2011

Review: Getting Things Done: The Art of Stress-Free Productivity

Getting Things Done: The Art of Stress-Free ProductivityGetting Things Done: The Art of Stress-Free Productivity by David Allen

My rating: 5 of 5 stars

I've been using the methods and techniques described in GTD along side mind mapping in practice for over 8 years (mostly due to tools like OneNote, Emacs ORG mode, XMind/Fremind, etc). Reading this book has definitely helped optimize my workflow and planning into something quite a bit more efficient.

Right now I'm still looking to overhaul my tooling, OneNote isn't available on UNIX-like system (though it mostly works with wine), and Emacs ORG mode isn't practical for pasting images, screenshots, video, audio, files, etc. and such for reference.

It's tried a bunch of Java tools (Thinking Rock and GTD Free) but they're not very good for reference, note taking and reminders / calendar stuff. So far it's proving hard to beat the OneNote + Outlook + Project combo.

One tool I've been using for a while now (probably an year or so) along side OneNote is Tracks . It's a RoR webapp that covers most things in the GTD workflow. Although import/export isn't yet available as of version 2.0, it gets the job done. It's also available from Bitnami as a pre-installed stack.

If you're into GTD or just like to organize yourself with TODOS, tasks, projects and such, Tracks is worth a try.

View all my reviews

Thursday, May 26, 2011

Convert AWK to Perl using a2p

Automatic conversion of AWK scripts to perl.

A little awk script that numbers lines:
ls -la /usr | ./linum.pl
1 : total 240
2 : drwxr-xr-x+ 12 root root 4096 2010-06-21 06:47 .
3 : drwxr-xr-x 22 root root 4096 2011-05-11 12:06 ..
4 : drwxr-xr-x+ 2 root root 69632 2011-05-24 14:07 bin
5 : drwxr-xr-x+ 2 root root 4096 2010-05-05 11:33 games
6 : drwxr-xr-x+ 5 root root 4096 2010-06-21 06:47 i586-suse-linux
7 : drwxr-xr-x+ 52 root root 4096 2011-05-13 04:17 include
8 : drwxr-xr-x+ 156 root root 69632 2011-05-24 14:07 lib
9 : drwxr-xr-x+ 10 root root 4096 2010-06-21 06:47 local
10 : drwxr-xr-x+ 2 root root 12288 2011-05-24 14:07 sbin
11 : drwxr-xr-x+ 213 root root 4096 2011-05-23 13:19 share
Let's convert this to perl using a2p.
echo '{ printf("%5d : %s\n", NR, $0) }' | a2p > linum.pl
chmod +x linum.pl
Let's try it out:
ls -la /usr | ./linum.pl
1 : total 240
2 : drwxr-xr-x+ 12 root root 4096 2010-06-21 06:47 .
3 : drwxr-xr-x 22 root root 4096 2011-05-11 12:06 ..
4 : drwxr-xr-x+ 2 root root 69632 2011-05-24 14:07 bin
5 : drwxr-xr-x+ 2 root root 4096 2010-05-05 11:33 games
6 : drwxr-xr-x+ 5 root root 4096 2010-06-21 06:47 i586-suse-linux
7 : drwxr-xr-x+ 52 root root 4096 2011-05-13 04:17 include
8 : drwxr-xr-x+ 156 root root 69632 2011-05-24 14:07 lib
9 : drwxr-xr-x+ 10 root root 4096 2010-06-21 06:47 local
10 : drwxr-xr-x+ 2 root root 12288 2011-05-24 14:07 sbin
11 : drwxr-xr-x+ 213 root root 4096 2011-05-23 13:19 share


The code block looks pretty good:

while (<>) {
chomp; # strip record separator
printf "%5d : %s\n", $., $_;
}

NSA Operating Systems Security Configuration Guides

NSA published some rather interesting OS security guides:
http://www.nsa.gov/ia/guidance/security_configuration_guides/operating_systems.shtml

The RHEL Security Guides are quite good.

I've used these along with the Security Guide and the Security-Enhanced Linux guides from RHEL.

Friday, May 20, 2011

IBM SmartCloud Enterprise tips: LVM and FTPS

IBM SmartCloud Enterprise tips:

Learn how to set up a 64-bit Linux® instance (starting with a Bronze-level offering) with the Linux Logical Volume Manager (LVM), capture a private image and deploy a new instance as a different offering (a Platinum tier) and then grow the LVM volumes and file systems to accommodate the new physical volumes. This article also shows how to configure and manage LVM across physical volumes using Linux LVM-type partitions:


Set up a Microsoft® Windows™ Server 2008 R2 on the IBM Cloud so that it can act as a file server. This article details the steps to configure an FTPS and SMB file server using persistent storage; this enables the cloud user to upload and download files to and from instances in the cloud and facilitate data exchange:

Sunday, October 10, 2010

Microsoft Mathematics Add-In for Word and OneNote

Heh, this one is pretty awesome. Calculus and plotting in Microsoft Word :-). Best of all, it's a free add-on.



And while we're on the subject of educational software:

You can even grab the source code for this: http://chem4word.codeplex.com/