Skip to content

Instantly share code, notes, and snippets.

Amador Pahim amadorpahim

Block or report user

Report or block amadorpahim

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 BZ#1112861
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:1a:4a:c3:6b:35 brd ff:ff:ff:ff:ff:ff
inet6 fe80::21a:4aff:fec3:6b35/64 scope link
valid_lft forever preferred_lft forever
View manual
[root@rhevm30 ~]# cd /var/lib/iscsi
[root@rhevm30 iscsi]# iscsiadm -m iface -I eth1 --op=new
New interface eth1 added
[root@rhevm30 iscsi]# iscsiadm -m iface -I eth2 --op=new
New interface eth2 added
[root@rhevm30 iscsi]# tree
.
`-- ifaces
View syslog-ng.conf
# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#
options {
sync (0);
@amadorpahim
amadorpahim / gist:5775725
Last active Dec 18, 2015
"yum install vdsm" hangs on a Host with selinux disabled
View gist:5775725
Installing : vdsm-4.11.0-28.git634b9f4.fc18.x86_64 1/1
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.27, searching for an older version.
SELinux: unable to find usable policy file: No such file or directory
/sbin/load_policy: Can't load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.27, searching for an older version.
SELinux: unable to find usable policy file: No such file or directory
/sbin/load_policy: Can't load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2.
Traceback (most recent call last):
View gist:4690815
2013-02-01 08:33:10::DEBUG::common_utils::339::root:: Executing command --> '/bin/rpm -q rhevm'
2013-02-01 08:33:10::DEBUG::common_utils::377::root:: output = rhevm-3.0.3_0001-3.el6.x86_64
2013-02-01 08:33:10::DEBUG::common_utils::378::root:: stderr =
2013-02-01 08:33:10::DEBUG::common_utils::379::root:: retcode = 0
2013-02-01 08:33:10::INFO::rhevm-upgrade::1129::root:: Info: Found .pgpass file at old location. Moving it to a new location.
2013-02-01 08:33:10::DEBUG::common_utils::690::root:: found existing pgpass file, fetching DB admin value
2013-02-01 08:33:25::DEBUG::common_utils::339::root:: Executing command --> '/bin/rpm -qa'
2013-02-01 08:33:26::DEBUG::common_utils::377::root:: output = cracklib-2.8.16-4.el6.x86_64
cairo-1.8.8-3.1.el6.x86_64
View gist:4684551
86 class CpuTopology(object):
87 def __init__(self, capabilities=None):
88 self._topology = _getCpuTopology(capabilities)
89
90 def threads(self):
91 return self._topology['threads']
92
93 def cores(self):
94 return self._topology['cores']
95
View with_new_caps_pythonic.py
#!/usr/bin/python
# Amador Pahim <apahim@redhat.com>
# Jan 12 2013
import libvirt
from xml.dom import minidom
#c = libvirt.open("qemu:///system")
#caps = minidom.parseString(c.getCapabilities())
caps = minidom.parse("capabilities.xml")
View with_new_caps.py
#!/usr/bin/python
import libvirt
from xml.dom import minidom
#c = libvirt.open("qemu:///system")
#caps = minidom.parseString(c.getCapabilities())
caps = minidom.parse("capabilities.xml")
host = caps.getElementsByTagName('host')[0]
cells = host.getElementsByTagName('cells')[0]
View importVm.py
import urllib2
import base64
import sys
from xml.etree import ElementTree
# Example
ADDR = "192.168.123.176"
API_PORT = "8443"
USER = "rhevm@ad.rhev3.com"
PASSWD = "T0pSecreT!"
View libvirt_caps_topo.py
#!/usr/bin/python
import libvirt
from xml.dom import minidom
def _getTopology():
c = libvirt.open("qemu:///system")
caps = minidom.parseString(c.getCapabilities())
host = caps.getElementsByTagName('host')
host = host[0]
topology = {'Sockets': host.getElementsByTagName('topology')[0].getAttribute('sockets'),
You can’t perform that action at this time.