Skip to content

Instantly share code, notes, and snippets.

View smalinux's full-sized avatar
🎯
FOCUS

Sohaib Mohamed smalinux

🎯
FOCUS
View GitHub Profile
@smalinux
smalinux / Makefile
Created April 22, 2020 04:21
Hello, world USB driver
# Set module name from the list:
program = sma_usb
# 'The list'
#----------
obj-m += sma_usb.o
# obj-m += sma_chardev.o
# obj-m += sma_skeleton.o
/*
* linux/fs/exec.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/*
* #!-checking implemented by tytso.
*/
/*
@smalinux
smalinux / timer.c
Created November 25, 2020 17:37 — forked from yagihiro/sample.c
timer sample on linux kernel
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
static void mykmod_timer_handler(unsigned long data);
static unsigned long onesec;
DEFINE_TIMER(mytimer, mykmod_timer_handler, 0, 0);
@smalinux
smalinux / x11.c
Last active December 15, 2020 07:49
My X11 simple window creation example.
// gcc x11.c -L/usr/X11R6/lib -lX11 -o x11
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
Display *d;
Window w;
XEvent e;
@smalinux
smalinux / gcp.rst
Last active December 27, 2020 17:19
Good C programmer

# Random notes for me to become a good C programmer

C89 (aka "Standard C", aka "ANSI C")

  • Pointers. This is critical. You can't do anything more than "hello world" type stuff in C if you don't get this.
  • Stop reading articles! No website is as good as a good book. [https://fabiensanglard.net/c/]
  • read this book: Expert C Programming
  • Write code every single day.
@smalinux
smalinux / 0001-mychar-hello-world-character-driver.patch
Last active January 18, 2021 17:35
Embox hacking - 101 tutorial
From 39991fa0f75e7e6302f17e4882ff2d2a18f36cae Mon Sep 17 00:00:00 2001
From: Sohaib Mohammed <sohaib.amhmd@gmail.com>
Date: Sat, 16 Jan 2021 06:48:31 +0200
Subject: [PATCH 1/1] mychar - hello world character device
---
src/kernel/Mybuild | 7 +++++++
src/kernel/mychar.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 src/kernel/mychar.c
https://github.com/kraten/chessbot
https://github.com/LouisAsanaka/PyChessBot
https://github.com/Panc4kes/chess.com-bot
https://github.com/kochsebastian/ChessVisionBot
https://github.com/taiypeo/ChessBot
https://github.com/edfrue/chess_cheat
https://github.com/Stanou01260/chessbot_python
https://github.com/GabrieleMaurina/chess-cheat
https://github.com/Akenne/Chess-Bot
# GUI.py
# RUN THIS FILE
import pygame
from solver import solve, valid
import time
pygame.font.init()
class Grid:
# To change the starting board change this
@smalinux
smalinux / stackoverflow
Created September 4, 2021 06:26
C programmers
https://stackoverflow.com/users/379897