Monday, April 3, 2017

Print full string in gdb

To print full string in gdb run the following in gdb

set print elements 0

Tuesday, May 31, 2016

Unix utilities

Rename all files which contain rc to deployment

ls * | sed -e 'p;s/rc/deployment/' | xargs -n2 mv

Monday, December 14, 2015

Deleting docker images based on condition or filter

I posted about deleting docker containers and deleting images.Sometimes we need to clean only some images based on a condition.

I am adding to commands to delete untagged images.You can grep on any value you like.

#Deleting untagged images
docker rmi $(docker images | grep none | awk '{print $3}')

Saturday, December 12, 2015

Difference between role and cookbook in chef

A role may be made up of one of more cookbooks whereas cookbook is a single entity made up of recipes.

So roles can be used to simplify run lists.
Instead of providing a run list with all the cookbooks a role can be provided.

{
 run_list : [
    "role[test]"
 ]
}

can be used instead of
{
 run_list : [
    "recipe[test1]",
    "recipe[test2]",
    "recipe[test3]"
 ]
}