This gist contains useful code, packagesS, script, commands for computer networking and systems admins
$user = "presidential\wheel"
$paths = @($env:userprofile)
$folders = @(
"AppData",
"Local AppData",
"Desktop",
"Start Menu",
"Personal",
"My Pictures",
"My Music",
"My Video",
"Favorites",
"{56784854-C6CB-462B-8169-88E350ACB882}",
"{374DE290-123F-4565-9164-39C4925E467B}",
"{BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968}",
"{7D1D3A04-DEBB-4115-95CF-2F29DA2920DA}",
"{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}"
)
foreach ($folder in $folders) {
$paths += $(Get-ItemPropertyValue 'HKCU:\software\microsoft\windows\currentversion\explorer\shell folders\' -Name $folder)
}
foreach ($path in $paths) {
$acl = Get-Acl $path
if (!($acl.Access | ?{$.IdentityReference -match [regex]::escape($user) -and $.FileSystemRights -match "FullControl"}))
{
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::None
$objType = [System.Security.AccessControl.AccessControlType]::Allow
$permission = $user, "FullControl", $InheritanceFlag, $PropagationFlag, $objType
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl.SetAccessRule($AccessRule)
(Get-Item $path).SetAccessControl($acl)
Write-Host "Done it"
} else {
Write-Host "Nothing to do"
}
}
Type: linux parkage (virsh) Description: linux virtualization package
- List running virtual machine
$ virsh list
- List all virtual machine
$ virsh list --all
. . .
type: virt-manager Purpose: Starts up the vietualization manager
$ virt-manager
Type: Reset ubuntu password Purpose: Reset ubuntu user password [Source Link)[https://itsfoss.com/how-to-hack-ubuntu-password/]
- Boot into recovery mode
- Drop to root shell prompt
- Remount the root with write access
$ mount -rw -o remount /
- Reset username or password
$ ls /home
$ passwd username
Type: SSH Purpose: Connecting to a remote computer with port 22
- Connect with X11 forwarding
$ ssh -X <userName>@<address>
# e.g
$ ssh -X [email protected]
$ ssh -X [email protected]
- Generate public private key pairs