Skip to content

Instantly share code, notes, and snippets.

View o3bvv's full-sized avatar

Oleksandr o3bvv

View GitHub Profile
@o3bvv
o3bvv / gist:f04f56ef355feda43c3f42682dbac840
Created February 29, 2024 09:51
xpath — table row with string
//*[@id="exampleTable"]/tr[td//text()[contains(., 'targetString')]]
@o3bvv
o3bvv / SolarizedDarkX.itermcolors
Created October 26, 2023 12:49
Custom iterm2 color profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.25882354378700256</real>
@o3bvv
o3bvv / exa_aliases.sh
Last active October 26, 2023 13:34
exa aliases
alias l="exa -l -F --group-directories-first -b --no-permissions --git --no-user --no-time"
alias lz='l -s size -r'
alias lZ='l -s size'
alias lx='l -s ext'
alias ls='exa'
alias l1='ls -1'
alias ll="exa -l -F --group-directories-first -b --no-permissions --git --no-user --time-style=long-iso --changed"
alias llt="ll -s changed -r"
alias llT="ll -s changed"
alias llz="ll -s size -r"
@o3bvv
o3bvv / post.py
Last active August 30, 2023 05:17
Export Apple Photos with meta sidecars
import datetime
import json
import os
from pathlib import Path
from typing import Callable
from osxphotos import ExportResults
from osxphotos import PhotoInfo
@o3bvv
o3bvv / .rsync-exclude
Last active July 22, 2022 06:51
Exclude items for rsync
.DS_Store
.tox
.pytest_cache
.egg-info
__pycache__
.vscode
.idea
Icon\r
Icon$\r
Icon?
@o3bvv
o3bvv / help-ukraine-stop-russia.md
Last active March 29, 2022 18:35
How YOU can help Ukraine right NOW

Help Ukraine! Stop Russia!

About

This document is a collection of links 🔗 people all over the world 🌐 can use to help Ukraine 🇺🇦 and Ukrainians to stand in the war started by Russian Federation (RF).

The list is deliberately made in a simplistic text-based version, so you can copy it, save, make a screenshot, print, etc and share it in case access to it is lost for any reason.

What YOU can do ⚡️:

@o3bvv
o3bvv / build-cache-for-existing.sh
Last active January 8, 2022 00:19
youtube-dl playlist
#!/usr/bin/env sh
for n in *.mp3
do if [[ "$n" =~ -[-_0-9a-zA-Z]{11}.mp3$ ]]
then echo "youtube ${n: -15: 11}" >> downloaded.txt
fi
done
@o3bvv
o3bvv / run.sh
Last active May 8, 2021 06:22
Delete old kernels from Ubuntu
#!/bin/sh
# 1. List old versions by:
# 1.1. Listing all "initrd.img-*" files in "/boot" (ls -1), ex: "/boot/initrd.img-5.8.0-44-generic"
# 1.2. Excluding current LOADED version (grep -v), ex: "5.8.0-50-generic"
# 1.3. Extracting version part from listed filenames (awk), ex: "5.8.0-44"
# 2. Purge kernel packages per each version, with confirmation prompt (configmation is enabled by default)
for v in $(ls -1 /boot/initrd.img-* | grep -v `uname -r` | awk -F'-' '{ print $2 "-" $3 }'); do \
sudo apt-get --purge remove \
linux-image-$v-generic \