Skip to content

Instantly share code, notes, and snippets.

View Subangkar's full-sized avatar
☺️
Beauty in the Chaos

Subangkar Karmaker Shanto Subangkar

☺️
Beauty in the Chaos
View GitHub Profile
@Subangkar
Subangkar / Binary-Search.asm
Last active May 20, 2022 03:25
8086-Assembly-Language Procedure for Binary Search
BIN_SEARCH PROC
;search in a sorted array by the binary search method
;input: SI = array offset address
; BX = number of elements
; CX = key
;output: SI = offset of sorted array
; AX = pos @where key has been found
;PUSH AX
PUSH BX
PUSH CX
@Subangkar
Subangkar / .gitignore
Last active August 21, 2019 10:16
Some Common global git ignore patterns
### https://www.gitignore.io/ ###
## git config --global core.excludesfile ~/.gitignore_global ##
# LaTeX
*.aux
*.synctex.gz
*.gz
*.log
*.toc
@Subangkar
Subangkar / CMakeList.txt for OpenGL
Created June 3, 2019 11:32
CMake configuration for running opengl project
cmake_minimum_required(VERSION 3.14)
project(ProjectName)
set(CMAKE_CXX_STANDARD 14)
include_directories(OpenGL)
include_directories(OpenGL/include) # OpenGL/include has to contain the required OpenGL's .h files
include_directories(OpenGL/lib) # OpenGL/lib has to contain the required OpenGL's .lib files
# glut32.dll must be present in "project-directory/OpenGL/dll/"
add_custom_target(glutdlllib
@Subangkar
Subangkar / Shell Scripts.sh
Last active October 5, 2020 15:41
Useful GNU Bash Scripts
# Common Contents of two text files -------------
diff -y -w --strip-trailing-cr -i --minimal --color=always file1 file2 | grep -n -v'' "[|<>]"
diff --ignore-blank-lines --ignore-space-change --ignore-trailing-space --ignore-case --minimal --strip-trailing-cr --unchanged-group-format='@@ %dn, %df
%<' --old-group-format='' --new-group-format='' --changed-group-format='' file1 file2
# -------------------------------------------
# CSV like parsing
sed 's/,,/, ,/g;s/,,/, ,/g' data.csv | column -s, -t
// for each loop
var a = ["a", "b", "c"];
a.forEach(function(entry) {
console.log(entry);
return true; // works like break
});
@Subangkar
Subangkar / Python-Snippets.py
Last active August 5, 2019 18:45
Useful python snippets like using shell, command line args
print("------")
@Subangkar
Subangkar / git-commands.sh
Last active May 16, 2020 13:08
Git basic commands to use it from terminal
# init git repo
git init
# start git ignore
touch .gitignore
# clone repo
git clone <remote-repo-link> <local-repo-folder-name>
# mount annonymous smb share
mount -t cifs //<your shareserver name or ip>/sharefolder -o username=guest,password="" /path_to_mountpoint
# access annonymous smb share
smbclient //host/share -U " "%" "
smbclient //host/share -U guest%
@Subangkar
Subangkar / .gitattributes
Created May 16, 2020 13:09
Common git attributes like ignore auto crlf etc.
# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto
# Never modify line endings of our bash scripts
*.sh -crlf
@Subangkar
Subangkar / linux-commands.sh
Last active December 25, 2021 09:04
Common Linux Commands for remote server machine
# Internet speed Test Check with speedtest-cli
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
# Show free RAM
free -h
vmstat
# Show CPU config
lscpu