Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cwilper's full-sized avatar

Chris Wilper cwilper

View GitHub Profile
@cwilper
cwilper / coursera-ml.environment.yml
Last active January 1, 2024 18:46
Minimal Conda environment for locally running the Coursera ML Specialization labs
#
# Minimal Conda environment for locally running the Coursera Machine Learning Specialization
# labs from https://www.coursera.org/specializations/machine-learning-introduction
#
# To use, download and unpack the notebooks from the course, make sure you have conda
# installed (Miniconda is fine), then create the environment for the first time:
#
# > conda env create -f coursera-ml.environment.yml
#
# Some optional labs, like Decision Trees in Course 2, Week 4, require graphviz
@cwilper
cwilper / handle.service
Created January 26, 2017 16:52
Systemd Unit file for Handle Service used by DSpace
# Systemd Unit file for Handle Service used by DSpace
#
# On hosts that use systemd, like RHEL7, this can be used to auto-start
# the handle service and provide the familiar "servicectl start|status|stop"
# commands for controlling execution.
#
# To install:
#
# 1) As dspace:
# REQUIRED:
@cwilper
cwilper / wordle-is-hard.md
Created December 8, 2022 05:42
Trying to teach GPT-3.5 three-letter wordle

Me: Can we play a word guessing game? I will think of a three-letter word, and you guess it. I will tell if you got it right or not. I will also tell you, for the first, second, and third letter of my word, whether it matches any letter in your word, and if so, if the letter in your word is in the same position as it is in my word. Do you understand?

ChatGPT: Yes, I understand the rules of the word guessing game. Let's begin. What is the three-letter word you are thinking of?

Me: You are supposed to come up with a guess for the word. I can't tell you exactly what the word is. I can only tell you if you guess right, or if some of your letters match those in my mystery word. Ok?

ChatGPT:

@cwilper
cwilper / how-to-sign-all-commits.md
Last active October 14, 2022 19:13
How to sign all git commits

Want to sign all your git commits by default?

There are many possible ways to do this. This is what worked for me in October 2022, on a recent (M1) mac with zsh, homebrew, and a recent version of git.

The first section below is required to get the basics working. All others are optional.

Install gpg, generate a key, and configure it for signing

brew install gnupg
@cwilper
cwilper / gh-changelog.sh
Last active June 14, 2022 20:05
Prints a markdown changelog for a project on GitHub, including a section for each release, with links to all merged PRs.
#!/usr/bin/env bash
#
# Prints a markdown changelog for a GitHub project, including a section for each release, with links to all merged PRs.
#
# Assumes all merged tags represent releases, and the remote named "origin" is the github one.
#
# Usage:
#
# git checkout main ; git pull
# url=https://gist.githubusercontent.com/cwilper/eb5299241349cae5b5c51b7c814cd341/raw/0486bd2bf9d777456ac1cea5337f4586f0aa196c/gh-changelog.sh
@cwilper
cwilper / git-lastmerge.sh
Created May 12, 2021 16:22
git-lastmerge - find the last time one branch was merged into another
#!/usr/bin/env bash
#
# script : git-lastmerge.sh
# purpose : Find the last time one branch was merged into another
# usage : git lastmerge [source_branch [dest_ref ["merge-id"|"parent-id"]]]
# created : May 2021 by cwilper
#
# How it works:
#
# * Looks for the last commit message saying "Merged branch 'x'"
@cwilper
cwilper / .tmux.conf
Last active November 23, 2020 02:47
My initial tmux config file
# Here's my initial tmux config, which works well on macOS and Linux,
# and uses screen-like and vi bindings. If using Linux, see notes about
# xclip below.
#
# If you use iTerm and homebew on a mac, you can set it up to automatically
# launch a new tmux session whenever a new terminal window opens:
#
# 1) Install tmux (e.g. via homebrew: brew install tmux)
# 2) Put this file in your home directory, named .tmux.conf
# 3) Edit your iTerm Preferences:
@cwilper
cwilper / solr-ds7-preview1.md
Last active May 20, 2019 17:21
Setting up Solr for DSpace 7 Preview 1

Setting up Solr for DSpace 7 Preview 1

These steps worked for me (cwilper) as of 2019/05/20. You don't need to deploy Solr this way...I'm just documenting what worked for me today.

Define a BASE dir

This is the parent directory of your dspace and solr installs. For example, if you will be deploying your dspace install under $HOME/Work/dspace/community-7/dspace, then BASEDIR should be set as follows:

@cwilper
cwilper / CommandRunner.java
Last active January 30, 2019 14:19
Java example of using ProcessBuilder synchronously and reading stdout/err from temporary files. See main method.
package com.atmire.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@cwilper
cwilper / nginx.conf
Created March 15, 2018 19:28
Nginx Permanent Redirect for Handle Prefix Change
server {
# Permanently redirect default DSpace handle prefix URLs to new, registered handle prefix
rewrite ^/handle/123456789/(.*)$ /handle/PUT-REGISTERED-PREFIX-HERE/$1 permanent;
}