Skip to content

Instantly share code, notes, and snippets.

@danthegoodman1
danthegoodman1 / aws-timesync-ptp.sh
Created July 3, 2025 03:42
Setup AWS Timesync with the PTP clock for Ubuntu (x86 and arm tested)
#!/usr/bin/env bash
set -euo pipefail
echo "[1/6] Install build deps…"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
build-essential git linux-headers-$(uname -r)
echo "[2/6] Fetch & compile ENA with PHC…"
workdir=$(mktemp -d)
@rain-1
rain-1 / base model trends.md
Last active July 3, 2025 03:47
base model trends.md
@zcroll
zcroll / JetBrains products Activation code until december 13 2024
Last active July 3, 2025 03:47
JetBrains products Activation code until december 13 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25r+AIOa0u+W3peS9nOWupCAgcmVuIHpodW4gZGlhbiBtaW5n77yBIiwiYXNzaWduZWVFbWFpbCI6IlJvYmJ5X1dlbmlnZXJAb3V0bG9vay5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiREIiLCJwYWlkVXBUbyI6IjIwMjQtMTAtMTQiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJJSSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNDIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNGIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkRTIiwicGFpZFVwVG8iOiIyMDI0LTEwL
@hroi
hroi / fish_jj_prompt.fish
Last active July 3, 2025 03:47
Jujutsu (jj) prompt for fish-shell
# Place me in ~/.config/fish/functions
# Then add me to `fish_vcs_prompt`: `funced fish_vcs_prompt` and save it to
# your personal config: `funcsave fish_vcs_prompt;`
function fish_jj_prompt --description 'Write out the jj prompt'
# Is jj installed?
if not command -sq jj
return 1
end
@artfulhacker
artfulhacker / gist:a6eb800e58f2eb6f9231
Created August 5, 2014 00:50
Military/Government IP Blocks
<?php
// Group detection by IP address
//
// [Region Abbreviation, Military/Government]
// Force Varnish to NEVER Cache this page
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// JSON Headers
@philschmid
philschmid / GEMINI.md
Last active July 3, 2025 03:31
Gemini CLI Plan Mode prompt

Gemini CLI Plan Mode

You are Gemini CLI, an expert AI assistant operating in a special 'Plan Mode'. Your sole purpose is to research, analyze, and create detailed implementation plans. You must operate in a strict read-only capacity.

Gemini CLI's primary goal is to act like a senior engineer: understand the request, investigate the codebase and relevant resources, formulate a robust strategy, and then present a clear, step-by-step plan for approval. You are forbidden from making any modifications. You are also forbidden from implementing the plan.

Core Principles of Plan Mode

  • Strictly Read-Only: You can inspect files, navigate code repositories, evaluate project structure, search the web, and examine documentation.
  • Absolutely No Modifications: You are prohibited from performing any action that alters the state of the system. This includes:
@szydan
szydan / gist:b225749445b3602083ed
Last active July 3, 2025 03:29
<U+FEFF> character showing up in files. How to remove them?
1) In your terminal, open the file using vim:
vim file_name
2) Remove all BOM characters:
:set nobomb
3) Save the file:
:wq
@Rami-Majdoub
Rami-Majdoub / README.md
Last active July 3, 2025 03:28
remove UNREGISTERED from StarUML
  • export as SVG (File > Export Diagram As > SVG... > Save)
  • open SVG file in web browser
  • open console and run
document.querySelectorAll("text").forEach(e => e.innerHTML = e.innerHTML === "UNREGISTERED"? "":e.innerHTML)
  • take screenshot
@inf3rtil
inf3rtil / demo_llm_rigol_dp800.py
Created July 2, 2025 06:55
LLM on Rigol DP800
from telegram import Update
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
import pyvisa
import ollama
BOT_TOKEN = "meu token gerado no botfather"
system_context="""
You are a natural language to fixed command converter for a power supply (channel).
1. translate from portuguese to english and change all string numbers to digits values if necessary
@inf3rtil
inf3rtil / RigolDP800.py
Created May 9, 2025 21:30
Rigol DP800
"""Use a Rigol DP800 to monitor load and store test on database."""
import pyvisa
import time
import mysql.connector
from datetime import datetime, timezone
def connect_to_database():
"""Connect to mysql database."""
try: