<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
	<channel>
		<title>Marco Valtas</title>
		<description>The study of or a collection of techniques.</description>
		<link>http://marcovaltas.com</link>
		
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/marcovaltas" /><feedburner:info uri="marcovaltas" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
				<title>CFIT in Software Development</title>
				<description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Controlled_flight_into_terrain"&gt;Controlled Flight into
Terrain&lt;/a&gt; or
&lt;strong&gt;CFIT&lt;/strong&gt; is a type of accident where an aircraft with no apparent mechanical
problems is flown into some obstacle like a mountain. Couple of days ago I used
this acronym to explain some situations that happen during software development,
but first let’s understand better &lt;strong&gt;CFIT&lt;/strong&gt;s.&lt;/p&gt;

&lt;p&gt;These can be caused by a large amount of reasons; poor visibility, confusion in
the cockpit, wrong navigation maps, poor capability to operate the aircraft and
so on. Usually what happens is that given these factors the aircraft is put in
collision course and when alarms go off there’s little time for the crew to
react or the crew is so confused that doesn’t understand what is happening and
take the wrong measures. Running the risk of adding one more acronym to the
large set we have in IT I propose the usage of &lt;strong&gt;CFIT&lt;/strong&gt; for some situations. &lt;/p&gt;

&lt;p&gt;In Software Development sometimes we have situations similar to these, when
information is so bad that we end up coding the wrong solution and this is a
factor for a &lt;strong&gt;CFIT&lt;/strong&gt;. We might also have poor visibility and make the wrong
calls i.e.  poor performance, because the real load was never shared with the
development team. Infrequently but still of note is poor directions given by
someone responsible for the solution, like a senior developer or an architect,
that instead of sharing the inputs (business problems) only share the outputs
(decisions made) leading the team steer the software into a collision course.
And by collision course I mean once gets release it fails in some way.&lt;/p&gt;

&lt;p&gt;We can deal with such situations adopting some practices, like fast and better
feedback and good visibility. A &lt;strong&gt;GPWS&lt;/strong&gt; (Ground Proximity Warning System) for
software development is nothing more than good monitoring, if metrics go off
chart we can correct the course before is too late. And a good &lt;strong&gt;CRM&lt;/strong&gt; (Crew
Resource Management) is good and honest feedback, of the product, of the code
and where the team is headed, poor &lt;strong&gt;CRM&lt;/strong&gt; is a Command Control environment
which is a great way to provoke a &lt;strong&gt;CFIT&lt;/strong&gt;. I believe we could draw some more
parallels but in fact what I’m looking for is lessons learned and how we can
adopt them to Software Development.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/xsEhxehMmoI" height="1" width="1"/&gt;</description>
				<published>2013-02-10 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/xsEhxehMmoI/cfit-software-development.html</link>
			<feedburner:origLink>http://marcovaltas.com/2013/02/10/cfit-software-development.html</feedburner:origLink></item>
		
			<item>
				<title>Continuous Delivery of this blog</title>
				<description>&lt;p&gt;For some time I’m using &lt;a href="https://github.com/mojombo/jekyll" title="Jekyll"&gt;Jekyll&lt;/a&gt; which gave the opportunity to automate
some things for this blog, I went as further I could in creating a Continuous
Delivery environment for it.&lt;/p&gt;

&lt;h3 id="tooling-stages-and-more"&gt;Tooling, stages and more&lt;/h3&gt;

&lt;p&gt;In order to make this Continuous Delivery environment I had to make sure that I
had some tools and stages defined, here’s a short description of these.&lt;/p&gt;

&lt;h4 id="version-control"&gt;Version Control&lt;/h4&gt;

&lt;p&gt;I have a private repository on &lt;a href="http://github.com" title="GitHub"&gt;github&lt;/a&gt; for all the code and posts, so
whatever automation that I will put in place it has to integrate with it.&lt;/p&gt;

&lt;h4 id="build-and-deploy-tool"&gt;Build and Deploy tool&lt;/h4&gt;

&lt;p&gt;Rake is my tool of choice for compiling and deploying the blog, actually rake
today is my tool of choice for building almost anything, the tasks and the fact
you can write plain Ruby in it is enough for most of automation that I’ve been
doing.&lt;/p&gt;

&lt;h4 id="compiling"&gt;Compiling&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/mojombo/jekyll" title="Jekyll"&gt;Jekyll&lt;/a&gt; is a static blog generator which pretty much is the same to say
that it reads your files and create a static website. That’s my definition of
compilation for this blog, whenever I use compilation I’m referring to the
execution of:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;	jekyll --pygments
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id="testing"&gt;Testing&lt;/h4&gt;

&lt;p&gt;When I’ve mentioned that I was doing this kind of automation to my colleagues
one of the first questions was “What are you testing it for?” Definitely a fair
question. All this automation without something to test would feel like doing a
&lt;a href="http://en.wikipedia.org/wiki/Rube_Goldberg_machine" title="Rule Goldberg Machine"&gt;Goldberg&lt;/a&gt; machine for a simple copy of static files.&lt;/p&gt;

&lt;p&gt;What I’ve found later was rather interesting, first I didn’t have tests but as
soon as the deployment was working I found it that I had the perfect environment
for doing all kind of tests.&lt;/p&gt;

&lt;p&gt;Currently I test the blog for two things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All internal links point to a valid resource.&lt;/li&gt;
  &lt;li&gt;No spurious CSS classes are left around cluttering without being used. &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id="packaging"&gt;Packaging&lt;/h4&gt;

&lt;p&gt;How do we package a static website? My answer to the packaging was as simple as
you might guess, &lt;code&gt;tar.gz&lt;/code&gt;. This is the simplest packaging you can have around
and works pretty well on Unix based systems and with a small website it doesn’t
hurt to do a replacement of all files every time I deploy. There’s a catch
though; you have to clean up the destination, otherwise files that got removed
will hang on the directory indefinitely.&lt;/p&gt;

&lt;h4 id="staging-environment"&gt;Staging environment&lt;/h4&gt;

&lt;p&gt;Before going to production I setted up a staging environment, basically this
environment plays two roles on the pipeline. First it’s where I can run some
tests with the website up. Second, it allows me to do a proof reading of what is
about to get published.&lt;/p&gt;

&lt;h4 id="continuous-integration--agile-release-management"&gt;Continuous Integration / Agile Release Management&lt;/h4&gt;

&lt;p&gt;I’m using &lt;a href="http://www.thoughtworks-studios.com/go-agile-release-management" title="ThoughtWorks GO"&gt;ThoughtWorks GO&lt;/a&gt; to coordinate all steps of testing and
deploying.&lt;/p&gt;

&lt;h3 id="the-pipeline"&gt;The pipeline&lt;/h3&gt;

&lt;p&gt;Here’s a screen shot of couple last runs of my blog.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://marcovaltas.com/img/posts/blog_pipeline.png" alt="Blog Go Pipeline" title="Blog Go Pipeline" /&gt;&lt;/p&gt;

&lt;p&gt;There’s nothing fancy about it, it compiles and that has a couple of steps
including packaging, publishes to UAT (User Acceptance Tests) environment, the
internal links tests happens and than there’s the last stage which is manually
triggered by me to publish to production. &lt;/p&gt;

&lt;p&gt;Please note that not every build got published to production, often times when I’m
proof reading or working on the site plumbing I find a problem that I didn’t
catch on my local environment.&lt;/p&gt;

&lt;p&gt;Another thing that might caught your attention is a broken build. That specific
one happened when I’ve added the jquery library I didn’t use a
absolute path on the &lt;code&gt;src&lt;/code&gt; of the &lt;code&gt;script&lt;/code&gt; tag, the issue was discovered by the
&lt;code&gt;checklinks&lt;/code&gt; on pages that were in directories and unable to find &lt;code&gt;jquery.js&lt;/code&gt;.&lt;/p&gt;

&lt;h4 id="build--compile-stage"&gt;Build / Compile stage&lt;/h4&gt;

&lt;p&gt;More than just run &lt;code&gt;jekyll&lt;/code&gt; happens on build stage, here’s all the tasks
currently executed by Go:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;bundle install --path vendor/bundle&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;bundle exec rake build&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;bundle exec rake archive&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;bundle exec rake send_pkg&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first task is just installing &lt;code&gt;jekyll&lt;/code&gt; and &lt;code&gt;rake&lt;/code&gt; and it’s dependencies,
using bundler gives me the option of updating jekyll without having to worry if
the CI’s jekyll is updated too, plus, is the update brakes the website and I
don’t catch the problem locally it will be caught by the CI.&lt;/p&gt;

