28 Apr 2012

Switching to VIMRepress

I’ve been looking for a way to lower the friction involved in blogging. Since I’m spending much of my free time on the commandline, I looked for a VIM solution. The plugin is called VimRepress and it allows you to revise, edit and post blog postings in VIM! The installation process was simple using ‘pathogen’: just a git clone of the repository into my ~/.vim/bundle, install the python-markdown module, and add a few configuration & authorization lines to my ~/.vimrc.

Add the following to your ~/.vimrc let g:vimrepress\_tags\_completable = 'true' let VIMPRESS=[{'username':'BLOG\_USER', 'password':'SECRET', 'blog\_url':'http://blog.xargs.io/'}] Now open up VIM and the blog commands start with :Blog[List, New, etc]. Source and Thanks to : Conner McD

25 Apr 2012

Converting Images of Documents to Near Scanned Quality

I’m working on a project at the moment where we’re handling large quantity of documents that have been photographed in less than ideal circumstances. These photographs are high resolution color photos of typed and handwritten documents that need to be transformed into scan quality documents.  The steps involved are:

  • Convert color to grayscale (128 shades or less)
  • Remove background noise and speckles/flecks/etc
  • Reduce size of images for easier distribution and lower bandwidth usage (currently ~40 GB for set of images) After a few days of working on the problem and learning about the technologies involved… here’s the script I came up with, along with notes about sources and inspirations (note much of the heavy lifting is done by ImageMagick and   Fred’s ImageMagick Scripts[gist id=2494870]

25 Apr 2012

Converting to Arch Linux

It’s been about 4 months now since I switched my HP Tm2t to ArchLinux.  This came after using my laptop for work  with necessary proprietary programs on Windows and dual booting into Crunchbang Linux (Debian based). Well, I upgraded the work laptop to a Vaio workstation replacement i7 w/ nVidia dedicated GPU which freed up my Tm2t! In my excitement, I swapped out the 500GB spinning platter drive for a 60GB 3Gbps SSD, installed ArchBang Linux, and couldn’t be happier. ArchBang is based on the style and concept of Crunchbang Linux (Openbox Minimalism with high utility) but based on the packaging system and system structure of Arch Linux.  This 2-3 yr old laptop is very quick and a nice environment for evening Ruby programming & development. I replaced Openbox with XFCE because my minimalism doesn’t run quite that deep, installed RVM, Chromium, gmrun, configured keyboard shortcuts for Terminator, spacefm (slick file manager), and then spent the next few weeks working on final optimizations (feeling pretty good about the 3+ hours of battery life under Linux). Now if only my touchpad had the quality of a MacBook Pro under Linux (or even the quality of the touchpad under W7), the battery lasted 5+ hrs like W7, and a high resolution screen.  I’m on the lookout to upgrade from this laptop once a decent high resolution ultra portable comes out, preferably from Lenovo’s Thinkpad line.

25 Apr 2012

Label every image with its filename in one fell swoop

Here’s a one off Ruby script to wrap up some ImageMagick labeling magic. This script takes all the JPG images in folder and applies the file’s name, as a label, to the bottom of the image. [gist id=2495001]

20 Feb 2012

Fixing 'Disk Not Found' Error in Grub after apt-get upgrade

One of my development virtual machines went belly up after a recent system upgrade. After tinkering around at the grub> prompt to no avail, I booted a LiveCD, followed the instructions here: http://sazeit.com/articles/repair-or-reinstall-grub-with-boot-repair, and was up and running in minutes. Moral of the story; sometimes it’s more important to solve the problem than understand the underlying issues…not often, but sometimes :).

19 Feb 2012

Absence

Dear spammers, You’ll be relieved to know that i am planning to get back to blogging more.  Thus you’ll have fresh tech posts where you can vainly attempt to post about Viagra and knockoff phones. PS, to human readers… I’ve been very busy with work and getting up to speed on web scraping, ruby, active record & SQLite3, Sinatra, and GIS. It’s an exciting time but a it mellows I’ll get back to blogging.

06 Oct 2011

More Adventures in Puppet

   Thursday, 2010-08-12. More adventures in Puppet: Fix this: err: /Stage[main]/Sudo/File[/etc/sudoers]: Could not evaluate: Could not retrieve information from source(s) puppet:///modules/sudo/files/etc/sudoers at /etc/puppet/modules/sudo/manifests/init.pp:11

By changing your file request (genuinely located at /etc/puppet/modules/sudo/files/etc/sudoers) from:

class sudo {
        package { sudo:
        ensure => present,
        }
        file { "/etc/sudoers":
                owner => "root",
                group => "root",
                mode => 0440,
                source => "puppet:///modules/sudo/files/etc/sudoers",
                require => Package["sudo"],
                }
}
To this:

``` bash
class sudo {
        package { sudo:
        ensure => present,
        }
        file { "/etc/sudoers":
                owner => "root",
                group => "root",
                mode => 0440,
                source => "puppet:///modules/sudo/etc/sudoers",
                require => Package["sudo"],
                }
}

This is using Puppet 2.6.2

05 Oct 2011

Uggh - "Puppet hostname doesnt match server certificate"

Wow, this one stumped me for the better part of 12 hrs… So Puppet (the Ruby Gem) uses SSL certificates to authenticate to the Puppet Master.  I kept receiving the warning listed in the title of this post no matter how I altered my configs. Here’s the short version: Determine what Fully Qualified Domain Name is being used by the PuppetMaster to created the signing cert.  On my virtual platform this ended up being the hostname Add that hostname/FQDN and it’s IP address to your PuppetClient’s /etc/hosts like so: 173.999.999.999    hostname Now start up the PuppetMaster Server with the following command # puppetmasterd --verbose --no-daemonize Now invoke the puppet client like so: puppet agent --no-daemonize --verbose --server=HostnameOfServer Finally, now that we know it’s working well edit the /etc/puppet/puppet.conf on Puppet Client so that you have a server entry in the [main] section: [main] server=HostnameOfServer Tada!   Source of partial answer: Puppet hostname doesnt match server certificate - Server Fault.

25 Sep 2011

Launchy + Search Everything = Win

When operating on a Windows operating system I miss using GNU/Linux’s Locate … so I replace it with a combination of Launchy and Search Everything. Search Everything indexes the names of all the files on your hard drive.  Launchy is a quick “Commandline Style” program launcher. After installing both programs, right click on the Search Everything Start Menu entry and modify the Properties.  Replace the target properties with “C:Program Files (x86)EverythingEverything.exe” -search " Now, right bring up the Launchy window and rebuild the catalog. Once Search Everything has a chance to index the contents of the hard drive, you can bring up Launchy type Search {Tab} STRINGTOSEARCHFOR. This will bring up the Search Everything window using your search term!

23 Sep 2011

OpenEMR Virtual Appliance

Noticed this today when checking my Google Analytics…. seems Civet blog is showing up from people searching for OpenEMR info. There’s a nice project available for anyone who would like to try out the OpenEMR system.  One of the project team members keeps an up to date virtual appliance ready to run in VMWare (or presumably imported and used in VirtualBox also). Nice way to try things out before implementing your own installation. Note: for security reasons it isn’t advisable to run the virtual appliance as a true deployment.  It’s easy to safely and securely deploy this via my previous blog post that describes the simple steps for installation in Debian/Ubuntu. Source link : http://www.bradymd.com/appliance/downloads.shtml