Skip to content

Instantly share code, notes, and snippets.

View danielinux's full-sized avatar

Daniele Lacamera danielinux

View GitHub Profile
/* vn.c generic virtual network client/server
* via UDP
* Author: Daniele Lacamera
* License MIT
*/
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/if_tun.h>
#include <stdio.h>
#include <stdint.h>
/*** *** *** ***
* Robot war cry
*
** Chiptune generated via loop variable (bytebeat).
* use:
* cc -o rwc rwc.c
* ./rwc |aplay
*
* Discovered by: danielinux
* Source code license: GPL
@danielinux
danielinux / .gdbinit
Created October 28, 2016 21:35
gdb init file for frosted
tar ext :3333
monitor reset
layout src
symbol-file
file kernel.elf
mon reset
mon halt
stepi
focus c
@danielinux
danielinux / pcap_replay.py
Created October 11, 2016 21:34
replay a captured pcap stream
#!/usr/bin/python
from scapy.all import *
import time, sys
pkts = rdpcap(sys.argv[1])
clk = pkts[0].time
for p in pkts:
time.sleep(p.time - clk)
clk = p.time
sendp(p)
@danielinux
danielinux / dozer.lua
Created September 30, 2016 11:52
Dozer utilities
----------------------------------------
-- script-name: dozer.lua
--
-- Based on example LUA dissector by Hadriel Kaplan <hadrielk at yahoo dot com>
-- Copyright (c) 2016 Daniele Lacamera
-- GPLv2
--
-- Wireshark dissector for the VLC implementation of the Dozer protocol
--
-- To add the dissector, start your wireshark using:
@danielinux
danielinux / font_to_buffers.c
Created September 9, 2016 09:15
Font utils
/* Font to buffers -> convert .font file into C const buffers */
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
int main(int argc, char *argv[])
{
@danielinux
danielinux / How to Frosted on QEMU
Last active July 17, 2016 10:19
How to run frosted on Qemu
# Create dir
mkdir frosted-qemu
cd frosted-qemu
# Clone frosted
git clone git@github.com:insane-adding-machines/frosted.git
cd frosted
git submodule init
git submodule update
#
# Automatically generated file; DO NOT EDIT.
# Crosstool-NG Configuration
#
CT_CONFIGURE_has_xz=y
CT_MODULES=y
#
# Paths and misc options
#
@danielinux
danielinux / gist:5840841
Created June 22, 2013 13:21
ZeroMQ simplest publisher example using PicoTCP
#include <stdint.h>
#include "pico_socket.h"
enum zmq_hshake_state {
ST_LISTEN = 0,
ST_CONNECTED,
ST_SIGNATURE,
ST_VERSION,
ST_GREETING,