Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@thomashartm
thomashartm / aws-sam-colima.md
Last active May 7, 2024 21:58
Enable AWS SAM local to run without Docker Desktop but Colima + Docker Daemon on MacOs

AWS SAM local commands without Docker Desktop

AWS SAM local commands check for the existance of DOCKER_HOST. If the variable is not present, it will fail with the following error message

Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running?

Replace it with Colima

Point DOCKER_HOST to unix socket of the Docker Daemon.

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 21:58
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@kirilkirkov
kirilkirkov / Multipart RAR Files
Created October 19, 2015 08:29
What is multipart archive
Hi! I am a complete newbie to RAR files and I want to learn what to do with them. I was just wondering:
What is a multipart RAR file?
1. A multipart RAR file is a standard RAR file, that was split into many smaller parts. This way, very large Archives can be placed on many small mediums, e.g. CDs.
2. The parts of a multipart RAR file are usually named "xyz.part1.rar", "yxz.part2.rar" etc. or "xyz.rar", "xyz.r01", "xyz.r02" etc. Depending on how many parts have been generated, there may be a few or a few hundred of these files.
3. A multipart RAR file can additionally be encrypted and protected by a password. Read more on password protection in the protected RAR files section of this FAQ.
4. BE CAREFUL: Sometimes multipart RAR files are used for phishing. Learn more in the phishing RAR files section of this FAQ.
5. Sometimes a multipart RAR file can be damaged and corrupted. Please take a look at the corrupted RAR files section of this FAQ to learn more.
Hi! I am an absolute beginner and
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Home/Core N 3KHY7-WNT83-DGQKR-F7HPR-844BM
Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Professional Enterprise
Professional Workstation
Enterprise NPPR9-FWDCX-D2C8J-H872K-2YT43
Enterprise N DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
@joerodgers
joerodgers / Get-SiteCollectionPermission.ps1
Last active May 7, 2024 21:53
Example script that users the PnP.PowerShell module to export the permissions of all uniquely permissioned webs and associated M365 Groups Owners and M365 Group Members
#requires -Modules @{ ModuleName="PnP.Powershell"; ModuleVersion="1.11.0" }
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
function Get-SiteCollectionPermission
{
<#
.SYNOPSIS
Returns all the webs in the site collection with unique permissions. If the site is group connected, also exports the group owners and group members.
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 7, 2024 21:52
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@ad3m3r5
ad3m3r5 / proxmox-unprivileged-lxc-coral-usb.md
Last active May 7, 2024 21:50
USB Coral TPU Passthrough for Unprivileged LXC in Proxmox

This guide is how I got a Coral TPU (USB) working in an unprivileged LXC container.

At the end, you should be able to use the Coral TPU for inferencing inside of an unprivileged LXC container as well as Docker containers within the LXC, such as Frigate.

This does NOT require privileged LXC or docker container.

NOTES:

  • Proxmox Version: 8.1.10
  • LXC Container: Debian 10/11 (Example #1)
    • Debian 12 was used as the Docker host (Example #2)
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.