Skip to content

Instantly share code, notes, and snippets.

@RLovelett
RLovelett / delete.sh
Created July 2, 2014 20:07
Delete ZFS snapshots from dataset one-liner
zfs list -r -H -t snapshot -o name stream/lxc/stash | xargs -n1 zfs destroy
@RLovelett
RLovelett / run.sh
Last active August 29, 2015 14:10
Pool Predictors
#!/usr/bin/env bash
if [ -a /home/ryan/bin/weka/weka-3-7-11/weka.jar ]
then
export CLASSPATH=/home/ryan/bin/weka/weka-3-7-11/weka.jar:/home/ryan/Source/student-filters/StudentFilters.jar:.
else
export CLASSPATH=/Applications/weka-3-7-11/weka.jar:.
fi
if [ "$(uname)" == "Darwin" ]
@RLovelett
RLovelett / gist:6791bde80575fc412983
Created October 14, 2015 00:50 — forked from chrislavender/gist:cad26500c9655627544f
HTTP Live Streaming Tutorial

Note: This is an older post that I did back when I thought I might have time to be a blogger. Oh I was oh so wrong. However, it has proven useful for some folks on stackoverflow. Thus I'm keeping it alive here on Gist.

One of my past projects dealt heavily with an open source Apple technology called HTTP Live Streaming. It’s an HTTP based streaming protocol that at its most fundamental level provides a way to stream video and audio from just about any server with nothing but a few free software tools provided by Apple**. However, it has a few additional features that I think make it a really exciting tool. Yet, I haven’t seen HTTP Live Streaming used very much. This is probably mainly due to the combination of a lack of good/clear documentation, and Apple’s Live Streaming Developer Tools being command line based also make the barrier to entry higher than many developers want to deal with.

The hope is to share my understanding of how to use this technology to:

@RLovelett
RLovelett / README.md
Last active October 17, 2015 02:15 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@RLovelett
RLovelett / initial-tuning-data.txt
Last active November 22, 2015 19:10
Linux TV zap and MPlayer Configs
#------------------------------------------------------------------------------
# file automatically generated by w_scan
# (http://wirbel.htpc-forum.de/w_scan/index2.html)
#! <w_scan> 20141122 1 0 TERRCABLE_ATSC US </w_scan>
#------------------------------------------------------------------------------
# location and provider: <add description here>
# date (yyyy-mm-dd) : 2015-11-22
# provided by (opt) : <your name or email here>
#
# A[2] <freq> <mod> [# comment]
@RLovelett
RLovelett / AVCodec.swift
Last active December 15, 2015 16:12
Allow `withUnsafePointer` to not mark `struct` function as `mutating`
extension AVCodec {
mutating func profileName(profile: Int32) -> String? {
let result = withUnsafePointer(&self) { (codecPointer) in
return av_get_profile_name(codecPointer, profile)
}
return String.fromCString(result)
}
}
@RLovelett
RLovelett / binutils-bisect.sh
Last active May 8, 2022 19:53
A Git bisect run script to find the binutils commit that introduced the move bug
#!/usr/bin/env bash
# Good: 2bd25930
# Bad: 71090e7a
set -ex
BINUTILS_DIR=$HOME/packages/trunk
SWIFT_DIR=$HOME/swift
@RLovelett
RLovelett / posix_spawnp.swift
Created April 21, 2016 02:22
Spawn a sub-process from Swift
import Glibc
var action = posix_spawn_file_actions_t()
posix_spawn_file_actions_init(&action);
defer { posix_spawn_file_actions_destroy(&action) }
posix_spawn_file_actions_addopen(&action, 1, "/tmp/foo-log", (O_WRONLY | O_CREAT | O_TRUNC), 0644)
posix_spawn_file_actions_adddup2(&action, 1, 2)
let args = [
"ffmpeg",

Keybase proof

I hereby claim:

  • I am rlovelett on github.
  • I am rlovelett (https://keybase.io/rlovelett) on keybase.
  • I have a public key ASCSdXfEevoHXXVb5eMvjn8rUL00ucXGH1-a1Czn-JSfJgo

To claim this, I am signing this object:

@RLovelett
RLovelett / smb.conf
Last active April 8, 2021 15:26
Samba Configuration
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
load printers = no