Skip to content

Instantly share code, notes, and snippets.

View ryan-williams's full-sized avatar
🚆

Ryan Williams ryan-williams

🚆
View GitHub Profile
@ryan-williams
ryan-williams / git.md
Last active December 7, 2020 16:09
installing git from source (optionally in home directory / with prefix)

Install libpcre2

In some situations, I've observed make below to fail for lack of a locatable libpcre2:

v=10.36
wget https://downloads.sourceforge.net/pcre/pcre2-$v.tar.bz2
tar -xvjf pcre2-$v.tar.bz2
pushd pcre2-$v
./configure --prefix="$HOME"
make
make install
@ryan-williams
ryan-williams / openssh.md
Last active November 19, 2019 22:54
Install OpenSSH into home directory from source
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
tar -xvzf openssh-8.0p1.tar.gz
cd openssh-8.0p1
./configure --prefix=$HOME --with-privsep-path=$HOME/var/empty
make
make install

The --with-privsep-path=$HOME/var/empty is necessary to avoid an error like:

@ryan-williams
ryan-williams / cd.py
Last active December 30, 2019 01:34
Python `cd` context manager for changing the current working directory, using pathlib; adapted from https://stackoverflow.com/a/13197763
from os import chdir, getcwd
from pathlib import Path
class cd:
"""Context manager for changing the current working directory"""
def __init__(self, path):
path = Path(path)
self.path = path.expanduser()
@ryan-williams
ryan-williams / minikubeflow-pipelines.md
Last active October 1, 2019 04:18
Instructions for running Kubeflow Pipelines on Minikube, locally on macOS
@ryan-williams
ryan-williams / shapeless-lazy-issue.md
Last active June 19, 2019 19:43
Appendix to Shapeless#902

The repro in shapeless#902 above is very simplified from my real use-case; perhaps I should just do something different upstream to avoid this, but nevertheless that behavior seems unexpected.

More context on my real use-case, fwiw:

  • A is actually OHList ("Options HList"), where each element in the underlying HList is wrapped in Option[_], and some relevant functionality is exposed.
  • TC is actually a comparator type-class Cmp, which defines logic for determining whether two instances of type T are equal:
    • If they are not equal, it returns a customizable output-type Δ representing the computed diff.
      trait Cmp[T] { type Δ; def apply(l: T, r: T): Option[Δ] }
  • In truth, [it is an alias](https://github.com/ryan-williams/test-utils/blob/lazy/cmp/shared/src/main/scala/org/hammer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ryan-williams
ryan-williams / composer.md
Last active June 11, 2020 14:34
Google Cloud CLI cheat sheet (gsutil / gcloud)
gcloud services enable composer.googleapis.com
gcloud config set composer/location us-east1
# Cloud Composer "environment" name
ENV=…
# Create Python3 Environment
gcloud composer environments create $ENV --python-version=3
# Describe Cloud Composer environment, or specific fields:
gcloud composer environments describe $ENV
gcloud composer environments describe $ENV --format="get(config.dagGcsPrefix)"
@ryan-williams
ryan-williams / prs.md
Created March 27, 2019 18:12
Add GitHub PRs as refs in local repo clones
git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/pr/*'
git fetch origin
git checkout pr/123
@ryan-williams
ryan-williams / 00-README.md
Last active March 19, 2019 05:24
kubeflow setup scripts

Helper scripts for spinning up Kubeflow clusters and monitoring them as they boot up.

An embellished version of the commands recommended in the docs:

export KFAPP=<YOUR CHOICE OF APPLICATION DIRECTORY NAME>
${KUBEFLOW_SRC}/scripts/kfctl.sh init ${KFAPP} --platform gcp --project ${PROJECT}
cd ${KFAPP}
${KUBEFLOW_SRC}/scripts/kfctl.sh generate platform
@ryan-williams
ryan-williams / tf.md
Last active March 12, 2019 20:42
Instructions for building+testing Tensorflow (1.13.1) on macOS with Bazel 0.22.0

I was trying "Run the tests", and saw some failures, apparently due to having GCC linked under gcc/g++ instead of clang, on macOS:

ERROR: /private/var/tmp/_bazel_ryan/b82c47e810a34e3560644976a9c6bf6f/external/protobuf_archive/BUILD:626:1: Linking of rule '@protobuf_archive//:python/google/protobuf/internal/_api_implementation.so' failed (Exit 1)
gcc: error: unrecognized command line option '-fobjc-link-runtime'; did you mean '-fgnu-runtime'?

Specifying clang in the CC env var seemed to work: