Skip to content

Instantly share code, notes, and snippets.

View fletchowns's full-sized avatar

Greg Barker fletchowns

View GitHub Profile
@avishayil
avishayil / route53.sh
Created October 14, 2018 17:00
Update Route53 Record With Machine IP Address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
# PATH=PATH
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="ZONEID"
# The CNAME you want to update e.g. hello.example.com
@lgramatikov
lgramatikov / Update-KodiLibrary.ps1
Last active November 27, 2021 09:41
Update remote Kodi library with PowerShell
#Requires -version 4
<#
.SYNOPSIS
Updates Kodi media library on a remote device.
.DESCRIPTION
Calls Kodi API to manually update media library. Web server should be enabled (see http://kodi.wiki/view/Webserver#Enabling_the_webserver).
.PARAMETER ComputerName
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@arangamani
arangamani / chef_attribute_converge.rb
Last active February 20, 2023 02:44
Dynamically update attribute of a Chef resource during converge phase (Node variable assignment in Compile vs Converge)
# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was