Skip to content

Instantly share code, notes, and snippets.

View JohnArchieMckown's full-sized avatar
💭
Retired

John Archie McKown JohnArchieMckown

💭
Retired
  • 06:47 (UTC -06:00)
View GitHub Profile
@JohnArchieMckown
JohnArchieMckown / cbtdown.sh
Last active December 11, 2017 16:27
z/OS UNIX download method for CBTTape.org files.
#!/bin/sh
# Get one or more files from CBTtape.org
#
if [ $# -eq 0 ]; then #help
printf "%s\n" "This routine takes one or more file names as input." \
"These are the CBT file numbers to be downloaded." \
"This routine constructs and executes a \"curl\" command to download the file(s)." \
"Example: \"$0 290\" would run \"curl ftp://cbttape.org/ftp/cbt/CBT209.zip >CBT209.zip\"." \
"This results in the file CBT290.zip being placed in the current directory." \
"You can then \"unzip\" this using the command: jar -xvf CBT209.zip" \
@JohnArchieMckown
JohnArchieMckown / DEFINES
Last active October 6, 2021 10:27
REXX program to parse a LISTCAT and create IDCAMS control cards
/* REXX PROGRAM TO GENERATE IDCAMS DEFINE */
TRACE E
DEFINED = ""
RESTARTS = 0
CARD='/* RUN AT ' TIME('N') ' ON ' DATE('S')
DO FOREVER;
EXITCODE = @MAIN()
IF EXITCODE = 0 THEN LEAVE
RESTARTS = RESTARTS+1
IF RESTARTS > 3 THEN LEAVE
@JohnArchieMckown
JohnArchieMckown / rust-root-files.txt
Created September 5, 2014 01:53
list of files in $HOME from rust install via "sudo make install"
112865735 4 drwxr-xr-x 2 root root 4096 Sep 4 08:20 ./tmp/empty_dir
16385680 100 -rw------- 1 root root 100515 Sep 4 08:19 ./doc/rustc/stability.html
16386425 4 drwx------ 5 root root 4096 Sep 4 08:19 ./doc/rustc/plugin
16386427 4 drwx------ 2 root root 4096 Sep 4 08:19 ./doc/rustc/plugin/build
16386429 8 -rw------- 1 root root 4459 Sep 4 08:19 ./doc/rustc/plugin/build/fn.find_plugin_registrar.html
16386428 8 -rw------- 1 root root 4392 Sep 4 08:19 ./doc/rustc/plugin/build/index.html
16386436 4 drwx------ 2 root root 4096 Sep 4 08:19 ./doc/rustc/plugin/registry
16386438 8 -rw------- 1 root root 6862 Sep 4 08:19 ./doc/rustc/plugin/registry/struct.Registry.html
16386437 8 -rw------- 1 root root 4360 Sep 4 08:19 ./doc/rustc/plugin/registry/index.html
16386430 4 drwx------ 2 root root 4096 Sep 4 08:19 ./doc/rustc/plugin/load
@JohnArchieMckown
JohnArchieMckown / add_mac_vlan.sh
Last active August 29, 2015 14:05
Help generate macvlan & support programs. Two default gateways on one NIC with 2 Internet routers
#!/bin/sh
ip link add link p36p1 mac1 address 56:61:4f:7c:77:db type macvlan
# next line adds default route via the router connected to the cable modem
ip route add default via 192.168.151.65 dev mac1 table mac1tbl # refers to /etc/iproute2/rt_tables entry
ip rule add from 192.168.151.65/32 table mac1tbl
ip rule add to 192.168.151.65/32 table mac1tbl
@JohnArchieMckown
JohnArchieMckown / CityCountry
Last active August 29, 2015 14:05
Example PostgreSQL CTE
CREATE TABLE t (country text, city text, ... other fields);
--
SELECT avg(b.countcountry)::int as "CountryCount", b.country, a.city, count(a.city) as "CityCount"
FROM t AS a
INNER JOIN
(SELECT COUNT(country) AS countcountry, country FROM t GROUP BY country) AS b
ON a.country = b.country
GROUP BY b.country, a.city
ORDER BY 1 DESC,4 DESC;
--
@JohnArchieMckown
JohnArchieMckown / README.md
Created August 20, 2014 14:12
Example HLASM template code for an LE enabled UNIX command

Example HLASM code

This gist contains my SKELETON.s program. This is basically a complicated "do almost nothing" written in LE-enabled HLASM. It does show how to call the C sprintf() subroutine to create a nice output message and then write it out to STDOUT via the BPX1WRT UNIX Callable Service to write that message out.

@JohnArchieMckown
JohnArchieMckown / RData & env()
Created August 20, 2014 13:36
Using environments for multiple versions of data from RData
To load multiple RData files which have identical variables in them and keep all versions of the variable, put them each in a separate environment
AData <- new.env();
load("AData.RData",envir=AData);
BData <- new.env();
load("BData.RData",envir=BData);
and so on.
You can then reference individual variable by using something like:
Question from Kate Ignatius
---------------------------
Have:
Family.ID Sample.ID Relationship
14 62 sibling
14 94 father
14 63 sibling
14 59 mother
17 6004 father
17 6003 mother