Skip to content

Instantly share code, notes, and snippets.

View aculich's full-sized avatar
😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG

Aaron Culich aculich

😀
Having fun exploring repos for Computational Text Analysis with D-Lab CTAWG
View GitHub Profile
  1. Current Situation:

    • The system has multiple kernel versions installed:
      • 4.9.127-32.el7.x86_64 (newest)
      • 3.10.0-1160.11.1.el7.x86_64 (currently booting)
      • 3.10.0-957.21.3.el7.x86_64 (your preferred version)
      • Several debug kernels
  2. The Issue:

    • The grubenv file shows that the system is set to boot into the debug version of 3.10.0-1160.11.1
    • This is likely happening because of the savedefault option in each menu entry, which saves the last booted entry as the default
#!/usr/bin/env python3
import os
import requests
from datetime import datetime
import json
class LegalServerAPI:
def __init__(self, site_name, api_key):
"""Initialize the API client
@aculich
aculich / zoom-smart-chapter.user.js
Created March 8, 2025 13:35
Zoom Smart Chapters Downloader
// ==UserScript==
// @name Zoom Smart Chapters Downloader
// @namespace http://tampermonkey.net/
// @version 1.2
// @description Download Zoom Smart Chapters in JSON and Markdown formats
// @author Your name
// @match https://*.zoom.us/rec/play/*
// @match https://*.zoom.us/rec/share/*
// @grant none
// ==/UserScript==

Mermaid on Github Examples

All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14

Pros & Cons:

  • Pro: You don't need to care about the layout.
  • Con: You cannot control the layout.

Notes:

  • Not all the features of Mermaid (in particular symbols B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
@aculich
aculich / bookmarkletify.sh
Last active January 16, 2025 10:42
converts a given JavaScript file into a bookmarklet using terser
#!/usr/bin/env bash
# Overview:
# This script ensures that npm and the terser package are installed,
# and it converts a given JavaScript file into a bookmarklet. The
# output is saved as bmlet_<original_file_name>.js. The script does the following:
# 1. Checks if npm is installed.
# 2. Installs terser globally if not already installed.
# 3. Minifies the provided JavaScript file and converts it into a bookmarklet format.
# 4. Outputs the result into a new file named bmlet_<input_file_name>.js.
#!/usr/bin/env python
import os
import sqlite3
from tqdm import tqdm
def get_table_schema(cursor, table_name):
cursor.execute(f"PRAGMA table_info({table_name})")
return {col[1]: col[2] for col in cursor.fetchall()}

Quick Start Tutorial: Setting Up SSH for a Mac Laptop to Access Remote Linux Environments

This tutorial will guide you through setting up SSH on a Mac laptop to securely connect to a remote Linux machine with two different user accounts. We'll cover SSH key generation, integrating keys with the Mac keychain, updating authorized keys on the remote machine, and configuring VS Code for seamless access.

Step 1: Generate SSH Keys on the Mac

  1. Open Terminal on your Mac.
  2. Generate a new SSH key pair:
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
@aculich
aculich / add_to_zshrc.sh
Created August 26, 2024 05:48 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@aculich
aculich / gcom.plugin.zsh
Last active August 26, 2024 06:42 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcom` command.
# or add it to ~/.oh-my-zsh/custom/plugins
#
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
#!/bin/bash
# turn GCP (Google Cloud Platform) metadata key/values into shell environment variables
# Function to fetch metadata and set as environment variable
fetch_and_export() {
local path=$1
local value=$(curl "http://metadata.google.internal/computeMetadata/v1/${path}" -H "Metadata-Flavor: Google" --silent)
if [ $? -eq 0 ] && [ ! -z "$value" ]; then
# Convert metadata keys to uppercase and replace invalid characters for shell variable names