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 / thinkpad-t440s-dmidecode
Created June 17, 2014 18:49
See the blog post for more information: https://blog.lnx.cx/?p=541
$ 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
@tbielawa
tbielawa / bitmath-examples.py
Created September 29, 2014 01:38
bitmath-1.0.8-1: Examples
>>> 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
@tbielawa
tbielawa / epel-6-sclpy27-x86_64.cfg
Last active August 29, 2015 14:10
mock SCL py27 configuration
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]
what does this actually do?
commit d0389e5ccf10d31ed01b862f70ea9f3822b0e932
Merge: e64c79f... 0fdab48...
Author: tbielawa <tim@ducksarepeople.com>
Date: Sun Jan 25 19:57:30 2009 -0500
Merge branch 'master' of git@github.com:tbielawa/tdf-os into makeinmakefiles
commit 0fdab482243e52abb8da69bea1d21044b061c356
Author: Tim Bielawa <tbielawa@fridge.(none)>
Date: Tue Jan 20 00:17:52 2009 -0500
#include <stdio.h>
#include <string.h>
#define MAX_FUN_LEN 8
int foo();
int bar();
struct func_list {
int (*function)();
char fname[MAX_FUN_LEN];
// FUNC_LIB.H
// Provides:
// (STRUCT) FUNC_ITEM
// (METHOD) FIND_FUNCTION((STRING) FUNC_NAME)
//
// TDF-OS http://ducksarepeople.com/tdf/
#include <stdio.h>
#include "FUNC_LIB.H"
#include "DATE.H"
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure