Skip to content

Instantly share code, notes, and snippets.

@UberKitten
UberKitten / policyidtest.yml
Created September 9, 2021 19:19
Conjur policy ID bug?
- !host policyidtest
- !policy
id: pita
owner: !host policyidtest
body:
- !policy
id: pitb
owner: !host policyidtest
body:
@UberKitten
UberKitten / PVWA-REST-AddReconcileAccount.ps1
Created December 11, 2019 17:07
Example script to add an account and immediately reconcile it using psPAS
$Creds = Get-Credential
$PVWAUri = "https://pvwa/"
$AccountSafe = "MySafe"
$AccountUsername = "example-rest"
$AccountAddress = "server.example.com"
$AccountPlatformID = "WinDomain"
Import-Module psPAS
New-PASSession -BaseURI $PVWAUri -Credential $Creds -type LDAP
@UberKitten
UberKitten / Connect-PSMRDP.ps1
Created October 16, 2019 22:05
PowerShell cmdlet to initiate an adhoc connection through CyberArk PSM
# If needed, first: Install-Module psPAS
Import-Module psPAS
function Connect-PSMRDP {
param(
[parameter(Mandatory=$false)]$Credential,
[parameter(Mandatory=$true, Position=0)]$TargetAddress
)
@UberKitten
UberKitten / MSSQLODBCTroubleshoot.ps1
Created August 6, 2019 21:17
Troubleshooting script for MSSQL ODBC connections
# Modify these values to match the account settings in PVWA
$Address = "example.com"
$User = "myuser"
$Password = "mypassword"
$Database = "mydatabasename"
# Modify this to match the Connection String under Platform -> Additional Policy Settings
# Don't put your username, password, etc in here, put them above
$ConnectionString = 'Driver={SQL Server};Server=%ADDRESS%;Database=%DATABASE%;Uid=%USER%;Pwd=%LOGONPASSWORD%;'
@UberKitten
UberKitten / OracleODBCTroubleshoot.ps1
Last active July 12, 2019 01:05
Troubleshooting script for Oracle ODBC connections
# Modify these values to match the account settings in PVWA
$Address = "example.com"
$User = "myuser"
$Password = "mypassword"
# Also known as Service Name in Oracle
$Database = "mydatabasename"
# Default for Oracle: 1521
$Port = 1521
@UberKitten
UberKitten / py-kms.service
Created May 26, 2019 11:59
Systemd py-kms service unit file
[Unit]
Description=py-kms
After=network.target
Wants=network-online.target
[Service]
# Have to use unbuffer otherwie py-kms tries to launch GUI
ExecStart=/usr/bin/unbuffer /opt/py-kms/env/bin/python3 /opt/py-kms/py-kms/py-kms/pykms_Server.py 0.0.0.0 1688 --logfile /var/log/py-kms.log -V DEBUG
Restart=always
KillMode=process
@UberKitten
UberKitten / py-kms.service
Created May 26, 2019 11:59
Systemd py-kms service unit file
[Unit]
Description=py-kms
After=network.target
Wants=network-online.target
[Service]
# Have to use unbuffer otherwie py-kms tries to launch GUI
ExecStart=/usr/bin/unbuffer /opt/py-kms/env/bin/python3 /opt/py-kms/py-kms/py-kms/pykms_Server.py 0.0.0.0 1688 --logfile /var/log/py-kms.log -V DEBUG
Restart=always
KillMode=process
@UberKitten
UberKitten / DownloadsArchive.ps1
Created October 25, 2018 00:50
Moves files from your Downloads folder to another specified folder, archived by week number
#
# DownloadsArchive.ps1
# By Michael West
#
# Moves files from your Downloads folder to another specified folder, archived by week number.
# Can be run weekly, daily, or whenever.
#
# ------------------------------------------------
# Config
# ------------------------------------------------
@UberKitten
UberKitten / DFWHackerBadge2.ino
Created August 19, 2018 08:45
DFW Hacker Badge code that allows for independent LED control with morse code functionality
/* **************************
WE DON'T NEED NO STINKIN
BADGES
* ************************** */
// Define Pins
/* NOTE that not all RGB LEDs have the same color pinout
so you need to adjust these definitions based on
the specific LEDs you use.
*/
@UberKitten
UberKitten / dnsmasq.service
Created July 22, 2018 06:56
webproc + dnsmasq for easy editing of config files and viewing of logs from the web
# /etc/systemd/system/dnsmasq.service
# Overrides Debian dnasmasq service with a webproc wrapped version to allow easy editing/log viewing from the web
# Uses webproc from https://github.com/jpillora/webproc
# Install webproc to /usr/local/bin
[Service]
Type=simple
# Gets passed to init.d script to run without forking
# Also log to stderr so we can view it in webproc