Skip to content

Instantly share code, notes, and snippets.

View rgerganov's full-sized avatar

Radoslav Gerganov rgerganov

View GitHub Profile
@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 / 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 / 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 / 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
@rgerganov
rgerganov / keybase.md
Created February 14, 2017 09:36
Keybase proof

Keybase proof

I hereby claim:

  • I am rgerganov on github.
  • I am rgerganov (https://keybase.io/rgerganov) on keybase.
  • I have a public key whose fingerprint is 5837 D10B AA3E 24E1 FA26 FE85 DCEB 64AA 28EC 50FC

To claim this, I am signing this object:

@rgerganov
rgerganov / astra_hack.py
Last active October 25, 2017 08:11
Astra hack
#!/usr/bin/env python
import os
import socket
import threading
import SocketServer
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def send_response(self, resp):
self.request.sendall("HTTP/1.1 200 OK\r\n")