Skip to content

Instantly share code, notes, and snippets.

View jmarhee's full-sized avatar

jmarhee

View GitHub Profile
@jmarhee
jmarhee / .muttrc
Last active May 7, 2024 08:26 — forked from lucianposton/.muttrc
mutt: muttrc settings for ProtonMail Bridge
set from="[email protected]"
set my_user="[email protected]"
set my_pass="pass"
set smtp_port="1025"
set imap_port="1143"
set ssl_starttls=yes
set smtp_url="smtp://$my_user:[email protected]:$smtp_port"
@jmarhee
jmarhee / minio-nginx.conf
Created May 30, 2023 21:27
Nginx config for Minio UI and API for mcli access
server {
server_name api.mart.data.internal;
access_log on;
location / {
proxy_set_header Host $host;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:9000;
@jmarhee
jmarhee / README.md
Created April 9, 2023 05:44
Generate an epidemic curve with gnuplot from a CSV of data.

Epidemic Curve Graph Bash Script

This is a Bash script that generates an epidemic curve graph using the gnuplot tool. The script takes in a data file in CSV format and outputs a PNG image of the epidemic curve.

Prerequisites

In order to use this script, you will need to have gnuplot installed on your system. If you're using a Debian-based distribution, you can install gnuplot using the following command:

sudo apt-get install gnuplot
@jmarhee
jmarhee / go.mod
Created April 9, 2023 05:25
Generate UUIDs in Go.
module uuid-generator
go 1.16
require github.com/google/uuid v1.2.0
@jmarhee
jmarhee / Cargo.toml
Created April 9, 2023 05:20
Delete all Kubernetes Pods in a specific namespace older than a user-specified number of hours. (i.e. all Pods in namespace "app-time-limited" older than 1 hour)
[dependencies]
kube = "0.64.0"
k8s-openapi = "0.12.0"
@jmarhee
jmarhee / post.py
Created March 22, 2023 20:59
Dump directory of video files to screenshots, script to randomly select a screenshot and post to Twitter.
import tweepy
import os, random
def main():
twitter_auth_keys = {
"consumer_key" : os.environ['CONSUMER_KEY'],
"consumer_secret" : os.environ['CONSUMER_SECRET'],
"access_token" : os.environ['ACCESS_TOKEN'],
#include <stdio.h>
// The payoffs for each player in the game
int player1_payoff[2][2] = {{3, 0}, {5, 1}};
int player2_payoff[2][2] = {{3, 5}, {0, 1}};
// Function to calculate the Nash equilibrium
void calculate_nash_equilibrium() {
int row, col;
// Find the maximum payoff for player 1 in each row

NashPy Quickstart for Python Programmers

nashpy is a Python library for computing equilibria in game theory. It provides tools for computing Nash equilibria, correlated equilibria, and other solution concepts in both cooperative and non-cooperative games.

This quickstart document will cover the basics of using nashpy to solve simple two-player games.

Installation

To install nashpy, you can use pip:

@jmarhee
jmarhee / canal-k3s-auto.sh
Last active January 4, 2022 22:27
[Installing Canal](https://projectcalico.docs.tigera.io/getting-started/kubernetes/flannel/flannel) requires updating a `CALICO_IPV4POOL_CIDR` environment variable in the installation manifest for use with K3s, which has a default Pod CIDR of "10.44.0.0/24"-- this will modify the manifest to reflect the current Pod CIDR.
## Applies the modified manifest to K3s, which automatically applies the contents of /var/lib/rancher/k3s/server/manifests
curl -s https://docs.projectcalico.org/manifests/canal.yaml | sed -e 's| # - name: CALICO_IPV4POOL_CIDR| - name: CALICO_IPV4POOL_CIDR|g' -e "s| # value: \"192.168.0.0/16\"| value: \"$(kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}')\"|g" | \
tee -a /var/lib/rancher/k3s/server/manifests/canal.yaml
from plexapi.myplex import MyPlexAccount
import os
plex_auth_info = {
"username" : os.environ['PLEX_USERNAME'],
"password" : os.environ['PLEX_PASSWORD'],
"server" : os.environ['PLEX_SERVER_NAME']
}
account = MyPlexAccount(plex_auth_info['username'], plex_auth_info['password'])