Skip to content

Instantly share code, notes, and snippets.

View quonic's full-sized avatar

Spyingwind quonic

  • Dallas
View GitHub Profile
@quonic
quonic / scum_sqlite.ps1
Last active September 3, 2022 22:16
For the game SCUM. This sets stats too 5 and skills to 4 for specified character.
#Requires -Module PSSQLite
param(
[Alias('Name', '')]
[string]
$ProfileName
)
<#
Updated for 9/2 patch
Updated by request of Truth91
#>
@quonic
quonic / ADAuthUDExample.ps1
Last active August 29, 2021 12:23
An example of AD auth with
Import-Module -Name UniversalDashboard
$ADDomain = "MyDomainHere.consto.com"
$ADGroup = "GroupNameHere"
$PageHome = New-UDPage -Name "Home" -Content {
New-UDLayout -Columns 3 -Content {
New-UDCard -Title "Scheduled" -Content {
"Links"
} -Links @(
@quonic
quonic / powershell.json
Last active April 29, 2023 05:36
A Powershell DynamicParam snippet for VSCode
{
"Dynamic_Param_Start": {
"prefix": "dynamic1start",
"body": [
"DynamicParam {",
"\t${1:dynamic2p}${2:}",
"}"
],
"description": "An empty dynamic parameter"
},
@quonic
quonic / ApacheGuacUserMapping.ps1
Last active May 29, 2021 00:14
Appache Guacamole user-mappings.xml file generator for current network
. .\NewXMLDocument.ps1
$rdp_domainname = "MicrosoftAccount"
$rdp_username = "fred"
$ssh_username = "fred"
$vnc_username = "fred"
$rdp_password = "changeme!"
$ssh_password = "changeme!"
$vnc_password = "changeme!"
@quonic
quonic / CredStore.ps1
Last active May 17, 2018 00:11
Store creds in a secure manner
function Get-ConfigData {
Param(
$Path = "$env:TEMP\MyScriptDefaultCredStore.config.clixml"
)
if (Test-Path -Path $Path) {
# Open Config file if exists
$ConfigData = Import-Clixml $Path
}
else {
# Create Config file if does not exists
@quonic
quonic / Out-Audio.ps1
Created May 11, 2018 20:51
A nicer way to play audio files from a string.
# Get the asterisk-extra-sounds-en-wav-current.tar.gz file or the one for your language
# Extract to a folder, example C:\Temp\asterisk-extra-sounds-en-wav-1.5\
$AsteriskAudioFolder = "C:\Temp\asterisk-extra-sounds-en-wav-1.5\"
function Out-Audio {
[CmdletBinding()]
param (
[string[]]
$FilePath
)
@quonic
quonic / AssignGroups.ps1
Last active April 24, 2018 18:46
AD Group assigner
$Users = Get-ADUser
$GroupData = Import-Clixml -Path ".\Groups.clixml"
$GroupsToAdd = $Users | ForEach-Object {
$User = $_
$Company = $GroupData.Companies | Where-Object {$_.Name -eq $User.Company}
$Departments = $Company.Departments | Where-Object {$_.Name -eq $User.Department}
$Departments.Groups
}
@quonic
quonic / Show-Calendar.ps1
Created April 23, 2018 18:10
Show-Calendar cmdlet
# From https://communary.net/2014/12/21/show-calendar-cal-for-powershell/
function Show-Calendar {
<#
.SYNOPSIS
Show calendar.
.DESCRIPTION
This function is a PowerShell version of the *NIX cal command and will show a
calendar of the chosen month(s). The current day will be marked with a '*'.
For best results, use together with the FormatPx module by Kirk Munro.
@quonic
quonic / Install RT 4.4.2 depends.sh
Created April 15, 2018 02:09
This should install most of the perl depdends on Debian 9 for RT
apt install libcgi-emulate-psgi-perl libapache-session-perl libcrypt-eksblowfish-perl libconvert-color-perl libcgi-psgi-perl libcss-minifier-xs-perl libcss-squish-perl libdata-guid-perl libdata-ical-perl libbusiness-hours-perl libdate-manip-perl libdatetime-format-natural-perl libdatetime-locale-perl libdatetime-perl libdata-page-pageset-perl libdate-extract-perl libdbi-perl libdbix-searchbuilder-perl libdevel-globaldestruction-perl libdevel-stacktrace-perl libemail-address-list-perl libemail-address-perl libcrypt-ssleay-perl libdbd-mysql-perl libcrypt-x509-perl libfcgi-perl libfile-sharedir-perl libfile-which-perl libgd-graph-perl libgd-perl libgd-text-perl libgnupg-interface-perl libgraphviz-perl libhtml-formattext-withlinks-andtables-perl libhtml-formattext-withlinks-perl libhtml-mason-perl libhtml-mason-psgihandler-perl libhtml-quoted-perl libhtml-rewriteattributes-perl libhtml-scrubber-perl libhttp-message-perl libipc-run3-perl libipc-run-perl libjavascript-minifier-xs-perl libjson-perl liblocale-maketex
# Run this script to see connected hard disk status with nifty bar graph!
$myDisk = Get-WmiObject -class win32_logicaldisk
$myDisk | ForEach-Object {
$free = ($_.freespace)
$total = ($_.size)
$used = $total - $free
$perUsed = ($used / $total) * 100
$perFree = ($free / $total) * 100
$t = [math]::Round($total / 1gb)
$f = [math]::Round($free / 1gb)