&lt;p&gt;When we invoke &lt;code&gt;rake build&lt;/code&gt; here’s what happens:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:build&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:compile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:check_css_redundancy&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:compile&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:pygments_is_installed&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; 
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;jekyll --pygments&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:check_css_redundancy&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:compile&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;bash -c &lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt;_bin/css-redundancy-checker.rb _site/css/style.css &amp;lt;(find _site -name &amp;#39;*.html&amp;#39; -type f)&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s2"&gt; &amp;quot;&lt;/span&gt; 
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="http://code.google.com/p/css-redundancy-checker/"&gt;&lt;code&gt;css-redundancy-checker.rb&lt;/code&gt;&lt;/a&gt;
will do the work of checking is there’s any CSS leftover on the site. I’ve
tweaked a little bit to fit the automation specially to give an exit different
of 0 in case it finds something, that causes Go to fail the task.&lt;/p&gt;

&lt;p&gt;If all goes well we arrive at the &lt;em&gt;archive&lt;/em&gt; task, which is this one.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:archive&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:version_info&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;FileUtils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mkdir&lt;/span&gt; &lt;span class="no"&gt;ARCHIVE_DIR&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exists?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ARCHIVE_DIR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;tar -zcf &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;ARCHIVE_DIR&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;pkg_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; -C _site .&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;pkg_name&lt;/span&gt;
  &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;GO_PIPELINE_LABEL&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="nb"&gt;fail&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;Can&amp;#39;t do much without environment variable GO_PIPELINE_LABEL&amp;quot;&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nil?&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;blog-&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.tar.gz&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;As I mentioned earlier packaging of the site is nothing more than a &lt;code&gt;tar.gz&lt;/code&gt; of
the files compiled by jekyll. The &lt;code&gt;GO_PIPELINE_LABEL&lt;/code&gt; environment variable is
used so that I have different packages for each build. The result of this task
is files like these:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;blog-63.tar.gz&lt;/li&gt;
  &lt;li&gt;blog-64.tar.gz&lt;/li&gt;
  &lt;li&gt;blog-65.tar.gz&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And after the file is packaged it is send to the server with &lt;code&gt;scp&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:send_pkg&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;scp -v &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;ARCHIVE_DIR&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;pkg_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;AT_USER&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;HOST&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:tmp/&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Here &lt;code&gt;AT_USER&lt;/code&gt; is my artifacts user which has an account on my server just to
host the packages. You may think about it as a repository similar to Yum or Apt
for the my artifacts just a much simpler one. This is the end of the build /
compile stage.&lt;/p&gt;

&lt;h4 id="publish-to-user-acceptance-test-environment-uat"&gt;Publish to User Acceptance Test environment (UAT)&lt;/h4&gt;

&lt;p&gt;The next stage is publishing the site to the UAT environment, this is
accomplished by this rake task:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:publish&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:env&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;valid_env_parameter&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;ssh -v &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &amp;#39; [ -f ~&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;AT_USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/tmp/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;pkg_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; ] &amp;quot;&lt;/span&gt; &lt;span class="p"&gt;\&lt;/span&gt;
       &lt;span class="s2"&gt;&amp;quot; &amp;amp;&amp;amp; rm -Rf &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;target_dir&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/* &amp;quot;&lt;/span&gt; &lt;span class="p"&gt;\&lt;/span&gt;
       &lt;span class="s2"&gt;&amp;quot; &amp;amp;&amp;amp; tar -zxf ~&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;AT_USER&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/tmp/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;pkg_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; -C &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;target_dir&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#39; &amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Which is a fancy way to just execute a shell command on the server. It first
checks if the package for the version of the blog we are about to deploy is in
the repository (remember if just a directory on the server). Than it follows by
removing all the files and uncompressing the package. This is the same task used
for UAT and production, it just differ by a parameter given to &lt;code&gt;rake&lt;/code&gt;, which
changes the host and the user to be used.&lt;/p&gt;

&lt;h4 id="uat-testing"&gt;UAT Testing&lt;/h4&gt;

&lt;p&gt;In this stage currently we run just the
&lt;a href="http://search.cpan.org/dist/W3C-LinkChecker/bin/checklink.pod"&gt;&lt;code&gt;checklink&lt;/code&gt;&lt;/a&gt;
tests, here’s the task that triggers it: &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:checklinks&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:env&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:checklinks_is_installed&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;  &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;target_dir&lt;/span&gt; &lt;span class="n"&gt;valid_env_parameter&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;
  &lt;span class="n"&gt;run_or_show&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;_bin/checklink_wrapper.sh &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In order to make checklink useful on the pipeline I coded a simple shell wrapper
that does the job of failing the task if checklink finds a problem, also in
order to test only internal links and changing the domain to which checklinks
runs I had to add one regular expression filter on it. Checklink is good but
it’s not so easy to understand how to use the parameters it has. Here’s the
wrapper: &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -e

&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0; 
&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read &lt;/span&gt;line
&lt;span class="k"&gt;do&lt;/span&gt; 
  &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$line&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="s1"&gt;&amp;#39;Code:&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;; 
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$line&lt;/span&gt;; 
&lt;span class="k"&gt;done&lt;/span&gt; &amp;lt; &amp;lt;&lt;span class="o"&gt;(&lt;/span&gt;checklink -r -b -X &lt;span class="s2"&gt;&amp;quot;^((?!$1).)*$&amp;quot;&lt;/span&gt; http://&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This script will exit with the number of links that were broken, again, if the
number is different than zero it will break the task and thus the build.&lt;/p&gt;

&lt;h4 id="publishing-to-production"&gt;Publishing to production&lt;/h4&gt;

&lt;p&gt;This is the same as publishing to UAT, it’s the same deployment script and it
changes only the user and host where the site will be published. This is a
manual triggered stage in Go, when I’m confident that I want to release I push the
button and it goes.&lt;/p&gt;

&lt;h3 id="notes-and-observations"&gt;Notes and Observations&lt;/h3&gt;

&lt;p&gt;Let’s discuss some principles of Continuous Delivery and how these relate with
what I did. &lt;/p&gt;

&lt;h4 id="one-package-one-binary"&gt;One package, one binary&lt;/h4&gt;

&lt;p&gt;You will note that the packing/archiving of jekyll compiled files is done only
once. As mentioned in the Continuous Delivery book, you want to compile only
once, test and deploy this “binary” as much as will feel like but not
recompiling it. Why? Because if you recompile it who guarantees you didn’t
change something from one compilation to another? When we create a binary or a
package we want that this package prove that is production worthy, it has to
face all challenges we can think of. If it survives, it’s production worthy.&lt;/p&gt;

&lt;h4 id="rolling-back--rolling-forward"&gt;Rolling back / Rolling forward&lt;/h4&gt;

&lt;p&gt;Another important factor on a Continuous Delivery environment is being able to
revert your changes. With the current pipeline and deployment scripts I can
release whatever version of the blog I want just with a click of a button. In
fact I did it just now for the fun of it and reverted the blog to a month old
version, it worked.&lt;/p&gt;

&lt;p&gt;In this particular environment there’s not actual rollback, it’s just roll
forward, the only thing that is needed is the deployment of an older version.&lt;/p&gt;

&lt;h4 id="extend-your-pipeline-to-production-do-it-as-earlier-as-possible"&gt;Extend your pipeline to production, do it as earlier as possible&lt;/h4&gt;

&lt;p&gt;When I decided to move my blog to CD I had another publishing routing, it was
simpler but still bases on the triggers of version control. In short, it ran
&lt;code&gt;jekyll&lt;/code&gt; as soon as I pushed to the repository. &lt;/p&gt;

&lt;p&gt;Moving to a proper pipeline and automation changed a lot of things; first I
stopped running &lt;code&gt;jekyll&lt;/code&gt; on the version control server, which as I already
guessed was the same as the web server. All of this stack was pilled up on one
server, now there’s a better organization of the roles of each server.&lt;/p&gt;

&lt;p&gt;I had to go through a lot back and forwards to design an architecture of
deployment to suit my scenario. A big challenge and one that I would see only
when automating to production was security. Currently I use DreamHost to host my
blog and for all my users I use &lt;em&gt;enhanced security&lt;/em&gt;, maintaining security and
still being able to perform automated deployments required some thought and some
different strategies that I first thought. &lt;/p&gt;

&lt;p&gt;This is why extending your pipeline to production is not something to be left
behind. It will pose to you different challenges from running your application
on your local machine, it will pose security questions, third party integration,
cleaning up the file system, making sure that if a deployment fails it will not
leave your application in an invalid state; and the list goes on.&lt;/p&gt;

&lt;h4 id="keeping-a-version-number"&gt;Keeping a version number&lt;/h4&gt;

&lt;p&gt;Another thing that I did just for the fun of it was add a version number to the
blog. If you access &lt;a href="http://marcovaltas.com/version.txt"&gt;this url&lt;/a&gt; you can check
what is the current build number of the website, the version control revision
and the date of compilation. I don’t have any practical usages for this
information, not by now anyways. Here’s the task that generates the
&lt;code&gt;version.txt&lt;/code&gt; file:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:version_info&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_site/version.txt&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;w&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;package: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;pkg_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;date: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt; 
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;revision: &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;GO_REVISION&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;That’s it.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/Ipc-kGDzDjM" height="1" width="1"/&gt;</description>
				<published>2012-10-17 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/Ipc-kGDzDjM/continuous-delivery-of-this-blog.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/10/17/continuous-delivery-of-this-blog.html</feedburner:origLink></item>
		
			<item>
				<title>Scripting Token Retrieval on OSX</title>
				<description>&lt;p&gt;It’s being sometime that I’m working from home and because of that I have to use
my RSA software token way more often. After a couple of: start SecurID, type
your pin, copy the token number, close the SecurID and paste on whatever
intranet site I want to access; I went and automated the whole thing with
AppleScript.&lt;/p&gt;

&lt;p&gt;Now I just fire up the script using and done, the token is added to my
clipboard and I can paste it anywhere I need.&lt;/p&gt;

&lt;h3 id="note-on-security"&gt;Note on security&lt;/h3&gt;

&lt;p&gt;There’s a caveat. If you’re willing to automate the token retrieval, where did
you plan to write down your pin? If you do it on the script itself it’s a bad
idea since is easy to get your pin just by executing &lt;code&gt;grep&lt;/code&gt; on it. &lt;/p&gt;

&lt;p&gt;A better and more secure solution is to have an encrypted storage on your OSX
from where you can retrieve the pin, and guess what, you have it and it’s called
&lt;em&gt;Keychain&lt;/em&gt;. That’s what I did, just added a new key to “login.keychain” (where
all your web passwords get saved) called &lt;em&gt;rsatoken&lt;/em&gt;. &lt;/p&gt;

&lt;h3 id="the-implementation"&gt;The implementation&lt;/h3&gt;

&lt;p&gt;I needed to search the internet for some information (since AppleScript is not
my strongest skill) and I ended up with this script:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="applescript"&gt;&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nv"&gt;appName&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;SecurID&amp;quot;&lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="nv"&gt;thePin&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="nv"&gt;RsaTokenPin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nb"&gt;activate&lt;/span&gt; &lt;span class="nb"&gt;application&lt;/span&gt; &lt;span class="nv"&gt;appName&lt;/span&gt;

&lt;span class="k"&gt;tell&lt;/span&gt; &lt;span class="nb"&gt;application&lt;/span&gt; &lt;span class="nv"&gt;appName&lt;/span&gt;
	&lt;span class="nb"&gt;activate&lt;/span&gt;
	&lt;span class="k"&gt;tell&lt;/span&gt; &lt;span class="nb"&gt;application&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;System Events&amp;quot;&lt;/span&gt;
		&lt;span class="nv"&gt;keystroke&lt;/span&gt; &lt;span class="nv"&gt;thePin&lt;/span&gt; &lt;span class="c"&gt;-- type the pin number&lt;/span&gt;
		&lt;span class="na"&gt;key code&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt; &lt;span class="c"&gt;-- return key&lt;/span&gt;
		&lt;span class="nb"&gt;delay&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt; &lt;span class="c"&gt;-- wait for token appear&lt;/span&gt;
		&lt;span class="na"&gt;key code&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt; &lt;span class="c"&gt;-- press tab&lt;/span&gt;
		&lt;span class="na"&gt;key code&lt;/span&gt; &lt;span class="mi"&gt;49&lt;/span&gt; &lt;span class="c"&gt;-- space (to hit the copy button)&lt;/span&gt;
	&lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="k"&gt;tell&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="k"&gt;tell&lt;/span&gt;

&lt;span class="nb"&gt;quit&lt;/span&gt; &lt;span class="nb"&gt;application&lt;/span&gt; &lt;span class="nv"&gt;appName&lt;/span&gt;

&lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="nv"&gt;RsaTokenPin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
	&lt;span class="no"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;do shell script&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;security -q find-generic-password -gl rsatoken 2&amp;gt;&amp;amp;1  | egrep &amp;#39;^password&amp;#39; | awk -F\\\&amp;quot; &amp;#39;{print $2}&amp;#39;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="nv"&gt;RsaTokenPin&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;What the script does is pretty much the way you have to do it manually, it
fires up the &lt;em&gt;SecurID&lt;/em&gt; application, enters your pin, type &lt;em&gt;return&lt;/em&gt; than a tab
followed by a space (which will press the “copy” button) and closes the
application.&lt;/p&gt;

&lt;p&gt;The catch is on retrieving your pin number, it doesn’t use the AppleScript API
to do it. &lt;a href="https://www.google.com/search?q=applescript+keychain+"&gt;Several sources&lt;/a&gt; 
stated that AppleScript and Keychain are not a good combination and dreadful slow. So I followed
their advise and used the &lt;em&gt;security&lt;/em&gt; shell command. &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;security&lt;/em&gt; command doesn’t give a usable output with just the password so I
had to use a little more piping around to get what I wanted.&lt;/p&gt;

&lt;p&gt;That’s it, quick recap. Add a key named “rsatoken” to your Keychain with your
pin as password. Paste this script in your Apple Script Editor and save it as
an Application. This should save some minutes during the day if you need to
enter your token quite often as I do. &lt;/p&gt;

&lt;p&gt;Cheers,
Marco.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/NOGCE7pwagE" height="1" width="1"/&gt;</description>
				<published>2012-10-09 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/NOGCE7pwagE/scripting-token-retrieval-on-osx.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/10/09/scripting-token-retrieval-on-osx.html</feedburner:origLink></item>
		
			<item>
				<title>Developer Checklist</title>
				<description>&lt;p&gt;Couple weeks ago I finished reading the &lt;a href="http://www.amazon.com/The-Checklist-Manifesto-ebook/dp/B0037Z8SLI/ref=tmm_kin_title_0"&gt;Checklist Manifesto&lt;/a&gt;
and guess what? I did my own checklist.&lt;/p&gt;

&lt;p&gt;I was familiar with checklists because my curiosity about aviation and human
factors in high reliable organizations, this book was just the little push I
needed to making one myself.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://marcovaltas.com/img/posts/before_push_chklst.png" alt="Before Push Checklist" title="Before Push" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://github.com/mavcunha/checklists"&gt;Check the code in GitHub&lt;/a&gt;&lt;/p&gt;

&lt;h4 id="a-little-more-about-checklists"&gt;A little more about checklists&lt;/h4&gt;

&lt;p&gt;A checklist is not a step by step procedure and it shouldn’t be comprehensive,
it’s not a manual. The point is to help experts to not forget simple steps that
have great importance. Checklists are only good if they are used and prevent
mistakes. That’s why they have to be simple and focus on important steps.&lt;/p&gt;

&lt;p&gt;Another characteristic is pause points. Some checklists will have a big bold
title (like the one above) telling you when to use it and that’s a “pause
point”. Some tasks will have several pause points, here’s some examples of pause
points in aviation:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Before push back&lt;/li&gt;
  &lt;li&gt;Before take off&lt;/li&gt;
  &lt;li&gt;After take off&lt;/li&gt;
  &lt;li&gt;Before landing&lt;/li&gt;
  &lt;li&gt;After landing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checklists are divided in two types, one known as &lt;strong&gt;READ-DO&lt;/strong&gt; and another
&lt;strong&gt;DO-CONFIRM&lt;/strong&gt;. In short the READ-DO type you read item by item while executing
each item. For the DO-CONFIRM you do all steps by memory and confirm these steps
against the checklist.&lt;/p&gt;

&lt;p&gt;More information about checklists you can find in the &lt;a href="http://www.amazon.com/The-Checklist-Manifesto-ebook/dp/B0037Z8SLI/ref=tmm_kin_title_0"&gt;book&lt;/a&gt; and if you
feel like trying do your own checklist also check &lt;a href="http://www.projectcheck.org/"&gt;Project
Check&lt;/a&gt; website.&lt;/p&gt;

&lt;h4 id="what-the-left-terms-mean"&gt;What the left terms mean&lt;/h4&gt;

&lt;dl&gt;
  &lt;dt&gt;CI&lt;/dt&gt;
  &lt;dd&gt;Continuous Integration - your build system, i.e. ThoughtWorks Go, Jenkis, Team
City…&lt;/dd&gt;
  &lt;dt&gt;Upstream&lt;/dt&gt;
  &lt;dd&gt;The code repository you’re working on, i.e. Github, SVN, Bitbucket…&lt;/dd&gt;
  &lt;dt&gt;Tests&lt;/dt&gt;
  &lt;dd&gt;Your tests, basically the unit tests.&lt;/dd&gt;
  &lt;dt&gt;Files&lt;/dt&gt;
  &lt;dd&gt;The files you are working or are part of your change.&lt;/dd&gt;
  &lt;dt&gt;Commit mgs&lt;/dt&gt;
  &lt;dd&gt;The message you write on your commits, also known as commit log.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h4 id="understanding-this-checklist"&gt;Understanding this checklist&lt;/h4&gt;

&lt;p&gt;Before I started this checklist I asked myself “where did I and my colleagues
made more mistakes?” Where we usually have to follow certain steps and we end up
making a mistake? My conclusion was: when we check-in code into repository and
that was my pause point.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BEFORE PUSH&lt;/strong&gt; in capital letters sets the time when this checklist fit. This
is a little biased to distributed version control systems, but checklists are
encouraged to be changed, so if you use SVN you can change the pause
point to &lt;strong&gt;BEFORE COMMIT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is a &lt;strong&gt;DO-CONFIRM&lt;/strong&gt; checklist. The items are simple and well known for
software developers, so just saying &lt;em&gt;“CI green.”&lt;/em&gt; is very similar to &lt;em&gt;“Gear down,
three greens.”&lt;/em&gt; (When pilots say “Gear down.”, a lever should be moved and
there’s three lights on it. “Three greens” means that all three landing gears
are down and locked.)&lt;/p&gt;

&lt;p&gt;Note that this checklist has the style of aviation checklists, the user will be
familiar with the acronyms and the actions/states they should be in.&lt;/p&gt;

&lt;h4 id="the-order-and-the-purpose-of-each-item"&gt;The order and the purpose of each item&lt;/h4&gt;

&lt;h5 id="cigreen"&gt;1. CI…GREEN&lt;/h5&gt;

&lt;p&gt;Before sending the code you will update, this step is to avoid updating/pulling
from a broken build (unless you intend to fix it). If you pull from a broken
build you might break your current work. Instead, you might choose to keep
working until the build is fixed.&lt;/p&gt;

&lt;h5 id="upstreampullupdate"&gt;2. Upstream…PULL/UPDATE&lt;/h5&gt;

&lt;p&gt;Most version control systems will not check-in code if conflicts show up, but
that’s not the thing you are focused on. Updating your code before
checking-in is considered a good practice, gives you the opportunity to see if
other team members changes will play well with yours and sometimes you need to
make further changes to accommodate the others.&lt;/p&gt;

&lt;h5 id="testsfull-set---green"&gt;3. Tests…FULL SET - GREEN&lt;/h5&gt;

&lt;p&gt;During your work usually you run just a small set of tests to keep things fast.
Before sending your changes and specially because you just pulled changes from
others, it’s good to check if all the tests are green.&lt;/p&gt;

&lt;h5 id="filesaddedstashed"&gt;4. Files…ADDED/STASHED&lt;/h5&gt;

&lt;p&gt;This step is to check is the files you about to be check-in are the ones part of
your change. It’s very common check-in files that are not related to your change.&lt;/p&gt;

&lt;h5 id="commit-msgreviewed"&gt;5. Commit msg…REVIEWED&lt;/h5&gt;

&lt;p&gt;Most companies have hooks on version control to relate the commit with a
ticket/story. People tend to check-in wrong identifiers, wrong messages and
similar mistakes.&lt;/p&gt;

&lt;h5 id="cigreen-1"&gt;6. CI…GREEN&lt;/h5&gt;

&lt;p&gt;After all the checks above the build might be broken (other team member
checked-in code) or potentially brake if is still running. This step is for you
double check if sending the files is safe.&lt;/p&gt;

&lt;h4 id="last-notes"&gt;Last notes&lt;/h4&gt;

&lt;p&gt;I plan to expand this work with other checklists, I believe there’s space for
it and enough pause points in software development where we can benefit from
checklists. If you have ideas or want check out the code and the PDF go to
&lt;a href="http://github.com/mavcunha/checklists"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/aHwoQ5qHDUA" height="1" width="1"/&gt;</description>
				<published>2012-08-15 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/aHwoQ5qHDUA/developer-checklist.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/08/15/developer-checklist.html</feedburner:origLink></item>
		
			<item>
				<title>Schrödinger's release</title>
				<description>&lt;p&gt;Schrödinger’s release is just a thought experiment as the &lt;a href="http://en.wikipedia.org/wiki/Schr%C3%B6dinger's_cat"&gt;original one&lt;/a&gt; for teams
pushing Continuous Delivery methodology. If your team got into to a good
Continuous Delivery process that means that at any time a release into
production can be made. Business feel empowered to release the current code
into production just with a push of a button. &lt;/p&gt;

&lt;p&gt;Imagine now that the software team is not aware when this might happen, at any
time business can decide go to production without communicating the team, like
the Schrödinger’s Cat the button can be pushed or not and the current code
inside inside the version control be in production or not. For the team it is a
unknown state. &lt;/p&gt;

&lt;p&gt;If the code can be released at any time decreases the chance of postponing
production readiness of the code just because the business will announce the
release couple days before. In a Schrödinger’s release the team can’t take any
chances, code checked-in (and green tests) is always releasable.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/LlDD6jG3-IQ" height="1" width="1"/&gt;</description>
				<published>2012-07-20 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/LlDD6jG3-IQ/schrodingers-release.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/07/20/schrodingers-release.html</feedburner:origLink></item>
		
			<item>
				<title>Spammers push technology forward too.</title>
				<description>&lt;p&gt;Almost a month ago I got the strangest Google Alert, it said:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Web 1 new result for "Marco Valtas"
 
No Prescription Needed Pain Killers And Sildenafil ... - Marco Valtas
No Prescription Needed Pain Killers And Sildenafil. Men's Health. Shipping
Policy, Canadian Pharmacy, Erectile Dysfunction, Stop Smoking.
marcovaltas.com/?page_id=no-prescription-needed...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Obviously something wrong had happened. I wasn’t quite sure why Google thought
that &lt;em&gt;Canadian Pharmacy&lt;/em&gt; would link to my blog, but who knows? After a couple
minutes digging around it became clear that something was very wrong, more and
more searches on Google returned bogus links and references to my site were also
from bogus links.&lt;/p&gt;

&lt;h4 id="wordpress-spam-injection-attackhttpswwwgooglecombrsearchsourceidchromeieutf-8qwordpressspaminjectionattack"&gt;&lt;a href="https://www.google.com.br/search?sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=wordpress+spam+injection+attack"&gt;WordPress Spam Injection Attack&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;In a nutshell, spammers gain control by your WordPress platform using some
vulnerability, which might be in some plugin or theme, make your site behave
differently when crawled by Google (maybe other search bots too). It’s pretty
clever, taking the Google page rank and attacking enough sites they start to
link one to another promoting the results. I had one Israel TV website linking
to my site by 36 different URLs, the TV website is also run by WordPress code.&lt;/p&gt;

&lt;p&gt;That’s what happened with my site. If you dig into the Google there’s stories of
people having to go over all data in their sites to ensure they were secure
again.  And the rest of the links talk about how to secure your WordPress
installation.&lt;/p&gt;

&lt;p&gt;So I did what you expected, I saved the code for evidence and took down the site
until I got some evidence that it was clean back again. Going through dumps of
MySQL and the code.&lt;/p&gt;

&lt;h4 id="trying-to-clean-everything"&gt;Trying to clean everything&lt;/h4&gt;

&lt;p&gt;I did just enough to be relatively confident that no bad code was injected
around. In order to avoid any missing file I did a simple clean install of
WordPress, I could go over the missing plugins afterward but the primary
objective was to clean up the website from any spammer injection.&lt;/p&gt;

&lt;p&gt;Even after checking files, doing a bit of grep around I wasn’t confident. First
because I didn’t know what vulnerability was exploited. Second because for some
reason if I tried to access the website using the bogus URL’s WordPress would
only redirect to my home page with a nice &lt;code&gt;200 OK&lt;/code&gt; http code back. I wasn’t
happy and I decided to dig the code a little more, this time I was determined to
control WordPress redirection in details, when I’ve found the &lt;a href="http://core.svn.wordpress.org/trunk/wp-includes/canonical.php"&gt;Canonical API to
handle WordPress
Redirecting&lt;/a&gt;.
That was the last push I needed to ditch WordPress.&lt;/p&gt;

&lt;h4 id="couple-notes-on-security"&gt;Couple notes on security&lt;/h4&gt;

&lt;p&gt;Until proven contrary Security and Convenience don’t walk together, they are
almost opposite to each other. You can tell by paying attention on the most
secure things you deal, lets say you bank account. If you want check your bank
account online chances are you will need a token not only your password. You
company might give you laptops and their policy don’t allow you to install
anything into it and other security hassles, some valid, some just theater.&lt;/p&gt;

&lt;p&gt;Taking out the social engineering, when is code against code, one thing matters
simplicity. Every operation you add to your code is one more operation to be
exploited, as your software grows in complexity also grows and possible security
holes and there’s clever folks out there making money (it got to be money in
this for exploiting my website to sell Viagra) with every invasion.&lt;/p&gt;

&lt;p&gt;All convenience WordPress was providing me is grounded in lines and more lines of
code. Themes, plugins, configuration, feeds, comments and such don’t come for
free security wise speaking. And frankly I didn’t need all this stuff.&lt;/p&gt;

&lt;h4 id="going-to-jekyll-and-plain-old-html-pages"&gt;Going to Jekyll and plain old HTML pages&lt;/h4&gt;

&lt;p&gt;I knew about Jekyll by some blogs, I thought about going for it but I was too
lazy to do so since my website, although important to me, it was not a priority
until the attack. When I decided to change, my friend &lt;a href="http://twitter.com/#!/chris_stevenson"&gt;Chris
Stevenson&lt;/a&gt; brought Jekyll to my
attention. Jekyll seemed the right solution, just enough to get a website running and
pretty old HTML would make less vulnerable to spammers. I won’t put all details
of migrating to Jekyll there’s plenty information already in the web. Some
details that made my migration a little different from the others I saw.&lt;/p&gt;

&lt;h5 id="backward-compatibility-with-wordpress-links"&gt;Backward compatibility with WordPress links&lt;/h5&gt;

&lt;p&gt;My old WordPress was configured with permanent links format like this
&lt;code&gt;http://marcovaltas.com/?p=107&lt;/code&gt;, in order to keep old links compatible with
Jekyll I needed some code to proper redirect URL’s. I did a dump from the
WordPress database and created a &lt;a href="/wp_reference.txt"&gt;file&lt;/a&gt; which maps post IDs
with the slugs used by Jekyll and little
&lt;a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface"&gt;CGI&lt;/a&gt; (this exposes how
old I am) script to redirect requests. I hope retire this script soon. &lt;/p&gt;

&lt;h5 id="the-dump-from-wordpress-didnt-went-smoothly"&gt;The dump from WordPress didn’t went smoothly&lt;/h5&gt;

&lt;p&gt;This website was migrated from Blogger to WordPress, WordPress to WordPress and
finally from WordPress to Jekyll. Was written in Portuguese (just a couple of
posts) and English. Guess what happened? It got mess up. Old posts with
weird characters that even changing encodings didn’t solve, no proper formats
and code snippets once formatted with SyntaxHighlighter have the old bracket
tag. So I have to go back and fix them all, maybe delete some posts :) &lt;/p&gt;

&lt;p&gt;There was a &lt;em&gt;migration page&lt;/em&gt; which lists the old posts and their
statuses of &lt;code&gt;Pending&lt;/code&gt; or &lt;code&gt;OK&lt;/code&gt;. For this, I created simple generator plugin for
Jekyll that only checks if the tag &lt;code&gt;migration&lt;/code&gt; is defined on the post, if so is
considered migrated. Here’s the script:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="ruby"&gt;&lt;span class="k"&gt;module&lt;/span&gt; &lt;span class="nn"&gt;Jekyll&lt;/span&gt;

  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MigrationListGenerator&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;Generator&lt;/span&gt;
    &lt;span class="n"&gt;safe&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;_includes/migrations.html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;w&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;

        &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
          &lt;span class="k"&gt;next&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;2012-04-02 00:00:00 -0300&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#39;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;title&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/a&amp;gt; &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has_key?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;migration&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;OK&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;Pending&amp;#39;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
        &lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

      &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Every run, Jekyll loads the plugin and executes it. An annoying side effect is I
can’t run Jekyll with the &lt;code&gt;--auto&lt;/code&gt; flag anymore. Since it creates a file, it
recognizes the site update and generates it again &lt;em&gt;ad infinitum&lt;/em&gt;. I had no time
(or too lazy) to think in a better solution. And &lt;code&gt;post.html&lt;/code&gt; layout has also
a conditional to render a little notice if the post wasn’t migrated yet (I had
to remove the tag {% op %} because of formatting constraints):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;if page.migration == null
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;migration_note&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  Looks like I didn&amp;#39;t fix this post yet, I&amp;#39;m working on fixing all my posts
  after a sad hacking of my site.  You can check the progress &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt;
    &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;/migrations.html&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;here.&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; 

&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
endif
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h4 id="final-thoughts"&gt;Final thoughts&lt;/h4&gt;

&lt;p&gt;Going to Jekyll wasn’t bad at all, was just the timing which wasn’t chosen by me
but by the spammers. Other advantages are being free of DB, use Git to manage
the files, using Vim to edit, a fresh look and some other ideas. Drawbacks, the
only I can think right now is loosing the ability of posting from any computer
with internet, now I have to push to the repository as a hook deploys the files. &lt;/p&gt;

&lt;p&gt;And if you see anything weird on the site please let me know, as something maybe
escape my sight. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I finished the migrations so there’s no more migrations.html page.&lt;/p&gt;

&lt;p&gt;Cheers.&lt;br /&gt;
Marco.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/zo9Xu30Ez30" height="1" width="1"/&gt;</description>
				<published>2012-05-09 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/zo9Xu30Ez30/spammers-push-technology-forward-too.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/05/09/spammers-push-technology-forward-too.html</feedburner:origLink></item>
		
			<item>
				<title>Vitosto JS - A new library in JavaScript for fast web development</title>
				<description>&lt;h4&gt;Motives&lt;/h4&gt;

&lt;p&gt;Today even the simplest application will demand from developers to know a
handful of technologies and languages. Rapid prototyping libraries were created
to bridge this, taking care of much of the boiler plate code necessary to put a
application online, like Rails. Moreover template engines are based on the
assumption that it will exists a Designer to take care of the pages, also the
business logic has to be isolated from the rest of the code like persistence.
Patterns like MVC, MVP and MVVM are thought to achieve this, but the sad truth
is, often times applications end up with logic everywhere in these layers making
growing the application harder and harder.  &lt;/p&gt;

&lt;h4&gt;Vitosto JS - a new way to think about web development&lt;/h4&gt;

&lt;p&gt;With these in mind, I joined a group of friends and we started to work in a
new library, Vitosto JS. &lt;strong&gt;View To Storage in JavaScript&lt;/strong&gt;. The
idea is lower down the amount of different layers between the user interface and
the storage where the data actually is. Developers can grow their application
just controlling one layer of code and having some knowledge about databases, as
for now, vitosto.js can only work with MySQL databases, support for Oracle is in
progress. Enough talking, more code:&lt;/p&gt;

&lt;p&gt;Hello World:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vitosto JS&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;vitosto.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;vitosto_config.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;$db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;my_table&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;&lt;code&gt;vitosto.js&lt;/code&gt; is the library it carries all code to actually
connect to the database plus a fluent API to issue queries.
&lt;code&gt;vitosto_config.js&lt;/code&gt; holds the connection information, for security it
is encrypted with &lt;a href="http://en.wikipedia.org/wiki/ROT13"&gt;ROT13&lt;/a&gt;
algorithm for security purposes. &lt;/p&gt;

&lt;p&gt;All the power of JavaScript is at your hands and a simple WebServer like
apache will be necessary to hold your application. Here's an example of a form
submission.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="html"&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vitosto JS Form&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;jquery.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;vitosto.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;vitosto_config.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;processForm&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;doSomeSanityCheck&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;#name&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;$db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;into&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;table&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;rewriteDomForThankYou&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;form&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;name&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;maxlength=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;50&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;submit&amp;quot;&lt;/span&gt;
&lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;processForm()&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;As will can see we can mix JQuery and other libraries with Vitosto.js.&lt;/p&gt;
name
&lt;h4&gt;Next Steps&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Oracle connection driver&lt;/li&gt;
  &lt;li&gt;Support for Oracle functions and procedures&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;Code and API information&lt;/h4&gt;

Download the Beta Release at: &lt;a href="http://github.com/mavcunha/vitostojs"&gt;Vitosto at GitHub.&lt;/a&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/RaIkCOfLIa8" height="1" width="1"/&gt;</description>
				<published>2012-04-01 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/RaIkCOfLIa8/vitosto-js-a-new-library-in-javascript-for-fast-web-development.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/04/01/vitosto-js-a-new-library-in-javascript-for-fast-web-development.html</feedburner:origLink></item>
		
			<item>
				<title>Two wrongs do not make a right</title>
				<description>&lt;p&gt;In the software development business there's some well known currencies, these currencies are used to value an employee and the employee (dev, architect, QA or manager) struggle to achieve them as they make their employment more stable or more profitable, this fact goes probably for all work environments. Some more common is productivity (whatever way it's measured), proactivity, efficiency, leading, domain knowledge. Whatever the company values the employee will try to make himself/herself good at it.&lt;/p&gt;

&lt;p&gt;Companies, whatever they value, have to pay attention to these values, misunderstanding what they mean and evaluating it wrong will lead to employees behaving as they're measured, which it turns out not to be the value glued in a beautiful frame on the wall.&lt;/p&gt;

&lt;p&gt; One in particular that I want to focus is "domain knowledge". I've seem much misunderstanding of this skill inside big companies. Let's say that you work on a big company that develops software. Some old time folks would be considered valuable because the have a lot of "domain knowledge", which usually translates in knowing the technology stack and how it works and its implementations, that's supposed to be good, right?&lt;/p&gt;

&lt;p&gt;An employee with this kind of knowledge is essential to help new comers to understand what is happening and how to deal with the application, how to improve it without breaking it and how to modify it. This is a good thing and companies are right to be worried about retaining such employees. &lt;/p&gt;

&lt;p&gt;Gaming the system is easy though. This is where I find hard to deal with in legacy systems. Much of the systems that I saw are not so complex in essence but they are a bad coded software. Domain Knowledge experts know the way around it because they wrote the thing in first place but often do not know the business concerns behind it. It turns out that this "domain knowledge" is just a background of the past bad code written.  &lt;/p&gt;

&lt;p&gt;In such situations two wrongs do not make a right, bad code is bad code, knowing how was written doesn't make an expert it is just half of the knowledge needed, it is still missing the knowledge of the problems the software was trying to solve. I expect from an expert to know the problem and the current solution and be able to discuss new solutions for the same problems as well find out other problems. Companies have to be aware of that otherwise employees regarded as experts might be only gaming the system and holding the company back on innovative solutions.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/3qxKqe7sMiQ" height="1" width="1"/&gt;</description>
				<published>2012-01-12 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/3qxKqe7sMiQ/two-wrongs-do-not-make-a-right.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/01/12/two-wrongs-do-not-make-a-right.html</feedburner:origLink></item>
		
			<item>
				<title>Keeping QuickSilver up with Launchd</title>
				<description>&lt;p&gt;OS X &lt;code&gt;launchd&lt;/code&gt; spawn processes and manage them, you can actually make use of it to help you out on OS X automation. I had the same exactly thought that &lt;a href="http://zzamboni.org/about.html"&gt;Diego Zamboni&lt;/a&gt; had when wrote &lt;a href="http://zzamboni.org/brt/2008/01/28/using-launchd-to-immortalize-quicksilver-howto/"&gt;this blog post&lt;/a&gt; four years ago.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://qsapp.com"&gt;QuickSilver&lt;/a&gt; became part of my interactions with OS X for a while but QS is not perfect and sometimes crash or needs to be restarted. As Diego felt, I felt that when QS quits is annoying go chasing it again to restart it. For this &lt;code&gt;launchd&lt;/code&gt; can help you.&lt;/p&gt;

&lt;p&gt;Start by disabling the &lt;strong&gt;Start at Login&lt;/strong&gt; option of QS in its preferences.&lt;/p&gt;

&lt;p&gt;After that adding the below XML as &lt;code&gt;~/Library/LaunchAgents/com.blacktree.Quicksilver.plist&lt;/code&gt; will do the trick of keep QS running, if it quits, it will be restarted automatically.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="xml"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;plist&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;com.blacktree.Quicksilver&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;LimitLoadToSessionType&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Aqua&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/Applications/Quicksilver.app/Contents/MacOS/Quicksilver&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/plist&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;You can check the this &lt;a href="http://developer.apple.com/library/mac/#technotes/tn2083/_index.html"&gt;Technical Note&lt;/a&gt; for a lot of details. But I will give a short explanation of what we have here.&lt;/p&gt;

&lt;ul&gt;
 &lt;li&gt;&lt;code&gt;Label&lt;/code&gt; - It's mandatory to identify the job and has to be unique, it has to match the file name (without the suffix .plist)&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;LimitLoadToSessionType&lt;/code&gt; - The context the job should run, Unix fellows this is similar to run levels. The value of &lt;code&gt;Aqua&lt;/code&gt; means full GUI.&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;ProgramArguments&lt;/code&gt; - Is actually what we want to run. Check the man &lt;code&gt;launchd.plist&lt;/code&gt; and &lt;code&gt;execvp(3)&lt;/code&gt; on the Terminal for more information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it, log out and log in back again and you should see QS running. If you want to test if &lt;code&gt;launchd&lt;/code&gt; is managing your QS just quit it and you should see it running back again. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/2li4cqCAsLo" height="1" width="1"/&gt;</description>
				<published>2012-01-11 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/2li4cqCAsLo/keeping-quicksilver-up-with-launchd.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/01/11/keeping-quicksilver-up-with-launchd.html</feedburner:origLink></item>
		
			<item>
				<title>Setting up a Mac for Development</title>
				<description>&lt;p&gt;Recently I got a new Mac and setting up for development is always fun, so I
decided share some of the setups I do on a new Mac.&lt;/p&gt;

&lt;h4&gt;Is a Mac a good machine for development?&lt;/h4&gt;

&lt;p&gt;I think so and also know folks that think Linux is better, some are more use
to Windows. In the end I think is not the OS which makes a better development
machine (although there's space for some debate here) but how you deal with it.
Take a look on &lt;a
  href="http://www.amazon.com/Productive-Programmer-Theory-Practice-OReilly/dp/0596519788"&gt;The
  Productive Programmer&lt;/a&gt; by Neal Ford for some other tips.&lt;/p&gt;

&lt;h4&gt;What to keep in mind&lt;/h4&gt;

&lt;p&gt;As you setup a machine for development some things you should keep in mind.
First is you want to lower the &lt;em&gt;keyboard to mouse&lt;/em&gt; time. Taking your
hands off the keyboard to point to a link in a webpage and then going back is
time consuming, a developer goes from the IDE to the browser lots of time during
the day.&lt;/p&gt;

&lt;p&gt;Make the computer do what you're thinking without much effort, few keystrokes
should take or do what you want. Going through menus, mouse, chasing windows on
the desktop are also time consuming, unproductive and (for me) annoying.&lt;/p&gt;

&lt;p&gt;If you do twice, think about how to do with one keystroke. If you caught
yourself repeating something, think in a way to automate it (if makes sense).
Apple has AppleScript and Automator which you can use to make simple scripts for
mundane things.&lt;/p&gt;

&lt;p&gt;Keep your projects and files organized, this goes for every developer. Not
knowing where the files are leads you to browsing around to find them, avoid
that. I have a &lt;code&gt;Projects&lt;/code&gt; directory and an alias &lt;code&gt;gp&lt;/code&gt; that
goes to this folder, plus &lt;code&gt;gp project&lt;/code&gt; takes me direct to the project
folder. If you have some suggestion please do so (use the comments), I'm keen to
know how you make your environment more smart and fast.&lt;/p&gt;

&lt;p&gt;Now, some of the things I do on my Mac for development. &lt;/p&gt;

&lt;h4&gt;Disabling the Dashboard&lt;/h4&gt;

&lt;p&gt;I tried to use, make some meaningful use of it but never achieved, it just
sit there. In Lion it turned to be a little more annoying as it shows on Mission
Control view. Disabling the Dashboard is pretty easy, go to the terminal and
issue this command:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;defaults write com.apple.dashboard mcx-disabled -boolean YES
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;And restart the Dock:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;killall Dock
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h4&gt;Get &lt;a href="http://www.iterm2.com/"&gt;iTerm 2&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;OS X has its Terminal application but iTerm 2 has some features that I really
like, one is the &lt;em&gt;Hotkey Window&lt;/em&gt; which you can trigger by a keyboard
shortcut and it come and goes easily. &lt;/p&gt;

&lt;p&gt;One tip for Lion users, if you use multi desktops set iTerm 2 to be available
in &lt;em&gt;All Desktops&lt;/em&gt;. You can achieve this by control + click on iTerm icon
in the Dock and selecting &lt;em&gt;Options - Assign To - All Desktops&lt;/em&gt;. This way
when you invoke Hotkey Window it will not shift from desktop to desktop. &lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://qsapp.com/"&gt;QuickSilver&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;QuickSilver is a very powerful application for action at distance. Some of
you might know Alfred (check the app store), in Linux the &lt;a
  href="http://do.davebsd.com/"&gt;Gnome Do&lt;/a&gt; and on Windows I recall &lt;a
  href="http://www.launchy.net/"&gt;Launchy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On a Mac I prefer QuickSilver, mind that it is not just a Application
launcher it can do a lot more than launch applications. &lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://www.dropbox.com/"&gt;Dropbox&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;I use dropbox for a lot of file transferring and storage, specially when I
change machines it helps to avoid the USB stick protocol.&lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://lightheadsw.com/caffeine/"&gt;Caffeine&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;A development machine that keeps dimming the monitor, going to screensaver
and sleeping because you took more than five minutes to type doesn't help you.
Caffeine when on don't let this happen, it's way more easy than changing Energy
Saver configurations.&lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://bjango.com/mac/istatmenus/"&gt;iStat Menus&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;This one is paid. I use to keep and eye on CPU, Memory, Hard drive access and
Network usage. Also it can replace the battery level indicator and the date menu
on the Mac. This is a habit that I've acquired working with Linux for long time
and &lt;a href="http://www.nongnu.org/bubblemon/"&gt;Bubblemon&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://developer.apple.com/xcode/"&gt;Xcode&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Although I don't develop for Mac, Xcode is needed because it brings a lot of
libraries for development that it's needed for a dev.&lt;/p&gt;

&lt;h4&gt;Get &lt;a href="http://mxcl.github.com/homebrew/"&gt;Home Brew&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;Or another package manager for Mac as &lt;a
  href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt;. You will need to install other
packages into your Mac. Unless you're a fan of compiling everything you need
something similar to &lt;code&gt;apt-get&lt;/code&gt; to your Mac.&lt;/p&gt;

&lt;h4&gt; Get &lt;a href="http://thegleebox.com/"&gt;GleeBox&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;I can't image myself using a browser without GleeBox. It makes easier to find
links, form items, issue bookmarkslets on a page and more. Is one more
application to lower the keyboard to mouse time. &lt;/p&gt;

&lt;h4&gt;Turn on keyboard access to all controls&lt;/h4&gt;

&lt;p&gt;In the System Preferences go to Keyboard then keyboard shortcuts and turn
&lt;em&gt;All Controls&lt;/em&gt;. Now you can use tab to navigate through windows buttons
and fields.&lt;/p&gt;

&lt;h4&gt;If you use Safari, turn "Tab" for links&lt;/h4&gt;

&lt;p&gt;It doesn't come with the "Tab" to links enabled by default, just to go to its
preferences advanced and turn &lt;em&gt;Press Tab to highlight each item on a
  webpage&lt;/em&gt;.&lt;/p&gt;

&lt;h4&gt;Get a real Text/Code editor&lt;/h4&gt;

&lt;p&gt;I use &lt;em&gt;Vim&lt;/em&gt; and usually is the first thing that I install in any
computer that I use. &lt;a href="http://code.google.com/p/macvim/"&gt;MacVim&lt;/a&gt; is
the Vim for a Mac. Also I don't like the menu if you also don't like add to your
&lt;code&gt;~/.gvimrc&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;code class="bash"&gt;&lt;span class="nb"&gt;set &lt;/span&gt;&lt;span class="nv"&gt;guioptions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-T
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h4&gt;Learn some common shortcuts of OS X&lt;/h4&gt;

&lt;p&gt;One of the good things about Apple software is it tries to be consistent over
the keyboard shortcuts. The famous &lt;code&gt;Command + ,&lt;/code&gt; in almost every
software that runs on a Mac takes you to the preferences of the app. &lt;/p&gt;

&lt;p&gt;Another good one is &lt;code&gt;Command + ?&lt;/code&gt; which takes you to the help
menu, plus there's a search that can show you a entry on the menu. If the app
doesn't not provide a shortcut for the action you're trying to make you can use
this one to go there.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/marcovaltas/~4/oFDmWHXBarI" height="1" width="1"/&gt;</description>
				<published>2012-01-09 00:00:00 +0000</published>
				<link>http://feedproxy.google.com/~r/marcovaltas/~3/oFDmWHXBarI/setting-up-a-mac-for-development.html</link>
			<feedburner:origLink>http://marcovaltas.com/2012/01/09/setting-up-a-mac-for-development.html</feedburner:origLink></item>
		
	</channel>
</rss>
