Added Tags to All Docs
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
---
|
||||
tags:
|
||||
- SSH
|
||||
- Bash
|
||||
- Authentication
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
*Purpose*: Sometimes you need two linux computers to be able to talk to eachother without requiring a password. Passwordless SSH can be achieved by running the following commands:
|
||||
|
||||
!!! note "Non-Root Key Storage Considerations"
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Linux
|
||||
- Bash
|
||||
- Scripting
|
||||
---
|
||||
|
||||
``` sh
|
||||
xrandr --auto
|
||||
xrandr --setprovideroutputsource 4 0
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Bash
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
# Git Repo Updater (Script)
|
||||
## Purpose
|
||||
Standalone `repo_watcher.sh` script used by the Git Repo Updater container. This script clones or pulls one or more repositories and rsyncs them into destination paths.
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Bash
|
||||
- QEMU
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
You may need to install the QEMU guest agent on linux VMs manually, while Windows-based devices work out-of-the-box after installing the VirtIO guest tools installer.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- XRDP
|
||||
- Bash
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
If you need to set up RDP access to a Linux environment, you will want to install XRDP. Once it is installed, you can leverage other tools such as Apache Guacamole to remotely connect to it.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- RAID
|
||||
- Bash
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04
|
||||
``` sh
|
||||
sudo mdadm --grow /dev/md0 -l 5
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Bash
|
||||
- Ports
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
If you want to check if a certain TCP port is open on a server.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Proxmox
|
||||
- Bash
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This script is ran via cronjob on `cluster-node-02` at midnight to rollback the deeplab environment automatically to a previous snapshot nightly.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Bash
|
||||
- Time Sync
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
The commands outlined in this short document are meant to be a quick-reference for setting the timezone and date/time of a Linux-based server.
|
||||
|
||||
### Set Timezone:
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
---
|
||||
tags:
|
||||
- Containers
|
||||
- Docker
|
||||
- Bash
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
If you find that you need to migrate a container, along with any supporting files, permissions, etc from an old server to a new server, rsync helps make this as painless as possible.
|
||||
Be sure to perform the following steps to make sure that you can copy the container's files.
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
---
|
||||
tags:
|
||||
- Bash
|
||||
- Netcat
|
||||
- File Transfer
|
||||
- Scripting
|
||||
- Linux
|
||||
---
|
||||
|
||||
**Purpose**: You may find that you need to transfer a file, such as a public SSH key, or some other kind of file between two devices. In this scenario, we assume both devices have the `netcat` command available to them. By putting a network listener on the device recieving the file, then sending the file to that device's IP and port, you can successfully transfer data between computers without needing to set up SSH, FTP, or anything else to establish initial trust between the devices. [Original Reference Material](https://www.youtube.com/shorts/1j17UBGqSog).
|
||||
|
||||
!!! warning
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
---
|
||||
tags:
|
||||
- Blue Iris
|
||||
- Batch
|
||||
- Monitoring
|
||||
- Scripting
|
||||
- Windows
|
||||
---
|
||||
|
||||
``` batch
|
||||
@echo off
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Robocopy
|
||||
- Batch
|
||||
- Scripting
|
||||
- Windows
|
||||
---
|
||||
|
||||
Robocopy is a useful tool that can be leveraged to copy files and folders from one location to another (e.g. Over the network to another server) without losing file and folder ACLs (permissions / ownership data).
|
||||
|
||||
!!! warning "Run as Domain Admin"
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Operations
|
||||
- Reference
|
||||
- Index
|
||||
- Documentation
|
||||
---
|
||||
|
||||
# Reference
|
||||
## Purpose
|
||||
Quick-use scripts and snippets for day-to-day operations.
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Email
|
||||
- Scripting
|
||||
---
|
||||
|
||||
!!! info "Prerequesite: [Connect to Azure AD](./connect-to-azure-ad.md)"
|
||||
|
||||
The uppercase `SMTP` address is the primary address, while lowercase `smtp` are aliases. You can find the value in active directory in **"User > Attribute Editor > proxyAddresses"**.
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**: Sometimes you will need to connect to Azure AD via powershell in order to perform troubleshooting / automation.
|
||||
|
||||
## Update Nuget Package Manager
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Exchange Online
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**: Sometimes you will need to connect to Office365 via powershell in order to perform troubleshooting / automation that either is too complex to do via the website, or is not exposed / possible to do via the website.
|
||||
|
||||
## Update Nuget Package Manager
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
Sometimes you just need a basic script that outputs a pretty directory and file tree. This script offers files and folders to ignore, and outputs a fancy directory tree.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- DNS
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
When it comes to best-practices with Windows-based DNS servers, you never want to have `127.0.0.1` or the IP of the server itself as the primary DNS server, you want to have a *different* DNS server as primary, and `127.0.0.1` as the secondary or tertiary DNS server instead.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- File Management
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
Locate specific files, and copy them with a renamed datestamp appended to a specific directory.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Windows
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
Sometimes when you try to run Windows Updates, you may run into issues where updates just fail to install for seemingly nebulous reasons. You can run the following commands (in order) to try to resolve the issue.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Group Policy
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
``` powershell
|
||||
$computers = Get-ADComputer -Filter * -SearchBase "OU=Computers,DC=bunny-lab,DC=io"
|
||||
$computers | ForEach-Object -Process {Invoke-GPUpdate -Computer $_.name -RandomDelayInMinutes 0 -Force}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
This script is designed to iterate over every computer device within an Active Directory Domain. It then reaches out to those devices over the network and iterates upon every local user profile on those devices, and using CIM, determines which profiles have not been logged into in X number of days. If executed in a non-dry-run nature, it will then delete those profiles (*this does not delete local or domain users, it just cleans up their local profile data on the workstation*).
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Rclone
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. Over 70 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.
|
||||
|
||||
!!! warning "Be Mindful of Sync Type"
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
Sometimes you need to restart a service across every computer in an Active Directory Domain. This powershell script will restart a specific service by name domain-wide. Each device will be processed in a serialized nature, one-by-one.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- Windows 11
|
||||
- Windows
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
You may need to upgrade a device to Windows 11 using an ISO stored on a UNC Network Share, the script below handles that.
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
Sometimes things go awry with backup servers and Hyper-V and a bunch of extra `.avhdx` virtual differencing disks are created, taking up a ton of space. This can be problematic because if you run out of space, the virtual machines running on that underlying storage will stop working. Sometimes this can involve dozens or even hundreds of differencing disks in rare cases that need to be manually merged or "collapsed" down to reclaim the lost space.
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
You may find that you cannot delete a VHDX file for a virtual machine you removed from Hyper-V and/or Hyper-V Failover Cluster, and either cannot afford to, or do not want to reboot your virtualization host(s) to unlock the file locked by `SYSTEM`.
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**: Sometimes a Hyper-V Failover Cluster node does not want to shut down, or is having issues preventing you from migrating VMs to another node in the cluster, etc. In these situations, you can run this script to force a cluster node to reboot itself.
|
||||
|
||||
!!! warning "Run from a Different Server"
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
This script *bumps* any replication that has entered a paused state due to a replication error. The script will record failed attempts at restarting the replication. The logs will rotate out every 5-days.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Minecraft
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**: This script was purpose-built for the homelab Minecraft servers in my homelab. It may need to be ported based on your own needs.
|
||||
|
||||
```powershell
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Nextcloud
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**: In some unique cases, you want to be able to either perform backups of data or exfiltrate data to Nextcloud from a local device via the use of a script. Doing such a thing with Nextcloud as the destination is not very documented, but you can achieve that result by running a script like what is seen below:
|
||||
|
||||
## Windows
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
Sometimes you need a report of every user in a domain, and if/when their passwords will expire. This one-liner command will help automate that reporting.
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
``` powershell
|
||||
$DaysInactive = 30
|
||||
$time = (Get-Date).Adddays(-($DaysInactive))
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Reporting
|
||||
- Scripting
|
||||
---
|
||||
|
||||
``` powershell
|
||||
InactiveDays = 30
|
||||
$Days = (Get-Date).Adddays(-($InactiveDays))
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- SMB
|
||||
- PowerShell
|
||||
- Permissions
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
This script will iterate over all network shares hosted by the computer it is running on, and will give *recursive* permissions to all folders, subfolders, and files, including hidden ones. It is very I/O intensive given it iterates recursively on every file/folder being shared.
|
||||
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
---
|
||||
tags:
|
||||
- SMB
|
||||
- PowerShell
|
||||
- Permissions
|
||||
- Scripting
|
||||
---
|
||||
|
||||
**Purpose**:
|
||||
This script will iterate over all network shares hosted by the computer it is running on, and will give *top-level* permissions to all the shared folders. It will not navigate deeper than the top-level in its report. Very I/O friendly.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user