Skip to content

Instantly share code, notes, and snippets.

Vish (Ishaya) Abrams vishvananda

Block or report user

Report or block vishvananda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am vishvananda on github.
  • I am vish (https://keybase.io/vish) on keybase.
  • I have a public key ASDJQdb6cmnHPgDREMp0elvm7IeX-yGsiggaGpyb-v9wUgo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am vishvananda on github.
  • I am vish (https://keybase.io/vish) on keybase.
  • I have a public key whose fingerprint is F79D 5621 D6B6 EAC6 F633 081E 6B4E B3E1 BCCC 3C0A

To claim this, I am signing this object:

@vishvananda
vishvananda / running-openstack-nova-with-pypy.md
Last active Sep 14, 2018
Running OpenStack Nova with PyPy
View running-openstack-nova-with-pypy.md

Overview

For those that are unfamiliar with the project, PyPy is an implementation of the Python language that features a JIT Compiler. I have noticed a huge performance benefit in some personal projects by switching to PyPy. I have always been curious how it would perform on a large and complex project like OpenStack, but my early experiments ran into massive roadblocks around broken dependencies.

It has been six months since I last looked, so I figured it was time to try it again. Support has come a long way and, now that lxml is working, we are close enough to get a Proof-of-Concept running. Read on for instructions on running nova with PyPy.

Preparation

Start out with a base ubuntu 12.04 (precise) install and run devstack. I won't go through the details of getting devstack running here, because there are already instructions on the devstack site.

View python-is-slow.md

Introduction

A few weeks ago I was browsing Hacker News, and I noticed a post about a little online programming game called Colossal Cue Adventure. I was instantly hooked and three problems quickly fell to some hacked-together Python.

I was feeling pretty satisfied with myself until I noticed the little phrase at the bottom:

you can try your hand at the bonus level by typing bonus...
@vishvananda
vishvananda / using-openssl-from-python-with-python-cffi.md
Last active Nov 20, 2018
Using OpenSSL from Python with python-cffi
View using-openssl-from-python-with-python-cffi.md

Introduction

A few weeks ago I stumbled across a thread on hacker news that referenced the Matasano Cyrpto Challenge. I find myself unable to resist this type of problem so I decided to make an attempt. It teaches you to find vulnerabilities in crypto systems by starting with simple attacks and building up to more complex ones. Early on in the project it has you start breaking ecryption that uses the AES cypher in ECB mode. It specifically asks you not to implement the cypher yourself but to use a known-correct implementation like OpenSSL.

I tend to try to solve programming challenges in python, because the coding goes much more quickly. I checked the pyOpenSSL docs (which I have used before) to determine the call for encryption in ECB mode.

@vishvananda
vishvananda / sumproduct.py
Created Oct 25, 2013
Solution for the sum product puzzle
View sumproduct.py
answers = set()
MAX = 100
for a in xrange(2, MAX):
for b in xrange(a, MAX):
answers.add((a, b))
print len(answers)
# sum knows product doesn't know the answer so potential a, b can't have one product solution
products = {}
@vishvananda
vishvananda / tunnel.sh
Created Oct 22, 2013
Script to set up an ipsec tunnel between two machines For Example: ./tunnel.sh 10.10.10.1 10.10.10.2 192.168.0.1 192.168.0.2 would set up an ipsec tunnel over 10.10.10.1 address using 192.168.0.1 as a virtual address passwordless sudo required for user on remote machine
View tunnel.sh
#!/bin/bash
if [ "$4" == "" ]; then
echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>"
echo "creates an ipsec tunnel between two machines"
exit 1
fi
SRC="$1"; shift
DST="$1"; shift
@vishvananda
vishvananda / strip-deb-key.sh
Created Oct 3, 2013
Strip the signing key from a debian package.
View strip-deb-key.sh
#!/usr/bin/env bash
if [ "$1" == "" ]; then
echo "Usage: $0 <deb-package>"
exit 1
fi
TARGET=$1
TMPDIR=`mktemp -d`
dpkg-deb -x $TARGET $TMPDIR
@vishvananda
vishvananda / docker_netns.sh
Last active Jul 13, 2018
Expose the netns of a docker container to the host.
View docker_netns.sh
#!/usr/bin/env bash
if [ "$1" == "" ]; then
echo "usage: $0 <docker_id>"
echo "Exposes the netns of a docker container to the host"
exit 1
fi
ppid=`docker inspect $1 | grep Pid | awk '{print $2 + 0}'`
if [ "$ppid" == "" ]; then
echo "lxc parent pid not found"
@vishvananda
vishvananda / git.sh
Created May 8, 2013
show me all commits since we added the debian directory that don't modify the debian directory, aren't cherry-picks (as identified by having the word 'cherry' in the commit message), and aren't merge commits. (The since 2011-01-01 is to ignore really old commits when searching for the debian directory addition since really old commits of nova ha…
View git.sh
git log --no-merges --pretty=oneline `git rev-list HEAD --since "2011-01-01" -- debian | tail -n1`..HEAD | grep -v -F "`git rev-list HEAD -- debian`" | grep -v -F "`git rev-list HEAD --grep cherry`"
You can’t perform that action at this time.