Skip to content

Instantly share code, notes, and snippets.

@cp16net
cp16net / gist:3100736
Created July 12, 2012 20:26
python 2.7 time_delta.total_seconds()
def get_total_seconds(td):
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6
@cp16net
cp16net / gist:4553704
Created January 17, 2013 04:41
looking over the list of packages installed here seems too much is dependent. I am not sure if everything is necessary... maybe it is.
update-rc.d: warning: open-iscsi stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
invoke-rc.d (tripleo 1.0)
Warning: Fake inovke-rc.d called, doing nothing
Setting up vlan (1.9-3ubuntu6) ...
run-parts: executing /tmp/in_target.d/install.d/05-base-apps
+ export DEBIAN_FRONTEND=noninteractive
+ DEBIAN_FRONTEND=noninteractive
+ apt-get -y install sysstat mytop ntp lvm2 xfsprogs xfsdump policycoreutils libmysqlclient-dev
Reading package lists... Done
Building dependency tree
py27 runtests: commands[1]
WARNING:test command found but not installed in testenv
cmd: /bin/bash
env: /Users/craig.vyvial/code/public/reddwarf/.tox/py27
Maybe forgot to specify a dependency?
py27 runtests: commands[2]
WARNING:test command found but not installed in testenv
cmd: /bin/bash
env: /Users/craig.vyvial/code/public/reddwarf/.tox/py27
Maybe forgot to specify a dependency?
@cp16net
cp16net / gist:5529919
Created May 7, 2013 02:47
vagrant plugin isntall vagrant-kvm failure
$ vagrant plugin install vagrant-kvm
Installing the 'vagrant-kvm' plugin. This can take a few minutes...
/opt/vagrant/embedded/lib/ruby/1.9.1/rubygems/installer.rb:562:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/opt/vagrant/embedded/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
@cp16net
cp16net / .gitconfig
Created May 7, 2013 04:45
My personal .gitconfig
[user]
name = Craig Vyvial
email = cp16net@gmail.com
[color]
ui = true
branch = auto
diff = auto
interactive = auto
status = auto
@cp16net
cp16net / Vagrantfile
Last active December 17, 2015 02:48
Simple Vagrantfile for precise64.
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
end
vagrant plugin install vagrant-kvm
vagrant plugin list
@cp16net
cp16net / Vagrantfile
Last active December 17, 2015 02:48
Converting a vagrant virtualbox image (precise64) to a kvm provider base
# Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.base_mac = "00163e779fe9"
config.vm.network :private_network, ip: "192.168.2.100"
end
# Load include vagrant file if it exists after the auto-generated
# so it can override any of the settings
vagrant up provider=kvm
@cp16net
cp16net / .inputrc
Created May 23, 2013 15:14
Allow up arrow and down arrow searching through history
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on