Skip to content

Instantly share code, notes, and snippets.

View ahmed-masud's full-sized avatar

Ahmed Masud ahmed-masud

View GitHub Profile
UID,Delete-to-Create Ratio,Threat
1786,0.44,False
9759,0.92,True
4120,0.56,False
4230,0.3,False
3025,0.18,False
@ahmed-masud
ahmed-masud / logger.conf
Created January 11, 2023 15:03
example-log-file
# Resiliate 1.0
# Copyright (C) 2022 saf.ai, Inc.
#
# CEFS Loggin facility configuration manager for Resiliate
#
# See https://docs.saf.ai/ for more information.
#
# Introduction
# ============
# The logging facility provides a way to direct various levels of
@ahmed-masud
ahmed-masud / vite-plugin-rust-loader.js
Created July 16, 2022 04:33 — forked from antnn/vite-plugin-rust-loader.js
Simple vite (vitejs) plugin for building rust wasm module. With SSR and Sveltekit support
/**
* MIT License
* Anton Valishin 2021
* contains code parts from https://github.com/wasm-tool/rollup-plugin-rust
*
* usage:
*
* import init, {exported_func} from "$project/Cargo.toml"
* await init()
* exported_func()
@ahmed-masud
ahmed-masud / unfollow.js
Created March 17, 2022 20:35
twitter mass unfollow script
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
const $confirmButton = '[data-testid="confirmationSheetConfirm"]';
const retry = {
count: 0,
limit: 3,
};
const scrollToTheBottom = () => window.scrollTo(0, document.body.scrollHeight);
@ahmed-masud
ahmed-masud / foo.c
Last active August 25, 2021 23:35
updated char *p vs. char a[]
nt bad() {
char *p = "hello world";
p[5] = 'x'; // this line segfaults
puts(p);
}
void good() {
char a[] = "hello world";
a[5] = 'x'; // this line does not
puts(a);
@ahmed-masud
ahmed-masud / foo.c
Created August 25, 2021 23:12
Difference between char *p and char a[]
int main() {
char *p = "hello world";
char a[] = "hello world";
// p[5] = 'x'; this line segfaults
a[5] = 'x'; // this line does not
}
@ahmed-masud
ahmed-masud / tmux.conf
Last active December 9, 2021 16:09
tmux
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
@ahmed-masud
ahmed-masud / autodump.c
Created February 24, 2021 16:28
Self-Dumping C program
#include <unistd.h>
#define $ while
#define $$ strdup
#define f open
#define f_(x) x = $$(__FILE__)
#define uck sizeof(__FILE__)
#define fu(ck) do { char *_fu = ck; \
$(*_fu) putchar(*_fu++); } $(0)
#define fuc read
#define F typeof

Keybase proof

I hereby claim:

  • I am ahmed-masud on github.
  • I am ahmedmasud (https://keybase.io/ahmedmasud) on keybase.
  • I have a public key ASDqGQr39qsDaccb1Jc8-ot0JYQhkluFL4QBnYAG82EOigo

To claim this, I am signing this object:

@ahmed-masud
ahmed-masud / win_vm_kerneldbg.md
Created August 1, 2020 15:33 — forked from cji/win_vm_kerneldbg.md
Steps to successfully debug the Windows kernel between 2 VMWare VMs

Open the debugger VM's .vmx file. delete the existing serial0 lines (used for printing, not needed) add these lines:

serial0.present = "TRUE"
serial0.pipe.endPoint = "client"
serial0.fileType = "pipe"
serial0.yieldOnMsrRead = "TRUE"
serial0.tryNoRxLoss = "FALSE"
serial0.startConnected = "TRUE"