Skip to content

Instantly share code, notes, and snippets.

View niranjan-nagaraju's full-sized avatar

Niranjan Nagaraju niranjan-nagaraju

View GitHub Profile
@niranjan-nagaraju
niranjan-nagaraju / A better implementation of bead-sort.md
Last active December 31, 2019 06:09
A better implementation of bead-sort

A better implementation of bead-sort

Introduction

Bead sort (a.k.a Abacus sort, or Gravity sort) is a sorting algorithm that can sort a list of positive integers.
Belonging to a class of natural algorithms, It uses (/simulates) gravity to sort an input list.
The sort algorithm accomplishes this in three acts —

Git cheatsheet

git config (~/.gitconfig)

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global core.editor emacs
$ git config --global merge.tool vimdiff
@niranjan-nagaraju
niranjan-nagaraju / tcpdump_tcpreplay.org
Last active October 26, 2023 10:15
TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

TCPReplay/TCPRewrite/TCPPrep/TCPDump Cheatsheet

tcprewrite

Rewrite IP/Mac addresses, -C optionally to fix checksums

  1. tcpprep, first:C2S, Second S2C, Generate cache file
        
;; emacsd-tile.el -- tiling windows for emacs
(defun swap-with (dir)
(interactive)
(let ((other-window (windmove-find-other-window dir)))
(when other-window
(let* ((this-window (selected-window))
(this-buffer (window-buffer this-window))
(other-buffer (window-buffer other-window))
(this-start (window-start this-window))