Skip to content

Instantly share code, notes, and snippets.

View 3N4N's full-sized avatar

Enan Ajmain 3N4N

View GitHub Profile

Login

There are two ways to use hestia: 1) through remotelab web, 2) through SSH. The benefit of Remotelab is that you can open GUI applications in it, which you cannot do in SSH sessions (you can, but it works poorly). But SSH does not require a web browser. So depending on what you need, you can choose either.

  1. RemoteLab
  • Click on "Research (wup)"
@3N4N
3N4N / build_vim.sh
Last active November 21, 2024 23:00
cd ~/projects/vim/src
./configure --prefix=$HOME/.local --with-compiledby="Enan Ajmain<3nan.ajmain@gmail.com>" \
--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 : 3nan.ajmain@gmail.com
# Github: https://github.com/enanajmain
import os
arr = os.listdir(".")
vdo=[]
sub=[]