Skip to content

Instantly share code, notes, and snippets.

View jbowes's full-sized avatar
🍀
🌙⭐️🌈❤️🧲🎈🦄

James Bowes jbowes

🍀
🌙⭐️🌈❤️🧲🎈🦄
View GitHub Profile
N A C K !
  /\___/\
/ /    ヽ ::: \
| (●), 、(●)、 |
|  ,,ノ(、_, )ヽ、,,   |
|   ,;‐=‐ヽ   .:::::|
\  `ニニ´  .:::/
/`ー‐--‐‐―´´\
       .n:n    nn
#!/usr/bin/python
#
# Fixes your manifest. Oops!
import os
import glob
import shutil
import simplejson as json
import sys
import tempfile
# 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;
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.
#!/usr/bin/python
import sys
from rhsm import _certificate
import zlib
fp = open(sys.argv[1], "r")
x509 = _certificate.load(pem=fp.read())
#!/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"))
PoolManager poolManager;
Refresher refresher = poolManager.refresher(lazy);
refresher.addOwner(someOwner);
refresher.addOwner(someOtherOwner);
refresher.addProduct(product1);
refresher.run();
#!/usr/bin/python
#
# Fixes your manifest. Oops!
import os
import glob
import shutil
import simplejson as json
import sys
import tempfile
@jbowes
jbowes / default-rules.coffee
Created October 20, 2012 12:06
Candlepin default rules auto-converted to CoffeeScript
#
# * Default Candlepin rule set.
#
entitlement_name_space = ->
Entitlement
consumer_delete_name_space = ->
ConsumerDelete
pool_name_space = ->
Pool
criteria_name_space = ->
@jbowes
jbowes / goth_scheme.vim
Created February 8, 2013 13:33
A vim color scheme to fit the void in your soul.
" 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