I drafted this blog post in 2016 (at least), but held off publishing it until I could have it fact checked. Well, 6 years have passed… I am 99% sure the information in this blog post is correct. But if you find an error with my explanation of the userspace-kernel-device dataflow then please send me an email so I can understand it better and update this post. Thank you!
I’ve been experimenting with creating functionality within bitmath for reading the size of storage devices. This would provide a function similar to Python’s os.path.getsize
, but for storage device capacity instead of file sizes.
Unfortunately, it turns out that there is no out of the box (and cross-platform) solution in Python for reading the capacity of system storage devices. This meant some research was going to be required. Luckily, possible solutions for how to do this are abundant across the internet. Well, for Linux anyway. Figuring out how to make this work on Mac OS X was more challenging.
And that’s where the story gets interesting.
In the rest of this blog post we’ll learn the basics of how programs can interact with storage devices via the ioctl()
system call. Then we’ll discuss the things we have to do and information we’ll need to have in order to implement an ioctl()
request in Python. Next we’ll see how to gather all the necessary information (request codes and expected result sizes). Finally we’ll put all of this together into a runnable Python program.
If you’re not familiar with that acronym, “ioctl” stands for “input/output control”.
Just 3 days after publishing this blog post GitHub made a new blog post:
Pull request reviews are a great way to share the weight of building software, and with review requests you can get the exact feedback you need.
To make it easier to find the pull requests that need your attention, you can now filter by review status from your repository pull request index.
Source: Filter pull request reviews and review requests
I have tried this out and it’s great! Like most everything else on GitHub it’s very intuitive and simple to use. I won’t steal their thunder and describe it all here. So go check out the blog post for yourself and read up on the details (screenshots included!).
Continue reading if you’re still interested in incorporating this kind of filtering and labeling into your Gmail account.
I’ve been looking for a way to filter my GitHub Pull Request lists under the condition that a review is requested of me. The online docs didn’t show any filter options for this, so I checked out the @GitHubHelp twitter account. The answer was there on the front page — they don’t support filtering PRs by review-requested-by:me
yet:
@zaghnaboot Adding a filter for reviewers is definitely on our radar, though I don’t have a specific timeline to share. –SJ
— GitHub Support (@GitHubHelp) January 19, 2017
So what is one to do? I’m using Gmail so I began considering what filter options were available to me there. My objectives were to clearly label and highlight:
@mention
‘dInterested in knowing more? Read on after the break for all the setup details.
bitmath is a Python module I wrote which simplifies many facets of interacting with file sizes in various units as python objects. A few weeks ago version 1.3.1 was released with a few small updates.
This new function accepts inputs using non-standard prefix units such as single-letter, or mis-capitalized units. For example, parse_string
will not accept a short unit like ‘100k‘, whereas parse_string_unsafe
will gladly accept it:
Several broken, moved, or redirecting links have been fixed. Wording and examples are more consistent. The documentation also lands correctly when installed via package.
bitmath-1.3.1 is available through several installation channels:
Ubuntu builds have not been prepared yet due to issues I’ve been having with Launchpad and new package versions.
It’s been quite a while since I’ve posted any bitmath updates (bitmath is a Python module I wrote which simplifies many facets of interacting with file sizes in various units as python objects) . In fact, it seems that the last time I wrote about bitmath here was back in 2014 when 1.0.8 was released! So here is an update covering everything post 1.0.8 up to 1.3.0.
bitmath
, you can use to do simple conversions right in your shell [docs]!To help with the Fedora Python3 Porting project, bitmath now comes in two variants in Fedora/EPEL repositories (BZ1282560). The Fedora and EPEL updates are now in the repos. TIP: python2-bitmath
will obsolete the python-bitmath
package. Do a dnf
/yum
‘update
‘ operation just to make sure you catch it.
The PyPi release has already been pushed to stable.
Back in bitmath-1.0.8 we had 150 unit tests. The latest release has almost 200! Go testing! :confetti: