Skip to content

Instantly share code, notes, and snippets.

View avirambh's full-sized avatar

Aviram Bar Haim avirambh

View GitHub Profile
@avirambh
avirambh / install_lio.sh
Last active May 4, 2017 21:23
Install LIO on ubuntu 14.04
pip uninstall -y rtslib-fb==2.1.49
sudo apt-get remove -y lio-utils
sudo apt-get install -y python-prettytable python-ipaddr python-netifaces python-configobj python-pyparsing python-epydoc texlive-latex-base texlive-latex-extra texlive-latex-recommended lmodern texlive-fonts-recommended python-urwid
rm -rf rtslib
git clone https://github.com/Datera/rtslib
cd rtslib; make deb; sudo apt-get -y remove rtslib ; dpkg -i dist/*.deb; cd ..
rm -rf configshell
git clone https://github.com/Datera/configshell
From 73e8cb03ad7d14ae517bd2e847e1eae07e9117a7 Mon Sep 17 00:00:00 2001
From: Aviram Bar-Haim <aviramb@mellanox.com>
Date: Tue, 10 Feb 2015 17:36:51 +0200
Subject: [PATCH] Added protocol type print for cinder-rtstool
---
cinder/cmd/rtstool.py | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/cinder/cmd/rtstool.py b/cinder/cmd/rtstool.py
repare_network_config(hiera('network_scheme', {}))
$mlnx = hiera('mellanox-plugin')
if ($mlnx['iser']) {
class { 'mellanox_openstack::cinder_iser' :
iser_ip_address => get_network_role_property('cinder/iscsi', 'ipaddr'),
}
}
# Create a file in /etc/infiniband/vfs with content of the form:
ib0 3
enp5s0 12
# and after modules start in openibd:
if [ -f /etc/infiniband/vfs ]; then
while read -r line
do
arrline=($line)
iface=`echo ${arrline[0]}`
# import the necessary packages
from skimage.measure import structural_similarity as ssim
import matplotlib.pyplot as plt
import numpy as np
def mse(imageA, imageB):
# the 'Mean Squared Error' between the two images is the
# sum of the squared difference between the two images;
# NOTE: the two images must have the same dimension
err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)
@avirambh
avirambh / yaml_override.py
Last active December 26, 2021 09:57
override argparse
def override_args_from_yaml(args):
"""
:param args:
:param yaml_settings:
:return:
"""
if args.config_file:
with open(args.config_file, 'r') as ymlfile:
yaml_settings = yaml.load(ymlfile)