Skip to content

Instantly share code, notes, and snippets.

View t1m0thyj's full-sized avatar

Timothy Johnson t1m0thyj

  • Pittsburgh, PA
  • 05:46 (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 / choco.wsb
Last active January 8, 2024 20:23
Windows Sandbox config that installs Chocolatey and mounts Public Documents to Desktop
<Configuration>
<MappedFolders>
<MappedFolder>
<HostFolder>C:\Users\Public\Documents\</HostFolder>
<ReadOnly>false</ReadOnly>
</MappedFolder>
</MappedFolders>
<LogonCommand>
<Command>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -Command "start powershell { -NoExit -Command \"&amp; { Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyInstaller.psm1"; Update-SessionEnvironment; cd C:\Users\WDAGUtilityAccount }\" }"</Command>
</LogonCommand>
@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 / main.py
Last active February 4, 2023 09:10
Play music from YouTube in Google Assistant on Raspberry Pi
#!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@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
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 / 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": [
@t1m0thyj
t1m0thyj / pisysinfo.sh
Last active May 25, 2022 19:04
Set up phpSysInfo with lighttpd and PHP 7 on Raspbian Stretch
#!/usr/bin/env bash
# Install lighttpd and PHP 7
sudo apt-get -y install lighttpd
sudo apt-get -y install php-cgi php php-xml
sudo lighty-enable-mod fastcgi-php
sudo service lighttpd force-reload
# Install phpSysInfo from GitHub
wget https://github.com/phpsysinfo/phpsysinfo/archive/stable.zip -O ~/Downloads/phpsysinfo-stable.zip
# 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")