Skip to content

Instantly share code, notes, and snippets.

View rgerganov's full-sized avatar

Radoslav Gerganov rgerganov

View GitHub Profile
@rgerganov
rgerganov / gerrit.user.js
Last active February 12, 2020 09:42
Userscript for hiding CI comments in Gerrit
// ==UserScript==
// @name Toggle CI comments in patches
// @author Radoslav Gerganov <rgerganov@vmware.com>
// @include https://review.openstack.org/#/c/*
// ==/UserScript==
function main() {
// these are CIs for Nova, feel free to modify this list
var ciNames = ["Jenkins",
"turbo-hipster",
@rgerganov
rgerganov / importvm.py
Last active September 17, 2015 08:47
Import VM into vSphere
#!/usr/bin/env python
import argparse
import getpass
import os
import logging.config
import struct
import sys
import urlparse
@rgerganov
rgerganov / relocate.py
Created September 28, 2015 11:57
relocate VM with pyvmomi
#!/usr/bin/env python
import atexit
import time
from pyVim import connect
from pyVmomi import vim
def wait_for_task(task):
while True:
if task.info.state == vim.TaskInfo.State.success:
@rgerganov
rgerganov / wordbrain.py
Created February 29, 2016 11:07
Wordbrain solver
#!/usr/bin/env python
# Wordbrain solver
import bisect
import copy
import sys
WORDS = []
def is_word(word):
@rgerganov
rgerganov / vpxdcfg.py
Created March 7, 2016 09:02
Script for setting vpxd options
#!/usr/bin/env python
# Script for setting vpxd options
# Example: vpxdcfg.py -host vcenter \
# -user root \
# -password vmware \
# -key config.vmacore.http.readTimeoutMs \
# -value 600000
import argparse
from oslo_vmware import api
@rgerganov
rgerganov / keyboard.js
Created March 17, 2016 13:50
Workaround for locale problems
var kbdUtil = (function() {
"use strict";
function substituteCodepoint(cp) {
// Any Unicode code points which do not have corresponding keysym entries
// can be swapped out for another code point by adding them to this table
var substitutions = {
// {S,s} with comma below -> {S,s} with cedilla
0x218 : 0x15e,
0x219 : 0x15f,
@rgerganov
rgerganov / websocket.py
Created March 18, 2016 08:36
Fix for 'error 1006'
#!/usr/bin/env python
'''
Python WebSocket library with support for "wss://" encryption.
Copyright 2011 Joel Martin
Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
Supports following protocol versions:
- http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07
- http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10
@rgerganov
rgerganov / Makefile
Created August 24, 2016 16:07
patched Makedfile
INSTALL = /usr/bin/install -c
INSTALLDATA = /usr/bin/install -c -m 644
PROGNAME = footswitch
CFLAGS = -Wall
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CFLAGS += -DOSX `pkg-config --cflags hidapi`
LDFLAGS = `pkg-config --libs hidapi`
else
ifeq ($(UNAME), Linux)
@rgerganov
rgerganov / rfid.c
Created December 31, 2016 13:04
Arduino RFID reader
/* Arduino program for DIY FSK RFID Reader
* See description and circuit diagram at http://playground.arduino.cc/Main/DIYRFIDReader
* Tested on Arduino Nano and several FSK RFID tags
* Hardware/Software design is based on and derived from:
* Arduino/Timer1 library example
* June 2008 | jesse dot tane at gmail dot com
* AsherGlick: / AVRFID https://github.com/AsherGlick/AVRFID
* Micah Dowty:
* http://forums.parallax.com/showthread.php?105889-World-s-simplest-RFID-reader
*
@rgerganov
rgerganov / nss-chrome-linux.patch
Created January 18, 2017 09:48
libnss patch to make Chrome accept VIO's certificate on Linux
--- nss-3.23/nss/lib/certdb/certdb.c 2016-02-26 22:51:11.000000000 +0200
+++ /opt/src/nss-3.23/nss/lib/certdb/certdb.c 2017-01-18 11:36:57.009855896 +0200
@@ -1198,11 +1198,12 @@
/* turn off the special bit */
requiredUsage &= (~KU_KEY_AGREEMENT_OR_ENCIPHERMENT);
switch (keyType) {
case rsaKey:
- requiredUsage |= KU_KEY_ENCIPHERMENT;
+ // hack for VIO's certificate