Skip to content

Instantly share code, notes, and snippets.

View ssato's full-sized avatar

Satoru SATOH ssato

View GitHub Profile
@ssato
ssato / yum-repo-size-info-list.sh
Last active May 2, 2017 02:23
yum のリポジトリメタデータに含まれる RPM パッケージファイルのサイズ情報などからリポジトリ容量を概算
#! /bin/bash
#
# Copyright(C) 2016 Red Hat, Inc.
# Author: Satoru SATOH <[email protected]>
# License: MIT
#
# Example:
# [root@rhel-7-client-1 ~]# ./yum-repo-size-info-list.sh \
# > -r rhel-7-server-rpms -r rhel-7-server-optional-rpms \
# > -r rhel-7-server-rh-common-rpms -r rhel-7-server-extras-rpms \
@ssato
ssato / gist:eb72d5c1e6214ffea0e4
Created December 14, 2015 17:25
json_vs_bson_vs_msgpack_vs_...
In [1]: import anyconfig
...
In [3]: save = lambda obj, fname, **kwargs: anyconfig.dump(obj, os.path.join("/tmp", fname), **kwargs)
In [4]: ipdata = anyconfig.load("/tmp/fleure-tests-ouZIjr/packages.json")
...
In [6]: %lprun -T /tmp/ips.json.lprof -f save save(ipdata, "ips.json")
Timer unit: 1e-06 s
Total time: 0.151962 s
In [3]: import collections
In [4]: import anyconfig
In [5]: ips = anyconfig.load("/tmp/fleure-tests-ouZIjr/packages.json")["data"]
In [6]: ips[0]
Out[6]:
{u'arch': u'x86_64',
u'buildhost': u'x86-007.build.bos.redhat.com',
概要
-----
ソースをビルドしてリリース、実際に適用 (アップデート) するまでの全体の流れ:
#. 一応テスト
#. ビルド・リリース用の Source RPM 作成
#. ビルド & リリース (社内 Yum リポジトリへ)
#. 適用 (社内 Yum リポジトリからとってきて普通に yum update -y するだけ)
#! /bin/bash
#
# Simple wrapper script for rpmbuild to build *rpm w/ minimum side effects,
# e.g. creating ~/rpmbuild/{RPMS,SOURCES,BUILD,...}.
#
# Author: Satoru SATOH <satoru.satoh at gmail.com>
# License: MIT
set -e
rpmspec=
#
# repodata.py - Parse repodata/*.xml.gz in yum repositories.
#
# Copyright (C) 2012 Satoru SATOH <[email protected]>
#
# 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.
#
#
# minifyrpms.py - Minify given rpm list
#
# Copyright (C) 2012 - 2014 Red Hat, Inc.
# Red Hat Author(s): Satoru SATOH <[email protected]>
#
# 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 <[email protected]>
#
# 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 <[email protected]>
#
# 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 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.