Skip to content

Instantly share code, notes, and snippets.

View tony-sol's full-sized avatar
🫥
in a burnout recovery

Tony Soloveyv tony-sol

🫥
in a burnout recovery
View GitHub Profile
"extensionsGallery": {
-- "nlsBaseUrl": "https://www.vscode-unpkg.net/_lp/",
-- "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
-- "itemUrl": "https://marketplace.visualstudio.com/items",
-- "publisherUrl": "https://marketplace.visualstudio.com/publishers",
-- "resourceUrlTemplate": "https://{publisher}.vscode-unpkg.net/{publisher}/{name}/{version}/{path}",
-- "controlUrl": "https://az764295.vo.msecnd.net/extensions/marketplace.json"
++ "serviceUrl": "https://open-vsx.org/vscode/gallery",
++ "itemUrl": "https://open-vsx.org/vscode/item"
},
@tony-sol
tony-sol / via.design.v2.json
Created September 11, 2024 14:35
Vortex Model M SSK us6.25 Via configuration
{
"name": "Model M-us6.25",
"vendorId": "0xEB88",
"productId": "0x0024",
"lighting": "qmk_rgblight",
"matrix": {
"rows": 6,
"cols": 18
},
"layouts": {
@tony-sol
tony-sol / convert-yaml-to-env-for-go-cobra-via-yq.md
Created August 13, 2024 18:04
How to convert yaml config file to envs for go app with cobra config parser

#tools/yq

Install yq for handy work with yaml

Convert yaml to env

 yml2env() {
	 yq --unwrapScalar=false --output-format=props "${1:-.} | (.. | select((tag == \"\!\!map\" or tag == \"\!\!seq\") and length == 0)) = \"\" | ... comments=\"\"" | awk '{gsub(/\./,"_",$1)} {$1=toupper($1);print}' | sed 's/ = /=/g'
}
@tony-sol
tony-sol / secret-notes-from-macos-keychain.md
Last active August 13, 2024 17:57
Get macos keychain secure note content from command line

Secure notes in macos keychain are actually hex dumped generic passwords, with plist as password value.

This plist contains data node, which is base64 encoded rich text, but also a string node, which is just plain text.

So fetching secure note plain text via command line (yq required)

get_secret_note() {
	security find-generic-password -C note -s "$1" -w | xxd -revert -plain | yq --input-format xml --prettyPrint '.plist.dict.string'
}
@tony-sol
tony-sol / colors.sh
Created April 17, 2024 15:51
Print all 256 colors in truecolor term
for i in {0..255}
do
printf "\x1b[38;5;%smcolour%s " "${i}" "${i}"
if (( ($i + 1) % 8 == 0 ))
then
echo ""
fi
done
@tony-sol
tony-sol / git-get-head
Last active April 17, 2024 14:57
git get-head command for fetch default branch name
#!/bin/zsh
set -e
git_get_head() {
(git symbolic-ref "refs/remotes/${@}/HEAD" --short || git remote show "${@}" ) 2>/dev/null | grep "${@}/\|HEAD branch" | sed -E "s#${@}/|HEAD branch:##" | sed 's# ##g'
}
git_get_head "${1}"
exit 0
@tony-sol
tony-sol / algorithms.md
Created June 17, 2023 12:49
Пособие по алгоритмам, сгенерированное ChatGPT (формат obsidian)
tag
algos
computer-science

Алгоритмы и структуры данных

  • [[#Общая часть|Общая часть]]
  • [[#1. Сложность алгоритмов|1. Сложность алгоритмов]]
@tony-sol
tony-sol / .wsl-git.md
Created March 19, 2023 16:17 — forked from carlolars/.wsl-git.md
HOWTO: Use WSL and its Git in a mixed development environment

How to setup a development environment where Git from WSL integrates with native Windows applications, using the Windows home folder as the WSL home and using Git from WSL for all tools.

Note if using Git for Windows, or any tool on the Windows side that does not use Git from WSL then there will likely be problems with file permissions if using those files from inside WSL.

Tools

These are the tools I use:

  • git (wsl) - Command line git from within WSL.
  • Fork (windows) - Git GUI (must be used with wslgit)
  • wslgit - Makes git from WSL available for Windows applications. Important! Follow the installation instructions and do (at least) the first optional step and then the Usage in Fork instructions.
@tony-sol
tony-sol / Ansible-101.md
Last active May 12, 2022 14:27
Quickstart guide to ansible for those who have never used it before

Ansible

Основы Ansible для новичка

Эта статья не замена https://docs.ansible.com/, а скорее 101 - база, которая поможет начать понимать основные принципы работы

Что такое Ansible

Ansible - в каноничном определении, система управления конфигурациями.