Skip to content

Instantly share code, notes, and snippets.

@papertigers
papertigers / README.md
Created May 5, 2020 03:45 — forked from mgerdts/README.md
Install windows with bhyve

These are bare-bones instructions for creating a Windows image for bhyve on SmartOS. You will need a platform image that has the fix for OS-7117. Platform images that I've used in testing are here: iso tgz usb

Create a volume that will be the disk.

zfs create -o volblocksize=4k -V 16g -s zones/hdd-windows

This script will be used for booting from the CD.

@papertigers
papertigers / playground.rs
Created April 8, 2019 14:36 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::net::{self, AddrParseError, IpAddr, SocketAddr};
use std::str::FromStr;
#[derive(Debug)]
struct Endpoint {
addr: SocketAddr,
}
impl Endpoint {
fn new<S: Into<SocketAddr>>(s: S) -> Self {
@papertigers
papertigers / trunk-images.md
Created January 3, 2019 23:25 — forked from jperkin/trunk-images.md
Test pkgsrc trunk bootstraps and images

pkgsrc trunk packages and images

Now that pkgin has refresh support and the macOS trunk builds have proven that a rolling trunk release works well, I am happy to make SmartOS/illumos trunk packages and images available again for testing.

These are rolling builds of pkgsrc trunk every day (or so), providing the latest packages without having to upgrade across quarterly releases. Just install once then pkgin full-upgrade to keep up-to-date.

This is primarily of interest to:

  • Users who just want the latest software.
  • Users who don't want to bother with having to upgrade releases every quarter.
@papertigers
papertigers / xcode-build-bump.sh
Created January 29, 2017 04:11 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@papertigers
papertigers / no_compute_resources_available.md
Created November 22, 2016 22:32 — forked from bahamat/no_compute_resources_available.md
Diagnosing "No Compute Resources Available" messages in Triton.

No Compute Resources Available

This error is somewhat ambiguious because there is seemingly no indication which resource is exhausted.

Triton chooses compute nodes with a subcomponent called sdc-designation (also refered to as , DAPI). The full DAPI log for a provision job is embedded in the CNAPI log file and can be extracted with the workflow job uuid and the following script.

#!/bin/bash

set -o errexit
@papertigers
papertigers / diff.swift
Created November 15, 2016 04:57 — forked from simme/diff.swift
Utility for diffing two arrays of arrays.
enum DiffModification<T: Equatable> {
case inserted(position: NSIndexPath, value: T)
case deleted(position: NSIndexPath, value: T)
case moved(position: NSIndexPath, newPosition: NSIndexPath, value: T)
}
extension DiffModification: CustomDebugStringConvertible {
var debugDescription: String {
switch self {
case .inserted(let position, let value):
@papertigers
papertigers / 0-README.md
Last active August 29, 2015 14:26 — forked from bahamas10/0-README.md
Joyent Manta Functions
@papertigers
papertigers / mdb.md
Last active August 29, 2015 14:20 — forked from tjfontaine/mdb.md

MDB is unlike most debuggers you've experienced.

It is not a source level debugger like gdb or lldb or even Node's builtin debugger

Generally used for postmortem analysis.

Postmortem is for Production and Development

We operate mostly on core files, though you can attach to running processes as well.

zipstream = require "zipstream"
fs = require "fs"
async = require "async"
class StreamingResponse
filename: ""
files: []
streaming: true
###
example openvpn config, from a site, to a Joyent zone, under SDC7:
----------------------------------------------------------------------------------------------------------------
example config:
server end, in joyent cloud, pick an IP address: 10.4.4.1
client ent, at home, pick an IP address: 10.4.4.2
in this example, I'm calling that network a /24, or 255.255.255.0 netmask
--------------------
on "the customer end": (my example, on my linux OpenWRT router at home)