Yet another one DevOps blog

Ops and DevOps stories

Jun 14, 2019 - 1 minute read - Comments - announcement

Upgrade bash on mac os x

Intro

MacOS X has old 3.x bash. I found it’s very uncomfortable, as it doesn’t fit >4.x bash on most linux host. So you need to remember where do you want to run your scripts:

  • on linux with bash >4.x?
  • on mac os x with bash 3.x?

So - why not upgrade. I found comprehenisve article here: Upgrading Bash on macOS

And now:

$ bash --version
GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Much better.

Jun 10, 2019 - 1 minute read - Comments - announcement

Reopen DevOps blog

About reopening

  • After years of laziness, I want to reopen My DevOps blog.
  • Hugo static site generator + autobuilds with Travis CI on push to github repository.
  • Also new domain - verydevops.com

Nov 21, 2014 - 2 minute read - Comments - technical chef knife devops

Chef shortcuts

Add a recipe to the end of run list on certain environment

Test run, not actually add a recipe:

knife exec -E 'nodes.transform ("chef_environment:beta") {|n| puts n.run_list << "recipe[logentries_ng]" }'

Add a recipe for real:

knife exec -E 'nodes.transform ("chef_environment:beta") {|n| puts n.run_list << "recipe[logentries_ng]"; n.save }'

May 3, 2014 - 3 minute read - Comments - technical chef cookiecutter python template

Chef cookbook templating with cookiecutter

One of the challenges in chef cookbook development - create a comprehensive cookbook template.

Good cookbook template might:

  • standartize your cookbooks
  • fill them with convenient predefinitions
  • save your time.

If you are not python averse, you could find that cookiecutter pretty useful tool for creating your cookbooks templates. This article describes my experience in creating chef cookbook template with cookiecutter.

Apr 24, 2014 - 4 minute read - Comments - technical aws amazon chef devops ruby backup

Backup gem and Chef

Intro

  • There’s a nice tool for doing fast and easy backup to AWS S3: backup gem
  • There should be done a lot of steps for setup a backup though.
  • So it could be automated with chef.
  • In this article I’ll write log of creation backup gem’s cookbook.
  • Essentially this cookbook will install backup gem, that will backup /var/www folder to AWS S3 every day in 01:00. It will store last 14 backups.

Jan 25, 2014 - 1 minute read - Comments - technical git amazon ruby

Rewriting your email in git commits

Sometimes you need to rewrite your email in your commits in some git repository. Do it with command: git filter-branch --env-filter 'if [ $GIT_AUTHOR_EMAIL = bad@email ]; then GIT_AUTHOR_EMAIL=correct@email; fi; export GIT_AUTHOR_EMAIL' For your collaborators this operatioin might be dangerous. According to Jakub Narębski collaborators will need to: if they didn’t base their work on history pre-rewrite, just git reset --hard origin/master or just git pull origin (which should fast-forward).