Skip to content

Instantly share code, notes, and snippets.

@KakersUK
KakersUK / plex-anti-sleep.ps1
Last active May 3, 2024 05:17
PowerShell 7 script to stop the PC from going to sleep if there are any active streams
# Plex on Windows Anti-Sleep
#
# References
# Gist: https://gist.github.com/KakersUK/d090e1836ffb881d29c9f529b380f795
# Install PowerShell 7: https://learn.microsoft.com/en-gb/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3#winget
# X-Plex-Token: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
# Host variables
$PlexHost = '127.0.0.1'
$PlexPort = 32400
Placeholder
@KakersUK
KakersUK / Update-AUPackages.md
Last active November 23, 2023 16:25
Update-AUPackages Report #powershell #chocolatey
@KakersUK
KakersUK / Update-AUPackages.md
Last active July 30, 2020 12:53
Update-AUPackages Report #powershell #chocolatey
@KakersUK
KakersUK / oomkiller.bash
Last active February 14, 2018 12:07
This BASH script will disable/enable the OOM (Out of Memory) killer for a given process(es)
#!/bin/bash
if [ "$1" = "disable" ]; then
for PID in $(pgrep $2 | grep -v oomkiller); do
oomValue=$(cat /proc/$PID/oom_adj)
if [ $oomValue == 0 ]; then
@KakersUK
KakersUK / mailcatcher.service
Created March 1, 2017 17:25
/etc/systemd/system/mailcatcher.service
[Unit]
Description=Mailcatcher Service
Before=httpd.service
After=network.target
[Service]
Type=simple
User=mailcatcher
ExecStart=/usr/local/bin/mailcatcher -f --no-quit --smtp-ip=127.0.0.1 --smtp-port=1025 --http-ip=127.0.0.1 --http-port=1080
Restart=on-abort
@KakersUK
KakersUK / memcached.sh
Last active September 30, 2016 10:27
/etc/init.d/memcached - Memcached multi-bin init.d script for CentOS 6
#! /bin/sh
#
# chkconfig: - 55 45
# description: The memcached-multi daemon is a network memory cache service.
# processname: memcached-multi
# config: /etc/sysconfig/memcached
# pidfile: /var/run/memcached/memcached.*.pid
# Standard LSB functions
@KakersUK
KakersUK / mailcatcher.sh
Last active June 28, 2018 01:27
/etc/init.d/mailcatcher - MailCatcher init.d script for CentOS 6
#!/bin/bash
# chkconfig: 345 70 30
# description: MailCatcher is a simple SMTP server to catch and display mail
# processname: mailcatcher
# Source function library.
. /etc/init.d/functions
RETVAL=0
prog="/usr/local/rvm/wrappers/default/mailcatcher"