Skip to content

Instantly share code, notes, and snippets.

View gvanem's full-sized avatar

Gisle Vanem gvanem

View GitHub Profile
@gvanem
gvanem / Makefile.Windows
Last active May 26, 2018 02:57
A makefile for Ettercap supporting MSVC, clang-cl and MinGW (the latter is little tested). Ref: https://github.com/Ettercap/ettercap
#
# Ettercap NG Makefile for MinGW / cl / clang-cl.
# by G. Vanem <[email protected]> 2011 - 2018.
#
THIS_FILE = Makefile.Windows
#
# Comment this away to NOT rebuild too many things when $(THIS_FILE) changes.
#
MDEPEND = $(THIS_FILE)
@gvanem
gvanem / Makefile.MSVC
Last active June 28, 2018 00:40
A GNU-makefile for Welle-IO; the RTL_SDR based DAB+ receiver from https://github.com/AlbrechtL/welle.io. Supports only MSVC and clang-cl. Building with MSVC needs lots of patches to be applied.
#
# GNU-makefile for Welle-IO (MSVC / clang-cl, 32-bit)
#
# By G. Vanem <[email protected]> 2017.
#
THIS_FILE := Makefile.MSVC
DATE := $(shell date +%d-%B-%Y)
#
# What to build:
@gvanem
gvanem / win32-stuff.c
Last active September 10, 2018 13:51
Win32-only functions to return extended information for network adapters. Used with "windump -Dv"
/*
* Winpcap stuff for Win32 only:
*
* 1) Simple trace function used by WINDUMP_TRACE() macro in netdissect.h.
* 2) Colourised 'ndo_printer'.
* 3) Low-level NDIS/Packet32 stuff that doesn't fit anywhere else.
*
* Written by G. Vanem <[email protected]> 2014.
*/
@gvanem
gvanem / mkhelp.py
Created June 5, 2018 11:00
Python version of curl's Perl-script mkhelp.pl. Ref: https://github.com/curl/curl/blob/master/src/mkhelp.pl
#!/usr/local/bin/python
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2014, Daniel Stenberg, <[email protected]>, et al.
#
@gvanem
gvanem / mk-opt-err-list.mak
Last active January 15, 2021 12:49
A Gnu-makefile to generate a file (curl_opt_err.c) with all current 'CURLOPT_x' and 'CURLE_x' values.
#
# A Gnu-makefile to generate a C-program ($(PROGRAM).c) with all
# current 'CURLOPT_x' and 'CURLE_x' values.
#
# NB! must be invoked from libcurl's './lib' directory.
#
# By G. Vanem <[email protected]> 2014 - 2018.
#
# The basename of what this makefile generates;
# A 'curl_opt_err.c' and a 'curl_opt_err.exe' (on Windows).
@gvanem
gvanem / msvc-sse2-crash.c
Last active July 4, 2018 07:35
MSVC cl internal error test-case. Crashes on "Version 19.13.26129 for x86". Maybe others too.
/*
* MSVC cl internal error test-case.
*
* An 'cl' optimiser bug that triggers this message while compiling a GnuRadio volk/lib .c-file:
*
* msvc-sse2-crash.c(82) : fatal error C1001: An internal error has occurred in the compiler.
* (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 260)
* To work around this problem, try simplifying or changing the program near the locations listed above.
* Please choose the Technical Support command on the Visual C++
* Help menu, or open the Technical Support help file for more information
@gvanem
gvanem / colour_print.py
Last active June 28, 2018 20:00
A Python netstat clone. Needs psutil, GeoIP and colour_print.py too (see below)
__all__ = [ 'printer', 'trace', 'color_print', 'textcolor' ]
#
# A simple module for printing with colours to the Windows console.
# Currently used only by the syslog-drop.py script.
#
# By G. Vanem <[email protected]> 2012.
#
import os, sys, inspect
@gvanem
gvanem / Makefile.Windows
Last active August 16, 2022 07:35
GNU Makefile for PortAudio. Using MinGW, clang-cl or MSVC. Currently for x86 only. Ref. http://www.portaudio.com/
#
# Gnu Makefile for PortAudio (MSVC + clang-cl).
#
# By G. Vanem <[email protected]> 2014 - 2022.
#
THIS_FILE = Makefile.Windows
TODAY = $(shell date +%d-%B-%Y)
comma := ,
#
@gvanem
gvanem / Makefile.Windows
Last active May 29, 2022 18:34
A GNU Makefile for the Vcpkg Package Manager; https://github.com/Microsoft/vcpkg.git
#
# GNU Makefile for the Vcpkg Package Manager (MSVC / clang-cl / MinGW).
#
# By <[email protected]> 2018 - 2022.
#
# Instructions:
# 1) Clone 'vcpkg' by:
# git clone https://github.com/Microsoft/vcpkg.git <SOME_DIR>
#
# 2) Clone 'vcpkg-tool' by:
@gvanem
gvanem / Makefile.Windows
Last active August 2, 2018 21:14
A GNU-makefile for GNU-make. Targets MinGW, MSVC and clang-cl. Needs trace.c too (see below). Get the sources at git://git.sv.gnu.org/make.git. Apply the below '*.diff' files to check for mem-leaks
#
# GNU Make to generate GNU Make (gnumake.exe) using
# either MinGW gcc, MinGW64-TDM gcc, clang-CL or MSVC cl.
#
# By G. Vanem <[email protected]> 2013.
#
VERSION := $(shell grep AC_INIT ../configure.ac | cut -d']' -f2 | sed -e 's/,\[//g')
DATE := $(shell date +%d-%B-%Y)