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 / kernel_v5_centos7.sh
Created August 3, 2022 13:15
Kernel v5 on CentOS 7
#!/usr/bin/env bash
# Based on the info from
# - http://elrepo.org/tiki/HomePage
# - https://www.golinuxcloud.com/set-default-boot-kernel-version-old-previous-rhel-linux/
# - https://www.casesup.com/category/knowledgebase/howtos/how-to-change-the-default-kernel-in-grub-for--rhel-and-centos
## !!!!!!!!!!!!!!!!!!!! ##
## ##
## !!! IMPORTANT: do not run this as-is, read all in-line comments ##
@vi7
vi7 / 00_Node_exporter_installer_script_for_AsusWRT_Merlin.md
Last active May 2, 2022 19:50
Prometheus Node Exporter installer script for AsusWRT Merlin routers with config examples

Prometheus Node Exporter installer script for AsusWRT Merlin

Installation

curl -sL https://gist.githubusercontent.com/vi7/bc27529bd4803576fefc479dbd326dfa/raw/node_exporter_installer_asuswrt_merlin.sh | sh \
&& rm -f node_exporter_installer_asuswrt_merlin.sh
@vi7
vi7 / 00_CoreDNS_installer_script_for_AsusWRT_Merlin.md
Last active May 2, 2022 19:38
CoreDNS installer script for AsusWRT Merlin routers with config examples

CoreDNS installer script for AsusWRT Merlin

Installation

curl -sL https://gist.githubusercontent.com/vi7/e41b07ff7d0fb845ac281cd940876e2a/raw/coredns_installer_asuswrt_merlin.sh | sh && rm -f coredns_installer_asuswrt_merlin.sh
@vi7
vi7 / alertmanager.yml
Last active April 15, 2022 12:27
Docker Compose file with Prometheus, Alertmanager, Node Exporter and cAdvisor. Sample configs included.
---
global:
resolve_timeout: 3m
slack_api_url: 'https://hooks.slack.com/services/<TOKEN>'
smtp_smarthost: 'mail.example.com:25'
smtp_from: '[email protected]'
smtp_require_tls: false
smtp_hello: 'alertmanager-dev'
# The directory from which notification templates are read.
@vi7
vi7 / devops_basics.md
Last active March 9, 2022 12:31
DevOps basics

DevOps topics

  • Linux command line basics:
    • navigating through directory tree
    • opening text files (logs)
    • checking CPU/Memory/Disk usage
    • checking network ports
    • services (stopping, starting, checking status)
  • Docker and containers overview (what is it and what it is used for)
@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