- http://wiki.qemu-project.org/Documentation/GettingStartedDevelopers
- https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg07818.html
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
ip netns add space-a | |
ip netns add space-b | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns space-a | |
ip link add veth2 type veth peer name veth3 | |
ip link set veth3 netns space-b | |
ifconfig veth0 0.0.0.0 up | |
ifconfig veth2 0.0.0.0 up | |
ip netns exec space-a ifconfig veth1 192.168.1.130/32 up | |
ip netns exec space-a route add -host 192.168.7.141 dev veth1 |
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
// These funcitons ought to come with a huge warning. Using them without | |
// understanding the differences between blocking and non-blocking, or | |
// between exclusive and shared access, and when to use them will cause | |
// problems that do not necessarily manifest right away, but rather | |
// fester in your program and rear their ugly head in the middle of the | |
// night when you're sleeping. | |
// | |
// If you use advisory file locking, *always* use Shared locking every | |
// single time you read the file, and *always* use Exclusive locking every | |
// single time you write the file. Period. There are no exceptions. Heed |
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 python3 | |
# -*- coding: UTF-8 -*- | |
# Author : tintinweb@oststrom.com <github.com/tintinweb> | |
''' | |
A simple TCP three-way handshake example | |
#> python scapy_tcp_handshake.py | |
DEBUG:__main__:init: ('oststrom.com', 80) | |
DEBUG:__main__:start | |
DEBUG:__main__:SND: SYN |
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
// Compile with $ gcc -o lmutracker lmu.m -framework IOKit -framework CoreFoundation -framework Foundation | |
// Usage: ./lmu [now] | |
// Prints out the value from the ambient light sensor and the back light LED every 1/10 of a second. Optionally print just one value. | |
// Inspired by the code found at | |
// http://google-mac-qtz-patches.googlecode.com/svn-history/r5/trunk/AmbientLightSensor | |
// and http://osxbook.com/book/bonus/chapter10/light/ | |
// and http://en.wikipedia.org/wiki/Wikipedia:Reference_desk/Archives/Computing/2010_February_10#Mac_OS_X_keyboard_backlight_drivers | |
// http://forums.macrumors.com/showthread.php?t=1133446 | |
#include <stdio.h> |
Explains how to install and configure react-storybook into a project created from the react-boilerplate setup.
React-boilerplate (rbp) is a good starting point to create React apps, with a focus on performance, best practices and DX.
The community around the repository is amazing and a constant source of learning.
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
import collections | |
import threading | |
__author__ = 'ashw7n' | |
import socket | |
import json | |
import logging | |
logging.basicConfig(level=logging.DEBUG) |
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
func partial<A, B, T>(f: (A, B) -> T, a: A) -> (B) -> T { | |
return { f(a, $0) } | |
} | |
func bind2nd<A, B, T>(f: (A, B) -> T, b: B) -> (A) -> T { | |
return { f($0, b) } | |
} | |
func partial<A, B, C, T>(f: (A, B, C) -> T, a: A) -> (B, C) -> T { |
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 <errno.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
void print_prot_bits(int prot) { | |
printf((prot & PROT_READ) == 0 ? "-" : "R"); | |
printf((prot & PROT_WRITE) == 0 ? "-" : "W"); | |
printf((prot & PROT_EXEC) == 0 ? "-" : "X"); | |
} |
On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this
object, and we've seen some awesome benefits from doing such.
Up until recently, a typical unit test for us looked something like this:
describe('views.Card', function() {
OlderNewer