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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#! perl -slw | |
use threads stack_size => 8*4096; | |
use Thread::Queue; | |
############################################################ | |
# | |
# There are pipe errors that happen. I came across only | |
# one, but it breaks the code entirely. | |
# |
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 <sys/mman.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define report_exceptional_condition() abort () | |
struct ring_buffer | |
{ |
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 <sys/mman.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define INDEX(B, P) ((P) - (B)) |
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
const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.124 2013/03/20 11:30:05 fabiankeil Exp $"; | |
/********************************************************************* | |
* | |
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ | |
* | |
* Purpose : Contains wrappers for system-specific sockets code, | |
* so that the rest of Junkbuster can be more | |
* OS-independent. Contains #ifdefs to make this work | |
* on many platforms. | |
* |
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
// $Id: simple-proxy.c,v 1.4 2005/02/25 04:23:24 dean Exp $ | |
// | |
// simple-proxy.c: simple tcp proxy for async bi-directional data transfer | |
// | |
// usage: simple-proxy host port | |
// | |
// this will open a socket to host:port and copy data from stdin to the socket, | |
// and from the socket to stdout. errors may appear on stderr. | |
// |
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
/* Copyright (c) 2001 Matej Pfajfar. | |
* Copyright (c) 2001-2004, Roger Dingledine. | |
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. | |
* Copyright (c) 2007-2013, The Tor Project, Inc. */ | |
/* See LICENSE for licensing information */ | |
/** | |
* \file connection.c | |
* \brief General high-level functions to handle reading and writing | |
* on connections. |
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
/* | |
* $Id: simple-tcp-proxy.c,v 1.6 2002/11/27 00:40:31 wessels Exp $ | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <netdb.h> | |
#include <string.h> | |
#include <signal.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 <stdio.h> | |
#include <unistd.h> //lseek, write, close | |
#include <stdlib.h> //exit | |
#include <fcntl.h> //open | |
#include <sys/mman.h> | |
#define Mapmalloc(number, type, filename, fd) load_mmap(filename, &(fd), (number)*sizeof(type), 'y') | |
#define Mapload(number, type, filename, fd) load_mmap(filename, &(fd), (number)*sizeof(type), 'n') | |
#define Mapfree(number, type, fd, pointer) releasemmap(pointer, (number)*sizeof(type), fd) | |
#define Stopifnot(assertion, ...) if (!(assertion)){printf(__VA_ARGS__); exit(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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <errno.h> | |
int main(int argc, char *argv[]) |
OlderNewer