Skip to content

Instantly share code, notes, and snippets.

Avatar

Shanto Roy shantoroy

View GitHub Profile
View autoviz_visualization.py
# Helps Visualizing overall summary of all features in a dataset
# !pip install numpy
# !pip install pandas
# !pip install autoviz
# !pip install xlrd
# !pip install xgboost
from autoviz.AutoViz_Class import AutoViz_Class
AV = AutoViz_Class()
View feature_selection_template.py
# Modified from source: https://machinelearningmastery.com/feature-selection-machine-learning-python/
# Feature Selection with Univariate Statistical Tests
from pandas import read_csv
from numpy import set_printoptions
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import f_classif
from sklearn.feature_selection import chi2
View ML_classification_template.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import classification_report, confusion_matrix
import joblib
import os
def preprocess(dataset, x_iloc_list, y_iloc, testSize):
View bin-sh-using-mprotect.c
// source: https://stackoverflow.com/questions/43849847/executing-shellcode-in-shared-memory-with-mmap
#include <string.h>
#include <sys/mman.h>
// /bin/sh shellcode
const char shellcode[] = "\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x03\xa0\x52\x40\xc2\x71\x05\xb4\x69\x46\x0b\x27\x01\xdf\x2d\x1c\x2f\x62\x69\x6e\x2f\x73\x68\x58";
int main(int argc, char **argv)
{
View function_pointer.c
// Function Pointer
#include <stdio.h>
int sum(int a, int b)
{
return a+b;
}
void hello_name(char *name)
View post_details.py
import json
class PostDetais(object):
def __init__(self, soup, link=None):
self.page_soup = soup
self.link = link
def get_title(self):
class_names = ['graf graf--h3 graf-after--figure graf--title',
View stack_overflow_test_program.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void IShouldNeverBeCalled() {
puts("I should never be called");
exit(0);
}
void vulnerable(char *arg) {