start new:
tmux
start new with session name:
tmux new -s myname
| import pexpect | |
| import sys, getpass | |
| user_pass = getpass.getpass("Sudo password: ") | |
| child = pexpect.spawn('vagrant up --no-provision --provider virtualbox', timeout=120) | |
| i = child.expect([pexpect.TIMEOUT, 'password for .*: ']) | |
| if i == 0: | |
| print ('Error') | |
| print(child.before, child.after) | |
| sys.exit(1) |
| #!/usr/bin/env python3 | |
| from dateutil import parser | |
| def get_logs(fh, log_file): | |
| for line in fh: | |
| if "endclass" in line: | |
| return fh | |
| else: | |
| with open(log_file, 'w') as fh: |
| # | |
| # Recommended minimum configuration: | |
| # | |
| # Example rule allowing access from your local networks. | |
| # Adapt to list your (internal) IP networks from where browsing | |
| # should be allowed | |
| # Auth | |
| auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/squid_passwd |
| #!/bin/bash | |
| # | |
| # virt-install-cloud.sh : script to start an OpenStack cloud image on kvm | |
| # version : 1.0 | |
| # | |
| # Author : Claude Durocher | |
| # License : GPLv3 | |
| # | |
| # ref. http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html | |
| # |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # Copyright © 2015 Praveen Kumar <[email protected]> | |
| # | |
| # This copyrighted material is made available to anyone wishing to use, | |
| # modify, copy, or redistribute it subject to the terms and conditions | |
| # of the GNU General Public License v.2, or (at your option) any later | |
| # version. This program is distributed in the hope that it will be | |
| # useful, but WITHOUT ANY WARRANTY expressed or implied, including the |
| # 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 |
| #!/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 = [] |
| 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 | |
| ``` |
| 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 |