Skip to content

Instantly share code, notes, and snippets.

View slyphon's full-sized avatar

Jonathan Simms slyphon

View GitHub Profile
@slyphon
slyphon / ramdisk.py
Created January 24, 2020 07:09
Simple utility to create a(n optionally encrypted) ramdisk on macos catalina. Python 2 & 3 compatible
#!/usr/bin/env python
# Copyright 2020 Jonathan Simms
#
# 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.
#
@slyphon
slyphon / keybase.md
Created November 12, 2019 05:36
new key for keybase

Keybase proof

I hereby claim:

  • I am slyphon on github.
  • I am slyphon (https://keybase.io/slyphon) on keybase.
  • I have a public key ASBx-5_lYUXnL3K9Kn8_o3pmX38r2lVsfBns9SY6kg5-6go

To claim this, I am signing this object:

@slyphon
slyphon / python-dev-notes.md
Created June 22, 2019 18:16
a non-authoritative short guide on how i do python dev.

Install pyenv, virtualenv, and the pyenv-virtualenv plugin

I have the following in my shell to load up pyenv if i want it, this is optional and you can just always load it up if you follow the standard installation instructions:

s-pyenv() {
  [[ -n "${PYENV_SHELL}" ]] && return 0

  unset PYENV_VERSION || true
@slyphon
slyphon / star-wars-imperial-march.sh
Created May 26, 2019 04:45
the imperial march played with "beep"
#!/bin/bash
[[ -x /usr/bin/beep ]] || exit 0
cd /
BEEPARGS=(
-l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100 --new -l 350 -f 392 -D 100
--new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 350 -f 392 -D
100 --new -l 250 -f 311.1 -D 100 --new -l 25 -f 466.2 -D 100 --new -l 700 -f
@slyphon
slyphon / build.log
Created November 26, 2018 17:16
failed build on macos - clang compiler
out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Security.framework/Security.tbd and library file /System/Library/Frameworks/Security.framework/Security are out of sync. Falling back to library file for linking.
Undefined symbols for architecture x86_64:
"___rust_alloc_zeroed", referenced from:
alloc::alloc::alloc_zeroed::h3a1f22bc4c6ddd5f in libbacktrace-9790369d577f04eb.rlib(backtrace-9790369d577f04eb.backtrace.d4gljdrp-cgu.10.rcgu.o)
alloc::alloc::alloc_zeroed::h9befe99d753639af in libtermcolor-a32fe53cd2fd2dcb.rlib(termcolor-a32fe53cd2fd2dcb.termcolor.8h6oext7-cgu.15.rcgu.o)
alloc::alloc::alloc_zeroed::h15153dfe2ca517b7 in libregex-a2d2ae3d5151aa2a.rlib(regex-a2d2ae3d5151aa2a.regex.2w9usw49-cgu.3.rcgu.o)
alloc::alloc::alloc_zeroed::h9d09b01d11874866 in libccommon_rs.rlib(ccommon_rs.228dvcpmrvtp0bay.rcgu.o)
alloc::alloc::alloc_zer
@slyphon
slyphon / AsyncExpress.ts
Last active May 7, 2019 11:44
a Typescript implementation of Awaitjs-Express (@awaitjs/express): async wrappers for express router methods
// Copyright 2018 Jonathan Simms
//
// 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.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
@slyphon
slyphon / fstat.scala
Created September 18, 2018 20:21
fstatistic in breeze/scala
import breeze.linalg._
import breeze.stats._
import breeze.numerics._
def fStatistic(test: DenseVector[Double], control: DenseMatrix[Double]): Double = {
val mtest = test.toDenseMatrix
val allData = DenseMatrix.vertcat(mtest, control)
val grandMean = mean(allData)
val testMean = mean(test)
extern crate log;
use log::{Record,Metadata};
use std::boxed::Box;
/*
pub struct Record<'a> {
metadata: Metadata<'a>,
args: fmt::Arguments<'a>,
module_path: Option<&'a str>,
[17:19:00]-❯ cargo build -p ccommon_rs --bin main -vv (cc-log-one-crate *) [K]
Fresh libc v0.2.42
Fresh void v1.0.2
Fresh cc v1.0.17
Fresh glob v0.2.11
Fresh ucd-util v0.1.1
Fresh lazy_static v1.0.1
Fresh unicode-xid v0.1.0
Fresh unicode-width v0.1.5
Fresh unicode-xid v0.0.4
@slyphon
slyphon / Instructions.md
Created April 13, 2018 15:48 — forked from mohakshah/Instructions.md
Builing ZFS on Raspberry Pi 3 running Rasbpian

Introduction

This is a tutorial for building and installing the latest release version (0.7.3 as of writing) of "ZFS on Linux" on a Raspberry Pi 3 running Raspbian Stretch. Specifically, we'll be building the dkms version of ZoL, which saves you the hassle of re-compiling the kernel modules after every kernel update. Even though ZoL added support for building dkms packages for debian in version 0.7.3, the build process on a Raspberry Pi 3 is not quite straight-forward. Hopefully, these instructions will make it easier.

Steps

  1. Install the build dependencies.
$ sudo apt-get update
$ sudo apt-get install build-essential autoconf libtool gawk alien fakeroot
$ sudo apt-get install zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev parted lsscsi wget ksh