Skip to content

Instantly share code, notes, and snippets.

View shekkbuilder's full-sized avatar

shekk shekkbuilder

View GitHub Profile
@shekkbuilder
shekkbuilder / aggregate_filestat.py
Last active September 18, 2015 13:05 — forked from SaveTheRbtz/aggregate_filestat.py
Linux per-file IO statistics
#!/usr/bin/env python
import logging as log
from fileinput import input
from collections import namedtuple, defaultdict
from pprint import pprint
if __debug__:
log_level = log.DEBUG
else:
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
# char buf[IFNAMSIZ+6];
#
# sprintf(buf, "%s-%s-%d",
@shekkbuilder
shekkbuilder / findbot.pl
Created September 28, 2015 15:04 — forked from dodyw/findbot.pl
Perl script to find suspicious scripts. This script is taken from http://cbl.abuseat.org/findbot.pl
#!/usr/bin/perl
# The above line may need to be changed to point at your version of Perl
#
# This script attempts to find malicious files/scripts on your machine.
# It specifically looks for spambots that we're aware of, as well
# as "suspicious" constructs in various scripting languages.
#
# Normally it should be run as root.
#
# By default, findbot.pl scans the directories /tmp, /usr/tmp, /home and
@shekkbuilder
shekkbuilder / 2arg_func.c
Created October 4, 2015 15:26 — forked from mikesmullin/2arg_func.c
C to Linux x86-64 Assembly (ASM) examples
#include <stdio.h>
int example(int a, int b) {
return a + b + 3;
}
int main(void) {
printf("%i\n", example(1, 2));
return 0;
}
@shekkbuilder
shekkbuilder / GNUPG Cheatsheet.md
Created October 26, 2015 20:45 — forked from turingbirds/GNUPG Cheatsheet.md
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

$ gpg --gen-key
$ gpg --list-secret-keys
@shekkbuilder
shekkbuilder / 00-README.md
Created November 2, 2015 22:03 — forked from rsms/00-README.md
Example programs and tests for the POSIX Asynchronous file I/O

There are some tests ripped out from git://repo.or.cz/ltp-debian.git/testcases/open_posix_testsuite/conformance/interfaces and made self-containing. They demonstrate and can be used to test the POSIX AIO interface for asynchronous I/O and formerly file IO.

Build with a c compiler (for instance clang or cc):

cc -o aio_read-test aio_read-test.c && ./aio_read-test

Note: Contrary to popular belief, it has been tested and confirmed to actually be asynchronous on Darwin 10.6.0 (xnu 1504.9.26~3).

@shekkbuilder
shekkbuilder / tcp_server.c
Created November 4, 2015 15:58
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>
@shekkbuilder
shekkbuilder / select_server.c
Created November 4, 2015 16:00
Handle multiple socket connections with select and fd_set on Linux
/**
Handle multiple socket connections with select and fd_set on Linux
Silver Moon ( [email protected])
*/
#include <stdio.h>
#include <string.h> //strlen
#include <stdlib.h>
#include <errno.h>
@shekkbuilder
shekkbuilder / hash.c
Created November 6, 2015 03:10 — forked from tonious/hash.c
A quick hashtable implementation in c.
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
struct entry_s {
char *key;
char *value;
@shekkbuilder
shekkbuilder / gist:40e09655afc6ab89c62e
Created November 7, 2015 21:57 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents