Skip to content

Instantly share code, notes, and snippets.

View shiponcs's full-sized avatar
💻
Coding

Abdul Matin shiponcs

💻
Coding
View GitHub Profile
@shiponcs
shiponcs / compile.sh
Created May 6, 2022 16:16 — forked from zYeoman/compile.sh
Simple WebSocket server based on libwebsockets. For full description read http://martinsikora.com/libwebsockets-simple-websocket-server
gcc libwebsockets-websocket.c -L/usr/local/lib -lwebsockets
@shiponcs
shiponcs / test.c
Created July 31, 2021 05:49 — forked from sbernard31/test.c
UDP load balancer proto using bcc (XDP/Bpf)
#define KBUILD_MODNAME "foo"
#include <uapi/linux/bpf.h>
#include <linux/bpf.h>
#include <linux/icmp.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
@shiponcs
shiponcs / gist:5b1b6b2d697a0402200548c0fb030dc0
Created June 11, 2021 17:54 — forked from pazdera/gist:1098119
Singleton example in C++
/*
* Example of a singleton design pattern.
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,