Skip to content

Instantly share code, notes, and snippets.

View haithemsekri's full-sized avatar

Haithem Sekri haithemsekri

View GitHub Profile
@haithemsekri
haithemsekri / docker.md
Created July 14, 2024 19:03 — forked from FreddieOliveira/docker.md
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@haithemsekri
haithemsekri / latest-protobuf-ubuntu-18-04.md
Created August 9, 2023 10:42 — forked from diegopacheco/latest-protobuf-ubuntu-18-04.md
How to Install Latest Protobuf on Ubuntu 18.04
sudo apt-get install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
make
make check
sudo make install
sudo ldconfig
@haithemsekri
haithemsekri / snort_user_setup.sh
Created March 4, 2023 16:57 — forked from maravedi/snort_user_setup.sh
Snort3 User Setup Script
# This is a continuation of the scripting of the installation of Snort3 from the setup guide for Ubuntu 16:
# https://s3.amazonaws.com/snort-org-site/production/document_files/files/000/000/123/original/Snort_3.0.0-a4-223_on_Ubuntu_14_and_16.pdf
#
# This script should be run AFTER the snort_postinstall_setup.sh script here: https://gist.github.com/maravedi/b82ad1d071ab46a5b72b6f507f8437c5
#
# How to run this script:
# sudo sh snort_user_setup.sh
egrep -i "^snort:" /etc/group;
if [ $? -eq 0 ]; then
echo "group exists: snort"
@haithemsekri
haithemsekri / snort_postinstall_setup.sh
Created March 4, 2023 16:55 — forked from maravedi/snort_postinstall_setup.sh
Snort3 Post-Install Setup Script
# This is a continuation of the scripting of the installation of Snort3 from the setup guide for Ubuntu 16:
# https://s3.amazonaws.com/snort-org-site/production/document_files/files/000/000/123/original/Snort_3.0.0-a4-223_on_Ubuntu_14_and_16.pdf
#
# This script should be run AFTER the snort_install.sh script here: https://gist.github.com/maravedi/9185595d3e5779ee45a9cc5bfb8c51cd
#
# How to run this script:
# sudo sh snort_postinstall_setup.sh
if ! grep -q "LUA_PATH" /home/$(logname)/.bashrc ;
then
@haithemsekri
haithemsekri / snort_install.sh
Created March 4, 2023 16:51 — forked from maravedi/snort_install.sh
Install script for Snort3
# I scripted out the installation commands from the Snort setup guide for Ubuntu 16:
# https://s3.amazonaws.com/snort-org-site/production/document_files/files/000/000/123/original/Snort_3.0.0-a4-223_on_Ubuntu_14_and_16.pdf
#
# This script will install all the prerequisites for Snort, including Snort itself.
# As time passes, it may be necessary to update the download URLs for Libsafe, Ragel, Hyperscan, DAQ, and Snort. As those are hard-coded URLs based on their versions
#
# How to run the script:
# sudo sh snort_install.sh
logfile=~/snort_install.log
@haithemsekri
haithemsekri / tcpKeepAlive.c
Created February 12, 2023 11:43 — forked from fffaraz/tcpKeepAlive.c
SO_KEEPALIVE
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
int enableKeepAlive = 1;
int fd = tcpSocket->socketDescriptor();
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &enableKeepAlive, sizeof(enableKeepAlive));
int maxIdle = 300;
setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &maxIdle, sizeof(maxIdle));
@haithemsekri
haithemsekri / dns.c
Created February 12, 2023 11:42 — forked from fffaraz/dns.c
DNS Query Code in C with linux sockets
//DNS Query Program on Linux
//Author : Silver Moon (m00n.silv3r@gmail.com)
//Dated : 29/4/2009
//Header Files
#include<stdio.h> //printf
#include<string.h> //strlen
#include<stdlib.h> //malloc
#include<sys/socket.h> //you know what this is for
#include<arpa/inet.h> //inet_addr , inet_ntoa , ntohs etc
@haithemsekri
haithemsekri / lsniffer.c
Created February 12, 2023 11:42 — forked from fffaraz/lsniffer.c
Packet Sniffer Code in C using Linux Sockets | http://www.binarytides.com/packet-sniffer-code-c-linux/
/*
Packet sniffer using libpcap library
*/
#include<pcap.h>
#include<stdio.h>
#include<stdlib.h> // for exit()
#include<string.h> //for memset
#include<sys/socket.h>
#include<arpa/inet.h> // for inet_ntoa()
#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<features.h>
#include<linux/if_packet.h>
#include<linux/if_ether.h>
#include<errno.h>
#include<sys/ioctl.h>
#include<net/if.h>
#include<net/ethernet.h>
@haithemsekri
haithemsekri / tr4_ll.c
Created February 12, 2023 11:42 — forked from fffaraz/tr4_ll.c
TCP/ICMP/UDP traceroute
/* Copyright (C) 2012-2015 P.D. Buchan (pdbuchan@yahoo.com)
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,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the