Skip to content

Instantly share code, notes, and snippets.

View Tony-Sol's full-sized avatar
😭

Tony Soloveyv Tony-Sol

😭
View GitHub Profile
@Tony-Sol
Tony-Sol / README.md
Created May 3, 2024 19:45
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 - в каноничном определении, система управления конфигурациями.