Skip to content

Instantly share code, notes, and snippets.

View 3N4N's full-sized avatar

Enan Ajmain 3N4N

View GitHub Profile
cd ~/projects/vim/src
./configure --prefix=$HOME/.local --with-compiledby="Enan Ajmain<[email protected]>" \
--disable-gui --without-x --disable-arabic --disable-rightleft --disable-terminal --disable-netbeans
make CC=cc CFLAGS="-O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1"
make install
@3N4N
3N4N / what.py
Last active December 13, 2022 08:00
Print curly-brace-enclosed structures (C, Rust) from files in directories
import os
import re
files = []
dirlist = ['src']
while len(dirlist) > 0:
for (dirpath, dirnames, filenames) in os.walk(dirlist.pop()):
dirlist.extend(dirnames)
files.extend(map(lambda n: os.path.join(*n),
import numpy as np
from tensorflow.keras.datasets import mnist
from tqdm.auto import tqdm
(x_train, y_train), (x_test, y_test) = mnist.load_data()
### IMPORTANT: RUN THIS CELL ONLY ONCE !!! ###
# add dimension to images
x_train = np.expand_dims(x_train, axis=1)
#!/bin/env bash
USRBINDIR="$HOME/.local/bin"
USRMANDIR="$HOME/.local/share/man/man1"
mkdir -p "$USRBINDIR" "$USRMANDIR"
apt_pkgs="python3 python3-pip steghide valgrind build-essential netcat-traditional nmap dirb wabt hashcat"
sudo apt install -y $apt_pkgs
#ifndef _GLUT_SHAPES_H_
#define _GLUT_SHAPES_H_
#include <GL/glut.h>
#include<math.h>
#define pi (2*acos(0.0))
void drawAxes(int drawaxes);
void drawSquare(double a);
@3N4N
3N4N / add-zoom-meeting.sh
Last active December 24, 2020 09:38
Schedule Linux desktop to automatically join a Zoom meeting
#!/bin/env bash
# TODO:
# [ ] sanity check for the zoom link.
# [x] check if the meeting is already scheduled.
MINS=$1
HOUR=$2
DATE=$3
MNTH=$4
com! -bar -range=% RemoveTabs call s:remove_tabs(<line1>,<line2>)
fu! s:remove_tabs(line1, line2) abort
let view = winsaveview()
let mods = 'sil keepj keepp'
let range = a:line1 . ',' . a:line2
let pat = '\%(^\s*\)\@!\&\(.\)\t'
let l:Rep = {-> submatch(1) . repeat(' ', strdisplaywidth("\t", col('.') == 1 ? 0 : virtcol('.') ))}
let g = 0
while search("\t", 'n') && g < 999
exe mods . ' ' . range .'s/' . pat . '/\=l:Rep()/ge'
@3N4N
3N4N / xorg.conf
Last active September 26, 2018 12:39
put it in /etc/X11/xorg.conf to work with xbacklight properly
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "Backlight" "intel_backlight"
EndSection
# Author: Enan Ajmain
# Email : [email protected]
# Github: https://github.com/enanajmain
import os
arr = os.listdir(".")
vdo=[]
sub=[]
Host Name IP Address MAC Address
Host A 10.9.0.5 02:42:0a:09:00:05
Host B 10.9.0.5 02:42:0a:09:00:06
Host M 10.9.0.105 02:42:0a:09:00:69