This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import libvirt | |
# Get a connection to Hypervisor (optional URI). | |
# Return virConnect object if successfull otherwise NULL | |
# More: http://libvirt.org/html/libvirt-libvirt.html#virConnectOpen | |
# Check openAuth and openReadOnly methods also. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
words := strings.Fields(s) | |
m := make(map[string]int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
pre := 0 | |
post := 1 | |
return func() int{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data_file = open('<file_name>', 'r') | |
running_job_object = new_job.invoke(block=True, | |
build_params={'<para1>': '<value>', '<para2>': '<value>'}, | |
files={'<file_para_name>': data_file}) | |
data_file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tox] | |
envlist = py26, py27 | |
[testenv] | |
commands = | |
python pytest | |
[testenv:py26] | |
deps= | |
argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install devel library | |
yum install rpm-devel | |
# Download available srpm (using f20 srpm) | |
wget https://kojipkgs.fedoraproject.org//packages/rpm/4.11.2/1.fc20/src/rpm-4.11.2-1.fc20.src.rpm | |
# Extract SRPM | |
rpm -Uvh <SRPM> | |
# Install rpm dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signal | |
import time | |
import os | |
from subprocess import check_output, Popen, CalledProcessError | |
def get_pid(name): | |
return check_output(["pidof",name]) | |
def handler(signum, frame): | |
print "signal handler called with signal %s" % signum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running Openshift in adb virtual-box | |
------------------------------------ | |
1. Note adb virtual box already running etcd service which using port | |
7001 then stop those service (In my case, kubernetes/etcd service was | |
running and due to that openshift/origin container was not able to run) | |
BZ #1271468 | |
2. Start openshift origin container | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script to get pull all <images>:<tag> with latest build | |
import docker | |
import json | |
cli = docker.Client(base_url='unix://var/run/docker.sock') | |
repo_tags = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using downloaded Vagrant | |
vagrant box add cdk2 file:///home/prkumar/work/cdk2/rhel-7.2-server-kubernetes-vagrant-scratch-1-1.x86_64.vagrant-libvirt.box | |
# Initialize a box (This will create a vagrantfile in current working directory) | |
vagrant init cdk2 | |
# Start a box | |
vagrant up | |
# ssh to the box |
OlderNewer