Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 14, 2025 19:31
Hyperlinks in Terminal Emulators
@tatsuya6502
tatsuya6502 / nonblocking.py
Created June 3, 2017 10:18
check and set nonblocking option to stdin and stdout
import fcntl, sys, os
def get_status(fileno):
fl = fcntl.fcntl(fileno, fcntl.F_GETFL)
if (fl & os.O_NONBLOCK) == os.O_NONBLOCK:
return "nonblocking"
else:
return "blocking"
def set_nonblocking(fileno):
@ivan
ivan / discord.fix_styles.js
Last active January 24, 2024 18:57
Fix Discord / discordapp.com to use an aligned xchat/hexchat-like nick gutter
// ==UserScript==
// @name Discord: use aligned nick gutter and fix styles
// @description Discord: use xchat-like aligned nick gutter and fix styles
// @namespace discord_styles
// @include https://discordapp.com/*
// @version 1.1
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
@ivan
ivan / init.el
Last active August 27, 2023 01:42
Emacs + org-mode configuration
; Load files as UTF-8 including quotes.org which has problems without this
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
; Make emacs start much faster on Windows by disabling support for git and other VCSes
(setq vc-handled-backends ())
; Recommended by flx, gc every 20MB
@ivan
ivan / install_all_fonts.bat
Last active January 10, 2024 23:59
Install all supplemental fonts on Windows 10
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Arab~~~und-ARAB~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Beng~~~und-BENG~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Cans~~~und-CANS~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Cher~~~und-CHER~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Deva~~~und-DEVA~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Ethi~~~und-ETHI~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Gujr~~~und-GUJR~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Guru~~~und-GURU~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Hans~~~und-HANS~0.0.1.0
DISM.exe /Online /Add-Capability /CapabilityName:Language.Fonts.Hant~~~und-HANT~0.0.1.0
@ivan
ivan / Back Template.html
Last active March 27, 2018 11:20
Randomizing the font, size, and color of your Japanese flashcards in Anki
<a style="text-decoration: none" href="https://jisho.org/search?utf8=%E2%9C%93&amp;keyword={{Front}}">{{FrontSide}}</a>
<hr id="answer">
<div lang="ja">
{{Back}}
</div>
@ivan
ivan / xfsprogs_less_defragging.patch
Last active November 8, 2017 03:05
xfs_fsr: Don't defrag files that have <= 1 extent per 512MB
From f910364d5b27dc01f903763c36b1a74d358b5661 Mon Sep 17 00:00:00 2001
From: Ivan Kozik <[email protected]>
Date: Wed, 8 Nov 2017 00:51:57 +0000
Subject: [PATCH] Don't defrag files that have <= 1 extent per 512MB
---
fsr/xfs_fsr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
@ivan
ivan / .xbindkeysrc
Last active November 25, 2017 09:30
konsole popup terminal (note: create a konsole profile called "popup-terminal" and set the title to "popup-terminal")
"/home/ivan/bin/show-hide-popup-terminal"
Control + space
@ivan
ivan / 70-synaptics.conf
Last active November 25, 2017 12:45
Acceptable touchpad settings for Linux / xorg that make precise movement easier
# Inspired by https://www.x.org/wiki/Development/Documentation/PointerAccelerationAsOf16/
# See http://who-t.blogspot.com/2016/09/synaptics-pointer-acceleration.html for synaptics insanity
Section "InputClass"
Identifier "touchpad"
# Use synaptics because libinput is broken: it fails to initiate cursor
# movement when touching starts at some edges and corners, and it makes
# assumptions about whether we need palm and thumb detection based
# on the size of our touchpad. I was unable to fix these issues by
@ivan
ivan / konsole-ssh
Last active May 29, 2019 16:37
Create and run konsole profile for ssh to user@host
#!/usr/bin/env bash
# Automatically create a konsole profile for ssh to user@host and start
# a new konsole with said profile.
#
# Remember to bind "Clone Tab" to e.g. Ctrl+T to open new tabs using the
# current profile instead of the default profile.
set -eu