Skip to content

Instantly share code, notes, and snippets.

View tbielawa's full-sized avatar
💭
bitmath!

Tim Case tbielawa

💭
bitmath!
View GitHub Profile
@tbielawa
tbielawa / get_bitmath.sh
Last active August 29, 2015 13:57
How do I get bitmath: via RPM; via PyPi (pip); via setup/distutils? https://github.com/tbielawa/bitmath More information: https://blog.lnx.cx/?p=521
########################################################################
# If you want it from PyPi:
$ sudo pip install bitmath
########################################################################
# If you like manual labor (and bleeding edge releases):
#
# clone that sweet sweet git repo:
$ git clone https://github.com/tbielawa/bitmath.git
$ cd bitmath
@tbielawa
tbielawa / get_bitmath.sh
Created March 16, 2014 22:14
How do I get bitmath (as an RPM)? https://github.com/tbielawa/bitmath More information: https://blog.lnx.cx/?p=521
git clone https://github.com/tbielawa/bitmath.git
cd bitmath
make rpm
sudo rpm -ivh ./rpm-build/noarch/python-bitmath*.noarch.rpm
@tbielawa
tbielawa / megafrobber.py
Created March 16, 2014 21:53
How many times have you found yourself doing the same thing? Converting units without a standard library? Why don't we have something for that? My answer: https://github.com/tbielawa/bitmath now we do.
def frob_account_quota(user):
user_quota_bytes = user.quota
user_quota_human_readable = user_quota_bytes / (1024 * 1024 * 1024)
print "%s has a quota of %s GB" % (user.name, user_quota_human_readable)

juicer-admin(1)

NAME

juicer-admin - manage pulp repositories, users, and roles.

diff --git a/Makefile b/Makefile
index be57177..5a59b31 100644
--- a/Makefile
+++ b/Makefile
@@ -171,6 +171,7 @@ rpm: rpmcommon
@find rpm-build -maxdepth 2 -name 'juicer*.rpm' | awk '{print " " $$1}'
@echo "#############################################"
+# This makes an RPM for Openshift Online
oorpm: rpmcommon
@tbielawa
tbielawa / gist:9201818
Created February 25, 2014 03:00
SO MANY CHANGES
[~/rhat/juicer] 21:58:39 (repos_from_file)
$ git ds master
Makefile | 4 +-
bin/juicer | 3 +
bin/juicer-admin | 5 +-
docs/man/man1/juicer-admin.1 | 206 ++++++++++++++++++++++++++--
docs/man/man1/juicer-admin.1.asciidoc.in | 96 +++++++++++--
docs/man/man1/juicer.1 | 92 ++++++-------
docs/man/man1/juicer.1.asciidoc.in | 76 +++-------
docs/man/man5/juicer.conf.5 | 8 +-
@tbielawa
tbielawa / Virtual-Disk-Operations.xml
Created December 6, 2013 18:11
Example of bad XML in a DocBook 5 book and how to detect it with the xmllint command
<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="invalid-syntax-example"
xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Test for Developer Blog</title>
<subtitle>From the basics to the advanced</subtitle>
@tbielawa
tbielawa / tryjson.py
Created November 22, 2013 18:25
How to import JSON on old python boxes
try:
import json
except:
import simplejson as json
diff --git a/juicer/juicer/Juicer.py b/juicer/juicer/Juicer.py
index f44ca6b..96d97dc 100644
--- a/juicer/juicer/Juicer.py
+++ b/juicer/juicer/Juicer.py
@@ -22,7 +22,6 @@ import juicer.juicer
import juicer.utils
import juicer.utils.Upload
import os
-import re
@tbielawa
tbielawa / gist:6920170
Created October 10, 2013 15:19
unit tests - juicer-0.6.0
Total time to run all tests ~= 498 ~= 8.3 minutes
[/tmp/tmp.ljh47fa992/juicer] 11:00:23 (master)
$ make test
. ./hacking/setup-env
Prefixing PYTHONPATH with /tmp/tmp.ljh47fa992/juicer:/tmp/tmp.ljh47fa992/juicer/Juicer/:/tmp/tmp.ljh47fa992/juicer/JuicerAdmin/
Prefixing PATH with /tmp/tmp.ljh47fa992/juicer/bin
Prefixing MANPATH with /tmp/tmp.ljh47fa992/juicer/docs/man
if [ "false" = "true" ]; then \