Skip to content

Instantly share code, notes, and snippets.

View rabin-io's full-sized avatar

Rabin Yasharzadehe rabin-io

View GitHub Profile
@rabin-io
rabin-io / kubevirt-monitor-live-migration.sh
Created January 7, 2024 16:47
Monitor kubevirt live migration progress in the terminal
#!/usr/bin/env bash
# usage
# kubevirt-monitor-live-migration.sh my-namespace/my-vm
#
namespace_vm=${1?vm name}
vm=${namespace_vm##*/}
namespace=${namespace_vm%%/*}
@rabin-io
rabin-io / destroy_fsx.sh
Created November 26, 2023 14:30
AWS FSx deployment scripts
#!/bin/bash
#
# Destroy FSx deployment
#
# Reference: https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/what-is-fsx-ontap.html
set -eo pipefail
# Check if DEBUG_MODE is set and enable bash -x
@rabin-io
rabin-io / DoH-Providers.txt
Last active November 18, 2023 23:42
DoH Providers
abel.waringer-atg.de
res-acst3.absolight.net
resolver3.absolight.net
adl.adfilter.net
per.adfilter.net
syd.adfilter.net
dns.adguard-dns.com
family.adguard-dns.com
unfiltered.adguard-dns.com
dns.adrianlam.com
@rabin-io
rabin-io / ipmitool.sh
Last active December 27, 2021 13:23
ipmitool.sh
#!/bin/bash
# https://gist.github.com/rabin-io/e7daba62cf273d24730d5e49a8087bc5
_HOSTS=/etc/dci-openshift-agent/hosts
_HOST=${1?Missing Hostname}
ipmi_user=root
_IPMI_VARS=$(grep -i $_HOST $_HOSTS | sed 's/ /\n/g' | grep 'ipmi')
@rabin-io
rabin-io / nginx-jenkins.conf
Last active August 22, 2023 09:03
NGINX config as reverse-proxy for Jenkins
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name jenkins.example.com;
root /var/lib/jenkins/war;
# SSL
ssl_certificate /etc/ssl/jenkins.example.com.crt;
ssl_certificate_key /etc/ssl/jenkins.example.com.key;
@rabin-io
rabin-io / jenkins.service
Last active December 9, 2021 09:21
Jenkins systemd service unit file
# /etc/systemd/system/jenkins.service
[Unit]
Description=Standalone Jenkins Master server
Documentation=https://www.jenkins.io/doc
Wants=network-online.target
After=network-online.target
[Service]
User=jenkins
@rabin-io
rabin-io / fcgi.include.conf
Last active May 27, 2024 20:42
Request Tracker nginx Configuration + systemd service and socket activation units
# /opt/rt5/var/nginx/fcgi.include.conf
#fastcgi_pass unix:/run/rt-server.sock;
fastcgi_pass rt_backend;
fastcgi_param SCRIPT_NAME "";
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
// ==UserScript==
// @name Toggle line wrap in Gmail
// @namespace https://rabin.io/
// @version 0.3
// @description Press "w" (hotkey) to toggle linewrap for emails
// @author rabin.io
// @license GPLv3
// @downloadURL https://gist.githubusercontent.com/rabin-io/f81e4267485c79708e38d3216d335cdc/raw/gmail-toggle-wrap.user.js
// @homepageURL https://blog.rabin.io/quick-tip/add-a-custom-hotkey-in-gmail-with-greasemonkey-tampermonkey
// @match https://mail.google.com/mail/u/*
<?php
$dbh = new PDO(
'mysql:host=127.0.0.1:3066;dbname=cacti',
'cacti',
'password',
);
$paletteName = "50 Steps of Flame";
$gradient = array("FF0000","FF0300","FF0600","FF0900","FF0C00","FF1000","FF1300",
# Taken from http://www.boi.org.il/he/Markets/Pages/explainxml.aspx
# the Key in hash is used in our table, and the value is for BOI
$currency_code = @{ "$" = "01"; "לש" = "02"; "Eur" = "27"; }
$API_URL = 'https://www.boi.org.il/currency.xml?'
$rdate = [DateTime]::Now
$script:recursive_limit = 7
$SQLServer = "localhost"
$DB_USER = "scripts_user"
$DB_PASS = "p@$$w0rd"