Skip to content

Instantly share code, notes, and snippets.

View aerosayan's full-sized avatar
:octocat:
ASM/C/C++ to rule them all !

Sayan Bhattacharjee aerosayan

:octocat:
ASM/C/C++ to rule them all !
  • Previously working in - Sukra Helitek Inc.
  • Chennai, India
View GitHub Profile
@aerosayan
aerosayan / orthodoxc++.md
Created February 22, 2019 15:42 — forked from bkaradzic/orthodoxc++.md
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@aerosayan
aerosayan / README.md
Created September 1, 2019 13:41 — forked from csswizardry/README.md
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@aerosayan
aerosayan / 1-1000.txt
Created March 19, 2020 07:15 — forked from deekayen/1-1000.txt
1,000 most common US English words
the
of
to
and
a
in
is
it
you
that
@aerosayan
aerosayan / Eigen Cheat sheet
Created March 30, 2020 12:16 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
import re
import sys
urls=[]
try:
file_name=sys.argv[1]
replacement=sys.argv[2]
except:
print("[!] Enter urls file name")
@aerosayan
aerosayan / pickle-payload.py
Created October 20, 2020 12:39 — forked from mgeeky/pickle-payload.py
Python's Pickle Remote Code Execution payload template.
#!/usr/bin/python
#
# Pickle deserialization RCE payload.
# To be invoked with command to execute at it's first parameter.
# Otherwise, the default one will be used.
#
import cPickle
import sys
import base64
@aerosayan
aerosayan / latency.txt
Created January 18, 2022 16:02 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@aerosayan
aerosayan / rdtsc.c
Created January 20, 2022 01:27 — forked from savanovich/rdtsc.c
Using RDTSC instruction that returns CPU TSC (Time Stamp Counter)
/*
https://en.wikipedia.org/wiki/Time_Stamp_Counter
https://ru.wikipedia.org/wiki/Rdtsc
*/
#include <stdio.h>
typedef unsigned long long uint64;
int main() {
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <string.h>
#define streq(a, b) (!strcmp((a), (b)))
#ifndef __USE_GNU
#define __USE_GNU