Skip to content

Instantly share code, notes, and snippets.

View anton-rudeshko's full-sized avatar
❄️
Snowflake

Anton Rudeshko anton-rudeshko

❄️
Snowflake
View GitHub Profile
@theodson
theodson / disable-macos-man-page-shortcuts.md
Created February 13, 2022 22:55 — forked from mrmanc/disable-macos-man-page-shortcuts.md
Turn off annoying macOS man page shortcuts via the command line

Turn off annoying macOS man page shortcuts via the command line

Context

macOS 10.14.4 introduced a keyboard shortcut that conflicts with one of IntelliJ IDEA’s best shortcuts. cmd-shift-a pops open a Terminal window running an apropos search on the text selection, rather than the command palette.

You can manually disable these keyboard shortcuts via System Preferences, but this script does this programmatically. I was unable to find any existing information about how to do this via the command line, so I rolled my own solution.

It took a long time to work out which defaults domain to find the plist for this. I probably worked out the pbs domain from this post.

@anton-rudeshko
anton-rudeshko / gpg-on-removable.md
Last active July 13, 2020 15:08
GPG on the flash drive (Windows FAT 32)

GPG on removable media

$ gpg --version
gpg (GnuPG/MacGPG2) 2.2.8
libgcrypt 1.8.3
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@anton-rudeshko
anton-rudeshko / life-on-the-command-line.md
Created April 4, 2019 10:20
Copy paste of "Life on the Command Line"

Stephen Ramsay - Sat, 04/09/2011 - 19:49

A few weeks ago, I realized that I no longer use graphical applications.

That’s right. I don’t do anything with GUI apps anymore, except surf the Web. And what’s interesting about that, is that I rarely use cloudy, AJAXy replacements for desktop applications. Just about everything I do, I do exclusively on the command line. And I do what everyone else does: manage email, write things, listen to music, manage my todo list, keep track of my schedule, and chat with people. I also do a few things that most people don’t do: including write software, analyze data, and keep track of students and their grades. But whatever the case, I do all of it on the lowly command line. I literally go for months without opening a single graphical desktop application. In fact, I don’t — strictly speaking — have a desktop on my computer.

I think this is a wonderful way to wor

@anton-rudeshko
anton-rudeshko / gpg.conf
Last active September 5, 2018 22:23
Let's talk GnuPG Materials
# Based on:
# - https://www.gnupg.org/faq/gnupg-faq.html
# - https://raw.githubusercontent.com/ioerror/duraconf/master/configs/gnupg/gpg.conf
# If you have more than 1 secret key in your keyring, you may want to
# uncomment the following option and set your preferred keyid.
# default-key KEYID
# If you do not pass a recipient to gpg, it will ask for one. Using
@larsxschneider
larsxschneider / clone.sh
Last active July 15, 2023 08:54
Clone a repository with Git LFS files and leverage a local cache.
#!/usr/bin/env bash
#
# Clone a repository with Git LFS files and leverage a local cache.
#
# Usage:
#
# Clone and checkout any branch:
# $ clone.sh <repo-url> <cache-dir> <working-copy-dir> <branch-name>
#
# Clone and checkout a PR head:
# В отчётах в CSV разделителем идёт точка с запятой, а не запятая
BEGIN {
FS=";"
}
# В первой строке ищем колонку с нужным именем и сохраняем её индекс
NR == 1 {
for (i = 1; i <= NF; i++)
if ($i == target)
column_idx = i
@anton-rudeshko
anton-rudeshko / git-lfs-to-json.awk
Last active August 30, 2021 20:45
Convert `git lfs --debug` output to json.
# Usage: git lfs ls-files -d | awk -f git-lfs-to-json.awk > lfs-files.json
BEGIN {
RS = ""
FS = "\n"
print "["
}
{
split($1, filepath, ": ")
@kurlov
kurlov / mkv embed soft subtitles
Created December 16, 2017 23:41
ffmpeg command to add .srt based subtitles to an .mkv file
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@slavafomin
slavafomin / nodejs-custom-es6-errors.md
Last active March 9, 2024 12:03
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js