Skip to content

Instantly share code, notes, and snippets.

View abhirup-dev's full-sized avatar
💭
I love Open Source and AI!

Abhirup Das abhirup-dev

💭
I love Open Source and AI!
  • AML Platform @ ShareChat
  • Kolkata
View GitHub Profile
@abhirup-dev
abhirup-dev / tmux.conf
Last active March 2, 2021 17:25 — forked from rajanand02/tmux.conf
Tmux configurations with status bar theme
unbind C-b
set -g prefix C-z
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind '"'
unbind %
@abhirup-dev
abhirup-dev / .tmux
Created September 1, 2020 03:22
Quick SSH tmux config
unbind C-b
set -g prefix C-z
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind '"'
unbind %
@abhirup-dev
abhirup-dev / gist:1195ea793c42af4bce344dd88809f0ab
Created July 7, 2020 02:54 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
# fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort)
fshow() {
local out shas sha q k
while out=$(
git log --graph --color=always \
--format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" |
fzf --ansi --multi --no-sort --reverse --query="$q" \
--print-query --expect=ctrl-d --toggle-sort=\`); do
q=$(head -1 <<< "$out")
k=$(head -2 <<< "$out" | tail -1)
@abhirup-dev
abhirup-dev / wsl2-hosts-sync.ps1
Created June 26, 2020 04:03 — forked from MichaelBelgium/wsl2-hosts-sync.ps1
WSL v2 windows hosts sync (powershell - updates domains to wsl2 ip)
# Requires -RunAsAdministrator
# Only works for WSL v2, this is completely not needed for WSL v1 where u always can use 127.0.0.1 in hosts file
Clear-Host
if ((Get-InstalledModule "Carbon" -ErrorAction SilentlyContinue) -eq $null) {
Install-Module -Name 'Carbon' -AllowClobber
}
Import-Module 'Carbon'
@abhirup-dev
abhirup-dev / caps-escape-swap-editors-only.ahk
Created May 21, 2020 08:55
AutoHotkey script to swap Capslock and Escape
SetTitleMatchMode 2
#IfWinActive emacs
Capslock::Esc
Esc::CapsLock
#IfWinActive
#IfWinActive GVIM
Capslock::Esc
Esc::CapsLock
#IfWinActive
# Theming: https://www.hanselman.com/blog/HowToMakeAPrettyPromptInWindowsTerminalWithPowerlineNerdFontsCascadiaCodeWSLAndOhmyposh.aspx
# https://github.com/dahlbyk/posh-git
# Import-Module posh-git
# Import-Module oh-my-posh
Set-Theme Agnoster
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
@abhirup-dev
abhirup-dev / .emacs
Last active July 11, 2020 04:01
.emacs for windows
;;https://medium.com/@suvratapte/configuring-emacs-from-scratch-use-package-c30382297877
(set-language-environment "UTF-8")
(require 'package)
(package-initialize)
(setq package-enable-at-startup nil)
;;(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
;; (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
;; (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
@abhirup-dev
abhirup-dev / getplot.sh
Last active January 23, 2020 10:04
Gnuplot files/scripts to capture and plot linux system metrics in real-time
#!/bin/bash
gnuplot -e "fname='$1'" liveplot.gnu
# Reconstructed via infocmp from file: /lib/terminfo/s/screen
screen|VT 100/ANSI X3.64 virtual terminal,
am, km, mir, msgr, xenl,
colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=\r,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
@abhirup-dev
abhirup-dev / export-toby.js
Created November 17, 2019 08:24 — forked from krishpop/export-toby.js
Export Toby
// code courtesy of Toby team
chrome.storage.local.get("state", o => (
((f, t) => {
let e = document.createElement("a");
e.setAttribute("href", `data:text/plain;charset=utf-8,${encodeURIComponent(t)}`);
e.setAttribute("download", f);
e.click();
})(`TobyBackup${Date.now()}.json`, o.state)
));