Skip to content

Instantly share code, notes, and snippets.

View richardschoen's full-sized avatar

Richard Schoen richardschoen

View GitHub Profile
@buzzia2001
buzzia2001 / RunQsh.sql
Last active February 11, 2026 23:36
Running QSH command using SQL
-- Purpose: Running QSH command using SQL
-- Version: 1.0
-- Date 08/02/2026
-- Author: Andrea Buzzi
-- Docs: https://www.ibm.com/docs/en/i/7.6.0?topic=services-qcmdexc-procedure
-- https://www.ibm.com/docs/en/i/7.6.0?topic=services-environment-variable-info-view
CREATE OR REPLACE FUNCTION SQLTOOLS.RUN_QSHELL (
INCMD VARCHAR(10000)
)

Beast Mode

Beast Mode is a custom chat mode for VS Code agent that adds an opinionated workflow to the agent, including use of a todo list, extensive internet research capabilities, planning, tool usage instructions and more. Designed to be used with 4.1, although it will work with any model.

Below you will find the Beast Mode prompt in various versions - starting with the most recent - 3.1

Installation Instructions

  • Go to the "agent" dropdown in VS Code chat sidebar and select "Configure Modes".
  • Select "Create new custom chat mode file"
@ryan-moeller21
ryan-moeller21 / GettingStartedWithFunctions.sql
Last active March 24, 2026 13:48
Getting Started with SQL Functions and Procedures
/*************************************************************************************************/
/* The goal of this SQL script is to demonstrate various features of SQL PL. This will include */
/* loops, error handling, parameters, cursor management, returning of result sets, and more. */
/* The topic of this script will revolve around the management (deletion) of journal receivers. */
/* */
/* Created for Common POWERUp 2024 */
/* Session: Getting Started with SQL Functions and Procedures */
/* Author: Ryan Moeller (rmoeller@ibm.com) */
/* Date: May 2024 */
/*************************************************************************************************/
@ryan-moeller21
ryan-moeller21 / JournalReceiverCleanup.SQL
Last active March 24, 2026 13:49
Cleaning Up Old, Unsaved Journal Receivers
/*************************************************************************************************/
/* Manage consumption of storage by journal receivers, only keep last N days of journals */
/*************************************************************************************************/
SELECT *
FROM QSYS2.JOURNAL_RECEIVER_INFO
WHERE DETACH_TIMESTAMP < CURRENT DATE - 3 DAYS;
-- NOTE: *IGNINQMSG is not specified for DLTJRNRCV. Any unsaved journals receivers will not be deleted.
CREATE OR REPLACE FUNCTION SYSTOOLS.DELETE_OLD_RECEIVERS (
@ryan-moeller21
ryan-moeller21 / AuditingUserProfile.sql
Last active March 24, 2026 13:49
Auditing User Profiles
/******************************************************************************/
/* Find security-related changes made by potentially vulnerable user profiles */
/******************************************************************************/
-- Navigator's Users Tab
SELECT
CASE GROUP_ID_NUMBER
WHEN 0 THEN 'USER'
ELSE 'GROUP'
END AS PROFILE_TYPE,
@ryan-moeller21
ryan-moeller21 / SystemCurrencyStatus.sql
Last active March 24, 2026 13:49
SYSTEM_CURRENCY_STATUS -- Combining GROUP_PTF_CURRENCY, DEFECTIVE_PTF_CURRENCY, and FIRMWARE_CURRENCY
/************************************************************************************************************/
/* Check for defective PTFs, new PTF groups, and firmware updates. Email someone a spreadsheet the results! */
/************************************************************************************************************/
CREATE OR REPLACE FUNCTION SYSTOOLS.SYSTEM_CURRENCY_STATUS (
EMAIL VARCHAR(100)
)
RETURNS INT
SPECIFIC SYSTOOLS.SYSCURSTS
MODIFIES SQL DATA
LANGUAGE SQL
@ryan-moeller21
ryan-moeller21 / IFSAuditAndSystemLimits.sql
Created February 1, 2024 20:27
Using System Limits and Audit Journals to Investigate IFS Usage
/*************************************************************/
/* Use system limits to find users abusing IFS space */
/*************************************************************/
-- Look at all users who have triggered system limits in the last 24 hours...
SELECT *
FROM QSYS2.SYSLIMITS
WHERE LAST_CHANGE_TIMESTAMP > CURRENT TIMESTAMP - 1 DAY
AND USER_NAME != 'QSYS'
ORDER BY LAST_CHANGE_TIMESTAMP DESC;
@ryan-moeller21
ryan-moeller21 / TempStorageInvestigation.sql
Created January 31, 2024 19:21
Temporary Storage Investigation
/**************************************************************************************/
/* Track temporary storage usage with QSYS2.SYSTEM_STATUS and QSYS2.SYSTMPSTG */
/**************************************************************************************/
-- Create schema for function and detail file creation.
CREATE SCHEMA TMPSTGMON;
-- Information as presented by Navigator
SELECT SYSTEM_ASP_STORAGE,
CURRENT_TEMPORARY_STORAGE,
@chrishiebert
chrishiebert / RtnDspAtr.RPGLE
Created August 18, 2022 16:54
RtnDspAtr Return Display Attribute hex code for RPGLE and 5250 screens.
// Based: Croy, Steve (2005) Display-attributes-made-simple/setcolor [Source code]. http://search400.techtarget.com/tip/Display-attributes-made-simple
// --------------------------------------------------
// Procedure name: RtnDspAtr
// Purpose: Return Display Attribute hex code that can be used on a
// screen to set color, underline, or other attributes.
// Returns: DSPATR hex value
// Parameter: Color Value - Text representing a color 'GRN' (default)
// other values: 'BLU' 'PNK' 'RED' 'TRQ' 'WHT' 'YLW'
@bladeSk
bladeSk / SQLite-PHP-quickstart.php
Last active April 2, 2026 15:08
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.