Skip to content

Instantly share code, notes, and snippets.

View mystix's full-sized avatar

Marc mystix

  • Singapore
View GitHub Profile
@othyn
othyn / 00_local_llm_guide.md
Last active April 17, 2025 06:36
Setting up a local only LLM (Qwen/Llama3/etc.) on macOS with Ollama, Continue and VSCode

Setting up a local only LLM (Qwen/Llama3/etc.) on macOS with Ollama, Continue and VSCode

As with a lot of organisations, the idea of using LLM's is a reasonably frightning concept, as people freely hand over internal IP and sensitive comms to remote entities that are heavily data bound by nature. I know it was on our minds when deciding on LLM's and their role within the team and wider company. 6 months ago, I set out to explore what offerings were like in the self-hosted and/or OSS space, and if anything could be achieved locally. After using this setup since then, and after getting a lot of questions on it, I thought I might share some of the things I've come across and getting it all setup.

Que in Ollama and Continue. Ollama is an easy way to locally download, manage and run models. Its very familiar to Docker in its usuage, and can probably be most conceptually aligned with it in how it operates, think imag

@thesamesam
thesamesam / xz-backdoor.md
Last active April 7, 2025 09:15
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@adulau
adulau / http2-rapid-reset-ddos-attack.md
Last active November 9, 2024 10:01
HTTP/2 Rapid Reset DDoS Attack

Introduction

This Gist aims to centralise the most relevant public sources of information related to the HTTP/2 Rapid Reset vulnerability. This vulnerability has been disclosed jointly by Google, Amazon AWS, and Cloudflare on 10 October 2023 at 12:00 UTC.

Please help us make this page as comprehensive as possible by contributing relevant references, vendor advisories and statements, mitigations, etc.

References

@levigroker
levigroker / dump.sh
Last active September 5, 2023 09:24
Companion to slackdump to perform selective exports and export updates from Slack
#!/bin/bash
#
# dump.sh
#
# Dumps messages and attachments for selected 1-1 direct messages, and selected named
# channels and group PMs, from the authenticated Slack workspace. Subsequent runs will
# fetch only the new content since the previous run.
#
# NOTE: This will cache the user and channel listing, so if new users or channels are
# expected it is best to delete these files so they are re-acquired.
@tuansoibk
tuansoibk / cryptography-file-formats.md
Last active April 10, 2025 20:30
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@benoit-cty
benoit-cty / slack_backup.py
Last active August 25, 2023 16:32
Script to archive Slack messages from a channel list.
'''
Script to archive Slack messages from a channel list.
You have to create a Slack Bot and invite him to private channels.
View https://github.com/docmarionum1/slack-archive-bot for how to configure your account.
Then provide the bot token to this script with the list of channels.
'''
TOKEN='xoxb-xxxxx-xxxxxx-xxxxxxxxxxx'
channels = {

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@un-def
un-def / luaversion.lua
Last active October 20, 2024 18:44
A simple function to detect Lua version
local luaversion = function()
if ({false, [1] = true})[1] then -- luacheck: ignore 314
return 'LuaJIT'
elseif 1 / 0 == 1 / '-0' then
return 0 + '0' .. '' == '0' and 'Lua 5.4' or 'Lua 5.3'
end
local f = function() return function() end end
return f() == f() and 'Lua 5.2' or 'Lua 5.1'
end
@SerKnight
SerKnight / Insomnia_workspace.json
Created February 3, 2020 22:22
Insomnia workspace to accompany Xero API tutorial
{
"_type":"export",
"__export_format":4,
"__export_date":"2020-02-03T22:17:29.587Z",
"__export_source":"insomnia.desktop.app:v7.0.6",
"resources":[
{
"_id":"req_1a56b9b120a94264b79018d1ecee95f3",
"authentication":{
"accessTokenUrl":"https://identity.xero.com/connect/token",
@channeladam
channeladam / Xero-ClientCredentials-Workaround-2020
Last active August 8, 2022 15:08
Xero client_credentials workaround - January 2020
Here is a workaround for the lack of a client credentials flow in Xero's OAuth 2.0 / OpenID Connect implementation.
From Xero's FAQ: https://developer.xero.com/faq/all/oauth-private
"Is there an equivalent of two-legged private apps in OAuth 2.0?
No, all users will follow the same OAuth 2.0 code flow.
Once you have an access token and refresh token you can refresh indefinitely or until the token is revoked by the user."
Workaround:
1. Login to Xero as the Xero user to use for the machine-to-machine flow workaround.