Skip to content

Instantly share code, notes, and snippets.

View edwinclement08's full-sized avatar

Edwin Clement edwinclement08

View GitHub Profile
@edwinclement08
edwinclement08 / gist:095dd43b4cbf8cb4c83ae8d67f6e928c
Created June 7, 2021 16:25 — forked from whiskerz007/gist:53c6aa5d624154bacbbc54880e1e3b2a
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
apt-get update
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
apt-get update
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
@edwinclement08
edwinclement08 / show_app.sh
Created April 30, 2021 19:12
Simple Script that can hide/focus or start an app(useful with alacritty)
#!/bin/sh
if [ $# -ne 2 ]
then
echo "Pass 2 params"
echo -e "show_app.sh <Window Title to check for> <app to open>"
echo -e "\nNotes\n\t<Window url> should be an exact string match"
echo -e "\t<app to open> should be path to the executable"
exit
fi
@edwinclement08
edwinclement08 / jtt.php
Created April 29, 2021 06:07 — forked from iansltx/jtt.php
Quick CLI for adding work log times in JIRA
#!/usr/bin/env php
<?php
if ($argc < 3) {
die("Usage: ./jtt.php ISSUE-1 30m optional comment here\n");
}
$username = 'EMAIL_GOES_HERE';
$token = 'API_KEY_HERE'; // see https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-basic-authentication/
$team = 'TEAM_NAME_HERE';
@edwinclement08
edwinclement08 / temp.sh
Created April 22, 2021 09:52
Get list of usb ids that are connected to a domain using virsh and xq(installed with yq)
virsh dumpxml Manjaro | xq '.domain.devices.hostdev | .[] | select( ."@type" == "usb") | .source | (.vendor."@id" + ":" + .product."@id") '
@edwinclement08
edwinclement08 / summary_logs.js
Last active April 15, 2021 10:05
Helpers for summary_logs page
// ==UserScript==
// @name Add some delta info to summary_logs page
// @namespace Violentmonkey Scripts
// @match https://www.browserstack.com/admin/summary_logs
// @grant none
// @version 1.0
// @author -
// @description 14/04/2021, 14:16:19
// ==/UserScript==
@edwinclement08
edwinclement08 / keymap-pre.c
Created March 24, 2021 21:15
Switch programs in Mac with one key tap.
#include QMK_KEYBOARD_H
#ifndef KEYMAP_PRE_CUSTOM
#define KEYMAP_PRE_CUSTOM
uint16_t cmd_tab_timer = 16960;
uint16_t cmd_tab_wait_delay = 700;
bool in_state = false;
@edwinclement08
edwinclement08 / compile_and_flash_qmk.sh
Last active March 24, 2021 20:41
compiles the given json file in qmk folder(with all the custom changes) and uploads it twice for split keyboard
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Pass a single parameter, that is the location of qmk config json"
exit
fi
FILE=$1
if [ ! -f $FILE ]; then
echo "Config File $FILE does not exist."
group_id = 4404657
latest_order = 556451
latest_cancellation_order = 556452
subscription_number = 'A-S00052771'
# InvoicePosted, Order Processed
bcs_invoice_posted = '1219450'
bcs_order_processed = '1219447'
billing_communications = [bcs_invoice_posted, bcs_order_processed]
subs_ssn_info = 199457
@edwinclement08
edwinclement08 / gist:f697f2982d155cdd6137257253a8554d
Created January 24, 2020 20:20
enumerate all present handlebar template variables in sql
#!/bin/bash
for file in queries/*.sql
do
echo $file;
\cat $file | egrep -o '{{[a-zA-Z\. _]*}}' | awk '{print "\t", NR, $0}';
done