Skip to content

Instantly share code, notes, and snippets.

View edwinclement08's full-sized avatar

Edwin Clement edwinclement08

View GitHub Profile
@edwinclement08
edwinclement08 / tmux.conf
Created November 2, 2017 09:12 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
#!/bin/bash
openssl genrsa -des3 -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
echo "Trust the Certificate; Ctrl-C when Done"
while true; do printf ""; sleep 1; done
sudo cp rootCA.pem /etc/ca-certificates/trust-source/anchors/rootCA_local.cert
#!/bin/bash
echo QUIT | openssl s_client -connect $DOMAIN_TO_FETCH_FROM:443 | sed -ne '/BEGIN CERT/,/END CERT/p' > my-cert
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n my-cert -i my-cert
certutil -d sql:$HOME/.pki/nssdb -L
@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
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 / 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."
@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 / 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 / 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") '