Skip to content

Instantly share code, notes, and snippets.

View tony-sol's full-sized avatar
πŸ«₯
total burnout

Tony Soloveyv tony-sol

πŸ«₯
total burnout
View GitHub Profile
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active September 22, 2026 01:26
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

-- Summary: get multiple file contents into one and write it back
-- Config: configuration should be done directly inside source code. This one is very niche so I won't make it into a plugin
-- Default it will find all file (exclude hidden files, take a look at line 47) in the current directory
-- If needed specific file pattern then you can pass pattern into the read() function like: require'onefiler'.read("/*.zig")
-- Change M.filename_deco to suit your file type, I recommend make it a comment line
-- It will write to any file in the onefile if match, so be careful before write
-- Usage:
-- Keymap: you can assign keymap for it
@moreati
moreati / ansible_playbook_keywords_table.rst
Last active March 14, 2026 17:31
Table showing Ansible playbook keywords that can be used at play, role, block, or task level

Generated using development version of Ansible on 15 Sep 2024. Details may differ from released versions.

@olets
olets / .zshrc
Created July 28, 2024 03:45
zsh completion setup
# If a completion is performed with the cursor within a word, and a full completion is inserted, the cursor is moved to the end of the word. That is, the cursor is moved to the end of the word if either a single match is inserted or menu completion is performed.
setopt always_to_end
# Automatically use menu completion after the second consecutive request for completion, for example by pressing the tab key repeatedly. This option is overridden by MENU_COMPLETE.
setopt auto_menu
# If unset, the cursor is set to the end of the word if completion is started. Otherwise it stays there and completion is done from both ends.
setopt complete_in_word
# On an ambiguous completion, instead of listing possibilities or beeping, insert the first match immediately. Then when completion is requested again, remove the first match and insert the second match, etc. When there are no more matches, go back to the first one again. reverse-menu-complete may be used to loop through the list in the other direction. This option over
@saharshbhansali
saharshbhansali / ObsidianMarkdownGuide.md
Last active September 7, 2026 02:43
Markdown Formatting Guide for Obsidian. Import this gist as a file into your Obsidian Vault to view it and to test new themes. Certain community plugins are required for a few features.

Markdown Formatting Guide for Obsidian

Learn how to apply basic formatting to your Obsidian notes, usingΒ Markdown. Import this as a note into your Obsidian Vault to view it and to test new themes. Certain community plugins are required for a few features.


Basic Formatting Syntax


Paragraphs

To create paragraphs, use a blank line to separate one or more lines of text.

using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@vancluever
vancluever / macos-big-sur-ssh-agent-local-no-disable-sip.md
Last active October 19, 2025 11:05
Run SSH Agent w/Modified Options (MacOS Big Sur, No Homebrew, No SIP Modification)

Run SSH Agent w/Modified Options (MacOS Big Sur, No Homebrew, No SIP Modification)

The following will show you how you can modify the startup options of the SSH agent supplied by MacOS in a non-invasive way. This can be useful for doing things like setting a key lifetime, which can then be used with AddKeysToAgent in your ~/.ssh/config to automate the timing out of saved keys. This ensures that your passphrase is re-asked for periodically without having to shutdown, re-log, or having it actually persisted in keychain, the latter being almost as bad as having no passphrase at all, given that simply being logged in is generally enough to then use the key.

This method does not modify the system-installed SSH agent service (com.openssh.ssh-agent), but rather duplicates its functionality into a user-installed launch agent where we can then modify the options. Modifying the system-installed service is becoming increasingly harder to do; SIP generally protects

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]}