Monday, April 16, 2012

IBM: 6 Ways for Enterprises to Adopt DevOps

https://www.ibm.com/developerworks/mydeveloperworks/blogs/invisiblethread/entry/6-ways-for-enterprises-to-adopt-devops?lang=en
  1. Automate Everything.
  2. Test Everything.
  3. Version Everything.
  4. Track and Plan Everything.
  5. Monitor and Audit Everything.
  6. Dashboard Everything. 
 

Sunday, April 15, 2012

CouchDB vs MongoDB

http://www.slideshare.net/gabriele.lana/couchdb-vs-mongodb-2982288





http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

CouchDB on Amazon EC2


https://github.com/iriscouch/build-couchdb (from http://wiki.apache.org/couchdb/Installing_on_Ubuntu)

  • Setup new instance: Ubuntu 11.10
  • ssh to new box
  • run the following to build couchdb from source (packages available via "sudo aptitude install couchdb" are too old):
sudo apt-get install git
sudo apt-get install make gcc zlib1g-dev libssl-dev rake
git clone git://github.com/iriscouch/build-couchdb
cd build-couchdb
git submodule init
git submodule update
rake
couchdb 

ubuntu@ip-10-128-141-191:~/build-couchdb$ couchdb
Apache CouchDB 1.0.1 (LogLevel=info) is starting.

