Skip to content

Instantly share code, notes, and snippets.

View karmafeast's full-sized avatar
😵

Gwydion Nanashi Ferrinas Solidor karmafeast

😵
View GitHub Profile
@karmafeast
karmafeast / markdownie.md
Created October 15, 2024 15:53
markdown useful boxes

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
This file has been truncated, but you can view the full file.
# Title: figs/hosts
# ===============================================================
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
127.0.0.1 local
255.255.255.255 broadcasthost
::1 localhost
::1 ip6-localhost
::1 ip6-loopback
@karmafeast
karmafeast / get_thycotic_secret.rb
Created October 10, 2018 19:20
get a thycotic secret 'password' field value by secret name
require 'json'
require 'rest-client'
require 'optionparser'
options = {}
OptionParser.new do |opts|
opts.banner = 'Usage: get_thycotic_secret.rb [options]'
opts.on('-b', '--baseurl BASEURL', 'https://secrets.moogles/secretserver') { |v| options[:baseurl] = v }
opts.on('-u', '--username USERNAME', 'username') { |v| options[:username] = v }
@karmafeast
karmafeast / SecretServerRest.psm1
Last active October 10, 2018 18:17
Thycotic Secret Server REST interactions for basic secret field value get. (you need powershell 5 / powershell 6/core -- yes,this will work on your mac and *nixey that can run ps-core)
<#
you need powershell 5 or higher, works on powershell-core / 6 (i.e. will work on your mac / *nix)
THIS IS FOR THYCOTIC SECRET SERVER REST API INTERACTIONS
- USE [ThycoticHelper] if you want fuller access.
- USE [SecretServer] static methods if you prefer easy mode
OAUTH2 bearer tokens for thycotic seem to only have a 60s lifespan it seems - so with this helper we'll just get a new one with each request
usage example (assuming you've put the file in current directory:
using module ./SecretServerRest.psm1
$cred = get-credential;
$baseUrl = 'https://secrets.moogles/secretserver';
md d:\otherloc
net stop wuauserv
rename c:\windows\softwaredistribution c:\windows\softwaredistribution.old
mklink /j c:\windows\softwaredistribution d:\otherloc
net start wuauserv
@karmafeast
karmafeast / raw_smtp_test.txt
Created April 18, 2018 17:30
raw smtp testy
helo google.com
mail from: somewhere@elsewhere
rcpt to: somewhere@local
data
subject: something
body text
.
curl -s
--form-string "token=tokenval"
--form-string "user=email@somewhere.local"
--form-string "message=hello world"
https://api.pushover.net/1/messages.json
@karmafeast
karmafeast / bootstrap_wu.ps1
Last active June 13, 2022 21:30
basic wuinstall take everything
get-module pswindowsupdate;
Install-Module pswindowsupdate;
import-module pswindowsupdate;
Get-WindowsUpdate -WindowsUpdate -UpdateType Driver -IsInstalled -ShowPreSearchCriteria -Verbose
get-windowsupdate -MicrosoftUpdate -IgnoreUserInput -Verbose -AcceptAll -Install;
get-windowsupdate -WindowsUpdate -IgnoreUserInput -Verbose -AcceptAll -Install;
@karmafeast
karmafeast / yum-cron-pushover.sh
Created April 18, 2018 17:18
set yum-cron for pushover
yum -y install yum-cron
chkconfig yum-cron on
EMAIL=email_to_device@api.pushover.net
sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron.conf
sed -i 's|^update_messages = no|update_messages = yes|' /etc/yum/yum-cron.conf
sed -i 's|^download_updates = no|download_updates = yes|' /etc/yum/yum-cron.conf
sed -i 's|^apply_updates = no|apply_updates = yes|' /etc/yum/yum-cron.conf
sed -i 's|^emit_via = stdio|emit_via = email|' /etc/yum/yum-cron.conf
sed -i "s|^email_to = root|email_to = ${EMAIL}|" /etc/yum/yum-cron-hourly.conf