Skip to content

Instantly share code, notes, and snippets.

@gkspranger
gkspranger / jclmvs.js
Last active November 18, 2024 21:35
running an MVS program
var exec = require("bldz/std/exp/exec")
console.log("hello world")
//ICONV EXEC PGM=EDCICONV,
// PARM=('FROMCODE(IBM-037),TOCODE(UTF-8)')
//SYSUT1 DD DISP=SHR,DSN=SOME.INPUT
//SYSUT2 DD DISP=SHR,DSN=SOME.OUTPUT
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
@gkspranger
gkspranger / asd.js
Created September 23, 2024 20:30
gist to install deps
var process = require("bldz/process")
var child_process = require("bldz/child_process")
var fs = require("bldz/fs")
var CWD = process.cwd()
var BUILD_DIR = `${CWD}/build-out`
child_process.spawn(`rm -fr ${BUILD_DIR}/* ${BUILD_DIR}/.*`)
child_process.spawn(`cp -r python/. ${BUILD_DIR}/`)
@gkspranger
gkspranger / .3270pro
Last active May 31, 2024 14:17
my macos keymap when using x3270
! Where I learned about "how"
! https://petr-vacula.medium.com/how-to-connect-to-mainframe-from-your-mac-laptop-using-x3270-16243667478
! https://x3270.miraheze.org/wiki/X3270/Keymap
! https://x3270.miraheze.org/wiki/Category:X3270_actions
! Put in ~/.c3270pro
! Use the 'mine' keymap, defined below
c3270.keymap: mine
! Definition of the 'mine' keymap
c3270.keymap.mine: \
<Key>BTAB: BackTab()\n\
@gkspranger
gkspranger / quick-nomad-Vagrantfile
Created June 7, 2023 16:51
vagrant file to get nomad up and running quickly with docker and raw_exec enabled
$setup = <<-SCRIPT
sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf clean all
sudo dnf -y install nomad docker-ce
sudo systemctl start docker.service
#!/usr/bin/env bash
set -e
sanitize_nomad () {
nomad system gc
nomad system reconcile summaries
}
deregister_instance () {
@gkspranger
gkspranger / seeme.tf
Created September 3, 2021 20:08
using count on a list of maps
locals {
minions = [
{ "name" = "greg",
"type" = "m5.large" },
{ "name" = "ragha",
"type" = "t3.micro"
}
]
@gkspranger
gkspranger / nested_arr.cr
Created October 13, 2020 20:33
crystal attempt at multidimensional array
# start nested array if i==100
# end nested array if i==200
flat_tokens = [1, 2, 100, 3, 4, 200, 5, 100, 6, 7, 200, 8]
alias MYARR = Array(Array(Array(Int32) | Int32) | Array(Int32) | Int32)
def parse(tokens, list : MYARR)
return {tokens, list} if tokens.empty?
token = tokens.shift
@gkspranger
gkspranger / recipe.rb
Last active March 11, 2020 19:36
Using a Shell's STDOUT in a Chef ruby_block
ruby_block 'shell out fun' do
block do
# this is me running my command and assigning the output to a var
ls = shell_out('ls /var/')
# this is me assigning the STDOUT to a var
raw_output = ls.stdout
# i used the Ruby p method to print out the raw chars
# then i knew how to manipulate the string
# cookbook code
...
reboot 'soon' do
delay_mins 2
action :request_reboot
end
Chef.event_handler do
on :run_failed do |exception, run_status|
version: 0.2
phases:
build:
commands:
- ansible-playbook -i $INVENTORY $PLAYBOOK \
--limit $LIMIT --extra-vars $EXTRA --tags $TAGS