Skip to content

Instantly share code, notes, and snippets.

View tbielawa's full-sized avatar
💭
bitmath!

Tim Bielawa tbielawa

💭
bitmath!
View GitHub Profile
@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 +-
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

juicer-admin(1)

NAME

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

@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)
@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 / 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
>>> from bitmath import *
>>> GiB(42) * 3
GiB(126.0)
>>> Bit(9) + Byte(3)
Bit(33.0)
>>> exbi = EiB(0.6)
@tbielawa
tbielawa / bitmath-shell.py
Created March 16, 2014 23:05
bitmath converts almost anything https://github.com/tbielawa/bitmath More information: https://blog.lnx.cx/?p=521
>>> from bitmath import *
>>> four_mibibits = Mib(4)
>>> four_mibibits.to_kB()
kB(524.288)
>>> ninty_nine_bits = Bit(99)
>>> a_small_exbibyte = ninty_nine_bits.to_EiB()
@tbielawa
tbielawa / 01-synaptics.conf
Created March 20, 2014 17:13
Tuning the Thinkpad T440s touchpad - See more at: https://blog.lnx.cx/?p=541
# /etc/X11/xorg.conf.d/01-synaptics.conf
Section "InputClass"
Identifier "t440 top buttons"
MatchDriver "synaptics"
# right btn|middle btn
Option "SoftButtonAreas" "60% 0 0 0 40% 60% 0 0"
Option "HorizHysteresis" "30"
Option "VertHysteresis" "30"
Option "PalmDetect" "1"
@tbielawa
tbielawa / python-bitmath.yum.info
Created March 27, 2014 16:37
python-bitmath - Now available in Fedora repositories! More at https://blog.lnx.cx/?p=550
$ yum info python-bitmath
Available Packages
Name : python-bitmath
Arch : noarch
Version : 1.0.4
Release : 1.fc20
Size : 23 k
Repo : updates/20/x86_64
Summary : Aids representing and manipulating sizes in various prefix
: notations