Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Massoud Asadi massoudasadi

🏠
Working from home
Block or report user

Report or block massoudasadi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leonid-ed
leonid-ed / udp_to_local.c
Last active Oct 20, 2019
Examples of using raw sockets (c, linux, raw socket)
View udp_to_local.c
/*
An example of using raw sockets.
You can capture packets by tcpdump:
tcpdump -X -s0 -i lo -p udp
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@oleksiiBobko
oleksiiBobko / tcp_server.c
Last active Sep 16, 2019
Simple socket server in C using threads (pthread library) Compiles on linux
View tcp_server.c
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@yackx
yackx / hello-boot.asm
Created Dec 10, 2014
Hello World bootloader in assembly language
View hello-boot.asm
;----------------------------------------------;
;
; A minimal bootloader that prints a hello world
; then halts.
;
; nasm -f bin hello-boot.asm -o hello-boot.bin
;
; @YouriAckx
;
;----------------------------------------------;
@geyslan
geyslan / shell_bind_tcp.asm
Last active Oct 24, 2019
Shell Bind TCP in Assembly (Linux/x86) - forlife
View shell_bind_tcp.asm
; This is a snippet of the original file in https://github.com/geyslan/SLAE/blob/master/1st.assignment/shell_bind_tcp.asm
global _start
section .text
_start:
; syscalls (/usr/include/asm/unistd_32.h)
; socketcall numbers (/usr/include/linux/net.h)
@aspyct
aspyct / signal.c
Last active Oct 17, 2019
Unix signal handling example in C, SIGINT, SIGALRM, SIGHUP...
View signal.c
/**
* More info?
* a.dotreppe@aspyct.org
* http://aspyct.org
*
* Hope it helps :)
*/
#include <stdio.h>
#include <stdlib.h>
@andyferra
andyferra / github.css
Created Apr 30, 2012
Github Markdown CSS - for Markdown Editor Preview
View github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@austinmarton
austinmarton / sendRawEth.c
Created Feb 27, 2012
Send a raw Ethernet frame in Linux
View sendRawEth.c
/*
* 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.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
You can’t perform that action at this time.