Friday, March 29, 2013

JavaScript debugging from SublimeText using Chrome

Debugging JavaScript just became a lot sexier! Just install the chrome JavaScript debugger package for Sublime text and get going!


Thursday, March 28, 2013

ElmahR - Real time Elmah logging

Today a project was featured on hackernews : ElmahR. It combines SignalR and Elmah which I think is pretty cool.


I'm not really sure whether this is really usefull in a business environment, but I still think it's a cool initiative.

Elmah?

Is THE library we use for error logging on all our .net web MVC applications. Actually, what we do is use NLog for logging and mailing critical bugs, but ELMAH keeps the database of actual exceptions and warnings.

Check it out here, but you want to get the NuGet package if you want to use it in your web-application. Getting the link for ELMAH, I saw that Scott Hanselman blogged about elmah in May 2011, so don't come here for new stuff... Next week, Windows 95. :)

SignalR?

Is a real time library written by some guys at Microsoft that allows your webpage to receive real-time data from the webserver. Typical implementations could be chat applications or live stock data.



Tuesday, March 26, 2013

MemSQL: in memory database system compatible with MySQL

Googling for 'fast' technoligies I came across the MemSQL database engine - which claims to be the fastest database engine available. It's an in-memory database and the cool thing is that it's compatible with MySQL. I think that implies that it's compatible with all existing MySQL libraries available for .NET which is really cool. Also - they mention the 'flat learning curve' implying that there's nothing to learn ( at least from a developer point of view I suppose ).

Sunday, March 24, 2013

Neo4j: A graph database engine

While browsing for intersting database techniques - I came across this one: Neo4j. It's a graph database engine from Sweden.


On the website, there's a video from Emil Eifrem who explains what possible applications of the database are. Neo4j exposes a REST API that typically servers and takes JSON objects making it cross platform. There is a C# client NuGet package available as well - here.

To give a quick idea - setting up graphs and querying is done using Cypher. Here's a snippet from their website:

Graph Setup:
start root=node(0)
create (Neo {name:'Neo'}), (Morpheus {name: 'Morpheus'}), (Trinity {name: 'Trinity'}), (Cypher {name: 'Cypher'}), (Smith {name: 'Agent Smith'}), (Architect {name:'The Architect'}),
root-[:ROOT]->Neo, Neo-[:KNOWS]->Morpheus, Neo-[:LOVES]->Trinity, Morpheus-[:KNOWS]->Trinity,
Morpheus-[:KNOWS]->Cypher, Cypher-[:KNOWS]->Smith, Smith-[:CODED_BY]->Architect

Query:
start n=node:node_auto_index(name='Neo') 
match n-[r:KNOWS*]-m 
return n as Neo,r,m

All in all, this is some really exciting stuff, check it out!

Sunday, March 17, 2013

Remote Desktop to Ubuntu 12.10 - doesn't work out of the box...

I've installed Ubuntu 12.10 on a VM and wanted to connect to it using RDP, since I'm on a windows based environment. The package XRDP seems the way to go, but that doesn't work out of the box with the fancy Ubuntu interface.

What you need to do is:
- Get the xrdp package
apt-get install xrdp
- Get the gnome session fallback pacakge
apt-get install gnome-session-fallback
- Create a file in the user home folder called .xsession and place the following line inside
gnome-session --session=gnome-fallback

No you can connect to your Ubuntu installation using RDP. However - you will have a completely different desktop from the latest version:


It's all described here - using software center - thanks Griffon.

Friday, March 15, 2013

Using Integrated Lights Out (iLO) to remotely start/stop my server

One of the nice features of my server is the iLO 2 interface which stands for Integrated Lights Out. It provides a web interface that allows me to see the server health and remotely boot it or shut it down. 

As soon as the server is connected to the power net, the iLO interface will go and get it's own IP ( static or dynamic, depending on setup at startup ). On this IP you can connect to the iLO interface and boot the server up, shut it down, check on the health and temparatures etc.


The former owner of my server told me that it cost him approx 50 euro's in electricity to run this server non-stop. Since this is my lab toy, I will not be running it all the time and thus this iLO is ideal to remotely start and stop it whenever I want. Only thing for me to do is assign a static IP to iLO and port forward it on port 443 - since it's over HTTPS.

Wednesday, March 13, 2013

Installing Windows Server 2012 with Active Directory and VPN

After installing the vSphere Hypervisor I wanted to setup VPN connection to my home network. I wanted to do that on Windows Server 2012 and use Active Directory for user management. Here's how I went about it.

1. Install Microsoft Server 2012

I'm skipping the parts where you download it from MSDN, upload the ISO to your datastore, create the VM, mount the ISO and install the server. Installing the server is just skipping through the wizard and getting it up and running.

The only thing I did afterwards and through the vSphere client console was:

  • Assign a static IP to the server after installation.
  • Enable remote desktop for the server
  • Give a meaningfull name to the server ( which is first step in setting up AD in the video tutorial below )
Note - this is after installing Active Directory + VPN + IIS.


After that, I switched to RDP for obvious reasons.


2. Install Active Domain Services

From the dashboard - 'add a feature' and install the Active Directory Domain Services. There's a bunch of tutorials out there, showing how to do it. After installation, you need to setup your domain to make the machine the domain controller. Windows Server will notify you that you have to do this, and it's a walk in the park.


3. Install 'Remote Access' role (VPN) on the server

Again - this is just adding a role to server and there's a bunch of tutorials for this too. I think the installation process automatically installs the DNS server and configures it correctly, i.e. makes it's default DNS server itself.

