This file contains hidden or 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
sudo add-apt-repository ppa:tbielawa/bitmath | |
sudo apt-get update | |
sudo apt-get install python-bitmath |
This file contains hidden or 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
$ gcc ./linux-request-code.c | |
$ ./a.out | |
Block count request code: 0x80081272 |
This file contains hidden or 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
config_opts['root'] = 'epel-6-sclpy27-x86_64' | |
config_opts['target_arch'] = 'x86_64' | |
config_opts['legal_host_arches'] = ('x86_64',) | |
config_opts['chroot_setup_cmd'] = 'install @buildsys-build scl-utils-build python27-build' | |
config_opts['dist'] = 'el6' # only useful for --resultdir variable subst | |
# beware RHEL use 6Server or 6Client | |
config_opts['releasever'] = '6' | |
config_opts['yum.conf'] = """ | |
[main] |
This file contains hidden or 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 bitmath | |
>>> a_big_kib = bitmath.KiB(102400) | |
>>> print "Default:", a_big_kib, "| Best-prefix:", a_big_kib.best_prefix() | |
Default: 102400.0 KiB | Best-prefix: 100.0 MiB | |
>>> print (a_big_kib/3.0).format("{value:.3f}/{unit}") | |
34133.333/KiB | |
>>> print a_big_kib.bits, a_big_kib.system |
This file contains hidden or 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
$ sudo dmidecode -t 16 | |
# dmidecode 2.12 | |
SMBIOS 2.7 present. | |
Handle 0x0005, DMI type 16, 23 bytes | |
Physical Memory Array | |
Location: System Board Or Motherboard | |
Use: System Memory | |
Error Correction Type: None | |
Maximum Capacity: 12 GB |
This file contains hidden or 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
fooooo | |
barr | |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
# /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" |
This file contains hidden or 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
>>> 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() |
This file contains hidden or 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
>>> from bitmath import * | |
>>> GiB(42) * 3 | |
GiB(126.0) | |
>>> Bit(9) + Byte(3) | |
Bit(33.0) | |
>>> exbi = EiB(0.6) |