Skip to content

Instantly share code, notes, and snippets.

View polynomial's full-sized avatar

Benjamin Smith polynomial

View GitHub Profile
@mbbx6spp
mbbx6spp / git-tips-part-1.org
Last active April 29, 2023 02:17
Git tips and tricks for dev group presentation

Git Tips

Config

Git has different levels of configuration that apply to different “scopes”:

  • system (almost never needed; not covered here)
  • global (which is “global for a user” scoped)
  • local (which is specific to one local clone)
  • worktree (which only applies to the current worktree; only relevant if you work with worktree s)
  • file (not covered here but you can set a git configuration option, when relevant at the file level, to one file)
@mbbx6spp
mbbx6spp / 00README.org
Last active August 2, 2022 15:30
A gist of the commands, metadata file (.desktop), and script I wrote to delegate web URLs to the correct sandboxed web browser inside of the appropriate user profile in Linux. Should work in all distros.

Delegating web requests in Linux to correct browser profile

A few months ago I set this up and here is the write up on it since yesterday, while talking to a fellow Linux user, they found it intriguing.

My requirements

Any URL I click in Slack, Signal desktop app, or launch via terminal actions should launch into the correct sandboxed, user-profile web browser instance (in precedence order):

  • https://github.com/<workorg>.* should open in the work Firefox profile
@mbbx6spp
mbbx6spp / tlatoolbox.nix
Last active March 17, 2018 05:21
nixpkgs ships with a tlaplus package which contains some standalone tools like tla2tex and tla2any etc but for the entire IDE I had to come up with my own package. I haven't submitted it upstream yet as the layout of the package dir is entirely wrong so I need to work on that first but it works for far.
{ stdenv, fetchurl, gtk2, xorg, patchelf, unzip, makeWrapper, jre }:
let version = "1.5.6"; in
stdenv.mkDerivation rec {
inherit version;
name = "TLAToolBox-${version}";
src = fetchurl {
url = "https://tla.msr-inria.inria.fr/tlatoolbox/products/TLAToolbox-${version}-linux.gtk.x86_64.zip";
sha256 = "1b5sf4d7sv0x1hg4f1if3q7wzsi09dr8fv71qfagj8m25zrh3lvj";
};
@cocreature
cocreature / Derangement.hs
Created January 10, 2018 18:32
An explanation for the benchmark results in https://github.com/vmchale/ats-benchmarks
-- This gist provides an explanation for why Haskell is significantly
-- faster than ATS and Rust in [vmchale’s great
-- benchmarks](https://github.com/vmchale/ats-benchmarks). What’s
-- happening is that the `derangements` list gets memoized so the
-- benchmark only checks the performance of (!!). `derangements'`
-- prevents GHC from memoizing the list and results in a significant
-- loss of performance. Criterion does try to prevent memoization but
-- it only prevents memoization of the function application (that’s
-- why the function and the argument need to be passed separately to
-- `nf`). It cannot prevent the memoization of the `derangements`
@techhazard
techhazard / Readme.md
Last active November 6, 2017 12:39
Nixos with ZFS on encrypted LUKS as root filesystem
@mbbx6spp
mbbx6spp / Logic.idr
Last active August 1, 2020 16:13
Propositions *AS* Types: The Cheatsheet (with Fancy Nancy)
module Logic
-- Connective is a fancy word for operator.
namespace Connectives
-- Truth: Also known as the "unit" type, (there is only one truth in value,
-- literally).
-- Scala: type Truth = Unit
-- Haskell: type Truth = ()
Truth : Type
@mbbx6spp
mbbx6spp / ldapserver.nix
Last active October 29, 2019 13:26
Suggested NixOS LDAP server configuration for Lookout. Nix, NixOS, OpenLDAP, LDAP. Basic (common sense) SSH/PAM/sudo settings too.
{ pkgs, config, ... }:
{
imports = [
<nixpkgs/nixos/modules/profiles/headless.nix>
];
# Enable sudo logins if the user's SSH agent provides a key
# present in <filename>~/.ssh/authorized_keys</filename>.
# This allows machines to exclusively use SSH keys instead of
# passwords.
@mbbx6spp
mbbx6spp / pdsh.md
Last active February 13, 2025 04:27
Tutorial on pdsh. I am revising this for pdsh from my previous tutorial on dsh from 2013 found here: https://gist.github.com/mbbx6spp/6181003

Parallel Distributed SHell (pdsh)

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

anonymous
anonymous / night-before-opsmas.txt
Created December 24, 2013 07:19
Twas the night before Opsmas..
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@epijim
epijim / googlelatitude_to_plot.py
Last active July 22, 2022 09:44
Take location data from google takeout, convert from json to kml and overlay on satellite photo
#I've merged code from two different sources, originally published by github users snowdonjames and Scarygami
#Import JSON, spit out KML
#usage.. location_history_json_converter.py input output [-h] [-f {kml,json,csv,js,gpx,gpxtracks}] [-v]
from __future__ import division
import sys
import json
import math