Skip to content

Instantly share code, notes, and snippets.

View r1990v's full-sized avatar
🎯
Focusing

Rahul Vats r1990v

🎯
Focusing
  • o9 Solutions
  • Bangalore, India
View GitHub Profile
@r1990v
r1990v / bash-cheatsheet.sh
Created August 11, 2021 11:03 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@r1990v
r1990v / .bash_profile
Created August 11, 2021 06:57
Nice ~/.bash_profile for Git.
#FILES
# /bin/bash
# The bash executable
# /etc/profile
# The systemwide initialization file, executed for login shells
# ~/.bash_profile
# The personal initialization file, executed for login shells
# ~/.bashrc
# The individual per-interactive-shell startup file
# ~/.bash_logout

Sync a Fork

Add a reference to the original repo

List the remote for your fork

$ git remote -v

Add a new remote "upstream" that will be synced with the fork

Basic merge conflict

Go to your local project and fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits will be stored in a local branch, remote_name/branch_name

$ git fetch <remote_name>

Check out the branch you want to merge into e.g. master

$ git checkout <base_branch>
@r1990v
r1990v / Update-branch.md
Created August 11, 2021 06:54 — forked from santisbon/Update-branch.md
Deploying from Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@r1990v
r1990v / Search my gists.md
Created August 11, 2021 06:52 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@r1990v
r1990v / ffmpeg_install.md
Created July 14, 2020 04:49 — forked from jmsaavedra/ffmpeg_install.md
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root
@r1990v
r1990v / psql_useful_stat_queries.sql
Created May 28, 2020 11:10 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)