Skip to content

Instantly share code, notes, and snippets.

View Mahedi-61's full-sized avatar
🕌
Oh Lord! Bestow me with Knowledge

Md Mahedi Hasan Mahedi-61

🕌
Oh Lord! Bestow me with Knowledge
  • West Virginia University
  • Morgantown, WV
View GitHub Profile
@Mahedi-61
Mahedi-61 / random_bit_generator.c
Created August 10, 2018 20:44
c code for random bit generator
#include <stdio.h>
#include <stdint.h>
#include <string.h>
//#include <stdlib.h>
int main(int argc, char* argv[])
{
uint32_t lfsr = 0xACE1ACE1u;
unsigned period = 0;
@Mahedi-61
Mahedi-61 / install_canon_printer.sh
Last active March 9, 2024 14:47
canon_LBP3300_printer_driver_installation_on_ubuntu_18.04
## This gist contains step by step instructions of installing canon LBP3300 printer driver on ubuntu 18.04 machine
## After a couple of months painful trying, i finally got it successfully installed on my 18.04 ubuntu machine.
## Here is the requirement
# 1) For 64 bit linux version install necessary the libraries
# 2) install the official CAPT drivers
# 3) register the printer with lpadmin
# 4) register the printer with the ccpd daemon
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// function for concatenation
char* concat(const char *s1, const char *s2)
{
char *result = malloc(strlen(s1) + strlen(s2) + 1); // +1 for the null-terminator
strcpy(result, s1);
@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 4, 2024 14:18
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@Mahedi-61
Mahedi-61 / ubuntu.sh
Last active January 19, 2020 20:14
steps require to install ubuntu 18.04 LTS from 16.04 LTS
## Upgrading ubuntu from 16.04LTS to 18.04LTS using command line
# first update previous version
sudo apt update && sudo apt upgrade && sudo apt dist-upgrade && sudo apt autoremove
# update manager core
sudo apt install update-manager-core
# make prompt=lts if not in following file
sudo nano /etc/update-manager/release-upgrades
@Mahedi-61
Mahedi-61 / latex_installation.sh
Last active July 4, 2018 16:08
this gist contains necessary steps for installing research work tools like LaTeX, R and other useful library.
### install latex for writing research paper
sudo apt-get update
sudo apt-get install texlive
# for extra (language) packages type following command instead of above
sudo apt-get install texlive-full
# Other useful packages (** optional)
# don't install if you have one or less space in disk
sudo apt-get install ibus
@Mahedi-61
Mahedi-61 / group_bar_plot.R
Last active December 29, 2018 11:16
creating group bar chart using r for research publication.
setEPS()
postscript("example.eps")
nm=c(98.45, 97.58, 98.75, 96.92, 99.41)
bag=c(56.23, 72.14, 72.73, 85.78, 87.10)
coat=c(16.93, 45.45, 41.50, 68.11, 55.13)
data=matrix(c(nm,bag,coat), ncol=3)
colnames(data)=c("normal", "bag", "coat")
rownames(data)=c("GEI+PCA", "SPAE", "GaitGAN", "PTSN", "Proposed")
@Mahedi-61
Mahedi-61 / linux_fun.sh
Last active April 8, 2018 14:47
this file contains linux command for fun. so let's install and enjoy :-)
### command: sl (Steam Locomotive) :-) :-)
sudo apt-get install sl
# This command works even when you type ‘LS‘ and not ‘ls‘.
#### CMatrix is a simple program that shows the cool matrix scrolling lines in the terminal.
sudo apt-get install cmatrix
# for running cmatrix type
#cmatrix
@Mahedi-61
Mahedi-61 / useful_unix_commands.sh
Last active January 19, 2020 20:15
some useful unix commands used most commonly.
#!/bin/bash
# This gist contains commands used in my everyday life
### compressing a file
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
# -c: create an archive.
# -z: compress the archive with gzip.
# -v: verbosity
# -f: allows you to specify the filename of the archive
@Mahedi-61
Mahedi-61 / ml_setup.sh
Last active August 25, 2022 21:36
setting python3 environment on linux machine for machine learning project
#!/bin/bash
# Instructions for installing necessary packages for running machine learning projects in Ubuntu machine
# first update and upgrade your system
sudo apt-get update
sudo apt-get install build-essential cmake g++ gfortran git pkg-config python-dev python3-tk software-properties-common wget
# install pip3 for working on python 3
sudo apt-get install python3-pip
pip3 install --upgrade pip