Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / zshrc
Last active June 22, 2024 16:29
#!/bin/zsh
# This is meant to be sourced; shebang line is for editors
umask 027
# Let me type a ! in a filename without escaping it
set +o histexpand
# http://www.zsh.org/mla/workers/1996/msg00615.html
HISTSIZE=21000
@ivan
ivan / grab-anchor-episode.sh
Last active May 16, 2024 22:16
Download a podcast episode from anchor.fm
#!/usr/bin/env bash
# Download a podcast episode from anchor.fm
#
# Usage:
# grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example)
# grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example)
#
# anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg.
#
@ivan
ivan / thoughts.md
Last active May 12, 2024 04:02
Thoughts on online dating and social networking apps after 7 years

OLD and SNS apps claim to provide value that is generally not delivered unless you are elite, or above some kind of threshold for attracting enough people to make it worthwhile; within a month or so you should be able to determine where you stand, and if you are below the threshold the only rational thing to do is cease use and do anything else with your time; popularity will not come from improved skill in using them; it's not like programming where years of practice will make it better, so said apps can easily deceive people with prior skill acquisition experiences, more hope, or long-term thinking.


If we exclude the rare and random rewards of friendship or good information (better than you'd get through other uses of time), a rational person would:

  • keep using online dating app if it were a semi-reliable source of dates with people they might like
  • keep using social networking app if it were improving their distribution through being retweeted/recommended, or semi-reliably connecting them with re
@ivan
ivan / github-users-starknet-rewards.tsv
Created March 25, 2024 23:02
All GitHub users rewarded STRK in the Starknet airdrop, most-rewarded first
We can't make this file beautiful and searchable because it's too large.
13911.1 swader
13911.1 sorpaas
13911.1 s1na
13911.1 rjl493456442
13911.1 qd-qd
13911.1 protolambda
13911.1 paulrberg
13911.1 noahzinsmeister
13911.1 neurone
13911.1 moodysalem
@ivan
ivan / devtools command.js
Last active March 25, 2024 18:44
Improve column layout in qbittorrent webui
for (const [k, v] of Object.entries(JSON.parse('{"sorted_column_torrentFilesTableDiv":"name","column_uploaded_visible_torrentsTableDiv":"1","column_save_path_visible_torrentsTableDiv":"1","column_last_activity_visible_torrentsTableDiv":"1","column_added_on_width_torrentsTableDiv":"143","column_total_size_width_torrentsTableDiv":"66","column_num_seeds_width_torrentsTableDiv":"54","column_tracker_width_torrentsTableDiv":"228","selected_filter":"all","column_save_path_width_torrentsTableDiv":"590","column_port_width_torrentPeersTableDiv":"57","reverse_sort_torrentFilesTableDiv":"0","column_relevance_width_torrentPeersTableDiv":"73","column_size_width_torrentsTableDiv":"68","reverse_sort_torrentsTableDiv":"1","column_num_leechs_width_torrentsTableDiv":"57","sorted_column_torrentsTableDiv":"upspeed","columns_order_torrentsTableDiv":"priority,state_icon,name,size,total_size,progress,status,num_seeds,num_leechs,dlspeed,upspeed,uploaded,eta,ratio,added_on,last_activity,category,tags,completion_on,tracker,save_path,dl
@ivan
ivan / dig.txt
Created March 15, 2024 16:03
dig -t TXT google.com
# dig -t TXT google.com
; <<>> DiG 9.18.24 <<>> -t TXT google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13779
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
@ivan
ivan / freerdp-dpi-help.md
Last active March 15, 2024 09:50
Use FreeRDP with non-standard DPI
xfreerdp /dynamic-resolution +decorations +fonts +aero +window-drag +multitransport /bpp:16 /rfx /codec-cache:rfx /video /scale-desktop:172 /scale-device:100

172% is the scaling factor we want.

/scale-device:100 is required because fucking Microsoft: "desktopScaleFactor (4 bytes): A 32-bit, unsigned integer. The requested desktop scale factor. This value MUST be ignored if it is less than 100% or greater than 500% or deviceScaleFactor is not 100%, 140%, or 180%. If this field is present, then the desktopOrientation and deviceScaleFactor fields MUST also be present."

https://msdn.microsoft.com/en-us/library/cc240510.aspx

@ivan
ivan / never buy a cheap refrigerator.sh
Last active March 10, 2024 01:27
Fridge software thermostat using Home Assistant + Zooz ZSE44 + Zooz ZEN15 800LR
#!/usr/bin/env zsh
# We use zsh instead of bash so that decimals work in $(( ))
set -eu -o pipefail
ha="http://192.168.10.2:8123"
# Expires 2034
token="..."
@ivan
ivan / about:config prefs
Last active February 26, 2024 07:19
Firefox settings and extensions
# Disable about:config warning
general.warnOnAboutConfig -> false
# Start up with tabs from last session
browser.startup.page -> 3
# Use blank new tab page
browser.newtabpage.enabled -> false
# Denser UI