Skip to content

Instantly share code, notes, and snippets.

View anilyadav's full-sized avatar

Anil Yadav anilyadav

  • Banglore
View GitHub Profile

Tcpdump

Tcpdump is a commandline tool that is used to dump traffic on a network. This tool comes in hand when you want to analyse network captures within the command line. Basically it can do most of the wireshark job.

NOTE This guide might not be complete it just serve as a reference to me.

Additional Note & Reference

@anilyadav
anilyadav / restore_node_from_opscenter_backups.ini
Created February 22, 2019 16:04 — forked from ibspoof/restore_node_from_opscenter_backups.ini
Restore a single nodes SSTables from OpsCenters S3 Backup Location using multi-threaded downloads
[s3]
#s3 bucket name
bucket_name = my_backups
download_threads = 6
# other s3 access is defined in the default aws cli settings file
[opscenter]
backup_job_uuid = # get this from s3 bucket
[node]
@anilyadav
anilyadav / 11-cassandra-filter.conf
Created February 22, 2019 16:03 — forked from ibspoof/11-cassandra-filter.conf
Grok Patterns and configuration for Cassandra logs
filter {
if [type] == "cassandralog" {
grok {
break_on_match => true
match => {
"message" => [
"%{CASS_COMPACTION_LARGE_KEY}",
"%{CASS_SLAB_POOL_CLEANER_1}",
"%{CASS_SLAB_POOL_CLEANER_2}",
@anilyadav
anilyadav / sql-mongo_comparison.md
Created October 31, 2018 18:02 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

#!/bin/bash -e
mkdir report
rpm -qa > ./report/rpm.txt
journalctl -b > ./report/journalctl.txt
df -k > ./report/df.txt
netstat > ./report/netstat.txt
sar -P ALL > ./report/sar.txt
iostat -d 1 10 > ./report/iostat.txt
@anilyadav
anilyadav / sed-cheatsheet.md
Created September 2, 2017 20:34 — forked from sergeyklay/sed-cheatsheet.md
Sed Cheatsheet

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
@anilyadav
anilyadav / sed cheatsheet
Created September 2, 2017 20:32 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@anilyadav
anilyadav / postgres_queries_and_commands.sql
Created May 23, 2017 11:34 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@anilyadav
anilyadav / elasticsearch-cheatsheet.txt
Created May 18, 2017 19:39 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# cat paths
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{index}
@anilyadav
anilyadav / logstash-mysql-query-parse.md
Created May 17, 2017 08:10 — forked from jordansissel/logstash-mysql-query-parse.md
parsing mysql's bullshit query log format with logstash

parsing mysql query logs with logstash

The problem is that some lines in the file are missing timestamps when they aren't continuations of any previous line. It's dumb, really.

The mysql query log is seriously bullshit format, but nothing logstash can't unscrew.

The main goal here is to show how we can fix the 'missing timestamp' problem.

% ruby bin/logstash agent -e '