Skip to content

Instantly share code, notes, and snippets.

View pdxjohnny's full-sized avatar
🐢
Rolling Alice...

John Andersen pdxjohnny

🐢
Rolling Alice...
View GitHub Profile
{
"descriptor": {
"method": "CollectionsWrite",
"protocol": "https://decentralized-social-media.org/protocol",
"protocolVersion": "1.1.0",
"contextId": "UUID_STRING",
"schema": "https://decentralized-social-media.org/schemas/post",
"published": true
},
"authorization": {
@moyix
moyix / CodeGen_GPTJ_Conversion.md
Last active January 5, 2024 12:50
How to convert the SalesForce CodeGen models to GPT-J

Using Linear Algebra to Convert a Large Code Model

Background

The SalesForce CodeGen models are a family of large language models trained on a large amount of natural language data and then fine-tuned on specialized datasets of code. Models of size 350M, 2B, 6B, and 16B parameters are provided in three flavors:

  • nl, the base model trained on The Pile, a large natural language dataset compiled by EleutherAI
  • multi, which is fine-tuned from the nl model on a dataset of code in multiple languages, scraped from GitHub, and
  • mono, which is fine-tuned from the multi model on Python code only.
import UUID from './uuid.mjs';
const Listeners = {};
const Callbacks = {};
const baseUrl = chrome?.runtime?.getURL ? chrome.runtime.getURL('') : '';
const env = location.href === (baseUrl + 'extension/background.mjs') ? 'background' : baseUrl ? 'content' : 'page';
const getListeners = topic => Listeners[topic] || (Listeners[topic] = []);

Tenant Bridges

This document defines a mechanism to establish multiplexed, platform-level information flow between the tenant scopes of different, multitenant platform-as-a-service (PaaS) or software-as-a-service (SaaS) systems. In particular, this specification introduces the concept of a tenant-bridging “channel” that is established as a communication link between the tenants of two cooperating platforms. While the mechanism defined here is quite simple, the solved problem requires quite a bit of context setting:

What are we solving?

The "cooperating platforms" are commonly from different cloud service vendors and are addressing different customer scenarios. Examples might be enterprise resource planning (ERP) on one side and general-purpose application hosting on the other. A scenario to enable might be for the ERP system to be easily extensible with event-driven serverless functionality hosted on the other platform.

In such a scenario, it will likely be the same customer organization who is a te

@chadbrewbaker
chadbrewbaker / bcctools.yaml
Created March 14, 2021 19:43
Example for eBPF profiling on Github Actions
name: CICD
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ${{ matrix.job.os }}
strategy:

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@marc-h38
marc-h38 / shallow_backfire.sh
Last active April 25, 2023 22:33
Shallow cloning creates a pull request with 1 million commits
#!/bin/sh
# Marc Herbert @ gmail.com
set -e
set -x
# git clone --depth "shallow cloning" can save continuous integration a
# lot of time. This demo shows how shallow cloning can turn a
# single-commit pull request into a pull request with 1 million commits!
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@nickjj
nickjj / 01-image-slugs.sh
Last active July 11, 2023 19:04
List of DigitalOcean slugs for images, sizes and regions.
# Listed generated on 2021-08-07 at 3:45am EST
curl -s -X GET -H "Content-Type: application/json" \
-H "Authorization: Bearer ${DIGITALOCEAN_ACCESS_TOKEN}" \
"https://api.digitalocean.com/v2/images?page=1&per_page=100&type=distribution" \
| jq '.images[].slug' | sort
"centos-7-x64"
"centos-8-x64"
"centos-stream-8-x64"
"debian-10-x64"
@katef
katef / life-utf8.c
Last active August 4, 2023 01:55
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*