Skip to content

Instantly share code, notes, and snippets.

View chelming's full-sized avatar

Chris Helming chelming

View GitHub Profile
@chelming
chelming / komga.js
Created February 4, 2022 14:01
quickadd macro for interfacing with Komga
const notice = (msg) => new Notice(msg, 5000);
const log = (msg) => console.log(msg);
const API_URL_OPTION = "Komga URL";
const API_USER_OPTION = "Username";
const API_PASS_OPTION = "Password";
module.exports = {
entry: start,
settings: {
{
"ignition": {
"config": {},
"security": {
"tls": {}
},
"timeouts": {},
"version": "3.0.0"
},
"passwd": {
@chelming
chelming / change_printer_password.ps1
Created April 3, 2018 17:18
Using powershell to change the password for a
function Invoke-PrinterPost ($WebSession, $Printer, $Body) { Invoke-RestMethod -WebSession $WebSession -Uri "https://$Printer.example.com/userpost/xerox.set" -Body $Body -Method Post }
$CurrentPassword = "Pr1nt3rzBl0w"
$NewPassword = "I<3PowerShell"
$PrintServer = "print.example.com"
$Printers = Get-Printer -ComputerName $PrintServer | Where-Object { $_.DriverName -like "Xerox*" } | Select -ExpandProperty Name
Foreach ($Printer in $Printers) {
$CSRFToken = (Invoke-WebRequest -SessionVariable Xerox -Uri "https://$printer.example.com/auth/config/new_password.php").Forms.Fields.CSRFToken
$LoginBody = "_fun_function=HTTP_Authenticate_fn&NextPage=/properties/authentication/luidLogin.php&webUsername=admin&webPassword=$CurrentPassword&frmaltDomain=default&CSRFToken=$CSRFToken"
$rm = Invoke-PrinterPost $Xerox $Printer $LoginBody
@chelming
chelming / 0_reuse_code.js
Created January 4, 2017 15:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@chelming
chelming / nxlog.conf
Last active December 9, 2020 15:35
NXLOG config that will parse SCCM and IIS logs
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define CERTDIR %ROOT%\cert
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
@chelming
chelming / default.json
Created May 30, 2014 14:40
Kibana dashboard for ELK stack
{
"title": "Logstash Search",
"services": {
"query": {
"list": {
"0": {
"query": "{{ARGS.query || '*'}}",
"alias": "",
"color": "#7EB26D",
"id": 0,
user nginx;
worker_processes 10;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
input {
tcp {
port => 5544
codec => json
ssl_cacert => "/etc/logstash/conf.d/ssl/ca.pem"
ssl_cert => "/etc/logstash/conf.d/ssl/cert.pem"
ssl_enable => true
ssl_key => "/etc/logstash/conf.d/ssl/key.pem"
ssl_verify => false
}
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,