Skip to content

Instantly share code, notes, and snippets.

View Kenya-West's full-sized avatar
💻
Windows

Innokenty Ivanov Kenya-West

💻
Windows
View GitHub Profile
@Kenya-West
Kenya-West / .env
Created March 2, 2025 19:17
Monitor cron jobs with custom script that wraps your cron job's script and send metrics to PushGateway
PUSHGATEWAY_URL= # PushGateway server URL
PUSHGATEWAY_USER= # Basic auth username to PushGateway server
PUSHGATEWAY_PASS= # Basic auth password to PushGateway server
INSTANCE= # Your string to name host instance. For the sake of readability, should be unique
TIMEOUT= # Dunno what is this for, no clear description of it
@Kenya-West
Kenya-West / README.md
Created February 2, 2025 11:26
Automatically download mongo-tools files from MongoDB website (only for Ubuntu)

Mongo-tools downloader

The problem

Let's assume I do not like to set and maintain MongoDB GPG keys and their repsitory lists in my Ubuntu host. I just need to download binaries and they should work.

The solution

This script only download a .tgz archive that contains requested binaries, to directory this script was run from.

@Kenya-West
Kenya-West / download_asset.sh
Last active December 15, 2024 09:49
Download specific asset using GitHub API, `curl` and `jq`
#!/bin/bash
# This script downloads specific asset that may be not included in the latest release
# but could be found in some other tag (version).
# You can set DEBUG=true ./download_asset.sh comnmand to enable debug messages.
# Requires curl, jq and head installed.
# You can set GitHub Personal Access token in $GITHUB_TOKEN to avoid API rate limiting. Look below.
# Constants (replace with your repo details)
OWNER="repo-owner-account" # GitHub username or organization
@Kenya-West
Kenya-West / split-and-join.ps1
Created November 28, 2024 07:28
Split long vertical image by sections and join them side-by-side (horisontally) via Powershell
# Requires ImageMagick to be installed: winget install -e --id ImageMagick.ImageMagick --source winget --accept-source-agreements --accept-package-agreements
# Ask the user for the input file path
$imagePath = Read-Host "Enter the path to the image file"
# Ask the user for the number of horizontal splits
$numParts = [int](Read-Host "Enter the number of horizontal parts to split the image into")
# Validate inputs
if (!(Test-Path $imagePath)) {
Write-Host "The file does not exist. Exiting." -ForegroundColor Red
@Kenya-West
Kenya-West / get-more-beatiful-nubmers.js
Created October 6, 2024 15:47
A ChatGPT snippet to output and sort the best (in terms of beauty) phone number to pick
// Helper function to check if all characters in a string are the same
function allSame(str) {
return str.split('').every(char => char === str[0]);
}
// Helper function to check if a string is a palindrome
function isPalindrome(str) {
return str === str.split('').reverse().join('');
}
@Kenya-West
Kenya-West / script.js
Last active October 6, 2024 15:46
Inoreader get Habr stats - shows comments and rating counter for Habr articles
// ==UserScript==
// @name InoReader get Habr stats
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Shows comments and rating counter for Habr articles
// @author Kenya-West
// @grant GM_registerMenuCommand
// @grant GM_unregisterMenuCommand
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
@Kenya-West
Kenya-West / script.js
Last active May 4, 2024 12:33
InoReader copy cover image - copy cover image of the post you selected in article list view
// ==UserScript==
// @name InoReader copy cover image
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @description Copy cover image of the post you selected in article list view
// @author Kenya-West
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
// @match https://*.inoreader.com/folder*
// @match https://*.inoreader.com/starred*
@Kenya-West
Kenya-West / script.js
Last active May 3, 2024 07:53
InoReader autoplay video in card view - autoplays Telegram video generated by RSS-Bridge feed when user chooses "card view" (press `4`)
// ==UserScript==
// @name InoReader autoplay video in card view
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @description Autoplays Telegram video generated by RSS-Bridge feed when user chooses "card view" (press `4`)
// @author Kenya-West
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
// @match https://*.inoreader.com/folder*
// @match https://*.inoreader.com/starred*
@Kenya-West
Kenya-West / script.js
Last active October 24, 2024 14:00
InoReader dynamic height of tiles in the card view. Requires https://greasyfork.org/ru/scripts/513854-inoreader-viewing-api-for-userscripts
// ==UserScript==
// @name InoReader dynamic height of tiles in the card view
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Makes cards' heights to be dynamic depending on image height
// @author Kenya-West
// @match https://*.inoreader.com/*
// @icon https://inoreader.com/favicon.ico?v=8
// @license MIT
// ==/UserScript==
@Kenya-West
Kenya-West / script
Created April 2, 2024 14:16
InoReader script that replaces comss.ru domain with comss.one in Inoreader links. Works with `V` key press, too
// ==UserScript==
// @name InoReader replace comss.ru domain with comss.one
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Replaces comss.ru links to comss.one for those who try to access comss.ru website from outside of Russian Federation
// @author Kenya-West
// @match https://*.inoreader.com/feed*
// @match https://*.inoreader.com/article*
// @match https://*.inoreader.com/folder*
// @match https://*.inoreader.com/starred*