Skip to content

Instantly share code, notes, and snippets.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
@drazul
drazul / add-remove-windows-path.ps1
Last active May 18, 2024 13:26
Example to add and remove local-path to system-path-variable on Windows. Without the limitations of 1024 characters
#------------ Add path to system variable -------------------------------------
$path2add = ';C:\path;'
$systemPath = [Environment]::GetEnvironmentVariable('Path', 'machine');
If (!$systemPath.contains($path2add)) {
$systemPath += $path2add
$systemPath = $systemPath -join ';'
[Environment]::SetEnvironmentVariable('Path', $systemPath, 'Machine');
write-host "Added to path!"

Keybase proof

I hereby claim:

  • I am drazul on github.
  • I am dlagua (https://keybase.io/dlagua) on keybase.
  • I have a public key whose fingerprint is A5FB 097C 5C7C D4BA BCD7 3B97 BCB1 4543 88E3 BEF1

To claim this, I am signing this object:

@drazul
drazul / mcf.sh
Created April 15, 2019 07:34 — forked from dminca/mcf.sh
Disable the fucking McAffee Proxy
#!/usr/bin/env bash
# JUST DISABLES McAfee on MacOS
# https://gist.github.com/pjobson/11167316#gistcomment-2787864
function help() {
echo "Disables McAfee"
}
function disable() {
function me() {
@drazul
drazul / gist:6b32757ad7b3a0806eb8b13d41a2c189
Created February 4, 2021 11:03
Grafana dashboard for aiohttp-prometheus-client python library --> https://github.com/RailYakup/aiohttp-prometheus
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@drazul
drazul / run-sparkapp
Last active November 4, 2021 14:22
Script to run a SparkApplication from a ScheduledSparkApplication
#!/bin/bash
namespace=${namespace:-default}
scheduledsparkapp=${scheduledsparkapp}
name=${name}
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
param="${1/--/}"