Skip to content

Instantly share code, notes, and snippets.

View sar's full-sized avatar

Sar Malik sar

View GitHub Profile
@sar
sar / gpt-j-6b.json
Created July 3, 2021 16:47
finetuneanon's GPT-J 6B JSON props
{
"activation_function": "gelu_new",
"architectures": [
"GPTNeoForCausalLM"
],
"attention_dropout": 0,
"attention_layers": ["global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global"],
"attention_types": [
[
[
@sar
sar / nix-ui.md
Created June 12, 2021 00:40 — forked from edolstra/nix-ui.md
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@sar
sar / libvirtd-ops.md
Created June 2, 2021 15:33 — forked from jhillyerd/libvirtd-ops.md
Getting started with nixops and libvirtd

Enable libvirtd

Add:

virtualisation.libvirtd.enable = true;

and

users.users.<you>.extraGroups = [ "libvirtd" ];
@sar
sar / aws-amplify-rewrite
Last active May 27, 2021 00:07
Front-end rewrite for React.js or Gatsby.js apps on AWS Amplify
Source address Target address Type Country code
/<*> /index.html 200 OK (Rewrite) -
@sar
sar / ublock-youtube-filter
Created May 26, 2021 20:26
ublock origin filter: fix YouTube gradient in firefox-linux
##.ytp-gradient-bottom
@sar
sar / youtube-unsubscribe-all.js
Last active May 24, 2021 04:50 — forked from willwm/bookmarklet-youtube-unsubscribe-all.js
Unsubscribe from YouTube channels in bulk on target page https://www.youtube.com/feed/channels
javascript:(() => {
const timeout = 500;
const buttons = document.querySelectorAll("[aria-label^='Unsubscribe from']");
for(let button of buttons) {
setTimeout(() => {
console.group(button.attributes['aria-label'].value);
setTimeout(() => { button.click(); }, timeout);
@sar
sar / fcos-embed-config-in-image
Created May 20, 2021 03:57 — forked from mpreu/fcos-embed-config-in-image
Fedora CoreOS - Example script to inject an Ignition configuration file into the virtual machine image. Originates from this blog post: https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/.
#!/bin/env bash
set -eo pipefail
#
# Part of a Fedora CoreOS blog post on my website:
# https://www.matthiaspreu.com/posts/fedora-coreos-embed-ignition-config/
#
# Script modifies a FCOS virtual machine image and injects
# an Ignition configuration in it.
#

RBL1 - Startup Evaluation Guide

Problem

  • What is the core problem or unmet need?
  • What is the pain?

Solution

  • What is your solution?
  • What is your product or service?
{
"metadata": {
"publisherId": "nicoespeon.abracadabra",
"publisherDisplayName": "nicoespeon"
},
"name": "abracadabra",
"publisher": "nicoespeon",
"version": "4.13.1"
},
@sar
sar / docker-compose.yml
Last active April 24, 2021 22:27
Docker compose file for testing Caddy, emits default `index.html` unless volume attached to `/var/www/html`
# -----------------
# Caddy
# Docs: https://hub.docker.com/_/caddy/
# -----------------
version: "3.7"
services:
caddy:
image: caddy:latest