Skip to content

Instantly share code, notes, and snippets.

View rgerganov's full-sized avatar

Radoslav Gerganov rgerganov

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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",