Skip to content

Instantly share code, notes, and snippets.

@jimrollenhagen
jimrollenhagen / i13.json
Last active August 29, 2015 14:27
created by github.com/tr3buchet/gister
{
"ip_whitelist": [
"173.203.32.136/29",
"173.203.5.160/27",
"67.192.155.96/27",
"89.234.21.64/28",
"166.78.7.146",
"50.56.249.239",
"166.78.107.18",
"162.209.4.155",
2014-05-08 22:41:05.184 31707 ERROR ironic.drivers.modules.agent [-] vendor_passthru failed with method heartbeat
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent Traceback (most recent call last):
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent File "/root/ironic/ironic/drivers/modules/agent.py", line 308, in vendor_passthru
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent return func(task, **kwargs)
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent File "/root/ironic/ironic/drivers/modules/agent.py", line 341, in _heartbeat
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent self._reboot_to_instance(task, **kwargs)
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent File "/root/ironic/ironic/drivers/modules/agent.py", line 389, in _reboot_to_instance
2014-05-08 22:41:05.184 31707 TRACE ironic.drivers.modules.agent neutron_client.remove_provisioning_network(node_object)
2014-05-08 22:41:05.184 31707 TR

Keybase proof

I hereby claim:

  • I am jimrollenhagen on github.
  • I am jroll (https://keybase.io/jroll) on keybase.
  • I have a public key whose fingerprint is EB0D 4751 8F86 CA1A 697E 5692 B66A 2F91 42C6 C09C

To claim this, I am signing this object:

@jimrollenhagen
jimrollenhagen / output.txt
Last active September 23, 2021 21:43
Cool little utility to build Django model definitions from a CSV file. Outputs CharField definitions, with blank=True for columns that have blank cells, and max_length corresponding to the next power of 2 greater than that column's actual max length.
Sample output:
processed 65534 lines
[(False, 10), (False, 12), (True, 908)]
field_one = models.CharField(max_length=16)
field_two = models.CharField(max_length=16)
field_three = models.CharField(max_length=1024, blank=True)
//
// WhatAPI.m
// iWhat
//
// Created by James Rollenhagen on 7/14/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "WhatAPI.h"
#import <RestKit/RestKit.h>
@jimrollenhagen
jimrollenhagen / gist:2985369
Created June 24, 2012 22:55
property example
class Thing(models.model):
something = models.CharField(null=True)
# ...
@property
def something_display(self):
if self.something is None:
return 'something else'
return self.something
def score(dice)
score = 0
points = { 1 => 100, 2 => 0, 3 => 0, 4 => 0, 5 => 50, 6 => 0 }
points_trip = { 1 => 1000, 2 => 200, 3 => 300, 4 => 400, 5 => 500, 6 => 600 }
(1..6).map { |i|
count = dice.count(i)
score += (count / 3) * points_trip[i] + (count % 3) * points[i]
}
score
end