Skip to content

Instantly share code, notes, and snippets.

@devnulled
devnulled / nvm-auto-run.md
Created April 23, 2025 16:31 — forked from tcrammond/nvm-auto-run.md
Automatically nvm use when entering directory

Calling nvm use automatically in a directory with a .nvmrc file

Put this into your $HOME/.zshrc to call nvm use automatically whenever you enter a directory that contains an .nvmrc file with a string telling nvm which node to use:

place this after nvm initialization!

@devnulled
devnulled / fix.sh
Created March 21, 2019 20:35
Deleting Stuck or Hung Kubernetes CRD's and CR's
#
# How to patch and delete CustomResourceDefinitions and CustomResources in Kubernetes
#
#
# Just copied and pasted from this solution in a kubernetes bug report:
#
# https://github.com/kubernetes/kubernetes/issues/60538
#
# remove the CRD finalizer blocking on custom resource cleanup
@devnulled
devnulled / chrony.conf
Created November 19, 2018 19:04
Default Chrony Config for Debian on AWS
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usuable directives.
#
# Amazon AWS NTP Server
#
server 169.254.169.123 prefer iburst
# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
@devnulled
devnulled / boot.sh
Created October 2, 2018 22:19
Simple shell script to install crony on boot in the Kubernetes version of Debian to use AWS time servers. Other keywords: time, sync, ntp, ntpd
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
apt-get -q -y install chrony --no-install-recommends
sed -i 's/pool 2.debian.pool.ntp.org iburst/server 169.254.169.123 prefer iburst/g' /etc/chrony/chrony.conf
systemctl restart chrony
@devnulled
devnulled / gist:d1993a45bc87643a03a76c6dcd51d125
Last active September 18, 2018 20:43
Run A Command Against a Collection of Kubernetes Resources
# An example of running a command against each persistantvolume of a given storage class in CoolBrosNetes
# Grab the JSON to parse from k8s
kubectl get pv -o json > pv.json
# Parse the JSON with jq and run that shit
jq -r '.items[] | select(.spec.storageClassName=="my-storage-class") | [.metadata.name] | @tsv' pv.json |
while IFS=$'\t' read -r name; do
echo The name is $name
done
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
output = p.communicate()[0]
o_max = [l for l in output.splitlines() if 'MaxCapacity' in l][0]
o_cur = [l for l in output.splitlines() if 'CurrentCapacity' in l][0]
@devnulled
devnulled / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am devnulled on github.
  • I am devnulled (https://keybase.io/devnulled) on keybase.
  • I have a public key whose fingerprint is 8B20 AB7F 1079 A02E 80BE 487D 2874 2656 D1B0 C961

To claim this, I am signing this object:

@devnulled
devnulled / project_documentation_methods.md
Created November 25, 2013 18:01
Ways I've ran across to implement documentation for a project, particularly in GitHub.

GitHub Project Documentation Methods

Just a quick guide on methods I've seen to document GitHub projects. This is not a complete list by any means, just things I've ran across and bookmarked.

More Common

  • GitHub Wiki's
  • GitHub Sites
  • A directory of markdown or AsciiDoc files
  • Sphinx generated documentation
@devnulled
devnulled / gist:5716661
Created June 5, 2013 19:42
Add An External Configuration File to a Grails Project

How To Create An External Configuration File in Grails

Note, this information is taken from user Big Ed at StackOverflow. Thanks Ed!

Ed's Answer

Create a properties file myExternalProperties.groovy and put it on your classpath (such as the $TOMCAT_HOME/lib directory).

Create a configuration file grails-app/conf/MyConfig.groovy to use the external configuration values (if needed). You will not be able to use the properties defined in myExternalProperties.groovy within grails-app/conf/Config.groovy.