Skip to content

Instantly share code, notes, and snippets.

View asomers's full-sized avatar

Alan Somers asomers

  • Longmont, Colorado, USA
View GitHub Profile
@asomers
asomers / gist:c01ad92ccebd93c0da28d825bf9ddeed
Created September 26, 2017 02:35
config.json for issue 351
{
"CONFIG_VERSION": "1",
"allow_chflags": "0",
"allow_mount": "0",
"allow_mount_devfs": "0",
"allow_mount_nullfs": "0",
"allow_mount_procfs": "0",
"allow_mount_tmpfs": "0",
"allow_mount_zfs": "0",
"allow_quotas": "0",
@asomers
asomers / epoll_bug.diff
Created July 19, 2017 05:39
Diff that adds debugging info to illustrate test_epoll _ctl code generation bug in nix
diff --git a/src/sys/epoll.rs b/src/sys/epoll.rs
index df48b9a..ae848d2 100644
--- a/src/sys/epoll.rs
+++ b/src/sys/epoll.rs
@@ -98,7 +98,10 @@ pub fn epoll_ctl<'a, T>(epfd: RawFd, op: EpollOp, fd: RawFd, event: T) -> Result
Err(Error::Sys(Errno::EINVAL))
} else {
let res = unsafe { libc::epoll_ctl(epfd, op as c_int, fd, &mut event.event) };
- Errno::result(res).map(drop)
+ println!("libc::epoll_ctl returned {:?}", res);
@asomers
asomers / config.log
Created April 5, 2017 16:48
output of ./configure CC=gcc for pjdfstest
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pjdfstest configure 0.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure CC=gcc
## --------- ##
## Platform. ##
@asomers
asomers / gist:28027beec01faa675d2e4bd669c9b547
Created April 5, 2017 16:18
Errors from compiling pjdfstest with GCC on FreeBSD 12
--- all ---
make all-am
--- pjdfstest.o ---
gcc -DHAVE_CONFIG_H -I. -Wall -Werror -g -O2 -MT pjdfstest.o -MD -MP -MF .deps/pjdfstest.Tpo -c -o pjdfstest.o pjdfstest.c
In file included from /usr/include/sys/param.h:90:0,
from pjdfstest.c:32:
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd12.0/4.9.4/include-fixed/sys/types.h:266:9: error: unknown type name '__vm_ooffset_t'
typedef __vm_ooffset_t vm_ooffset_t;
^
/usr/local/lib/gcc49/gcc/x86_64-portbld-freebsd12.0/4.9.4/include-fixed/sys/types.h:268:9: error: unknown type name '__vm_pindex_t'
@asomers
asomers / zfsfrag.py
Last active November 6, 2016 09:05
Python script to analyze fragmentation of a ZFS file system
# Copyright (c) 2014-2015 Spectra Logic Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions, and the following disclaimer,
# without modification.
# 2. Redistributions in binary form must reproduce at minimum a disclaimer
@asomers
asomers / patch-client.c
Last active December 20, 2015 09:09
Make --minimal work in client/server mode in fio The second revision makes --output-format=json work in client/server mode
--- ../../work/fio-2.1.1/client.c 2013-06-05 08:55:53.000000000 -0600
+++ client.c 2013-08-29 16:01:10.978230695 -0600
@@ -23,6 +23,7 @@
#include "server.h"
#include "flist.h"
#include "hash.h"
+#include "json.h"
static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd);
static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd);
#! /usr/bin/python
import time
import random
import sys
import StringIO
import operator
import optparse
import os.path
import pdb
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name item -->
<column type="gchararray"/>
</columns>
<data>