Skip to content

Instantly share code, notes, and snippets.

@dcui
dcui / toeplitz_based_hash.py
Created May 9, 2019 17:37 — forked from joongh/toeplitz_based_hash.py
Python implementation of Toeplitz-based hash function. It is implemented to understand how the Toeplitz-based hash function works.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# Test data including the secret key, ip, port numbers and the hash values
# as the result is from "Intel Ethernet Controller 710 Series Datasheet".
KEY=[]
def reset_key():
global KEY
@jarek-przygodzki
jarek-przygodzki / centos-install-kernel-debuginfo.sh
Created February 16, 2017 20:23
CentOS 7 - How to install kernel-debuginfo
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active May 7, 2024 10:38
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* 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>