Skip to content

Instantly share code, notes, and snippets.

View vi7's full-sized avatar
💭
smd

Vitaliy D. vi7

💭
smd
  • Krakow, Poland
View GitHub Profile
@vi7
vi7 / close_notifications_applescript.js
Created February 22, 2022 20:56 — forked from lancethomps/close_notifications_applescript.js
AppleScript to close all notifications on macOS Big Sur
function run(input, parameters) {
const appName = "";
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
const CLOSE_ACTION = "Close";
@vi7
vi7 / git_status_check.sh
Last active December 31, 2021 12:35
Oneliner scripts to check Git working tree status for multiple repositories in a batch
#!/usr/bin/env bash
# Collection of oneliner scripts to check Git working tree status for multiple repositories in a batch
set -e
# The most simple, prints all the git repos found and outputs not commited changes if any
for dir in $(find . -type d -name '.git'); do pushd $dir/.. >/dev/null; pwd; git status --short; popd >/dev/null; done
# Print paths to repositories with uncommitted changes only
@vi7
vi7 / ldapsearch_examples.md
Created November 10, 2021 12:12
Linux ldapsearch examples for AD and LDAP

Working with AD from Linux

Prerequisites

In order to access AD data from Linux one should install ldapsearch utility which is a part of openldap-clients package on CentOS:

yum -y install openldap-clients
@vi7
vi7 / resize_partition_lvm_linux.md
Last active September 28, 2021 10:31
Resizing existing partition on Linux using parted and LVM

Resizing existing partition on Linux

This guide was tested on CentOS 7 but should be in general applicable for other Linux distros with parted and LVM

WARN You can’t resize partitions on the running OS in CentOS 6 (unless you’re brave enough to mess with the sfdisk) So the fastest option is to add new disk partition, create LVM PV from it and extend needed LVM VG accordingly Bad luck for you if you’re not using LVM ☠️

  1. Add required amount of space to the virtual machine disk
@vi7
vi7 / libreelec_firmware_flashing.md
Last active September 27, 2021 16:05
Flashing LibreELEC 8.2 to the Aun AKEY1 PLUS Android beamer projector

LibreELEC for AUN akey1 plus

LibreELEC 8

Flashing procedure

Steps below are needed only once. USB will be configured as a primary boot device

@vi7
vi7 / asuswrt_merlin_search_domain.md
Created September 10, 2021 19:28
Configure search domains on the Asus router with the Asuswrt Merlin firmware

Create /jffs/configs/dnsmasq.conf.add and add DHCP option 119 providing the domain search list (home in the example below):

dhcp-option=lan,119,home

Allow custom configs in the nvram:

nvram set jffs2_scripts=1
@vi7
vi7 / Vagrantfile
Created August 29, 2021 12:25
Vagrant machine with the OSX 10.9 suitable for iPhone 3GS jailbreak via p0sixspwn v1.0.8
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "inria-pro-sed/conda-build-osx-10.9-base"
config.vm.box_version = "1.0.0"
#config.vm.network "public_network"
@vi7
vi7 / vsphere_cpi_csi_prerequisites.sh
Last active July 22, 2021 09:58
Deploying a Kubernetes Cluster on VMWare vSphere with CSI and CPI. Prerequisites configuration example
## !!! DO NOT RUN THIS SCRIPT AS IS !!!
## SOME VALUES ARE JUST AN EXAMPLE AND MUST BE CHANGED
## ACCORDING TO YOUR INFRASTRUCTURE CONFIGURATION
## This example script uses the following considerations:
# - vSphere 6.7U3 (or later) is a prerequisite for using CSI and CPI at the time of writing
# - vCenter Datacenter name: DC01
# - vCenter Cluster name: CLS01
# - vCenter Datastore names: DATASTORE01, DATASTORE02, DATASTORE03
# - K8S nodes VMs hostname pattern: example-k8s* (e.g.: example-k8s-master01.example.com)
@vi7
vi7 / gradle_daemon.cron
Created May 12, 2021 10:58
Cronjob for the Gradle Daemon logs cleanup
# Cleanup Gradle Daemon logs older than 3hr (180min)
# NOTE: Change path to the .gradle/daemon as needed
05 */1 * * * root /usr/bin/find /var/lib/jenkins/.gradle/daemon/ -type f -mmin +180 -exec rm -vf '{}' \;
# Cleanup Gradle Daemon empty dirs
# NOTE: Change path to the .gradle/daemon as needed
10 */1 * * * root /usr/bin/find /var/lib/jenkins/.gradle/daemon/ -type d -empty -exec rm -vrf '{}' \; || true
@vi7
vi7 / pto.yaml
Created April 23, 2021 09:33
Paid time off (PTO/Day-off) tracker
---
2021:
pto_days_total: 28
months:
- name: may
num: 5
pto_days:
- 6
- 7