I'm using a forward lookup domain so you want to make sure that is set up correctly. Use the top right Tools > DNS and get your ISP DNSs in:


Also - after setting up a VPN connection - I noticed that I had no internet access, nor could I reach other hosts within the network. I changed the DHCP settings to a static pool using Tools > Routing and Remote access > right click on the server and go to properties:


I'm NOT changing the per-user setting of the dial-in permissions, since this would not be workable in a working environment. I'm going to use a network policy for this.

4. Create active directory group with user

I created a user group called VpnUsers in order to simulate a working environment, and created a user in that group. Server 2012 has this nice thing called Active Directory Administration Center which makes this a breeze:


I'm setting up the group - because I don't want to do a per-user setting of the VPN policy.


5. Create a VPN Access policy on the Network Policy Server

The final step was for me to give these VpnUsers permission to dial-in. Go to the Network Policy Server and set it up in the 'Network Policy' folder.

Right click Network Polcy and hit 'New'. This is what I did:










And presto - you've got VPN set up and with a manageable setup to allow and disallow users to access your VPN.

The only thing left for me to do was to port-forward the PPTP port on 1723 of my router:

Tuesday, March 12, 2013

Installing Ubuntu Server 12.10 with static IP

After setting up my server, I went ahead to install Ubuntu Server 12.10 on it in order to stay familiarized with Linux based server and hosting environments. The great thing about installing Ubuntu Server is that it presents you with a few options for a typical out-of-the-box-server-installations. I ticked 'OpenSSH' and 'LAMP', so right after installation, I had SSH access AND Apache, Mysql and PHP installed in one go.

Ubuntu server 12.10 installation screen

The only thing I wanted to do is make the server use a static IP address. I started out using this tutorial, but I did it slightly different because the resolvconf package is installed on Ubuntu Server by default and therefore the resolv.conf is overwritten on every boot. Also - you can use 'service networking restart' in order to restart the service after updating the /interfaces file.

So - here's the /interfaces/ file from the vSphere console:
vSphere client showing /etc/networking/interfaces ip configuration

Here's the original tutorial that got me on the way:
Setting up static IP address on Ubuntu Server 12.10


You can see in htop the server has a very small footprint and uses approx 170 megs of RAM.

htop showing Ubuntu Server 12.10 footprint



Sunday, March 10, 2013

My new toy: HP DL380G5 + setting up VMware vSphere Hypervisor

I'm switching jobs and I'm presuming I'll have more to do with server installations. In order to play around with this a bit more I treated myself to a 5th generation HP DL380.


They're not that expensive 2nd hand and I think I got quite a good deal on one with 2 Xeon 5160's, 20 GB of RAM and 8 146 GB discs.
This thing is heavy and it's loud, but I've had lots of fun with it thusfar. Here's what I did:


1. Installed VMware vSphere Hypervisor

It's amazing that this product is for free. Get your account at VMWare and get the Hypervisor. You'll get a license that makes the free features never expire.



Made a bootable USB using YUMI and installed it on the server. I had to make one change in the BIOS in order for it to work - see "ESXi requires the Execute Disable/No Execute CPU feature to be enabled". It's easy - check it out here. You just need to get it on the server, set a root password and assign a static IP address to the machine ( at least - that's what I did ).

2. Get the client and upload some ISOs

Now download the client, install it and connecto to the server. You need to use the client to enter your license key ( here's how ) . After getting in and looking around a little - I uploaded some ISOs to the datastore. I decided to go with the latest Ubuntu server and Windows Server 2012. My company has a  BizSpark membership - so I can get all the Microsoft goodness for free.



3. Create some VMs

After the uploads are done - you can start creating VMs. Just right click on the server, hit 'New virtual machine' and the process is pretty much self explanatory. After booting up the VM - you want to mount the ISO that you uploaded to the datastore. It will boot from the ISO and you'll install the server in no-time.



Thursday, March 7, 2013

Herding code - Cool podcast discussing new projects

While watching the Channel 9 videos presented by Scott Hanselmann, Jon Galloway and Damian Edwards on the current MS web stack, I noticed the 'Herding Code' sticker on his computer. This points to a podcast that John Galloway hosts with others and where a broad spectrum of new technologies is discussed.

Here's a list of topics they recently discussed:
  • Breeze.js : JavaScript library that allows you to query a REST API ( like the Web API from Microsoft ) and works with KnockOut for binding the results.
  • Nancy: A super light-weight web application framework that uses a lot of dynamics I believe
  • Xamarin 2.0: This used to be MonoTouch I believe, a subset of the Mono project with additional libraries for working with mobile ( touch enabled ) devices. This allows you to write .NET code for iPhone, Android etc.
  • Oak: Described as "Frictionless development for ASP.NET MVC single page web apps. Prototypical and dynamic capabilities brought to C#." - I'm going to have to look into that one.
Anyway - I'll be adding it to my podcast subscriptions and I'll be looking into these projects.




Monday, March 4, 2013

Microsoft Channel 9 video series on the latest web stack

A couple a days ago, Scott Hanselman posted a series of 8 videos about the latest and greatest in web development coming from Microsoft. The video series touch on a broad spectrum modern techniques included in the latest Visual Studio update and .NET framework. It's not very high level, but it's great to get a quick peak into a whole lot of web technologies that are being packed into Visual Studio.


Friday, March 1, 2013

XKCD is awesome ...

My brother once introduced me to XKCD - this guy draws awesome cartoons. I think you need to be an engineer to get most of them though. The latest one is SO applicable to my current situation in which I'm the appointed person to fix all my relatives computers: