Skip to content

Instantly share code, notes, and snippets.

View jagtesh's full-sized avatar

Jag Chadha jagtesh

View GitHub Profile
@jwbee
jwbee / jq.md
Last active April 27, 2025 11:31
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

Enable & Using vGPU Passthrough

This gist is almost entirely not unlike Derek Seaman's awesome blog:

Proxmox VE 8: Windows 11 vGPU (VT-d) Passthrough with Intel Alder Lake

As such please refer to that for pictures, here i will capture the command lines I used as i sequence the commands a little differently so it makes more logic to me.

This gists assumes you are not running ZFS and are not passing any other PCIE devices (as both of these can require addtional steps - see Derek's blog for more info)

This gist assumes you are not running proxmox in UEFI Secure boot - if you are please refer entirely to dereks blog.

@8bitgentleman
8bitgentleman / roam-backend-api-example.py
Last active September 27, 2023 17:28
Example python functions for accessing the Roam Research Alpha Backend API
import requests
import json
import pprint
GRAPH_NAME = "GRAPH"
API_TOKEN_READ = "TOKEN"
API_TOKEN_WRITE = 'TOKEN'
BASE_URL = "https://api.roamresearch.com"
ENDPOINT_q = f"/api/graph/{GRAPH_NAME}/q"
@rain-1
rain-1 / LLM.md
Last active April 8, 2025 13:49
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@spenserhale
spenserhale / git-batch-push.sh
Last active May 6, 2025 06:06
When your repo exceeds upload limit (GitHub 2GB), you can push in batches so you can store up to total size limit. (100GB) (Warning uses force push, ideally should be used for setting up new remote, once)
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=250
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
@lucasmenares
lucasmenares / Disable Device Enrollment Program (DEP) notification on macOS Ventura (Apple Silicon Chips).md
Last active January 24, 2024 21:32
Disable Device Enrollment Program (DEP) notification on macOS Sonoma/Ventura (Apple Silicon Chips)

This worked for me on M1 Pro 2021 with MacOS Ventura, original method was for Big Sur but I changed it using a different type of domain block since the old method doesn't work anymore:

First of all, if you want to trigger the notification you can use this command: sudo profiles show -type enrollment

Now we will start. First block your Mac from reaching the domain iprofiles.apple.com. For this you can use your hosts file like:

echo "0.0.0.0 iprofiles.apple.com" | sudo tee -a /etc/hosts

or blocking them from your firewall.

@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active April 25, 2025 22:53
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@tombarys
tombarys / children-block-count.clj
Last active October 5, 2023 01:18
Show children block count
;; Instructions for including the Clojure script (this) into your Roam can be found in my article
;; here: https://lifehacky.net/how-to-list-namespaces-and-find-more-in-roam-research-5c25d9f24556
;; Search for section "How to make it work in your Roam?" and think of "better-search" as of "children-block-count"
(ns reddit.8-7-2022-reagent
(:require [roam.datascript :as rd]
[reagent.core :as r]
[roam.datascript.reactive :as rdr]))
(defn show-num [uid]
@dbieber
dbieber / roam-blocks.js
Last active October 3, 2021 11:59
JavaScript Functions for Inserting Blocks in Roam. Documentation at https://davidbieber.com/snippets/2021-02-12-javascript-functions-for-inserting-blocks-in-roam/
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function getPage(page) {
// returns the uid of a specific page in your graph.
// _page_: the title of the page.
let results = window.roamAlphaAPI.q(`
[:find ?uid
:in $ ?title
@dbieber
dbieber / detect.py
Created January 5, 2021 02:47
Automatic distraction detection. Detects visits to distraction websites on your phone from your computer.
"""Automatic distraction detection. Work in progress.
Usage:
python detect.py main
"""
import fire
import subprocess
import plyvel
import re