
Hello World. Ive spent the last few weeks working on a GPL interface for ghettoVCB called ghettoVCB.js. This interface uses NodeJS (Express + MongoDB) + ExtJS 4.1 for its main components. This will probably be the last ExtJS project I do for a while. I think time is now for me to begin learning objective-c for OSX/iOS apps. That, and I will focus on Twitter's Bootstrap and jQuery for a more light weight set of widgets than what ExtJS offers me. I also shouldn't settle in with a single product ie ExtJS. Sencha. Interacting with the company has a lot to be desired, but enough with that.
MicroServer ESXi White(silver)Box Part1
I recently researched a dedicated home office ESXi 5 server. The goal was to have the capacity to run 4-8 virtual machines. My implementation includes two dedicated windows server domain controllers, two linux servers for a continuously integrated development environment, and a dedicated storage appliance (running ubuntu linux) to host fast SSD and large spindle disk storage. This "datacenter in a box" was to have the capacity to add disks, passthrough PCIe devices, and have the potential to team with more (with a central NAS) for a complete "cloud" environment on the cheap. I wanted this datacenter in a box to simply "plug n' play". No dependency on keyboard/mouse or display. Everything would exist virtually via the network and thus power and ethernet are its only requirements. Ultimately this box would end up hidden somewhere in a closet or under a desk, out of sight. The greatest requirement was to be small, quiet and use as little power as possible.
After a bit of research on the concept of creating one of these home server whiteboxes (http://ultimatewhitebox.com/), I found a nice blog entry called The Baby Dragon: http://rootwyrm.us.to/2011/09/better-than-ever-its-the-babydragon-ii/, which detailed a fairly recent (as of 2011) configuration for a home office whitebox ESXi server. From there I compiled an order on newegg.
Part 1 of this series will detail the hardware procurement and installation. Later parts will discuss ESXi installation, maintenance and caveats.
Motherboard, Processor, and Ram
SharePoint 2010 is a decent CMS out there from Microsoft. Great for customized document storage, customized data lists, and of course Office Web Apps for cross-browser web based viewers/editors (word, excel, powerpoint, visio, etc). SharePoint 2010 can also be extended to open source technologies rather easily with its REST services in order to create customized HTML reports rather than viewing through the clunky ribbon interface in SharePoint itself.
In this presentation, I will use NodeJS, Express, Jade, coffee-script, and Twitter's Bootstrap to construct a simple list report generator that page breaks on every item. We will pretend that the SharePoint 2010 data is a custom list with three required columns and two optional columns that may not contain data: Title (string), Content (rich text), and Feedback (rich text), TextArea1, TextArea2. The last two are obviously the optional columns.
Imagine that this custom list contains a lot of text in each column. Viewing this in SharePoint would show it as a grid, with each associated property listed horizontally (think spreadsheet). There would be much scrolling or resizing of the browser. Why cant we view this data like a book or a white paper? That is what I intend to accomplish in this presentation.
First of all, you'll need to pick up all the tools. I am using Node 0.8.3 with the following modules: Express (3.0.0beta7), Jade (0.27.0), coffee-script (1.3.3), and request (2.9.203). All of the modules are on npm. See here for instructions on running coffee-script from the command line.
Next, pick up the latest bootstrap and its javascript plugins. Finally go get jQuery.
$ mkdir reportGenerator
$ cd reportGenerator
$ mkdir public routes views
Now that we have our public folder, lets put the client side stuff in there.
$ mv ~/Downloads/bootstrap ./public
$ mv ~/Downloads/jQuery.min.js ./public/bootstrap/js
Lets setup our web server.
$ vim app.coffee
Now we need to create the route app.coffee depends on.
$ vim ./routes/index.coffee
Cool. So this route renders a Jade template. Lets make the layout and index templates.
$ vim ./views/layout.jade
$ vim ./views/index.jade
Now that the templates are done, we are ready to rock. Start it up
$ coffee app.coffee
Print to PDF. Look at that! A nice report generated with page breaks on each main topic (item) based on SharePoint 2010 data in a simple yet expressive way.
Today I will be updating my box to the latest nodejs and after doing so, installing the coffee-script command line interface which allows for coffee-script to be run on such things as crontab, init.d, or even nagios (see other post). I will also be installing nodemon which will act as a daemon for my coffee-script web applications. Nodemon will watch for changes and restart the application if it finds any, which is pretty neat.
$ wget http://nodejs.org/dist/v0.8.3/node-v0.8.3.tar.gz
$ tar zxvf node-v0.8.3.tar.gz
$ cd node-v0.8.3
$ ./configure
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'host_arch': 'x64',
'node_install_npm': 'true',
'node_install_waf': 'true',
'node_prefix': '',
'node_shared_openssl': 'false',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_openssl': 'true',
'target_arch': 'x64',
'v8_no_strict_aliasing': 1,
'v8_use_snapshot': 'true'}}
creating ./config.gypi
creating ./config.mk
$ make
$ sudo make install
$ sudo npm install -g coffee-script
$ sudo npm install -g nodemon
Lets imagine for a second that you are using Nagios to monitor systems and services. Nagios can send you notifications upon events, but the default email notification command is kind of boring.
Today, I brought back up an old machine of mine running windows 7. It had been a good 6 months since I've last used it, so naturally, windows updates was not working.
I managed to find a nice thread on social.technet: http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/6a8889a8-65b2-4012-9cf8-2689f47b21e4
stop Windows Update Service
delete C:\windows\softwaredistribution\*.*
start Windows Update Service
check for updates
Hope this helps if you run into the same issue.
Creating a content driven, continuously tested and integrated source controlled website with NodeJS and Express.
The next set of blog entries will be dedicated to bringing online my pet project PortalGNU.com/org
Portal GNU will contain content dedicated to the open source movement. The website will act as a blueprint for spawning your own personal NodeJS + Express + MongoDB driven website.
Before PortalGNU goes live, my blog will be dedicated to describing the process from github to travis-ci to amazon EC2.
Right now this is a work in progress. More to come.
I'm beta testing server 8, which is in public beta (link)
This is the first time I've tried installing just the core, but it seems to make sense now.
It is an extremely quick way to get a box online and exposing RDP without the hassle of navigating a GUI.
To quickly get your hostname, networking, and RDP configured, simply run sysconfig.cmd
Add-WindowsFeature Server-Gui-Shell
Finally you'll reboot.Today I wrote a blogger scraper for my new NodeJS website: http://mikekunze.info
This script connects to my blog's RSS JSON feed and sends its data to a mongolab hosted mongoDB instance.
Pretty nifty. Now I have content for my website, and still can use blogger's API to create that content.
One of the bonuses with this script is how it will not duplicate entries. This feature checks title names. If we want to be more dynamic we would create hashes on the entry content... maybe some day.
Hello internet.
I have been spending quite a bit of time refactoring the server side code for bang.js lately. I started a total conversion of it to coffeescript. Its quite amazing how easy it is to translate into coffeescript which natively supports classical inheritance.
bang.coffee is our main file, which is executed by the iced coffee-script compiler
abstractServer.coffee and server.coffee contain the coffee ingredients to boot up the server.
You'll also notice I've made significant improvements on the layout of the project. Now there are two main folders: client and server.
Hello!
First, I'll recommend Javascript: The good parts.
Currently, I am reading the following:
Javascript Web Applications by Alex MacCaw
Javascript Patterns by Stoyan Stefanov
The javascript patterns book is exceptional for getting an idea of the power and customization javascript offers.
ExtJS4 has been designed with an inheritance class based MVC core framework along with its rich set of UI controls. The current ExtJS 4.0.7 framework supports a concept of an Application. This application class, from my experience, works well if there is just one defined and initialized.
An application can have many controllers, however. Each controller can take models, stores, and views. The controller is the meat of an application and controls the logic for the views. It is the controller we want to dynamically add at run time.
Lets setup our ajax getJS loader. Then lets get the interface, which will contain the application definition.
The long and short of it, you need to keep a reference of the application itself. In my case: Ext.bang.util.app is where I'm storing it.
Now, when I want to add another "sub" application (in this case, a login window), we use the application reference to getController('login'), and then init() it to run its init method.
remotejs.getJS({ js: 'login.js', app: 'bang'}, Ext.bang.util.run);
The controller does the rest. Take a look at the bang client code to see how it all fits together.
Hello. Its been a while. I took a break from coding up until around December, and since then I've been working on a new framework called bang.js.
I will take in many concepts from portalstack for security and ui. Take a look at my github page:
https://github.com/mikekunze/bang.js
One project I worked on recently involved reading in multiple Metrics logs for the Illumina iScan. Basically, a file represented an entire scan session, where a scan consisted of a bunch of sections. These sections included a bunch of metrics that needed to be run against a pass/fail algorithm.
Therefore, each section is graded with a pass /fail. All of this information is organized into a hierarchical structure of many beadChips with many Sections with many section values.
Using the whole async approach, I am able to load and process approx 54 files over smbfs in seconds and then run queries against it using a web front end.
Here is the gist for populating the available metric file array.
Once we have the list of metrics files, we create beadChip objects:
for each metrics file
new beadchip(file);
The object automatically calls its init script, which uses async to build the object's information from the log file.
Finally, here is the forEach async function used in building the beadChip:
Before I jump to the meat, we need to discuss a bit what is required for 3rd party authentication to twitter, github, and linkedin. These social based sites all have developer APIs, which I think is an awesome open idea. For the most part, I will be using their API for OAuth authentication, eliminating the need for me to focus on user registration.
Github's interface for creating apps was a bit hard to find, look at their documents or search google for github api.
Linkedin has a developer network and so does twitter. Both are easy to use.
For each API, I had to create an "application" on their platform. I receive a consumer ID and secret key. These are used to tell them who I am when requesting a bridge for authentication.
gists to come
A few nights ago, I started up a new project called extstack. Instead of designing a registration and authentication system, I will rely on the nodejs module, everyauth. Everyauth authenticates with many different popular social sites: twitter, facebook, github, etc.
This new project will have exactly the same requirements and goals as portalstack, but with a more useful name and a little more care in the architectural design of the stack.
I investigated Express and its template abilities, such as jade. I have since learned jade works well with everyauth, eliminating redundant lines of code and simplifying the HTML UI aspect of the stack.
Check it out: https://github.com/mikekunze/extstack
Everyauth: https://github.com/bnoguchi/everyauth
In this introduction to node, I will be using ExpressJS. If you have not already done so, install NPM and then as root, "npm install express".
On my dev platform, I create a new Express Project:
express -s madisonHQ
This command creates a new folder "madisonHQ" and adds a skel app.js. Head to git and create a new repository.
Now, lets get this setup on Git.
cd madisonHQ
git remote add madisonHQ git@github.com:mikekunze/madisonHQ.git
git init
git add .
git commit -m 'first commit'
git push -u madisonHQ master
As you can see here, https://github.com/mikekunze/madisonHQ, my new project is synced and repo'ed.
Depending on your environment, you might need to get the express library added to the project. This is easy. Inside the madisonHQ directory:
npm install express
Lets talk about roles. Roles, for my implementation, represents an application container. An account may be granted a permission to this role, and run its applications.
For my relationalness, I always create a role permission collection, p_roles, that links references to the account identifier as well as the role identifier.
This is where my last example came in. This time, however, I want to populate a grid of accounts that do not exist in a role, so that the interface user may add them to it. This required two things:
Hello internet, today I would like to give a little information on a misconception with MongoDB. NoSQL explicitly denounces relational queries as a thing of the past, however it is necessary to normalize your data and keep it efficient and avoid having duplicate information.
For my discussion today, I will refer to vendors permissions, which was for a sample purchasing app I demoed inside portalstack.
To do a relational look up, you need to do a bit of async programming. For me, I used the async library provided by the nodejs community.
First, I query my permissions collection, p_vendors, for an account_id and the vendor_id, both are ObjectID references.
Next, I use async to foreach the returned permission set. When the async call is complete, it returns the prepared data to ExpressJS and its sent off to the client.
Today, I spent the morning watching a few conference videos discussing nodejs.
http://www.readwriteweb.com/hack/2011/07/nodejs-creator-ryan-dahls-keyn.php
http://joyeur.com/2011/08/11/node-js-meetup-distributed-web-architectures/
I will be installing NodeJS 4.1.0 on ubuntu 11.04.
Requirements
Roles are a very useful aspect to an abstract system, especially for systems that have more than one function or application. These roles are assigned to accounts and in turn these accounts can access said roles.
For my implementation using mongodb, I will follow the same methodology I've used in the past: role definitions and role permissions.
Mongoose schema definitions:
So, very simply, a role has a description, and its _id is stored in the permission collection for the specific account_id. A user's account_id is stored in a session server side. Then, whenever a user requests client javascript or GET/POST data for a specific role, a check to p_roles will be made.
I synced my code to github for all to admire. GPL 3.0
https://github.com/mikekunze/portalstack