Skip to content

Instantly share code, notes, and snippets.

View r1walz's full-sized avatar
:electron:
Building Something BIG

Rohit Ashiwal r1walz

:electron:
Building Something BIG
View GitHub Profile
@r1walz
r1walz / gdb.txt
Created March 17, 2019 14:23
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@r1walz
r1walz / my_gzip.c
Last active February 14, 2019 21:29
file that can compress any string using zlib compression library
#include "zlib.h"
#include <stdio.h>
#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# ifdef UNDER_CE
# include <stdlib.h>
# endif
# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
@r1walz
r1walz / FORK.md
Last active November 5, 2018 21:07
Snippet used to explain the fork.c code in unix fork lecture

My understanding of fork/buffer

The code that I will explain is available here.

Concept

Everything is copied (on write) to child on forking, hence, every process will have a different buffer! (but contents will be same as parent initially).

Explanation

@r1walz
r1walz / manjaro-avell-g1513.md
Created October 17, 2018 20:04 — forked from mauri870/manjaro-avell-g1513.md
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
@r1walz
r1walz / manjaro.rsa
Last active October 18, 2018 07:53
My laptop RSA public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQEHEU/rs2Tp1UL1li6VLXgPmg+8G2TIsTEZdrMobZ7zApbNi5QPint+jf7iK10JeiwucXY8i5qAQ4S3AzEDOqhTod0xmuuyj1Jb9zkQLMCRfPNQdR+inQdMQ6imWUYb5X1gb1M0QMLyrfjmBtQ1duSelUflY8hfxUeFwG9L8BixxhcCSO6Vg8p0p71vnnkuN+DsNxEOUEtllmp1aSLn43TLAk7yKplIGk86Kx8hS0TFSbM0xPi8mORooV/uY5mC7B4/6NaVWL6oAxPK8KB9BCl8jBB5S3h+QCw/HTfpKpFDnPe/DtTLPvTqWYD/hH6gK/h86UWs+AUQlQxDE3O9TB r1walz@ar135
@r1walz
r1walz / mdg-ubuntu.rsa
Created September 28, 2018 08:42
My Ubuntu RSA public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrdklNFDbntJQTLGeEQ5IT5c290MNgbuAV8qr3oCd12Yvo16NK9WeBHOX33B+8wNsFHIbLc32BvQyeZcdhzazl9vg4FsxlwjNopgdGhKfZxQ2s3+ix+6u/eHFwtlgeaJC8n4dNl5Vz0ns+Ax9D5I9WWPQV/hccPg2Ft1LA1Jejy7htjv39hXY5Nuk9epiVjl/NLvdiATo0rBZ5RzVO65C7EiDqteOpV80D7s1mJrcRWRODQbPV/J/ji7irRs4HlG0v9JikhFXeWKE4kXIz5q6bM/evHMcfCu9Y291LUU1kY8UKgNyC7ORyeu9EskjGeQLwgoJYPhsO3tlqrKmZyDQ3 rohit@mdg-ubuntu
@r1walz
r1walz / mdg-imac.rsa
Last active September 28, 2018 08:41
My iMac RSA public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLcpMivEpgIOI6VF0jUWh+xnZnhWj+vJuDyF59vvyVtf1FELFnF7JD0gtHQAmM1unUdRfOvog+kVZTk+89zEy5KODBkvYgfHhVkdSlGZAiIZOTL3G6IUkMcEooSjQ8muotPZ90e11tNJa9ZbEFss7B4eQwRZQrWRkAD8V9R/CRYGH3TygNmw82LoOh9plMGiIk31d+ZLL1Fqe18cIcu/VQz2xI+CQ/u5RXsgOf5gKsWgUZsZ++2wv4YtOILT/xxROyHSSQX6UFyPMVmlWz5lDIvIMxu9o+hZbjjibeB8be0A0sX24Wh4YhB9eRdmUv5x4eVGa6k1cdbdqtCA8B4cC5 r1walz@MDGs-iMac
@r1walz
r1walz / .tmux.conf
Created August 24, 2018 18:16
configuration file for tmux
# remap prefix from 'C-b' to 'C-Space'
unbind C-b
set-option -g prefix C-Space
bind-key C-Space send-prefix
set -g default-terminal "screen-256color"
# split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
@r1walz
r1walz / .vimrc
Last active October 11, 2019 21:06
configuration file for vim
set background=dark
syntax enable
set mouse=n
set number
set wildmenu
set ruler
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set smartcase
@r1walz
r1walz / .bashrc
Last active October 5, 2018 09:46
configuration file for bash
#
# ~/.bashrc
#
[[ $- != *i* ]] && return
colors() {
local fgc bgc vals seq0
printf "Color escapes are %s\n" '\e[${value};...;${value}m'