Joined August 2012
·

Hannes Georg

Handyman at XING AG
·
Hamburg, Germany
·
·
·

You can even turn this on for all connections by setting the sql_safe_updates variable to 1. ( source )

Hey Justin! I use this myself a lot. One thing really hit me hard: value_for_platform fails silently when used in an attribute file. Afaik this will change in chef 11.

Posted to Chef: Avoid execute, ruby_block, ... over 1 year ago

You hit the mark! A thing I've forgot to mention: some commands exit with a certain exit code if they did nothing. You can then check this exitcode when setting updated_by_last_action.

You're welcome!

Posted to Chef: Avoid execute, ruby_block, ... over 1 year ago

Hi autolykos!

I turn the commands into LWRPs. This takes some hours but the my colleagues appreciate having a descriptive LWRP instead of a command.

I usually look first whether there is something like a check-command which I can if this command should be excuted. For example domainjoin-cli has the subcommand query. The provider then looks somewhat like this: https://github.com/opscode-cookbooks/samba/blob/master/providers/user.rb

Posted to return from block over 1 year ago

@hauleth Indeed! Depends on what you actually want.

Posted to Get/Send SSH-Keys the Github way over 1 year ago

@tuikiken you just append ".keys" to the profile url. This url can be fetched with curl or similiar tools.

Posted to Prefer DateTime over Time over 1 year ago

Are you sure? Ruby 1.9.3 represents a Time as 64 bit wide timestamp. Some experiments yielded:

pry(main)> Time.mktime(-4371,1,1)
=> -4371-01-01 00:00:00 +0053
pry(main)> Time.mktime(23012,1,1)
=> 23012-01-01 00:00:00 +0100

Posted to Don't overuse $(this) over 1 year ago

I've done this for years. Why haven't I come up with the idea of writing this protip?

Achievements
1,201 Karma
76,017 Total ProTip Views