Skip to content

Instantly share code, notes, and snippets.

@0xack13
0xack13 / wezterm.md
Last active March 31, 2025 15:32
wezterm
❯ cat ~/.wezterm.lua
-- Pull in the wezterm API
local wezterm = require("wezterm")

-- This will hold the configuration.
local config = wezterm.config_builder()

-- This is where you actually apply your config choices
@0xack13
0xack13 / og.md
Last active February 28, 2025 18:41
og

function og() { open $(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g') }

#!/bin/bash

# Open the repo in the browser
function og() { 
  open "$(git config --get remote.origin.url | sed 's/git@\(.*\):\(.*\)\.git/https:\/\/\1\/\2/g')" 
}
@0xack13
0xack13 / gha_failure.sh
Last active March 4, 2025 18:48
gha_wfdiff.go
#!/bin/bash
# Disable pager
export GH_PAGER=cat
# Usage: ./failed_steps.sh <workflow_name_or_id> <repo_owner/repo_name>
WORKFLOW_NAME="$1"
REPO="$2"
@0xack13
0xack13 / 1-setup.md
Created February 22, 2025 16:16 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@0xack13
0xack13 / gha_action_duration.sh
Last active February 20, 2025 23:06
gha_action_duration
#!/bin/bash
# Set your GitHub personal access token (Use a fine-grained PAT with "actions: read" permission)
GITHUB_TOKEN="your_personal_access_token"
OWNER="your_github_username_or_org"
REPO="your_repository_name"
# Get the latest workflow run ID
RUN_ID=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
@0xack13
0xack13 / ngrams.py
Created February 17, 2025 16:52 — forked from benhoyt/ngrams.py
Print most frequent N-grams in given file
"""Print most frequent N-grams in given file.
Usage: python ngrams.py filename
Problem description: Build a tool which receives a corpus of text,
analyses it and reports the top 10 most frequent bigrams, trigrams,
four-grams (i.e. most frequently occurring two, three and four word
consecutive combinations).
NOTES
@0xack13
0xack13 / gha_logs
Last active January 31, 2025 02:05
gha_logs
2025-01-16T04:34:05.2325283Z Current runner version: '2.321.0'
\u001b[36m Sample ANSI message \u001b[0m
2025-01-16T04:34:05.2325283Z Current runner version: '2.321.0'
[INFO] Application started successfully.
[WARN] Configuration file not found, using defaults.
[ERROR] Failed to connect to the database.
[DEBUG] Processing request ID: 12345.
[INFO] User 'admin' logged in.
[WARN] Disk usage is above 80%.
@0xack13
0xack13 / gha_map.py
Created January 29, 2025 22:21
gha_map
import os
import yaml
from pathlib import Path
import argparse
def find_called_workflows(file_path):
"""Parse a workflow file to find referenced workflows."""
called_workflows = set()
with open(file_path, "r") as f:
try:
@0xack13
0xack13 / compare_ts.py
Last active January 28, 2025 20:28
compare_ts
import sys
from datetime import datetime
def prepend_diff(input_file, output_file):
# Read all lines from the input file
with open(input_file, 'r') as file:
lines = file.readlines()
output_lines = []
prev_timestamp = None
@0xack13
0xack13 / github-actions-notes.md
Created January 16, 2025 04:56 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions