Skip to content

Instantly share code, notes, and snippets.

View t1m0thyj's full-sized avatar

Timothy Johnson t1m0thyj

  • Pittsburgh, PA
  • 04:49 (UTC -04:00)
View GitHub Profile
@t1m0thyj
t1m0thyj / 20-cgit.conf
Created January 17, 2024 04:49
CGit and Lighttpd config for GitHub mirror
server.modules += ( "mod_cgi", "mod_alias" )
$HTTP["url"] =~ "^/cgit" {
server.document-root = "/usr/lib/"
server.indexfiles = ("cgit.cgi")
cgi.assign = ("cgit.cgi" => "")
mimetype.assign = ( ".css" => "text/css" )
url.access-deny = ( "~", ".inc" )
}
@t1m0thyj
t1m0thyj / importIssues.js
Last active January 8, 2024 21:36
Imports issues and pull requests into GitHub v2 project
/**
* Imports issues and pull requests into GitHub v2 project
*
* To use this script:
* 1. Install the dependencies:
* npm install -D dayjs @octokit/core @octokit/plugin-paginate-graphql @octokit/plugin-paginate-rest
* 2. Define GitHub token in an environment variable GITHUB_TOKEN
* 3. Run the script with a project ID passed on the command line:
* node importIssues.js <projectId>
*/
@t1m0thyj
t1m0thyj / package.json
Last active August 2, 2023 20:15
Test UTF-16 and long credentials in Windows keyring
{
"name": "keyring-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
@t1m0thyj
t1m0thyj / zowe-install-test.env
Last active November 17, 2022 14:32
Zowe install test scripts for Windows
# Update variables in this file before running the script
TEST_PACKAGE_DIR=../zowe-cli-package-X.Y.Z
TEST_OFFLINE=no
TEST_V1LTS=no
TEST_HOST=example.com
TEST_ZOSMF_PORT=443
TEST_APIML_PORT=7554
TEST_USER=XXX
TEST_PASSWORD=XXX
@t1m0thyj
t1m0thyj / zowe.config.json
Created August 18, 2022 13:45
Large team config file for testing Zowe Explorer performance
{
"$schema": "./zowe.schema.json",
"profiles": {
"base": {
"type": "base",
"properties": {
"host": "example.com",
"rejectUnauthorized": true
},
"secure": [
# Usage: test-zowe.ps1 ../Brightside-v3.0.0 16 -Offline
param ([string]$packageDir, [string]$nodeVersion, [switch]$offline = $false)
$ErrorActionPreference = "Stop"
# Install Node.js and npm
$response = Invoke-WebRequest https://nodejs.org/download/release/latest-v$nodeVersion.x -UseBasicParsing
$x64Msi = $response.Links |? { $_.href -Match "-x64.msi" }
(New-Object Net.WebClient).DownloadFile("https://nodejs.org/download/release/latest-v$nodeVersion.x/$($x64Msi.href)", "$env:Temp\node.msi")
msiexec /I $env:Temp\node.msi /passive | Out-Null
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
#!/bin/bash
set -ex
npmRegistry=$1
tempDir=$(mktemp -d)
cd $tempDir
[[ ! -z "$npmRegistry" ]] && echo "@zowe:registry=$npmRegistry" >> .npmrc
npm init -y
npm install @zowe/cli
ls node_modules # Only one dependency should be at top level (@zowe/cli)
grep flatted node_modules/@zowe/cli/npm-shrinkwrap.json
@t1m0thyj
t1m0thyj / client.js
Created January 18, 2022 18:17
Node.js client/server performance test with TCP/pipes/sockets
const fs = require("fs");
const net = require("net");
const os = require("os");
let opts = {};
switch (process.argv[2]) {
case "pipe":
opts.path = `\\\\?\\pipe\\${os.userInfo().username}\\ZoweDaemonTest`;
break;
case "socket":
FROM rust:alpine
# Install build dependencies
RUN apk --no-cache add git musl-dev
# Download zowex source from GitHub
RUN git clone --depth 1 https://github.com/zowe/zowe-cli.git
# Build zowex binary
RUN cd zowe-cli/zowex && cargo build --verbose --release
@t1m0thyj
t1m0thyj / ProfileUtils.ts
Last active May 11, 2022 10:58
Example of how to load default Zowe CLI profile in VS Code extension
import { IProfArgAttrs, IProfile, ProfileInfo } from "@zowe/imperative";
import { trueCasePathSync } from "true-case-path";
import { window, workspace } from "vscode";
/**
* Load properties for the default Zowe CLI profile of a given type.
* @param profileType The type of profile (e.g., "zosmf")
* @returns Profile object with property names and values defined
*/
async function getDefaultProfile(profileType: string): Promise<IProfile> {