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
# to use: | |
# make -f /usr/share/selinux/devel/Makefile | |
# semodule -i rhsmcertd_additions.pp | |
module rhsmcertd_additions 1.0; | |
require { | |
type devlog_t; | |
type cert_t; | |
type shell_exec_t; |
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 base64 | |
import zlib | |
import json | |
def decompress_payload(payload): | |
""" | |
Certificate payloads arrive in base64 encoded zlib compressed strings | |
of JSON. | |
This method decodes, de-compressed, parses the JSON and returns the | |
resulting dict. |
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/python | |
import sys | |
from rhsm import _certificate | |
import zlib | |
fp = open(sys.argv[1], "r") | |
x509 = _certificate.load(pem=fp.read()) |
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/python | |
import sys | |
import zlib | |
from rhsm import _certificate | |
fp = open(sys.argv[1], "r") | |
x509 = _certificate.load(pem=fp.read()) | |
print zlib.decompress(x509.get_extension("1.3.6.1.4.1.2312.9.7")) |
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
PoolManager poolManager; | |
Refresher refresher = poolManager.refresher(lazy); | |
refresher.addOwner(someOwner); | |
refresher.addOwner(someOtherOwner); | |
refresher.addProduct(product1); | |
refresher.run(); |
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/python | |
# | |
# Fixes your manifest. Oops! | |
import os | |
import glob | |
import shutil | |
import simplejson as json | |
import sys | |
import tempfile |
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
# | |
# * Default Candlepin rule set. | |
# | |
entitlement_name_space = -> | |
Entitlement | |
consumer_delete_name_space = -> | |
ConsumerDelete | |
pool_name_space = -> | |
Pool | |
criteria_name_space = -> |
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
" Vim color file - goth_scheme | |
set background=dark | |
if version > 580 | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif | |
endif | |
set t_Co=256 |
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
function! StripTrailingWhitespace() | |
" Preparation: save last search, and cursor position. | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
" do the business: | |
%s/\s\+$//e | |
" clean up: restore previous search history, and cursor position | |
let @/=_s | |
call cursor(l, c) |
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
// ==UserScript== | |
// @name My Fancy New Userscript | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match https://github.com/*/pulls | |
// @copyright 2012+, James Bowes | |
// ==/UserScript== | |
// TODO: |