Skip to content

Instantly share code, notes, and snippets.

View mainframed's full-sized avatar

Soldier of FORTRAN mainframed

View GitHub Profile
@mainframed
mainframed / fake_credit.py
Created June 6, 2019 21:04
Generate fake credit card profiles for DB2
#!/usr/bin/env python
from faker import Faker
fake = Faker()
for i in xrange(1000000):
x = fake.credit_card_full().splitlines()
a = fake.address().splitlines()
print x[1] + " " + x[2] + ' ' + x[3].split()[1] + " " + a[0] + " " + a[1]
S.No Clist Command Its USE
1 &DATATYPE &DATATYPE is used to determine the data type of an expression.
2 &EVAL &EVAL forces numeric evaluation of the expression that is passed to the function.
3 &LASTCC The &LASTCC variable contains the return code from the last TSO command,subcommand, CLIST statement, or nested CLIST that was executed.
4 &LENGTH The &LENGTH function returns the number of bytes occupied by an expression or character string.
5 &MAXCC The &MAXCC variable contains the highest return code from any TSO command,subcommand, CLIST statement, or nested CLIST that was executed while the current CLIST is active.
6 &NRSTR The &NRSTR function defines a non-rescannable string.
7 &STR The &STR function is used to pass character data to a CLIST without any CLIST language evaluation being done on the data.
8 &SUBSTR The &SUBSTR function is used to extract a character string from within another character string. 
9 &SYS_VARIABLES TSO/E contains certain control variables which are available for use in CLISTs
#!/usr/bin/env python
import tweepy
import sys
# argument 1 is the tweet, argument 2 is the path to the image
def get_api(cfg):
auth = tweepy.OAuthHandler(cfg['consumer_key'], cfg['consumer_secret'])
auth.set_access_token(cfg['access_token'], cfg['access_token_secret'])
return tweepy.API(auth)
@mainframed
mainframed / add_racf_user.py
Last active June 3, 2022 16:10
A really poorly comments/edited Python 2.7 script to add users to ADCD z/OS expects a file name with users and name
#!/usr/bin/python
# To use this program:
# ./add_racf_user.py users.txt
# users.txt has either a username (max 7 chars, must start with a letter)
# or a name (two words seperated by a space)
from ftplib import FTP #For FTP stuff
import time #needed for sleep
import os #to manipulate people... uh I mean files
@mainframed
mainframed / upload_compile.sh
Created February 16, 2019 01:54
bash script to upload then compile your hlasm with JCL. Could use EOF and tmp files but good enough for now
#!/bin/bash
echo "[+] Uploading and Compiling"
HLASM=`echo $1|awk -F. '{print $1}'`
JCL=$2
HOST='SMOG'
echo "[+] HLASM File: $1 to $HLASM"
echo "[+] JCL File: $JCL"
echo "[+] Host: $HOST"
ftp -iv $HOST <<END_SCRIPT
passive
@mainframed
mainframed / COMPILE.JCL
Created February 16, 2019 01:50
Used to compile HLASM in TEST mode so you can use TSO TEST
//SOF1C JOB (ASSY),'COMPILE IT',CLASS=A,MSGCLASS=Y,
// NOTIFY=&SYSUID,MSGLEVEL=(1,1)
//* Use this JCL to compile HLASM in TEST mode
//* So you can use TSO TEST to debug
// SET FILE=APFLISTC
//ASM EXEC PROC=HLASMCL,PARM.L=(TEST),PARM.C=(TEST)
//SYSIN DD DSN=SOF.ASM.SOURCE(&FILE),DISP=(SHR)
//C.SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB
// DD DISP=SHR,DSN=SYS1.MODGEN
//L.SYSLMOD DD DSN=SOF.ASM.BIN(&FILE),DISP=(SHR)
//<USERID> JOB (ACCT),
// ' ',
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1),
// REGION=0M
//UNIXCMD EXEC PGM=BPXBATCH,REGION=800M
//STDPARM DD *
SH find . -type f -exec ls -s {} \; > /tmp/t
/*
//RACROUTE JOB (ACCT),
// ' ',
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1),
// REGION=0M,
// NOTIFY=&SYSUID
//*
//* From David Spiegel 2016
//*
@mainframed
mainframed / protall.clist
Created October 27, 2018 05:27
CLIST Example for KDE Developers (Protects all user accounts)
PROC 2 USER TOTAL
CONTROL NOCAPS
WRITE *** Protecting users &USER 1 to &USER &TOTAL
DO &COUNT = 1 TO &TOTAL
ALU &USER&COUNT NOPASS
END
WRITE *** DONE
!Add this to your x3270 profile in your home folder (~/.x3270pro)
x3270.model: 2
! First we set the color scheme to the name demo
x3270.colorScheme: demo
! Then we set the colors we need
! These colors were picked for the class
x3270.colorScheme.demo: \
black midnightBlue darkred brown \
darkGreen midnightblue darkgoldenrod black \
black midnightblue SaddleBrown purple \