Skip to content

Instantly share code, notes, and snippets.

Blake Irvin bixu

Block or report user

Report or block bixu

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
@bixu
bixu / banana-strap.sh
Last active Jul 11, 2018
python & machine learning on bananapi
View banana-strap.sh
#!/bin/bash
# execute this script directly by piping to your shell from `curl` like this:
# curl --silent https://gist.githubusercontent.com/bixu/1033ed8954fafea48f2f7b3f32faf1fe/raw/banana-strap.sh | sudo bash
set -e
echo "Setting up $(hostname)..."
apt-get update
@bixu
bixu / services_cli.md
Last active Jun 7, 2018
thoughts on service interactions for the Habitat CLI
View services_cli.md

Habitat CLI UX

What’s confusing now:

  • start does not load a service, but load starts one…
  • historically, start or load would also install a service, but this is no longer the case for start

Possible alternatives, with an imaginary workflow:

$ hab search/provides <ident>
@bixu
bixu / module_vendoring.md
Last active Feb 28, 2018
vendoring Python modules with Habitat
View module_vendoring.md

The following code can be put in a file we source via a plan.sh inside a directory representing the module to be vendored, such as Cython:

pkg_origin="bixu"
pkg_name="${PWD##*/}" # use the name of the directory containing our `plan.sh` to get the `pip` module name
pkg_bin_dirs=(bin)
pkg_lib_dirs=(lib)

# libs commonly needed during Python module installs:
@bixu
bixu / triton_quickstart.sh
Last active Oct 6, 2017
get shell in triton in about 30 seconds
View triton_quickstart.sh
#!/bin/bash
set -ex
# This assumes you have a Triton account
# (see http://lpage.joyent.com/Triton-Free-Trial.html)
# and that you have installed the Triton cli tools:
# `npm install -g triton`
triton instance create 7b5981c4 g4-highcpu-1G \
View ZFS_on_macOS.md

For macOS Sierra (10.12) and OS X El Capitan (10.11), you also need to boot into the Recovery OS (either the Recovery partition or bootable OS X install media for 10.11) and run

csrutil disable

or

csrutil enable --without kext

The latter will allow you to load your custom-built, unsigned kernel extensions, while keeping the rest of System Integrity Protection (SIP) in place. (Depending on your needs, other options you may want are --without fs, --without debug, --without dtrace, or --without nvram. If you specify all of them, that is equivalent to csrutil disable. The --without option takes a comma-delimited list or can be specified multiple times: --without kext,debug,dtrace is equivalent to --without kext --without debug --without dtrace). If you have any other implementation of ZFS installed, you must uninstall it and reboot before proceeding further. Similarly, if you have installed the O3X installer version, please follow the uninstallation directions before proceeding.

@bixu
bixu / postgresql94.service
Created Nov 1, 2016
systemd service definition for habitat-managed postgres
View postgresql94.service
[Unit]
Description=postgresql94 managed by habitat
[Service]
Restart=always
ExecStart=/path/to/postgresql94.sh
[Install]
WantedBy=default.target
@bixu
bixu / postgres_replica.toml
Created Nov 1, 2016
Use Habitat to create a Postgres replica
View postgres_replica.toml
standby_mode = "on"
primary_conninfo_host = "postgres.primary.tld"
primary_conninfo_port = 5432
initdb_superuser_name = "postgres"
initdb_superuser_password = "password"
primary_conninfo_user = "postgres"
primary_conninfo_password = "password"
trigger_file = "/hab/svc/postgresql9.4/data/failover_trigger_file"
initdb_encoding = "en_US.UTF-8"
@bixu
bixu / postgresql94.sh
Created Nov 1, 2016
Loading a custom `.toml` file into Habitat under your favorite service manager
View postgresql94.sh
#!/bin/sh
HAB_POSTGRESQL94=$(cat /path/to/custom.toml) /usr/bin/hab start --no-color bixu/postgresql94
@bixu
bixu / habitized_postgres
Last active Oct 7, 2016
postgres in the habitat studio
View habitized_postgres
HAB_POSTGRESQL='dynamic_shared_memory_type = "none"' hab start core/postgresql
View gist:c7f331959a45d9c9a75eb115a501dc4d
---
driver:
name: joyent
driver_config:
joyent_version: '~7.0'
joyent_username: <account name>
joyent_keyfile: <path to private ssh key>
joyent_keyname: <ssh key "name" in your Joyent account>
joyent_url: https://us-east-1.api.joyent.com
You can’t perform that action at this time.