Skip to content

Instantly share code, notes, and snippets.

View deltamualpha's full-sized avatar
🥔

David Ashby deltamualpha

🥔
View GitHub Profile
@deltamualpha
deltamualpha / stacktrace.out
Created August 24, 2017 19:17
stacktrace.out
Generated at 2017-08-24 18:57:53 +0000
Mixlib::ShellOut::ShellCommandFailed: remote_directory[/path] (recipename::default line 35) had an error: Mixlib::ShellOut::ShellCommandFailed: cookbook_file[/path/to/PropertyLoader$args.class] (dynamically defined) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255'
---- Begin output of /sbin/restorecon -R "/path/to/PropertyLoader$args.class" ----
STDOUT:
STDERR: /sbin/restorecon: lstat(/path/to/PropertyLoader.class) failed: No such file or directory
---- End output of /sbin/restorecon -R "/path/to/PropertyLoader$args.class" ----
Ran /sbin/restorecon -R "/path/to/PropertyLoader$args.class" returned 255
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:293:in `invalid!'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:280:in `error!'
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42/lib/chef/mixin/shell_out.rb:120:in `shell_out!'
{
"variables": {
"timestamp": null,
"aws_access_key": null,
"aws_secret_key": null
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-1",
2016/07/29 16:28:33 [INFO] Packer version: 0.10.1
2016/07/29 16:28:33 Packer Target OS/Arch: darwin amd64
2016/07/29 16:28:33 Built with Go Version: go1.6.2
2016/07/29 16:28:33 Detected home directory from env var: /Users/davidashby
2016/07/29 16:28:33 Using internal plugin for file
2016/07/29 16:28:33 Using internal plugin for parallels-iso
2016/07/29 16:28:33 Using internal plugin for azure-arm
2016/07/29 16:28:33 Using internal plugin for null
2016/07/29 16:28:33 Using internal plugin for openstack
2016/07/29 16:28:33 Using internal plugin for virtualbox-ovf
// Peculiar balance
// ================
// Can we save them? Beta Rabbit is trying to break into a lab that contains the
// only known zombie cure – but there’s an obstacle. The door will only open if
// a challenge is solved correctly. The future of the zombified rabbit
// population is at stake, so Beta reads the challenge: There is a scale with an
// object on the left-hand side, whose mass is given in some number of units.
// Predictably, the task is to balance the two sides. But there is a catch: You
// only have this peculiar weight set, having masses 1, 3, 9, 27, … units. That
// is, one for each power of 3. Being a brilliant mathematician, Beta Rabbit
@deltamualpha
deltamualpha / pyramid.js
Created May 20, 2016 00:40
another coding challenge that came up recently: given an odd number, return a centered pyramid with a base that width.
var pyramid = function(width) {
if (width % 2 == 0) {
console.log("odd numbers only, please");
return;
}
var gaps = '';
for (var i = ((width-1)/2); i >= 0; i--) {
gaps += ' ';
}
var hashes = '#';
@deltamualpha
deltamualpha / any_base_palindromes.js
Last active May 20, 2016 02:30
This problem was presented to me: given a list of numbers, 1-1000, can you name the smallest base in which each one is a palindrome?
var palindrome_test = function(array) {
for (var i = 0; i <= array.length - 1; i++) {
if (array[i] !== array[array.length - i - 1]) {
return false;
}
}
return true;
}
var int2base = function(int, base) {
@deltamualpha
deltamualpha / keybase.md
Created April 21, 2016 21:42
keybase.md

Keybase proof

I hereby claim:

  • I am deltamualpha on github.
  • I am deltamualpha (https://keybase.io/deltamualpha) on keybase.
  • I have a public key ASAHcIGA69GoZ2GE70pQbpKsWbRWeipiheYAq53ctGapLwo

To claim this, I am signing this object:

@deltamualpha
deltamualpha / gist:c3a191260352f24eb74e
Created September 6, 2014 21:21
create a proper extension file for an installed php module
define php::conf {
if $::lsbdistcodename == 'precise' {
$php_build = '20090626'
file { "/etc/php5/conf.d/${title}.ini":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => template("php/conf.d/${title}.ini"),
@deltamualpha
deltamualpha / gist:614e1799f97c8be298f8
Last active August 29, 2015 14:06
php phar download puppet
# install a phar file from a remote server directly
define php::phar ($url, $insecure = false, $target = $title) {
$split = split($url, '/')
$filename = $split[-1]
# for wget bug workarounds
if ($insecure == true) {
$wget_options = "--no-check-certificate"
}
@deltamualpha
deltamualpha / gist:9918757
Last active August 29, 2015 13:57 — forked from fernandoaleman/gist:4551494
A one-liner to delete the crud files that s3fs leaves in your mounted s3 directories after you've quit using s3fs
s3cmd ls --recursive s3://BUCKET_NAME |\
ruby -rdate -ne 'date, time, size, uri = $_.split; puts uri if size == "0" && uri[-1,1] != "/" && !uri.include?(".")' |\
xargs s3cmd del