Thursday, August 15, 2013

Linux & Windows partition changes, boot fun

To remove GRUB from the MBR on primary disk in the laptop that hold Windows 7:

  • boot with recovery DVD
  • get to a command window
  • issue commands to re-write the MBR

To write GRUB to the external HD containing Linux Mint:
  • Boot Machine off Mint Live DVD (can't use virtual box for this)
  • Launch GPARTED to determine disk and partition holding Mint
  • Open terminal window
  • sudo mount   /dev/sdb1   /mnt
  • sudo grub-install /dev/sdb  --root-directory=/mnt
grub probe does report some errors but installation of grub works.


to refresh the grub menu on the external drive (if it needs updating...):
  • sudo update-grub

to add an entry for linux into the Windows boot menu (otherwise one needs to get the boot list (f12 at startup)):


Tuesday, August 6, 2013

Powershell (Windows... ugg)

Powershell ISE

Powershell 2.0 was loaded on my Win7 SP1 machine so...

Windows Management Framework 3.0 (includes PS 3.0)
http://www.microsoft.com/en-us/download/details.aspx?id=34595



How to determine what version of PowerShell is installed:
PS C:\> $psversiontable

To Update help in PS, start an elevated PS session (not the ISE!) and enter:

PS> Update-Help






Thursday, July 4, 2013

A Basic Node.js site

A basic Node.js site using:

  • Mongoose - object data modeling (ODM) library to access a mongoDB data store
  • Express web app framework
  • Jade template engine
  • Connect middleware (cookies, favicon, static files, session management, etc) Note: This is installed by NPM as a dependency for Express.
  • twitter bootstrap front end framework
  • tbd - login using Google, Facebook, etc (passport?)
  • best practices for packages.json (support dev & prod, proper dependency version wild-carding etc.)
Steps:

$ cd ~/dev          (assumes ~/dev exists)
$ express appName   (pick any valid app name)
$ cd appName

edit package.json to include following dependency line
"mongoose": "*"

$ npm install     (install all dependencies)
$ npm start       (just test the server starts and works the ^c out of it)

$ mkdir model     (create a dir to hold model related files)
$ cd model

edit db.js to contain:


var mongoose = require( 'mongoose' );
var todoSchema = new mongoose.Schema({
 item: String,
 complete: Boolean,
 date: { type: Date, default: Date.now }
});
mongoose.model( 'Todo', todoSchema );
mongoose.connect( 'mongodb://localhost/todoDB' );



add to app.js:
, db = require('./model/db')


Tuesday, July 2, 2013

PyCharm - bought it.



Yes its great and all the free IDE options were lacking somehow so I bought a license. I like it for python and javascript. Lots of useful add-ins for MongoDB, Jade, etc etc.

PyCharm !