=CRASH REPORT==== 19-Apr-2012::11:28:09 ===
  crasher:
    initial call: couch_event_sup:init/1
    pid: <0.80.0>
    registered_name: []
    exception exit: {{badmatch,
                         {'EXIT',
                             {{badmatch,{error,eacces}},
                              [{couch_log,init,1},
                               {gen_event,server_add_handler,4},
                               {gen_event,handle_msg,5},
                               {proc_lib,init_p_do_apply,3}]}}},
                     [{couch_event_sup,init,1},
                      {gen_server,init_it,6},
                      {proc_lib,init_p_do_apply,3}]}
      in function  gen_server:init_it/6
    ancestors: [couch_primary_services,couch_server_sup,<0.32.0>]
    messages: []
    links: [<0.79.0>,<0.6.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 24
    reductions: 116
  neighbours:

=SUPERVISOR REPORT==== 19-Apr-2012::11:28:09 ===
     Supervisor: {local,couch_primary_services}
     Context:    start_error
     Reason:     {{badmatch,{'EXIT',{{badmatch,{error,eacces}},
                                     [{couch_log,init,1},
                                      {gen_event,server_add_handler,4},
                                      {gen_event,handle_msg,5},
                                      {proc_lib,init_p_do_apply,3}]}}},
                  [{couch_event_sup,init,1},
                   {gen_server,init_it,6},
                   {proc_lib,init_p_do_apply,3}]}
     Offender:   [{pid,undefined},
                  {name,couch_log},
                  {mfargs,{couch_log,start_link,[]}},
                  {restart_type,permanent},
                  {shutdown,brutal_kill},
                  {child_type,worker}]


=SUPERVISOR REPORT==== 19-Apr-2012::11:28:09 ===
     Supervisor: {local,couch_server_sup}
     Context:    start_error
     Reason:     shutdown
     Offender:   [{pid,undefined},
                  {name,couch_primary_services},
                  {mfargs,{couch_server_sup,start_primary_services,[]}},
                  {restart_type,permanent},
                  {shutdown,infinity},
                  {child_type,supervisor}]

=CRASH REPORT==== 19-Apr-2012::11:28:09 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.31.0>
    registered_name: []
    exception exit: {bad_return,
                        {{couch_app,start,
                             [normal,
                              ["/etc/couchdb/default.ini",
                               "/etc/couchdb/local.ini"]]},
                         {'EXIT',
                             {{badmatch,{error,shutdown}},
                              [{couch_server_sup,start_server,1},
                               {application_master,start_it_old,4}]}}}}
      in function  application_master:init/4
    ancestors: [<0.30.0>]
    messages: [{'EXIT',<0.32.0>,normal}]
    links: [<0.30.0>,<0.7.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 987
    stack_size: 24
    reductions: 115
  neighbours:

=INFO REPORT==== 19-Apr-2012::11:28:09 ===
    application: couch
    exited: {bad_return,{{couch_app,start,
                                    [normal,
                                     ["/etc/couchdb/default.ini",
                                      "/etc/couchdb/local.ini"]]},
                         {'EXIT',{{badmatch,{error,shutdown}},
                                  [{couch_server_sup,start_server,1},
                                   {application_master,start_it_old,4}]}}}}
    type: temporary


Alternatives

http://wiki.apache.org/couchdb/Getting_started_with_Amazon_EC2

  • sudo apt-get update && sudo apt-get -y upgrade
  • sudo apt-get install erlang libmozjs-dev libicu-dev libcurl4-gnutls-dev make subversion automake autoconf libtool help2man
  • Fetch, build, and run CouchDB:
    • svn checkout http://svn.apache.org/repos/asf/couchdb/trunk couchdb
    • cd couchdb
    • ./bootstrap
    • ./configure
    • ./configure
    • make && sudo make install
    • sudo adduser --system --home /usr/local/var/lib/couchdb --no-create-home --shell /bin/bash --group --gecos 'CouchDB account' couchdb
    • sudo chown -R couchdb.couchdb /usr/local/var/{lib,log}/couchdb
    • (Optional) Enable direct web access. NOTE: This step makes your CouchDB instance available for everyone. See the FaQ for some (but not all) security options.
      • sudo vim /usr/local/etc/couchdb/local.ini 
      • Search for "bind_address", uncomment it, and change it to 0.0.0.0
      • Save and exit
    • (Alternative option) Set up port forwarding to access your DB, for example with SSH.
      • ssh -L 5984:localhost:5984 -l ubuntu <public DNS name>
      • Leave that session open as long as you need the proxy to work
      • Your new DB URL will be http://127.0.0.1:5984/ instead.
    • sudo -i -u couchdb couchdb 
    • Test it by going to http://<public dns name>:5984/_utils/


Saturday, April 14, 2012

BusinessInsider: 8 Mind Games That Recruiters Play During Interviews


8 Mind Games That Recruiters Play During Interviews

1.    They will pause for an awkward silence just to get you talking
2.    They'll ask you specific questions about your former boss — like ask you to spell his or her name —  to get you in honesty mode
3.    They'll leave out parts of questions to see how you'll finish answering
4.    They judge you by your pronoun usage
5.    They'll listen closely for your adverb usage — since low performers use 40 percent more adverbs than high performers
6.    They'll listen to your verb tense when you answer a question — since high performers respond more frequently in the past tense
7.    They'll see if you converse in the active voice
8.    They'll listen to see how often you use the words "always" and "never." Low performers use absolutes 100 percent more often than high performers

BusinessInsider: 17 Tips On Becoming A Charismatic Leader



17 Tips On Becoming A Charismatic Leader
1.       You don't have to be the most attractive person in the room
2.       Make people feel like they're the most intelligent, impressive and fascinating person in the room
3.       To make someone feel as if they're the only person that matters, do these three things during conversations:
a.       Lower the intonation of your voice at the end of sentences.
b.      Reduce how quickly and often you nod.
c.       Pause for two full seconds before speaking
4.       Your presence should always be present
5.       Think of something pleasant so you appear to be sincere
6.       To appear more open and inviting, rise if you're sitting to be similar heights and keep your hands out of you pockets when you shake someone's hand
7.       Make sure you have the right handshake
8.       Become an excellent listener by deliberately pausing and asking question
9.       Choose your seat carefully around a table
10.   Don't compare yourself to others
11.   Combine your power with warmth to create a full, charismatic package
12.   Don't let self-doubt affect your persona
13.   Recognize what the problems are and fix them. For example, if you're wearing clothes that are too tight, it will physically show that you're uncomfortable, but your companions will think you appear disengaged and untruthful
14.   When you're dealing with a difficult group of people, divide them up, then conquer
15.   Make time to warm-up before a big event
16.   Intentionally put yourself in uncomfortable situations so that you can deal with internal discomfort more effectively
17.   Know that there are different charisma styles
a.       Focus. This style is based on the perception of presence. Adopt this when you want people to feel like they're the only ones in the room with you
b.      Visionary. This kind of style makes other people feel inspired and appearance matters far less than with any other style.
c.       Kindness. This kind of charisma comes from body language and is based mostly on warmth. However, if you don't combine this with some authoritative skills, you'll come off as too overeager to please.
d.      Authority. This is the most powerful charisma style of them all and those who acquire it are not likeable all the time. We evaluate this power through four indicators: body language, appearance, title and reactions of others. 

Friday, April 13, 2012

Deploying Grails app to CloudFoundry

http://grails.org/plugin/cloud-foundry
http://blog.springsource.com/2011/04/12/one-step-deployment-with-grails-and-cloud-foundry/
http://docs.cloudfoundry.com/tools/vmc/installing-vmc.html
http://grails-plugins.github.com/grails-cloud-foundry/docs/manual/index.html

  • grails install-app cloud-foundry
  • Create /<homedir>/.grails/settings.groovy:
    •     grails.plugin.cloudfoundry.username = "<email>"
    •     grails.plugin.cloudfoundry.password = "<passwd>"
  • grails cf-info
    • VMware's Cloud Application Platform
      For support visit http://support.cloudfoundry.com
      Target:   http://api.cloudfoundry.com (v0.999)
      User:     <email>
      Usage:    Memory   (1.0G of 2.0G total)
                Services (1 of 16 total)
                Apps     (2 of 20 total)
  • grails prod cf-push
    • choose app name
    • say yes to MySQL
    • say no to postresql
  • grails cf-services
    • ============== System Services ==============
      +------------+---------+---------------------------------------+
      | Service    | Version | Description                           |
      +------------+---------+---------------------------------------+
      | mysql      | 5.1     | MySQL database service                |
      | postgresql | 9.0     | PostgreSQL database service (vFabric) |
      | mongodb    | 1.8     | MongoDB NoSQL store                   |
      | redis      | 2.2     | Redis key-value store service         |
      | rabbitmq   | 2.4     | RabbitMQ message queue                |
      +------------+---------+---------------------------------------+
      =========== Provisioned Services ============
      +---------------+---------+
      | Name          | Service |
      +---------------+---------+
      | mysql-f9bee59 | mysql   |
      +---------------+---------+
  • grails cf-apps
    • +-------------------------+----+---------+------------------------------------------+---------------+
      | Application             | #  | Health  | URLs                                     | Services      |
      +-------------------------+----+---------+------------------------------------------+---------------+
      | blog                    | 1  | RUNNING | gailsblog.cloudfoundry.com               | mysql-f9bee59 |
      +-------------------------+----+---------+------------------------------------------+---------------+
      | cloudfoundry_grailsblog | 1  | RUNNING | cloudfoundry_grailsblog.cloudfoundry.com |               |
      +-------------------------+----+---------+------------------------------------------+---------------+
  • grails cf-map grailsblog.cloudfoundry.com
  • cf-apps
    • +-------------------------+----+---------+---------------------------------------------------------+---------------+
      | Application             | #  | Health  | URLs                                                    | Services      |
      +-------------------------+----+---------+---------------------------------------------------------+---------------+
      | blog                    | 1  | RUNNING | gailsblog.cloudfoundry.com, grailsblog.cloudfoundry.com | mysql-f9bee59 |
      +-------------------------+----+---------+---------------------------------------------------------+---------------+
      | cloudfoundry_grailsblog | 1  | RUNNING | cloudfoundry_grailsblog.cloudfoundry.com                |               |
      +-------------------------+----+---------+---------------------------------------------------------+---------------+
  • grails cf-unmap gailsapp.cloudfoundry.com
  • grails cf-update-instances 3
    • Scaled 'blog' up to 3 instances.
  • grails prod cf-update
    • Updating Application:  Checking for available resources: OK  Processing resources: OK  Packing application: OK  Uploading (28K): OK
      Application 'blog' stopped.
      Trying to start Application: 'blog'.
      ...Application 'blog' started at http://grailsblog.cloudfoundry.com
  • grails cf-delete-app

Wednesday, April 11, 2012

Grails: Accessing paths, properties and URLs


In Service classes:

·         ApplicationHolder.application.metadata.'relative.dir'  -->  returns "relative.dir" property value from application.properties

·         ApplicationHolder.application.getMainContext().getResource('/').getFile().getAbsolutePath() -->  returns the local root directory of the webapp on the server

·         [inject] LinkGenerator grailsLinkGenerator  (literally)

o   grailsLinkGenerator.serverBaseURL + "/path"  -->  http://localhost:9999/context/path

o   grailsLinkGenerator.link(uri: "/path", absolute: true)  -->  same as above (see javadoc on link())

 

 

In gsp:

·         grailsApplication.metadata.'relative.reports.dir' -->  returns "relative.dir: property value from application.properties

·         request.getSession().getServletContext().getRealPath("/")  -->  returns the local root directory of the webapp on the server

·         request.getSession().getServletContext().getRealPath("/path")  -->  returns /path relative to the local root directory of the webapp on the server


Monday, April 9, 2012

Kanban vs Scrum, Shock Therapy


Saturday, April 7, 2012

Create Grails app


  • create-app blog
  • create-domain-class post
  • Edit Post.groovy:
    • package blog
      class Post {
          String title
          String content
          Date date
          static constraints = {    }
      }
  • generate-all blog.Post
  • create-domain-class comment
  • Add comments to Post.groovy:
    • class Post {
          String subject
          String content
          Date date
          static hasMany = [comments: Comment]
          static constraints = {
              // Ordering constraint
              subject()
              content()
              date()
              comments()    }
      }
  • generate-all *
  • add to views/post/show.gsp
    • <g:link class="comment" action="comment" id="${postInstance?.id}"><g:message code="default.button.comment.label" default="Comment" /></g:link>

Wednesday, April 4, 2012

OWASP Agile web security: Evil Stories & Top 10 Web Security tips

OWASP: https://www.owasp.org/index.php/Agile_Software_Development:_Don%27t_Forget_EVIL_User_Stories


  • Example #1. "As a hacker, I can send bad data in URLs, so I can access data and functions for which I'm not authorized."
  • Example #2. "As a hacker, I can send bad data in the content of requests, so I can access data and functions for which I'm not authorized."
  • Example #3. "As a hacker, I can send bad data in HTTP headers, so I can access data and functions for which I'm not authorized."
  • Example #4. "As a hacker, I can read and even modify all data that is input and output by your application."



1.  Injection

2.  Cross-Site Scripting (XSS)

3. Broken Authentication and Session Management

4.  Insecure Direct Object References.

5.  Cross-Site Request Forgery (CSRF)

6.  Security Misconfiguration

7.  Insecure Cryptographic Storage

8.  Failure to Restrict URL Access

9.  Insufficient Transport Layer Protection

10.  Unvalidated Redirects and Forwards


Dwight Merriman: MongoDB, CAP theorem

Software Engineering Radio: http://www.se-radio.net/2010/07/episode-165-nosql-and-mongodb-with-dwight-merriman/

Dwight Merriman talks with Robert about the emerging NoSQL movement, the three types of non-relational data stores, Brewer’s CAP theorem, the weaker consistency guarantees that can be made in a distributed database, document-oriented data stores, the data storage needs of modern web applications, and the open source MongoDB.

Sunday, April 1, 2012

Jared Koumentis: The Asymptote of DevOps Utopia

http://omniti.com/seeds/the-asymptote-of-devops-utopia

http://www.liberumvir.com/2012/03/28/seeds-article-for-omniti-the-asymptote-of-devops-utopia.html

Silos


http://www.resorgs.org.nz/pubs/Silos.pdf


  • "It is helpful to think of silos existing in degrees along a continuum, 
  • i.e. silo existence isn’t a binary, black and white matter. 
  • Most organisations and organisational units will have some silo characteristics at any given time. 
  • But silos become problematic when they are develop to a point that good performance suffers. 
  • The challenge is to indentify silos that are problematic or that threaten to become so, and to identify and take remedial steps."


Linked from: http://www.jedi.be/blog/2012/01/08/devops-a-wicked-problem/