Skip to content

Instantly share code, notes, and snippets.

Chris Vest chrisvest

Block or report user

Report or block chrisvest

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View journalctl output on bluetooth trackpad reconnect
Jul 25 11:20:12 flowerpot upowerd[1829]: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256/0005:05AC:030E.001B
Jul 25 11:20:13 flowerpot kernel: magicmouse 0005:05AC:030E.001C: unknown main item tag 0x0
Jul 25 11:20:13 flowerpot kernel: input: Touchy-Feely as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:512/0005:05AC:030E.001C/input/input38
Jul 25 11:20:13 flowerpot kernel: magicmouse 0005:05AC:030E.001C: input,hidraw2: BLUETOOTH HID v1.60 Mouse [Touchy-Feely] on b4:6b:fc:31:1b:3f
Jul 25 11:20:13 flowerpot upowerd[1829]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:512/0005:05AC:030E.001C
Jul 25 11:20:13 flowerpot upowerd[1829]: treating change event as add on /sys/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:512/0005:05AC:030E.001C/power_supply/hid-d8:96:95:e3:fa:64-battery
@chrisvest
chrisvest / configuration.nix
Created Jun 30, 2018
NixOS configuration for Lenovo P52s laptop
View configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
View gist:bd9abc6440d78d22ac931e2c54c57ee8
uname -a && echo $'O_RDONLY\nO_RDWR\nSEEK_SET\nSEEK_END\nEBADF\nEINVAL\nENXIO\nEOVERFLOW\nESPIPE\nEACCES\nEAGAIN\nEDQUOT\nEEXIST\nEFAULT\nEINTR\nEIO\nEISDIR\nELOOP\nEMFILE\nENAMETOOLONG\nENFILE\nENOENT\nENOSPC\nENOTDIR\nEOPNOTSUPP\nEROFS\nEFBIG\nEPIPE\nEWOULDBLOCK' | gcc -imacrosunistd.h -imacrosfcntl.h -imacrossys/errno.h -E - | tail -n 29
View Handover.java
void popAll( Consumer<Object> consumer ) {
Node nodes = stack.getAndSet( END );
while ( nodes != END ) {
consumer.accept( nodes.value );
Node next;
do {
next = nodes.next;
} while ( next == null );
nodes = next;
}
View Handover.java
void push( Object value ) {
Node node = new Node( value );
node.next = stack.getAndSet( node );
}
View Handover.java
class Handover {
private static class Node {
final Object value;
volatile Node next;
Node( Object value ) {
this.value = value;
}
}
View app.pony
use "files"
use "collections"
actor Main
new create(env: Env) =>
let collector = Collector(env)
let parser = Parser(collector)
let caps = recover val FileCaps.set(FileRead).set(FileStat) end
try
View Main.java
package repl;
import jdk.nashorn.internal.runtime.ParserException;
import jnr.ffi.LibraryLoader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.file.Files;
@chrisvest
chrisvest / pagelock.c
Created May 12, 2015
This program uses memory in page units. As much as you like. Have fun.
View pagelock.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/mman.h>
void err(char** argv) {
printf("Usage: %s <page count>\n", argv[0]);
View perf-stats.txt
Perf stats for release : BinaryLatch # CountDownLatch(1)
-----------------------------------------------------------------------------------------------------------------
task-clock (msec) : 37386,009560 ~ 0,928 # 98597,132785 ~ 2,449 CPUs utilized
context-switches : 380.403 ~ 0,010 # 20.918.164 ~ 0,212 M/sec
cpu-migrations : 69 ~ 0,002 # 5.269.662 ~ 0,053 M/sec
page-faults : 3.990 ~ 0,107 # 3.977 ~ 0,040 K/sec
cycles : 147.525.086.934 ~ 3,946 # 344.168.284.382 ~ 3,491 GHz
stalled-cycles-frontend : 0 ~ 0,00% # 0 ~ 0,00% frontend cycles idle
stalled-cycles-backend : 0 ~ 0,00% # 0 ~ 0,00% backend cycles idle
instructions : 80.495.832.415 ~
You can’t perform that action at this time.