Skip to content

Instantly share code, notes, and snippets.

use threads;
use threads::shared;
use Fuse;
mkdir("a");
mkdir("b");
async { Fuse::main(mountpoint=>"a", threaded=>1, getattr => sub { warn "a"; sleep(1); }) };
async { Fuse::main(mountpoint=>"b", threaded=>1, getattr => sub { warn "b"; sleep(1); }) };
sleep(10);
system("ls a/");
@pipcet
pipcet / .travis.yml
Last active August 29, 2015 14:16 — forked from calid/00-preamble.md
language: perl
before_install:
- sudo apt-get install libzmq3-dev
- sudo apt-get install gcc
install:
- cpanm -n ZMQ::LibZMQ3
- cpanm -n ZMQ::FFI
- cpanm -n Benchmark
@pipcet
pipcet / hooks-9p
Last active August 29, 2015 14:19
Debian root-on-diod-over-IPv6 scripts
These are scripts for setting up a Debian (sid) root file system on a diod (http://github.com/chaos/diod) server using IPv6 only—no IPv4 IP required. This requires some minor modifications, but with one exception, the initramfs-tools(8) toolchain that ships with Debian works.
The main work is done in the kernel command line (which is actually parsed by the initramfs's init script). It should look like this:
[ 0.000000] Kernel command line: boot=9p ip=dhcpv6 rootfstype=diod root=server:/path
boot=9p includes the right script for dealing with 9p-specific boot setup; ip=dhcpv6 runs dhclient -6 rather than ipconfig to configure our network interface; rootfstype=diod runs the right fs helper, and root=server:/path is the path specification for diod. (You can use a DNS name, but you cannot currently use an IPv6 IP without modifying diodmount. Currently, you have to use an absolute path.).
Modifications necessary:
From b9a9a286c48a28ea7a3e095fbd1bb2cbf6165ef5 Mon Sep 17 00:00:00 2001
From: Philip <[email protected]>
Date: Sat, 22 Aug 2015 19:05:35 +0000
Subject: [PATCH] Do not apply this patch, it might break KWin
---
src/gtkutil.c | 11 -----------
src/xterm.c | 23 +++++++++++++++++++++++
2 files changed, 23 insertions(+), 11 deletions(-)
Debugger entered--Lisp error: (wrong-type-argument (or eieio-object class) nil obj)
signal(wrong-type-argument ((or eieio-object class) nil obj))
slot-value(nil status)
(= xcb:GrabStatus:Success (slot-value (car (xcb:-+reply exwm--connection (xcb:-+request-unchecked exwm--connection (make-instance (quote xcb:GrabPointer) :owner-events 0 :grab-window frame-id :event-mask xcb:EventMask:NoEvent :pointer-mode xcb:GrabMode:Async :keyboard-mode xcb:GrabMode:Async :confine-to xcb:Window:None :cursor xcb:Cursor:None :time xcb:Time:CurrentTime)) nil)) (quote status)))
(and buffer (setq frame (save-current-buffer (set-buffer buffer) exwm--floating-frame)) (setq frame-id (frame-parameter frame (quote exwm-outer-id))) (= xcb:GrabStatus:Success (slot-value (car (xcb:-+reply exwm--connection (xcb:-+request-unchecked exwm--connection (make-instance (quote xcb:GrabPointer) :owner-events 0 :grab-window frame-id :event-mask xcb:EventMask:NoEvent :pointer-mode xcb:GrabMode:Async :keyboard-mode xcb:GrabMode:Async :confin
exwm--on-ClientMessage([161 32 140 0 20 0 96 0 115 1 0 0 1 0 0 0 119 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0] t)
funcall(exwm--on-ClientMessage [161 32 140 0 20 0 96 0 115 1 0 0 1 0 0 0 119 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0] t)
(condition-case err (funcall listener data synthetic) (error (message "%S" err)))
(let ((listener (car --dolist-tail--))) (message "calling %S" listener) (condition-case err (funcall listener data synthetic) (error (message "%S" err))) (message "returned from %S" listener) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((listener (car --dolist-tail--))) (message "calling %S" listener) (condition-case err (funcall listener data synthetic) (error (message "%S" err))) (message "returned from %S" listener) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- (elt event 0))) (while --dolist-tail-- (let ((listener (car --dolist-tail--))) (message "calling %S" listener) (condition-case err (funcall listener data synthetic) (error (message "%S" err)))
https://bugzilla.mozilla.org/show_bug.cgi?id=1259280
Currently, SpiderMonkey (without asm.js) has a unique NaN value. It might be necessary for compliance to distinguish all IEEE NaN values in case they are stored into Float64Arrays or Float32Arrays. The idea would be to use a JS::Value that has the same tag as the canonical NaN but a payload pointing to a garbage-collected cell containing the actual payload that would be written to a typed array.
But why stop there? We could allow any value, including objects, to be "NaNified": define functions NaV ("not an actual value") and VaN such that:
NaV(x) !== NaV(y) (in particular, NaV(x) !== NaV(x))
VaN(NaV(x)) is identical to x
In essence, we allow anything as the "payload" of a NaN, even JavaScript objects. In particular, we allow Promises:
@pipcet
pipcet / libc.wasm
Last active December 26, 2016 12:54
perl.7z should be a 7z archive containing the asmjs-generated Perl binary, and you should be able to run it with the SpiderMonkey shell like this:
# time js perl.js < /dev/null
<random output>
real 1m4.540s
user 2m11.000s
sys 0m3.556s
# time otherjs perl.js < /dev/null
<random output>
real 0m12.751s
@pipcet
pipcet / .config
Last active June 8, 2021 10:01
barebox configuration
#
# Automatically generated file; DO NOT EDIT.
# Barebox/arm64 2021.05.0 Configuration
#
CONFIG_ARM=y
CONFIG_ARM_LINUX=y
CONFIG_TEXT_BASE=0x0
#
# System Type
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm64 5.14.0-rc4 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100201
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23502