Skip to content

Instantly share code, notes, and snippets.

View jtimberman's full-sized avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile
@jtimberman
jtimberman / fun-with-knife-and-jq.md
Created May 8, 2020 21:32
Reminder that Chef has an rich set of data and an API

Did you know that every time the chef-client runs, it knows what time it is, and it stores that value as a node attribute, ohai_time? Did you know that you can use this value for searching a Chef Infra Server? It's a Unix Epoch!

For example, let's look for the nodes that were updated in the last 10-15 minutes:

now=$(date +%s)
range_start=$(expr $now - 900)
range_end=$(expr $now - 600)

knife search node "ohai_time:[$range_start TO $range_end]" -a ohai_time -F json

Keybase proof

I hereby claim:

  • I am jtimberman on github.
  • I am jtimberman (https://keybase.io/jtimberman) on keybase.
  • I have a public key ASCJzdFw_o9eVy7biR2J5moJQ_AmV1Mcj2V-vUIITlkiVAo

To claim this, I am signing this object:

Gluten free. Easily dairy free (skip the cheese).
Serves four
1 lb chicken
1 poblano pepper
1 Anaheim pepper
1 cup dry black beans
1 cup frozen corn
Half cup cilantro
Gluten free. Easily dairy free (skip the cheese).
Serves four
1 lb chicken
1 poblano pepper
1 Anaheim pepper
1 cup dry black beans
1 cup frozen corn
Half cup cilantro
@jtimberman
jtimberman / jtimberman.zsh
Last active June 13, 2018 15:35
jtimberman.zsh-theme - but with -theme it doesn't syntax highlight....
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%} %{$fg[red]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%} %{$fg[green]%}✔%{$reset_color%}"
function chef_profile_prompt() {
[[ -n $CHEF_PROFILE ]] && echo " %{%F{blue}%}${CHEF_PROFILE}%{$reset_color%}"
}
function aws_profile_prompt() {
@jtimberman
jtimberman / gist:420eca4c2986e458120f963b80227bd5
Created May 1, 2018 22:30 — forked from spudbean/gist:1558257
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons

Prerequisites

You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to https://github.com so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example depot.example.com. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in. The /#/sign-in is required.

Operating System

@jtimberman
jtimberman / dynamic-fonts.el
Last active May 23, 2016 17:08 — forked from arnab/dynamic-fonts.el
Dynamically adjust fonts in emacs based on screen resolution (Retina vs. Thunderbolt)
;; Gist-ed from in https://github.com/arnab/emacs-starter-kit
(defun fontify-frame (frame)
(interactive)
(if window-system
(progn
(if (> (x-display-pixel-width) 2000)
(set-frame-parameter frame 'font "Inconsolata 19") ;; Cinema Display
(set-frame-parameter frame 'font "Inconsolata 16")))))
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch ([email protected])
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
email_address="[email protected]"