View setup xen environment
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
setup xen environment |
View SparkEventSource.java
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
package com.spark; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.handler.HandlerList; | |
import org.eclipse.jetty.servlet.*; | |
import org.eclipse.jetty.servlets.EventSource; | |
import org.eclipse.jetty.servlets.EventSourceServlet; | |
import spark.Service; | |
import spark.Spark; | |
import spark.embeddedserver.jetty.EmbeddedJettyServer; |
View qemu-with-bridge.py
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/python3 | |
""" | |
This scripts creates an isolated network environment, | |
and adds necessary configuration to the given QEMU command line to run | |
in this network. | |
WARNING: for development purposes only, allows PE for every user on the host. | |
Typical Usage |
View ifdef_guard_to_pragma_once.py
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/python | |
import sys | |
import os | |
import tempfile | |
import re | |
starts_with_ifndef = re.compile(r'^\s*#ifndef.*\n#define.*\n') | |
ends_with_endif = re.compile(r'#endif.*$') |
View objdump-hexdump.c
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 <ctype.h> | |
#include <stdio.h> | |
struct buf { | |
unsigned char *p; | |
uint64_t len; | |
}; | |
void hexdump(struct buf buf) { | |
int i = 0; |
View vagurl.sh
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 | |
if [ -z "$@" ]; then | |
echo Example usage: | |
echo $0 ubuntu/xenial64 | |
echo Output: | |
echo https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20160627.0.0/providers/virtualbox.box | |
echo https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20160625.0.0/providers/virtualbox.box | |
echo ... | |
exit 1 | |
fi |
View jitter.c
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 <inttypes.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <regex.h> | |
#include <time.h> | |
#include <stdbool.h> |
View POD.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
#import <Foundation/Foundation.h> | |
@interface POD : NSObject<NSCopying> | |
-(nonnull NSString *)description; | |
-(nonnull NSDictionary *)toDictionary; | |
+(nonnull id)fromDictionary:(nonnull NSDictionary *)dict; | |
-(nonnull id)copyWithZone:(nullable NSZone *)zone; | |
@end |
View INT 13 fail
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
This is a demonstration of how INT 13, ah=42 fails after a while. | |
Run 'bash debug.sh`, then hit `c` a couple of times, you should | |
see that INT 13 returns with CF set, which means it had an error. | |
Why is it happening? The code is pretty simple, all it does is reading | |
a sector from the disk, and copying it to some place in the memory. |
View parse_perf_events.c
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
int print_records_read(void *_this, void *buf, int size) { | |
int nread = 0; | |
struct perf_record_mmap *mmap_r; | |
struct perf_record_lost *lost_r; | |
struct perf_record_comm *comm_r; | |
struct perf_record_exit *exit_r; | |
struct perf_record_throttle *throttle_r; | |
struct perf_record_fork *fork_r; | |
struct perf_record_read *read_r; | |
struct print_records *pr = _this; |