Skip to content

Instantly share code, notes, and snippets.

View crondaemon's full-sized avatar

Dario Lombardo crondaemon

View GitHub Profile
@crondaemon
crondaemon / balloons.rb
Created September 14, 2021 09:55
balloons
class Balloon
EXPECTED = {
'b' => 1,
'a' => 1,
'l' => 2,
'o' => 2,
'n' => 1
}
def initialize
dario@hardcore:~/projects/wireshark/build-ninja (oss-fuzz)$ git diff
diff --git a/tools/debian-setup.sh b/tools/debian-setup.sh
index c57662ba26..28d7fb2723 100755
--- a/tools/debian-setup.sh
+++ b/tools/debian-setup.sh
@@ -172,6 +172,7 @@ ACTUAL_LIST=$BASIC_LIST
# Now arrange for optional support libraries
if [ $ADDITIONAL ]
then
+ echo "Adding additional"
@crondaemon
crondaemon / iwyu-wireshark.md
Created December 4, 2015 13:56
How to setup include-what-you-use in ubuntu 14.04 to compile wireshark's dissectors

Install clang

Iwyu relies on clang, hence we need to install it. In ubuntu 14.04 the latest version is 3.5: let's go with it.

sudo apt-get install clang-3.5 llvm-3.5-dev

Compile iwyu

@crondaemon
crondaemon / iwyu-test-1.txt
Last active December 4, 2015 13:38
iwyu test 1
$ make packet-aeron.o -k
CC packet-aeron.o
warning: optimization flag '-fno-delete-null-pointer-checks' is not supported
warning: optimization flag '-fexcess-precision=fast' is not supported
warning: argument unused during compilation: '-fno-strict-overflow'
warning: argument unused during compilation: '-fno-delete-null-pointer-checks'
warning: argument unused during compilation: '-fexcess-precision=fast'
warning: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Wunknown-warning-option]
warning: unknown warning option '-Wjump-misses-init'; did you mean '-Wimplicit-int'? [-Wunknown-warning-option]
@crondaemon
crondaemon / pcap-stats-example.c
Last active May 13, 2018 17:51
pcap_stats() example
#include <stdio.h>
#include <pcap.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
struct pcap_stat stat;
pcap_t* pcaph;
char errbuf[PCAP_ERRBUF_SIZE];