Skip to content

Instantly share code, notes, and snippets.

View pariekshit's full-sized avatar
🎯
Focusing on golang

Pariekshit pariekshit

🎯
Focusing on golang
View GitHub Profile
@pariekshit
pariekshit / tcp_flags.txt
Created January 26, 2022 05:21 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@pariekshit
pariekshit / redis_key_sizes.sh
Created September 17, 2020 20:44 — forked from epicserve/redis_key_sizes.sh
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@pariekshit
pariekshit / cka-bookmarks.html
Created August 31, 2020 14:55
cka-bookmarks
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1579618265" LAST_MODIFIED="1582022136" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
@pariekshit
pariekshit / PYTHON_TRACEBACK.md
Created March 20, 2019 15:52
Retrieve the last python traceback
>>> import sys
>>> import traceback
>>> 
>>> def _get_traceback():
...     exc_type, exc_value, exc_traceback = sys.exc_info()
...     return traceback.format_exception(exc_type, exc_value, exc_traceback)
... 
>>> try:
... raise Exception("this is an exception")
@pariekshit
pariekshit / ci_jobs.groovy
Created October 13, 2018 01:17 — forked from tknerr/ci_jobs.groovy
JobDSL example for setting up master / release branch builds + PR builds via bitbucket-branch-source-plugin (using the generated JobDSL)
// define the bitbucket project + repos we want to build
def bitbucket_project = 'awesome'
def bitbucket_repos = ['foo','bar','baz']
// create a pipeline job for each of the repos and for each feature branch.
for (bitbucket_repo in bitbucket_repos)
{
multibranchPipelineJob("${bitbucket_repo}-ci") {
// configure the branch / PR sources
branchSources {
@pariekshit
pariekshit / config.yml
Created March 15, 2018 01:57 — forked from briantjacobs/config.yml
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@pariekshit
pariekshit / gist:b1a506c36e9a306fe657d612ee8a204c
Created January 3, 2017 04:20 — forked from sebsto/gist:19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version