The less-than-random ramblings of Scott Jackson, software architect.

No Such Comfort

(link) Why I use Tape Instead of Mocha & So Should You

Posted by scottj on April 13, 2017 in Custom Development, Debugging, Testing with No Comments


I must say I’m enjoying Node JS development. I’m starting to lose track of things though, so I need to be writing down my thoughts here. Right now, this is just a link to another blog regarding a Node JS test framework.

Why I use Tape Instead of Mocha & So Should You

CentOS Minimal, Revisited

Posted by scottj on March 24, 2016 in Custom Development with 2 Comments


It’s been a long time since CentOS 6 came out.  We’re well into the healthy lifespan of CentOS 7 now, and the process of getting a minimal desktop has changed a little.

First, the install GUI, even for a minimal install, will guide you through setting up an admin user, so we can skip that.  It’s just a matter of installing the X Window System and the smallest slice of Gnome we can manage.

yum groupinstall -y "X Window System" "Fonts"
yum install -y gnome-classic-session control-center gnome-terminal
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

And that should do it. You’ll have nothing but Gnome Desktop, admin tools and Gnome Terminal.

Now I didn’t include this last time, but if you’re setting up in a VirtualBox VM, before you reboot, you’ll also want to install the VirtualBox Tools…

yum install -y epel-release
yum install -y dkms bzip2 kernel-devel-$(uname -r)
mount /dev/cdrom /media
/media/VBoxLinuxAdditions.run

Happy clean and minimal developing!

CentOS 6 Minimal

Posted by scottj on September 12, 2014 in Custom Development with No Comments


I’ve come to enjoy using CentOS 6 as installed from the minimal CD.  Once it is installed, all you get is a login prompt and a root user.  I take the following steps to set up a personal account:

useradd administrator
passwd administrator            
usermod -G wheel administrator
visudo
# uncomment line allowing wheel to use sudo
vi /etc/pam.d/su
# uncomment line requiring wheel to su to root
vi /etc/aliases
# alter line redirecting root's mail

Then I install a very minimal desktop. These instructions assume you’re root, if not, you’ll need to sudo them.

yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"
vi /etc/inittab
# boot into runlevel 5 instead of runlevel 3

When you’re done, don’t forget to yum upgrade.

Understanding View Models

Posted by scottj on April 10, 2012 in Custom Development with No Comments


A view model represents the state and behavior of a particular piece of UI—it is the non-framework-specific analogue of a control. Just as you can’t generally place the same control instance in two locations in a UI tree, you can’t also reuse the same view model instance.

If you could, we’d call it a ViewsModel 🙂
Bryan Watts

I remember spending time when learning MVVMlight debugging issues around the reuse of view models, and I thought such reuse was integral to MVVM.  In then end, and with much regret, I tore out all this reuse, replacing it with very simple code that created a new view model when views were instantiated.  I felt awful, scrapping the work that went into MVVMlight to do this.  And yet, after reading the above quote, I feel a little vindicated.  I’m sure there’s cases where you might want to keep a viewmodel instance around, but I’m still suspicious if this should be the default behavior.

Setting Up a Development VM

Posted by scottj on June 21, 2011 in Custom Development with No Comments


I often set up development VMs.  Here’s some settings I like.

Turn Off the Shutdown Dialog
Almost always my first change, that annoying shutdown tracker may be the best thing since checking comments, in an audited IT environment, but it’s less than useless on a personal development VM.  Let’s get rid of it!  From Start -> Run:

gpedit.msc

Then visit  Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Display Shutdown Event Tracker and pick “Disable”.

Turn Off NAT and Bridging
We’re about to configure Windows in one of the most insecure ways possible.  You don’t want this on a network anyone else can get to, even through your own actions.

Install Microsoft Security Essentials
Most companies I know are pretty good about requiring virus scanning “on the metal” of my laptops.  Very few have asked if I run an anti-virus on my VMs.  Security Essentials should be considered just that, your minimum, essential security.  Did I mention these VMs are going to be pretty darn insecure?  And remember, your VM is usually powered off, so when that status icon goes orange or red, please run a manual scan, eh?

User Accounts
On “my” VMs, my login is always my usual network account name.  My password is not.  It’s something well known throughout whichever consulting company I work for, usually the consulting company’s name, proper case, followed by the number 1.  The point here is that I should be happy to give this password out to any of my coworkers, in the case I’m “hit by a truck” and want them to pick  up where I left off.  If the VM is intended to be shared around, the login will be the company name, all lower case instead.

Registration
All VMs should have correct registration information with my full name, and the common name of my firm.  Registration information isn’t easy to correct, and doesn’t seem to be set by default installations of Windows 7 or Windows Server 2008 anymore.

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v RegisteredOrganization /t REG_SZ /d "No Such Comfort" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v RegisteredOwner /t REG_SZ /d "Scott Jackson" /f

Thanks to win2008workstation.com for these tips.

Turn Off User Account Control
User Account Control just slows you  down on a development VM.  I shut it off.

Auto Login
Since the idea of a development VM is to boot-and-get-to-work, I set up auto login. From Start -> Run:

control userpasswords2

Uncheck the box requiring a password. If it’s already unchecked, check and re-uncheck it. Click Apply and you’ll be prompted for the login credentials to use.

If you join a computer to a domain, that handy checkbox is gone.  To get it back we can do:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d "1" /f

Also, you will likely need to provide the default login domain for the account you used via:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d "domain" /f

Thanks to Jeff for these tips.

Make Sure Auto Login Sticks
Once you do the above, if you cold-boot the VM you’ll be logged in, but if you suspend it, or just walk away too long, you’ll likely be asked to log in again.   On the start menu, search for “Require” and open “Require a password when the computer wakes”.  Turn that right off.  You may also want to visit the power options and turn off the display timeout, and double-check the screen saver, making sure it doesn’t require a password, if you use one at all.

Recycle Bin
Turn off the confirmation dialog when tossing stuff in the recycle bin. You’d probably do this anyway, but it’s always nice to remember to do so before you snapshot your VM, or you’ll be doing it over and over again whenever you revert.

Power Management
Useless on a VM, go ahead and turn on high performance and disable the screen timeout. By default the screen saver should already be disabled in modern shipping versions of Windows (in favor of the greener screen timeout and suspend settings).

Install Windows Updates on Your Schedule
There are few things more annoying than going to shut down your computer and finding out it’s going to install umpteen Windows updates.  Be sure to visit the Windows Update settings in the Control Panel, and choose one of the less-aggressive settings.  Since surprise changes to development environments are often to be avoided, I often choose Never Check for Updates.  Updating a development VM for me is a very long process that also involves shrinking disk drives and other fun.

Capricious Whim

“Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.” —Fred Brooks