This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to convert PDF file to JPG images | |
# | |
# Dependencies: | |
# * pdftk | |
# * imagemagick | |
PDF=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
""" | |
Other Repositories of python-ping | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
* https://github.com/l4m3rx/python-ping supports Python2 and Python3 | |
* https://bitbucket.org/delroth/python-ping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* An example using splice syscall which avoids copying to/from user space buffers to kernel space | |
* and uses the pipe buffers allocated in kernel space as an intermediate to directly xfer from one file to another | |
* | |
* gcc -o splice splice.c -g | |
*/ | |
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// This is a rewrite and analysis of the technique in this article: | |
// http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html | |
// ------- Framework ------- | |
// The little library required to work this magic | |
// Generate a static data member of type Tag::type in which to store | |
// the address of a private member. It is crucial that Tag does not |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Primary use case: workaround non-working "ip link set wlan0 netns ..." for some network drivers. | |
Secondary use case: simple demo for getting/setting the MAC address, tun/tap, raw sockets... | |
Pre-built version: http://vi-server.org/pub/tap_copy |
OlderNewer