Skip to content

Instantly share code, notes, and snippets.

View wwalker's full-sized avatar

Wayne Walker wwalker

View GitHub Profile
@wwalker
wwalker / env-var-broken
Created May 1, 2024 21:21
variable-wont-export-into-env
>$ echo "$GITLAB_TOKEN"
asdf
>$ export GITLAB_TOKEN
>$ echo "$GITLAB_TOKEN"
asdf
>$ /usr/bin/env | /usr/bin/grep GIT
>$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
@wwalker
wwalker / walk_method
Created August 16, 2023 17:51
traverse JSON::Any Object
def walk(prefix : Array(String))
@item = @j if prefix.size == 0
if @item.nil?
puts "walk: #{prefix.join(".")} is Nil THIS SHOULD NOT HAPPEN"
return
end
case @item.class
when Hash
@item.as_h.keys.each do |k|
puts "walk: #{prefix + [k]} ia a Hash"
@wwalker
wwalker / 0
Created February 9, 2023 00:02
[Style/RedundantBegin] Redundant `begin` block detected
Why does this say "[Style/RedundantBegin] Redundant `begin` block detected" (from vim Syntastic)
@wwalker
wwalker / i3-get-wndow-criteria
Created February 8, 2023 04:52
i3-get-window-criteria
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
@wwalker
wwalker / just-the-commands
Created February 7, 2023 07:39
Build Boomer
git clone https://github.com/nim-lang/Nim.git
cd Nim
./build_all.sh
nim c koch.nim
koch boot -d:release
PATH=~/git/Nim/bin:$PATH
cd ..
git clone https://github.com/tsoding/boomer
cd boomer
nimble build
#
# /home/wwalker/.nvidia-settings-rc
#
# Configuration file for nvidia-settings - the NVIDIA X Server Settings utility
# Generated on Fri Jan 31 16:30:55 2020
#
# ConfigProperties:
RcFileLocale = C
# Global Postfix configuration file. This file lists only a subset
# of all parameters. For the syntax, and for a complete parameter
# list, see the postconf(5) manual page (command: "man 5 postconf").
#
# For common configuration examples, see BASIC_CONFIGURATION_README
# and STANDARD_CONFIGURATION_README. To find these documents, use
# the command "postconf html_directory readme_directory", or go to
# http://www.postfix.org/.
#
# For best results, change no more than 2-3 parameters at a time,
@wwalker
wwalker / a.yml
Created November 10, 2022 05:12
mysql_user
---
- name: Install Elasticsearch
hosts: all
tasks:
- name: add rancher user to consume cattle db
become: true
become_user: root
community.mysql.mysql_user:
name: rancher
@wwalker
wwalker / inventory.yml
Last active November 9, 2022 15:59
dynamic host inventory generation
---
masters:
hosts:
es-master-{{ cluster_name }}-00{1..{{ master.count }}}: {}
hot-nodes:
hosts:
es-hot-{{ cluster_name }}-00{1..{{ hot.count }}}: {}
warm-nodes:
hosts:
es-warm-{{ cluster_name }}-00{1..{{ warm.count }}}: {}
@wwalker
wwalker / 0-irb-session-excerpt
Last active June 22, 2022 00:40
Time vs ActiveSupport::TimeWithZone
irb(main):028:0> cp.last.class
=> Time
irb(main):029:0> cp.last
=> 2022-06-21 15:30:00 -0500
irb(main):030:0> c.next_run.class
=> NilClass
irb(main):031:0> c.next_run=cp.last
=> 2022-06-21 15:30:00 -0500
irb(main):032:0> c.next_run.class
=> ActiveSupport::TimeWithZone