Skip to content

Instantly share code, notes, and snippets.

@VimleshS
VimleshS / patterns-of-enterprise-application-architecture.md
Created July 25, 2018 06:17 — forked from paulstatezny/patterns-of-enterprise-application-architecture.md
Notes from Patterns of Enterprise Application Architecture by Martin Fowler

Patterns of Enterprise Application Architecture

By Martin Fowler (2002)

Chapter 1: Layering

A basic example of layering: FTP < TCP < IP < Ethernet

Benefis of layering:

  • You can understand a layer without knowing much about the others.
  • Minimize dependencies.
@VimleshS
VimleshS / ruby_cert.rb
Created August 30, 2016 09:35
Usage examples of ruby’s openssl lib
#Reference
#https://devnotcorp.wordpress.com/2012/08/21/usage-examples-of-rubys-openssl-lib/
#!/usr/bin/ruby
require 'openssl'
require 'date'
require 'time'
Recording Rule Example 1
================================
# Aggregating up requests per second that has a path label:
- record: instance_path:requests:rate5m
expr: rate(requests_total{job="myjob"}[5m])
- record: path:requests:rate5m
expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"})
Recording Rule Example 2
@VimleshS
VimleshS / jq-insert-var.sh
Created January 20, 2022 08:20 — forked from joar/jq-insert-var.sh
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@VimleshS
VimleshS / git-rebase.markdown
Created January 28, 2016 09:00 — forked from tmcgilchrist/git-rebase.markdown
Git rebase workflow

Checkout a new working branch

 git checkout -b <branchname>

Make Changes

 git add
 git commit -m "description of changes"

Sync with remote

@VimleshS
VimleshS / ansible-summary.md
Created August 28, 2020 07:33 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@VimleshS
VimleshS / jenkins-rails-ec2
Created April 11, 2016 07:27
Jenkins setup for Rails on EC2
Based on these:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
http://www.intridea.com/blog/2013/5/21/howto-install-setup-jenkins-ci-for-rails-projects
Setup an EC2 instance with Ubuntu (14.04)
Open port 8080
Install Jenkins
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
@VimleshS
VimleshS / Golang program stdin stdout interaction.md
Created January 28, 2019 07:18 — forked from jamesrr39/Golang program stdin stdout interaction.md
Using stdout and stdin from other programs in Golang

Go program interaction

Example of how to use stdout and stdin from other programs in golang

Requires go

Run

go run parentprocess.go
@VimleshS
VimleshS / cols.txt
Created January 16, 2019 12:46 — forked from 0/cols.txt
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99