hit counter

Timeline

My development logbook

Sensu Plugin Problem

Encountered problem when installing sensu-plugin

    $ gem install sensu-plugin --no-rdoc --no-ri
    /usr/bin/ruby1.9.1 extconf.rb
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
            from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
            from extconf.rb:1:in `<main>'

This is the solution: use the ruby runtime embedded in sensu

    $ /opt/sensu/embedded/bin/gem install sensu-plugin
    Fetching: sensu-plugin-1.1.0.gem (100%)
    ERROR:  While executing gem ... (Gem::FilePermissionError)
        You don't have write permissions for the /opt/sensu/embedded/lib/ruby/gems/2.0.0 directory.
    vagrant@default-ubuntu-1404:~$ sudo /opt/sensu/embedded/bin/gem install sensu-plugin
    Successfully installed sensu-plugin-1.1.0
    Parsing documentation for sensu-plugin-1.1.0
    Installing ri documentation for sensu-plugin-1.1.0
    1 gem installed

Knife Did Not Create Any Data Bag

I want to create an offline cookbook. I want to create a user databag to use the users recipe. I ran

knife data bag create users

but it created nothing in the databag folder.

It turns out I need to run it in local mode and give it a user name:

knife data bag create users myuser -z

Resize Tmux Window

The size of the window is limited by the smallest size of attached client.

So to reset the size we need to detach all non-active clients

This is the command:

 C-b :attach -d

Tmux Resizing Pane

I want to increase a height of a pane in a tmux session. I tried ‘C-b C-’, but since my C- is binded to expose in OSX, it did not work.

Fortunately it is very easy to control the behavior via command line. First of all, you need to identify the pane. It can be done either by a ‘C-b q’ or by command tmux list-panes. The pane from which you issued the command will be marked as active.

Once the id of the pane is identified, you can run the following command:

   tmux resize-pane -t 1 -U    # 1 is the pane id 

Useful Vbox Command

This will list out all the VMs

    $ VBoxManage list vms
    "virtualbox_default_1418633437021_83822" {0342b0ad-d64c-4864-a0e2-c16235dc6ff2}
    "serverr" {eca868d2-6d5d-4b49-b076-27f5ef396355}
    "sensu_client" {70b38f62-0a0c-4965-b4f4-5360ec761d64}
    "analytics" {ab9e59e4-7058-4c9f-80af-c403348cac6f}
    "sensu-server_default_1424653555631_75219" {4d7174f7-6f7b-4732-98c3-9509c426cae3}
    "simple-sensu-client_default_1424660131045_1714" {1eb59ae6-2d5e-4b0f-9135-a7de6c882e1d}