Skip to content

Instantly share code, notes, and snippets.

View richardschoen's full-sized avatar

Richard Schoen richardschoen

View GitHub Profile
@richardschoen
richardschoen / building_ibm_db2.md
Created August 20, 2024 23:05 — forked from kadler/building_ibm_db2.md
Building ibm_db2 on IBM i 7.2 with Zend PHP

Building ibm_db2 on IBM i

Setup

We need to install various packages in order to build ibm_db2. Most of these can be installed with yum:

yum group install 'Development tools'
yum install git
@richardschoen
richardschoen / README.md
Created August 13, 2024 13:24 — forked from NicolasSchindler/README.md
How to connect IBM i to LDAP Server

How to connect a LDAP Server to IBM i

In this Project i provide a simple example how to connect to a LDAP Server from IBM i. I added some Constants and Functions from the LDAP Headerfile provided by IBM, not all Functions are implemented in this example. The Serviceprogramm is written in Fixed Format RPGLE and uses the provided LDAP API written in C, which is included in the OS. The Documentation of the LDAP API can be found here

Thanks to @ScottKlement, who has published an example of a copybook on his site, which I have used as a guide. You can find his example here. Also thanks to @m1h43l for helping me with handling the null-terminated strings in the RPG Code.

@richardschoen
richardschoen / SQLite-PHP-quickstart.php
Created August 13, 2024 03:43 — forked from bladeSk/SQLite-PHP-quickstart.php
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.
@richardschoen
richardschoen / SQLite-PHP-quickstart.php
Created August 13, 2024 03:43 — forked from bladeSk/SQLite-PHP-quickstart.php
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.
@richardschoen
richardschoen / simplerelay.py
Created August 8, 2024 13:34 — forked from JCotton1123/simplerelay.py
Start of simple SMTP relay service in Python
#!/usr/bin/env python
import os
import re
import daemon
import asyncore
import smtpd
class SimpleRelayService(smtpd.PureProxy):
"""Handles processing mail for relay"""
@richardschoen
richardschoen / HowTo_Install_dotnet8_Raspberry.md
Last active April 11, 2024 23:02 — forked from ramonsmits/HOWTO.md
Install .NET 8 on Raspberry pi
-- category: Bryan.Dietz
-- description: Jobs in msgw(wrkactjob)
SELECT Job_Name
,Subsystem
,Function_Type CONCAT '-' CONCAT Function AS "Function"
,Job_Status
,(SELECT Message_Text
FROM TABLE (Qsys2.Joblog_Info(I.Job_Name)) A
ORDER BY Ordinal_Position DESC
#!/bin/sh
file=path/to/file
bucket=your-bucket
resource="/${bucket}/${file}"
contentType="application/x-compressed-tar"
dateValue="`date +'%a, %d %b %Y %H:%M:%S %z'`"
stringToSign="GET
${contentType}
${dateValue}
${resource}"
@richardschoen
richardschoen / gitcommitchgs.sh
Created May 27, 2020 13:56
Single sample bash command to stage, commit, push and pull changes to remote git repository with timestamped comment
#!/bin/bash
# This script can be used to commit changes to git repo and push to
# remote repo all in one command.
TODAY=$(date)
HOST=$(hostname)
git add .
git commit -m "Changes committed: $TODAY from $HOST"
git push
git pull
@richardschoen
richardschoen / sqlitedbtest1.py
Created March 6, 2020 13:59
Python 3 Script to Test SQLite DB
#!/usr/bin/python
#------------------------------------------------
# Script name: sqlitedbtest1.py
#
# Description:
# This script is a good test program for SQLite DB
# functionality.
#
# Parameters:
# P1=