Skip to content

Instantly share code, notes, and snippets.

View ssato's full-sized avatar

Satoru SATOH ssato

View GitHub Profile
#! /usr/bin/python
#
# * install libvirt network and domain (guest) from xml file
# * uninstall libvirt network and domain (guest) by name
#
# Copyright (C) 2009 Satoru SATOH <satoru.satoh at gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#! /usr/bin/python
#
# List package groups and packages in comps XML.
#
# Copyright (C) 2013 Satoru SATOH <ssato at redhat.com>
# License: MIT
#
from logging import DEBUG, INFO
import xml.etree.cElementTree as ET
@ssato
ssato / gist:5759708
Last active December 18, 2015 09:09
#! /bin/bash
set -e
set -x
conffile=$1
listfile=$2
## Example ~/.ssh/config:
#Host rhel-x86_64-server-5
# Hostname 192.168.155.151
@ssato
ssato / sqlminus.py
Created June 13, 2013 12:17
Query Oracle Database in RHN Satellite like sqlplus. It requires cx_Oracle: http://cx-oracle.sourceforge.net.
#
# sqlminus.py - Query Oracle database.
#
#
# Copyright (C) 2009 - 2012 Red Hat, Inc.
# Copyright (C) 2008, 2009 Satoru SATOH <ssato@redhat.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
[root@rhel-6-client-3 ~]# mkdir updates
[root@rhel-6-client-3 ~]# yum --downloadonly --downloaddir=./updates update -y
Loaded plugins: downloadonly, product-id, refresh-packagekit, rhnplugin, security
This system is receiving updates from RHN Classic or RHN Satellite.
rhel-x86_64-server-6 | 1.8 kB 00:00
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package autofs.x86_64 1:5.0.5-88.el6 will be updated
---> Package autofs.x86_64 1:5.0.5-89.el6_5.1 will be an update
[root@rhel-6-client-3 ~]# cat /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=1
[root@rhel-6-client-3 ~]# sed -i 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf
[root@rhel-6-client-3 ~]# rpm -q yum-plugin-security
yum-plugin-security-1.1.30-14.el6.noarch
[root@rhel-6-client-3 ~]# yum list-sec
Loaded plugins: downloadonly, product-id, refresh-packagekit, rhnplugin, security
This system is receiving updates from RHN Classic or RHN Satellite.
RHBA-2014:0314 bugfix autofs-1:5.0.5-89.el6_5.1.x86_64
#
# comp2json.py - Parse repodata/comps.xml* in yum repositories and dump
# JSON data files.
#
# Copyright (C) 2013 Red Hat, Inc.
# Copyright (C) 2012 Satoru SATOH <ssato@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#
# List latest RPMs in the software channel specified with using RHN API.
#
# Copyright (C) 2013 Red Hat, Inc.
# Red Hat Author(s): Satoru SATOH <ssato redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# List errata with using RHN API.
#
# Copyright (C) 2012 Red Hat, Inc.
# Red Hat Author(s): Satoru SATOH <ssato@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# List multiple versions of RPMs by versions.
#
# Copyright (C) 2012 Red Hat, Inc.
# Red Hat Author(s): Satoru SATOH <ssato@redhat.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.