Skip to content

Instantly share code, notes, and snippets.

View nouredd2's full-sized avatar

Mohammad Noureddine nouredd2

View GitHub Profile
@nouredd2
nouredd2 / KernelBuildStarter.md
Last active September 6, 2018 21:36
A starter to building your first kernel

Introduction to Linux kernel building

The goal of this gist is to introduce you to building your first Linux kernel and installing it on an Ubuntu Linux virtual machine.

Prerequisites

We assume the presence of the following tools:

  1. Access to a Linux machine to build the kernel
    • On this machine, install the following packages (assuming it's an Ubuntu machine):

sudo apt install libncurses5-dev gcc make git exuberant-ctags bc libssl-dev

@nouredd2
nouredd2 / IntroXForwardingKvm.md
Last active August 3, 2023 19:40
Introduction to ssh X forwarding and kvm
@nouredd2
nouredd2 / tmux.conf
Created March 3, 2019 20:49
Default configuration for tmux (goes in ~/.tmux.conf)
set -g default-terminal "screen-256color"
set -g mode-keys vi
set-option -g default-shell /usr/local/bin/zsh
set -g prefix C-q
unbind C-a
bind C-q send-prefix
# vim splits like switching
bind h select-pane -L
@nouredd2
nouredd2 / macros.tex
Created April 26, 2019 00:21
General purpose macro definitions for my papers
\newcommand{\Sys}{\textsc{P4aig}\xspace}
\newcommand{\Fix}[1]{\textcolor{red}{[#1]}}
\newcommand{\pfour}{\texttt{P4}\xspace}
\newcommand{\CodeIn}[1]{{\small \texttt{#1}}}
\newcommand{\PP}[1]{\noindent {\bf #1}}
\newcommand{\ie}{i.e.,\xspace}
% for drawing the colored circles to mention the figure
@nouredd2
nouredd2 / cscopeCommands.md
Created October 24, 2019 17:14
Cscope configuration commands

To filter out all of the unrelated files, we can generate cscope.files using find as follows

find ./src ./include -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.c" \) -print > cscope.files

This will search for all .cpp, .h, and .c files in the src/ directory and dump them into a cscope.files files.

Next to gerenate the cscope database and referesh it, use

cscope -C -b -q -k
@nouredd2
nouredd2 / Makefile
Last active January 11, 2024 00:43
Generic makefile for latex project using latexmk
# "Improved" Makefile for LaTeX documents
# INTPUFILE This defines the name of the file you want to latex
# the make file will automatically look for INPUT.tex as the latex file
# check if main file name is in .latexmain, if not, ask for it and save it.
MAINFILE := $(shell if [ -f .latexmain ]; then cat .latexmain; else read -p "Enter main tex file name: " name; echo $$name > .latexmain; cat .latexmain; fi)
INPUTFILE := $(shell basename -s .tex $(MAINFILE))
OTHERFILES := $(shell find . -name '*.tex' -not -name $(MAINFILE))
LMK_FLAGS := -output-directory=./build/ -pdf -pdflatex="pdflatex -synctex=1"
@nouredd2
nouredd2 / c_cpp_properties.json
Last active October 4, 2024 11:17
Config options for using VSCode for kernel module development.
{
"configurations": [
{
"name": "Linux",
"browse": {
"path":[
"/usr/include",
"/usr/local/include",
"/usr/src/linux-headers-5.8.0-41-generic/include",
"/usr/src/linux-headers-5.8.0-41-generic/arch/x86/include/",
@nouredd2
nouredd2 / launch.json
Created December 13, 2021 16:41
[CSSE332] Launch configuration for the simple shell homework
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "simpleshell debug",
"type": "cppdbg",
"request": "launch",
@nouredd2
nouredd2 / generic_macros.tex
Created September 28, 2023 14:27
Generic LaTeX macros
\newcommand{\Fix}[1]{\textcolor{red}{[#1]}}
\newcommand{\CodeIn}[1]{{\small \texttt{#1}}}
\newcommand{\CI}[1]{\CodeIn{#1}}
\newcommand{\PP}[1]{\noindent {\bf #1}}
\newcommand{\ie}{i.e.,\xspace}
\newcommand{\eg}{e.g.,\xspace}
\newcommand{\latex}{\LaTeX\xspace}
@nouredd2
nouredd2 / header_script.sh
Last active October 11, 2023 12:35
Header for my bash scripts.
#!/usr/bin/env bash
# <script_name> v1.0
#
# <TODO: Add script description.>
#
# Author: Mohammad Noureddine <[email protected]>
# Late modified:
#