server build notes and such

This commit is contained in:
jcolebrand 2023-05-30 23:15:46 -07:00
parent f5910782d4
commit 5c5bde9244
6 changed files with 240 additions and 0 deletions

View File

@ -0,0 +1,22 @@
function Add-LDAPSudoerUser {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
$Username
)
$logLead = Get-LogLeadName
Write-Host "$logLead : Adding user to sudoers group in LDAP"
<#
cat > add-to-sudo-role.ldif << 'EOL'
dn: cn=sudo,ou=SUDOers,dc=jcolebrand,dc=info
changetype: modify
add: sudoUser
sudoUser: jgitlin
EOL
ldapmodify -W -f add-to-sudo-role.ldif -D 'cn=Directory Manager'
#>
}

View File

@ -0,0 +1,14 @@
function Get-AllAffectingProfilesAsText {
[CmdletBinding()]
[OutputType([string[]])]
param()
$resultingProfile = ""
$allProfilePaths = ($profile | Get-Member -MemberType NoteProperty).Name
foreach ($profileName in $allProfilePaths) {
$resultingProfile += "`n #File read from $profileName`n"
$resultingProfile += Get-Content -Path $profile.$profileName -ErrorAction Ignore -Raw
}
return $resultingProfile
}

View File

@ -0,0 +1,70 @@
function Merge-MkvVideos {
<#
.SYNOPSIS
Used to merge two MKV files into one output file
.PARAMETER OutputFile
Target a single file for output, full name
.PARAMETER Path
Two or more paths, comma separated, will concatenate in the order presented
.LINK
https://mkvtoolnix.download/downloads.html
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias('Target')]
[Alias('Output')]
[Alias('o')]
[string[]]$OutputFile,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias('Source')]
[Alias('Input')]
[string[]]$Path
)
$mkvmergePath = "/usr/bin/mkvmerge"
$alternateMvkMergePath = (which mkvmerge)
if (-not (Test-Path -Path $mkvmergePath)) {
if ($alternateMvkMergePath.indexOf(": no")) {
Write-Warning "Maybe you should do: [https://mkvtoolnix.download/downloads.html] ?"
throw "Could not find the path for mkvmerge [$mkvmergePath] Is it installed? Is it in the PATH?"
} else {
$mkvmergePath = $alternateMvkMergePath
}
}
if ($Path.Count -lt 2) {
throw "Must supply more than one path to this function"
}
if (Test-Path -Path $OutputFile) {
Write-Warning "The specified file already exists. This file will be overwritten."
}
$commandArguments = @("-o", $OutputFile)
$firstPath = $true
foreach ($filePath in $Path) {
$filePath = Resolve-Path -Path $filePath
if (-not $firstPath) {
$commandArguments += "+"
}
$commandArguments += $filePath
$firstPath = $false
}
$invokeArguments = @{
Path = $mkvmergePath
Arguments = $commandArguments
}
Invoke-CallPathWithArguments @invokeArguments
}

View File

@ -0,0 +1,100 @@
Add
Approve
Assert
Backup
Block
Build
Checkpoint
Clear
Close
Compare
Complete
Compress
Confirm
Connect
Convert
ConvertFrom
ConvertTo
Copy
Debug
Deny
Deploy
Disable
Disconnect
Dismount
Edit
Enable
Enter
Exit
Expand
Export
Find
Format
Get
Grant
Group
Hide
Import
Initialize
Install
Invoke
Join
Limit
Lock
Measure
Merge
Mount
Move
New
Open
Optimize
Out
Ping
Pop
Protect
Publish
Push
Read
Receive
Redo
Register
Remove
Rename
Repair
Request
Reset
Resize
Resolve
Restart
Restore
Resume
Revoke
Save
Search
Select
Send
Set
Show
Skip
Split
Start
Step
Stop
Submit
Suspend
Switch
Sync
Test
Trace
Unblock
Undo
Uninstall
Unlock
Unprotect
Unpublish
Unregister
Update
Use
Wait
Watch
Write

View File

@ -0,0 +1,2 @@
gogs -> gocd token f2ba5ad47e56620760ee2eba569bcb636061e520
gocd -> first token dfbb1a530fbf17926b865afe9718219c8f1413b8

View File

@ -0,0 +1,32 @@
cvtsudoers -b ou=SUDOers,dc=jcolebrand,dc=info -o ~/sudoers.ldif /etc/sudoers
dn: ou=SUDOers,dc=jcolebrand,dc=info
objectclass: organizationalunit
ou: SUDOers
description: LDAP SUDO Entry
dn: cn=defaults,ou=SUDOers,dc=jcolebrand,dc=info
objectClass: top
objectClass: sudoRole
cn: defaults
description: Default sudoOption's go here
sudoOption: !visiblepw
sudoOption: always_set_home
sudoOption: match_group_by_gid
sudoOption: always_query_group_plugin
sudoOption: env_reset
sudoOption: env_keep=COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS
sudoOption: env_keep+=MAIL QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE
sudoOption: env_keep+=LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES
sudoOption: env_keep+=LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE
sudoOption: env_keep+=LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY
sudoOption: secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin
dn: cn=sudo,ou=SUDOers,dc=jcolebrand,dc=info
objectClass: top
objectClass: sudoRole
cn: sudo
sudoUser: cbrand
sudoHost: ALL
sudoRunAsUser: ALL
sudoCommand: ALL