Skip to content

Instantly share code, notes, and snippets.

View Gerst20051's full-sized avatar

Andrew Gerst Gerst20051

View GitHub Profile
@infused-kim
infused-kim / ls_colors_gen.py
Last active April 17, 2023 01:30
Exa LS_COLORS theme generator
#!/usr/bin/env python
#
# What is this:
# This script generates an LS_COLORS theme.
#
# By default it is using the same colors as the ls replacement exa. The
# purpose is to generate an LS_COLORS theme that is consistent with exa's
# colors so that it can be used by other tools like fzf.
#
@sts10
sts10 / rust-command-line-utilities.markdown
Last active October 4, 2026 04:00
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active October 8, 2026 06:03
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
# frozen_string_literal: true
class RateLimiter
class Error < StandardError; end
class UnknownIntervalError < RateLimiter::Error; end
class WaitTimeError < RateLimiter::Error; end
attr_reader :bucket_name, :interval, :maximum_wait_time, :rate, :redis
def initialize(bucket_name, options = {})
# frozen_string_literal: true
# @see https://gist.github.com/commitshappen/5928740df2e01f256778c2dbd14364a5 for the RateLimiter
module RateLimitable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def rate_limiter(bucket_name, global: {}, local: {})
module Middleware
class BasicMiddleware
def initialize(app)
@app = app
end
def call(env)
# Before the app is called.
status, headers, response = @app.call(env)
# After the app is called.
@christophberger
christophberger / futures.go
Last active November 28, 2022 07:42
Code from appliedgo.net/futures
package main
import (
"fmt"
"time"
)
func main() {
c := make(chan int)
@Konfekt
Konfekt / git-diff.md
Last active October 28, 2025 11:14
git diff common binary files

To diff common binary files in git using appropriate external converters such as unrtf, pandoc, docx2txt.pl, odt2txt, git-xlsx-textconv, git-xlsx-textconv.pl or pptx2md, add to ~/.config/git/config the lines

[diff]
    [diff "pdf"]
      binary = true
      textconv = "f(){ if command -v pdftotext >/dev/null 2>&1; then pdftotext -layout -enc UTF-8 -nopgbrk -q \"$1\" -; else cat \"$1\"; fi; }; f"
      # textconv = pdfinfo
      cachetextconv = true
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.7.2"
@iximiuz
iximiuz / ethsend.py
Last active December 28, 2024 23:14
Send Ethernet frames from Python.
#!/usr/bin/env python3
# Usage: ethsend.py eth0 ff:ff:ff:ff:ff:ff 'Hello everybody!'
# ethsend.py eth0 06:e5:f0:20:af:7a 'Hello 06:e5:f0:20:af:7a!'
#
# Note: CAP_NET_RAW capability is required to use SOCK_RAW
import fcntl
import socket
import struct