Skip to content

Instantly share code, notes, and snippets.

View karmab's full-sized avatar

Karim Boumedhel karmab

View GitHub Profile
def start_vm(uuid)
vm = find_vm_by_uuid(uuid)
attributes = vm.attributes
puts "#{attributes.inspect}"
if attributes[:user_data].present?
vm.start_with_cloudinit(:blocking => true, :user_data => attributes[:user_data])
else
vm.start(:blocking => true)
end
end
import requests
host = "192.168.122.61"
port = "8443"
user = "admin"
password = "admin"
b = requests.session()
b.auth = (user, password)
b.verify = False
@karmab
karmab / trello.30s.py
Last active November 27, 2017 15:44
trello.30s.py
#!/usr/bin/python
# <bitbar.title>trello list</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Karim Boumedhel</bitbar.author>
# <bitbar.author.github>karmab</bitbar.author.github>
# <bitbar.desc>Lists trello cards in New/In Progress</bitbar.desc>
import os
#fist make sure externalIPNetworkCIDRs is set to ["0.0.0.0/0"] in master config
# refer to https://access.redhat.com/solutions/2464791
# this is needed for the services that declare use of external ips
# in the project where you're deploying kubevirt
#disable selinux or fight as https://adam.younglogic.com/2017/09/se-linux-for-centos-continued/
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
@karmab
karmab / kubevirt-v0.1.0.sh
Last active December 14, 2017 16:16
kubevirt-v0.1.0.sh
VERSION="v0.1.0"
sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
setenforce 0
oc project kube-system
wget https://github.com/kubevirt/kubevirt/releases/download/$VERSION/kubevirt.yaml
wget https://github.com/kubevirt/kubevirt/releases/download/$VERSION/spice-proxy.yaml
oc adm policy add-scc-to-user privileged -z kubevirt-infra
oc adm policy add-scc-to-user hostmount-anyuid -z kubevirt-infra
oc create -f kubevirt.yaml
oc create -f spice-proxy.yaml
@karmab
karmab / README.md
Last active February 22, 2019 19:58
demo_preparation

Basic tooling for cool demos

Installation

sh install.sh

How to use

@karmab
karmab / README.md
Last active June 7, 2018 08:43
kubevirt Packer image for google cloud compute
  • packer needs a patch pending from this pr
  • put the files except the json one in a kubevirt-button directory
  • edit packer-kubevirt-button.json to properly set the path of your account_file. You can optionally change things like
    • cpu and memory of the image with the machine_type
    • network_ip depending on which region you'll want the resulting images to launch in
  • create the image with the following command
packer build packer-kubevirt-button.json
@karmab
karmab / .gitignore
Last active July 9, 2018 13:20
CNV LAB
*_rsa
*_rsa.pub
*retry
@karmab
karmab / REAME.md
Last active October 4, 2018 16:18
Deploy latest okd
apiVersion: v1
kind: ReplicationController
metadata:
labels:
app: kubevirt-web-ui
openshift.io/deployment-config.name: kubevirt-web-ui
name: kubevirt-web-ui
spec:
replicas: 1
selector: