Skip to content

Instantly share code, notes, and snippets.

@khoben
khoben / icmp_counter.c
Created December 19, 2019 12:32
icmp packet counter
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/ip.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
MODULE_LICENSE("GPL");
@khoben
khoben / main.c
Created December 19, 2019 12:44
phonebook linux device
/*
* main.c
*
* Created on: Sep 15, 2019
* Author: khoben
*/
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
@khoben
khoben / main.c
Created December 19, 2019 12:49
linux netfilter firewall
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#include <linux/netfilter.h>
#include <linux/proc_fs.h> /* Необходимо для работы с файловой системой /proc */
#include <asm/uaccess.h> /* определения функций get_user и put_user */
#include "neth.h"
MODULE_LICENSE("GPL");
@khoben
khoben / FWRuleIO.cpp
Created December 19, 2019 12:52
firewall client
#include "FWRuleIO.hpp"
FWRuleIO::FWRuleIO(const string& filename) {
fWrite.open((const char *) filename.c_str(), ios::out | ios::app);
fRead.open((const char *) filename.c_str(), ios::in);
}
FWRuleIO::~FWRuleIO() {
fWrite.close();
fRead.close();
@khoben
khoben / opencv-4.3.0-building-windows-param
Created June 13, 2020 03:11
OpenCV 4.3.0 correct building params for windows platform
BUILD_opencv_rgbd OFF
BUILD_opencv_python3 OFF
BUILD_opencv_python_bindings_generator OFF
BUILD_opencv_python_tests OFF
OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int64_t
find . -type f -name '*.hpp' -o -name '*.cpp' | xargs awk 'FNR==1 && NR>1 {print ""} {print}' >> out.txt