Top.Mail.Ru
? ?

Reconnecting

So on the off-chance someone other than Imagefdsf is actually around, I'd love to reconnect if we've lost touch, but so many people here have really outdated information.

You can find me under the name halkeye all over the place, gmail, twitter, I think facebook, places!

Gavin

How to output pretty json in puppet

Originally published at http://www.halkeye.net/2012/03/14/output-pretty-json-puppet/. You can comment here or http://www.halkeye.net/2012/03/14/output-pretty-json-puppet/#comments.

It kept seeming like it should be straight forward. Various attempts by myself (mostly because I don’t know ruby) seemed to fail. I’m just leaving it here now that I figured out how to get it working so I can find it again (and hopefully help others).

init.pp

$config_data = { "foo" => "bar" }

template.erb

<%= require "json"; JSON.pretty_generate config_data %>

I found config_data.to_json wasn’t going to work for me because it seemed to output things in different orders each run.

(it was http://snippets.aktagon.com/snippets/412-How-to-pretty-print-JSON-data-with-Ruby that helped me figure this out)

Edit: While pretty, still doesn’t sort so puppet can update the config file each run :( I will figure this out.

Tags:

Originally published at http://www.halkeye.net/2012/02/17/gitpush-notification-gitolite-andjenkins/. You can comment here or http://www.halkeye.net/2012/02/17/gitpush-notification-gitolite-andjenkins/#comments.

Its so easy now to support jenkins+git with gitolite. No more having git polling per project and slamming the git server with ssh requests.

To install:
Edit .gitolite/hooks/common/post-receive file[1]
Add:

curl -s http:///git/notifyCommit?url=/${GL_REPO}.git

For me, my git prefix is: “ssh://git@git.kodekoan.com”

Its that simple.

[1] .gitolite/hooks/common/post-receive should be symlinked in every repo you have. I think you needed to set it up before you created a repo though)

Tags:

I get my own ugly code

Originally published at The Nameless Site. You can comment here or there.

sub rw { my $word = "$_[0]"; $word =~ s/(.)/rc($1)/ge; $word;}
sub rc { return ((rand(1)*2+1)%2) ? lc($_[0]): uc($_[0]);    }

(i don’t care about efficiency or whatnot, i was just creating a simple function for a unit test, it just looks like someone threw up some letters.

Tags:

Oct. 20th, 2008


If the price of an apple was raised 50% and then decreased 50%, making it cost $0.75, how much was the original price?

$1.00
$0.75
$1.25
$0.50


as Imageaeiouy123 pointed out with his nice formula the answer is indeed $1.00



I just love this question. I kinda want to see if we can put it on the interview test at work.

Oct. 18th, 2008

If the price of an apple was raised 50% and then decreased 50%, making it cost $0.75, how much was the original price?

$1.00
$0.75
$1.25
$0.50

I don't think its a difficult question, but so many people think its the wrong answer.
So I'm curious.

PS, i'll unscreen comments in a couple days.

Somethign to think about


And the body language was all screwed up out west. Art believed that your entire unconscious affect was determined by your upbringing. You learned how to stand, how to hold you face in repose, how to gesture, from the adults around you while you were growing up. The Pacific Standard Tribe always seemed a little bovine to him, their facial muscles long conditioned to relax into a kind of spacey, gullible senescence.

Beauty, too. Your local definition of attractive and ugly was conditioned by the people around you at puberty. There was a Pacific "look" that was indefinably off. Hard to say what it was, just that when he went out to a bar or got stuck on a crowded train, the girls didn't seem all that attractive to him. Objectively, he could recognize their prettiness, but it didn't stir him the way the girls cruising the Chelsea Antiques Market or lounging around Harvard Square could.


- Eastern standard tribe - Cory Doctorow
http://bash.org/?865032 is quickly becoming one of my fav bash quotes.

that is all

Snow at the skytrain

Originally published at The Nameless Site. You can comment here or there.

Image
Snow at the skytrain
Originally uploaded by halkeye

look at the awesome snow we had this morning
it so barely is noticeable.

Tags:

Dear interweb,

why does my computer lag drastically after doing anything with gmail? especially after navigating away from it?

almost, and i mean not really, tempted to stop using it. Moreso I think i'll just stop using firefox with it.

Latest Month

January 2014
S M T W T F S
   1234
567891011
12131415161718
19202122232425
262728293031 

Links

Syndicate

RSS Atom

Comments

Powered by LiveJournal.com
Designed by Teresa Jones
Image