Skip to content

Instantly share code, notes, and snippets.

@ravibhure
ravibhure / git_squash_commits.md
Last active Sep 1, 2020
How to squash commits
View git_squash_commits.md

To squash commits, you can do the following:

Make sure your branch is up to date with the master branch.

Run git rebase -i master.

You should see a list of commits, each commit starting with the word "pick".

Make sure the first commit says "pick" and change the rest from "pick" to "squash". -- This will squash each commit into the previous commit, which will continue until every commit is squashed into the first commit.

View service-errors.md
$ sudo journalctl --no-pager -b -u docker.service
Jul 01 11:09:43 ravi-ThinkPad-X240 dockerd[28098]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [fd://], from file: [unix:///var/run/docker.sock])
Jul 01 11:09:43 ravi-ThinkPad-X240 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 01 11:09:43 ravi-ThinkPad-X240 systemd[1]: Failed to start Docker Application Container Engine.
Jul 01 11:09:43 ravi-ThinkPad-X240 systemd[1]: docker.service: Unit entered failed state.
Jul 01 11:09:43 ravi-ThinkPad-X240 systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 01 11:09:45 ravi-ThinkPad-X240 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 01 11:09:45 ravi-ThinkPad-X240 systemd[1]: Stopped Docker Application Container Engine.
Jul 01 11:09:45 ravi-ThinkPad-X240 systemd[1]: docker.service: Start request repeated too
@ravibhure
ravibhure / AUTO_REGISTER_NAGIOS.md
Created Jun 27, 2020
How to use Nagios to monitor services running under AWS auto scaling group (ASG)
View AUTO_REGISTER_NAGIOS.md

How to use Nagios to monitor services running under AWS auto scaling group (ASG)

What is expected from reader

The reader is expected to have basic knowledge about below technologies/concepts.

  • Nagios Core
  • AWS Auto Scaling Group (ASG)
  • PHP REST API
  • DevOps
@ravibhure
ravibhure / Jenkinsfile
Created Jun 18, 2020 — forked from richid/Jenkinsfile
Jenksfile declarative pipeline with parallel dynamic stages
View Jenkinsfile
def applications = env.APPLICATIONS.split(",").findAll { it }.collect { it.trim() }
def environment = env.ENVIRONMENT
def version = env.VERSION
def jobs = [:]
if (applications.size() < 1) {
error("ERROR: APPLICATIONS must be a comma-delimited list of applications to build")
}
for (int i = 0; i < applications.size(); i++) {
View keybase.md

Keybase proof

I hereby claim:

  • I am ravibhure on github.
  • I am ravibhure (https://keybase.io/ravibhure) on keybase.
  • I have a public key ASCE8Vdzk4uezYOmUnvJJQwTjJfbQqvOYl6Eze2GFI4hZAo

To claim this, I am signing this object:

@ravibhure
ravibhure / coronavirus.py
Created Mar 13, 2020
A python program to check the risk of the corona virus
View coronavirus.py
#!/usr/bin/python3
# A python program to check the risk of the corona virus.
# This is not written by me, but found somewhere on social media
# Thanks to UNKNOWN coder :)
name = input('name: ')
age = int(input('age: '))
print('\ndo you have any of these symptomps?')
fever = int(input('fever (0= no, 1= yes): '))
cough = int(input('cough (0= no, 1= yes): '))
sob = int(input('shortness of breath (0= no, 1= yes): '))
@ravibhure
ravibhure / whois.conf
Created Nov 27, 2019 — forked from thde/whois.conf
/etc/whois.conf WHOIS records for nTLDs.
View whois.conf
##
# WHOIS servers for new TLDs (http://www.iana.org/domains/root/db)
# Current as of 2017-12-10 UTC
##
\.aarp$ whois.nic.aarp
\.abarth$ whois.afilias-srs.net
\.abbott$ whois.afilias-srs.net
\.abbvie$ whois.afilias-srs.net
\.abc$ whois.nic.abc
View extra_vars.yml
---
c1_packages:
- c1-templates-bundle
- c1-cre-api
@ravibhure
ravibhure / ca.md
Created Aug 9, 2018 — forked from soarez/ca.md
How to setup your own CA with OpenSSL
View ca.md

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ravibhure
ravibhure / jenkins-home-git.sh
Created Mar 22, 2018 — forked from cenkalti/jenkins-home-git.sh
Backup Jenkins home periodicallly with git.
View jenkins-home-git.sh
#!/bin/bash
# Setup
#
# - Create a new Jenkins Job
# - Mark "None" for Source Control Management
# - Select the "Build Periodically" build trigger
# - configure to run as frequently as you like
# - Add a new "Execute Shell" build step
# - Paste the contents of this file as the command