CK Cheatsheet See list of certs before renewing
set-inform https://unifi.cktechx.com:8080/inform
set-inform http://unifi.cktechx.com:8080/inform
set-inform https://unifi.resolvetech.biz:8080/inform
set-inform http://unifi.resolvetech.biz:8080/inform
20.246.74.195
set-inform http:/20.246.74.195:8080/inform
sudo systemctl stop nginx
sudo certbot certonly --standalone -d unifi.cktech.org
sudo nano /etc/nginx/sites-available/unifi
sudo certbot certonly --standalone -d unifi.yourdomain.com
sudo certbot certonly --standalone -d unifi.cktech.o
pct resize <CTID> rootfs +10G
pve7to8 --full
Re-generate Self-Signed Certificates
Node will either be pve or galaxy
rm /etc/pve/pve-root-ca.pem
rm /etc/pve/priv/pve-root-ca.key
rm /etc/pve/nodes/<node>/pve-ssl.pem
rm /etc/pve/nodes/<node>/pve-ssl.key
After removal run the following command and reboot:
pvecm updatecerts -f
# 1. Pre-flight check
pve8to9 --full
# 2. Switch APT sources to Trixie + PVE 9 (no-subscription)
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/pve-enterprise.list 2>/dev/null || true
echo "deb http://download.proxmox.com/debian/pve trixie pve-no-subscription" > /etc/apt/sources.list.d/pve-no-sub.list
# Optional: Ceph sources (if you run Ceph, replace quincy with reef)
# echo "deb http://download.proxmox.com/debian/ceph-quincy trixie no-subscription" > /etc/apt/sources.list.d/ceph.list
# 3. Update + upgrade
apt update && apt full-upgrade -y
# 4. Reboot into Proxmox VE 9
reboot
ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc
W269N-WFGWX-YVC9B-4J6C9-T83GX
VDYBN-27WPP-V4HQT-9VMD4-VMK7H
Slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
Slmgr /skms kms8.msguides.com
slmgr /ato
DISM /online /Set-Edition:ServerStandard /ProductKey:VDYBN-27WPP-V4HQT-9VMD4-VMK7H /AcceptEula
Slmgr /ipk VDYBN-27WPP-V4HQT-9VMD4-VMK7H
Slmgr /skms kms8.msguides.com
slmgr /ato
Windows Server 2025 Standard TVRH6-WHNXV-R9WG3-9XRFY-MY832
Windows Server 2025 Datacenter D764K-2NDRG-47T6Q-P8T8W-YP6DF
Windows Server 2025 Datacenter: Azure Edition XGN3F-F394H-FD2MY-PP6FD-8MCRC
Windows Server 2025
DISM /online /Set-Edition:ServerStandard /ProductKey:TVRH6-WHNXV-R9WG3-9XRFY-MY832 /AcceptEula
Slmgr /ipk TVRH6-WHNXV-R9WG3-9XRFY-MY832
Slmgr /skms kms8.msguides.com
slmgr /ato
slmgr -rearm
This command displays the license information for the Windows installation in a pop-up window:
slmgr.vbs /dli
slmgr.vbs /dlv
(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
slmgr /xpr
#to a file to a directory
for d in /data/projects/*/; do
[ -d "$d" ] || continue
if [ -f "$d/.gitignore" ]; then
grep -qxF "CLAUDE.md" "$d/.gitignore" || echo "CLAUDE.md" >> "$d/.gitignore"
else
echo "CLAUDE.md" > "$d/.gitignore"
fi
done
lsb_release -d
apt install unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades
uptime -p
ip a
Ifconfig
sudo dpkg -i ConnectWiseControl.ClientSetup.deb
echo $PATH
this will search the Which input
man -k which
sudo apt update && sudo apt upgrade
sudo apt install openssh-client
sudo apt install openssh-server
sudo systemctl status ssh
sudo ufw allow ssh
nano /etc/ssh/sshd_config
PermitRootLogin yes
Can also enable PubkeyAuthentication and disable password login when using SSL Key based authentication
sudo apt install openssh-server
sudo systemctl status ssh
Sudo vim /etc/ssh/sshd_config
Uncomment port 22 and change it to anything under 1024
Insert mode (i) → 22 → 888
ESC (command mode)
:wq
Sudo systemctl restart sshd
ssh-keygen -t ed25519
ssh-keygen -t rsa
mkdir ~/.ssh && chmod 700 ~./ssh
Linux Copy key to authorized_keys
Ssh-copy-id root@10.3.0.10
Windows:
Scp $env:USERPROFILE/.ssh/ id_ed25519.pub chris@10.3.6.9:~/.ssh/authorized_keys
Alternatively, just create a new keychain in Termius and copy the key to the authorized_keys file. Do NOT save the passphrase to termius, store password in Bitwarden
Copy key to authorized_keys
Ssh-copy-id root@10.3.0.10
Restart SSH
Sudo systemctl restart sshd
sudo apt update && sudo apt full-upgrade -y
Sudo apt install ufw
Sudo ufw status
Sudo ufw allow 888
Sudo ufw enable
Sudo ufw allow ‘Apache’
Sudo ufw allow ‘Apache Full’
Sudo ufw allow Nginx
sudo ufw status numbered
Sudo ufw delete 1 (example)
Ubuntu Package Manager issue (21.10)
sudo apt-get install -f
popOS Updates
sudo apt update
sudo apt full-upgrade
Linux Redirection
Cat 1> output txt
Cat > output1.txt
nmap -sS domain.com
-sV (service version)
Nc -lnvp 87 -s 10.1.1.1 (IP to listen to on x port)
Nc -e /bin/bash 10.1.1.1 87
TBD…
chmod +x script.sh
./script.sh
https://github.com/ChristianLempa/cheat-sheets/blob/main/tools/docker.md
sudo apt update && sudo apt upgrade -y
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
docker --version
docker ps
sudo docker volume create vname
docker exec -it acmesh-acme.sh-1 /bin/sh
docker exec -it acmesh-acme.sh-1 bash
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Docker Management
Business license:
2-WROdVQVBRPljDdBHvbiGglZkUjoHY0+4DaY+c9dhJLrxQUBd5w+qLYmQi1any2Cbfdr60MBMOCncoA==
# Create portainer Volume
sudo docker volume create portainer_data
#Pull latest EE version (You can skip to next step and just do -ce instead for community
sudo docker pull portainer/portainer-ee:latest
sudo docker run -d -p 9443:9443 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer-ee:latest
=== OPT ===
sudo docker run -d -p 9443:9443 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer/portainer-ee
=== OPT ===
docker run -d \
-p 9001:9001 \
--name portainer_agent \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/docker/volumes:/var/lib/docker/volumes \
-v /:/host \
portainer/agent:2.21.5
docker volume create portainer_data
sudo docker run -d -p 9443:9443 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer-ee:latest
docker stop portainer
docker rm portainer
docker pull portainer/portainer-ce:latest
docker run -d -p 9443:9443 -p 8000:8000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx -d cktech.org
sudo docker pull portainer/portainer-ce
sudo docker volume create portainer_data
sudo docker run -d -p 9443:9443 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /srv/portainer:/data portainer-ee:latest
winget update –all
winget update --all --include-unknown
Other:
winget upgrade --all --accept-package-agreements
https://learn.microsoft.com/en-us/windows/package-manager/winget/
https://github.com/microsoft/winget-cli
Winget search appname
Winget install appname (or app id - spaces require “ “ when spaces i.e. “Github Desktop” )
Winget upgrade appname
#Command to update all applications
Winget upgrade —all
winget install -e --id tailscale.tailscale
Winget ships with windows now but I had issues running it via Powershell on a few of my computers. Not sure what’s changed but I can’t just run winget upgrade –all in powershell. Potential workaround is add the path to winget and run in command prompt
C:\Users\chris\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
#timeout=1000000
"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --all --accept-source-agreements
"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" search "Google Chrome" --accept-source-agreements
find which version of DesktopAppInstaller is installed
dir "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller*"
Working, to update all packages
#timeout=1000000
#maxlength=1000000
"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --all --include-unknown --silent --accept-source-agreements
C:\WINDOWS\system32>"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" upgrade --name "Google Chrome" --silent --accept-source-agreements
"C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_1.19.11071.0_x64__8wekyb3d8bbwe\winget.exe" show "Google Chrome" --accept-source-agreements
sudo dd if=/dev/zero bs=1M count=1024 of=/mnt/1GiB.swap
sudo chmod 600 /mnt/1GiB.swap
sudo mkswap /mnt/1GiB.swap
sudo swapon /mnt/1GiB.swap
Verify Swap
cat /proc/swaps
make sure swap comes back after a reboot
adds to the FS tab file
echo ‘/mnt/1GiB.swap swap swap defaults 0 0’ | sudo tee -a /etc/fstab
wget https://kasm-static-content.s3.amazonaws.com/kasm_release_1.16.0.f2d6e1.tar.gz
unzip file
tar -xf kasm_release*.tar.gz
run installation script
sudo bash kasm_release/install.sh
apt install certbot -y
Certbot certonly –standalone -d kasm.cktech.org
Replace SELF_SIGNED Certs:
sudo /opt/kasm/bin/stop
cp /etc/letsencrypt/live/kasm.cktech.org/fullchain.pem /opt/kasm/current/certs/kasm_nginx.crt
cp /etc/letsencrypt/live/kasm.cktech.org/privkey.pem /opt/kasm/current/certs/kasm_nginx.key
sudo /opt/kasm/bin/start
Setup Cron Job for renewal
sudo certbot renew --force-renewal -d kasm.cktech.org
sudo certbot certificates
sudo certbot renew
TXT record
Host: @
Value: v=spf1 include:_spf.google.com ~all
TTL: 1 Hour or 3600 seconds
Start
Add a DNS TXT record for _dmarc
TXT Record name _dmarc.cktech.org (Some DNS providers automatically add the domain to the end)
TXT Record Value:
v=DMARC1; p=none; rua=mailto:reports@cktech.org
Phase 2 (Quarantine a small number)
v=DMARC1; p=quarantine; pct=5; rua=mailto:reports@cktech.org
v=DMARC1; p=reject; rua=mailto:reports@cktech.org;
v=DMARC1; p=reject; rua=mailto:reports@cktech.org; adkim=s; aspf=s;
v=DMARC1; p=reject; rua=mailto:postmaster@cktech.org, mailto:reports@cktech.org; pct=100; adkim=s; aspf=s
You can go to Admin Center and go to Settings → Domains and review Domain DNS records and or a health check.
https://lazyadmin.nl/office-365/configure-dkim-office-365/
TXT Record
Name: @
Value: v=spf1 include:spf.protection.outlook.com -all
https://lazyadmin.nl/office-365/configure-dkim-office-365/
Host Name : selector1._domainkey
Points to address or value: selector1-cktechnology-org._domainkey.crktechnology.onmicrosoft.com
Host Name : selector2._domainkey
Points to address or value: selector2-cktechnology-org._domainkey.crktechnology.onmicrosoft.com
https://admin.microsoft.com/AdminPortal/?searchSolutions=DKIM#/homepage
https://lazyadmin.nl/office-365/office-365-dmarc/
Starter less restrictive:
v=DMARC1; p=none; rua=mailto:dmarc@cktechnology.org
TXT RECORD:
Host: _dmarc
value: v=DMARC1; p=reject; rua=mailto:dmarc@cktechnology.org; ruf=mailto:dmarc@cktechnology.org; pct=100; adkim=s; aspf=s
curl -sSL https://install.pi-hole.net | bash
echo "deb https://packages.pi-hole.net/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/pihole.list
curl -sSL https://raw.githubusercontent.com/pi-hole/pi-hole/master/automated%20install/basic-install.sh | sudo bash
pihole -up
pihole -g
sudo pihole -a -p
Update
sudo apt-get upgrade pihole
sudo systemctl restart pihole-FTL.service
sudo apt install -y qemu qemu-kvm libvirt-daemon libvirt-clients bridge-utils virt-manager
sudo systemctl status libvirtd
sudo mkinitcpio -P
# Refresh Chaotic AUR mirrors if you're getting 404 or connection errors
sudo pacman -Sy chaotic-mirrorlist
sudo pacman -Syyu # Full system refresh using updated mirror
sudo pacman -S snapper snap-pac
sudo btrfs subvolume create /.snapshots
sudo chmod 750 /.snapshots
sudo chown :wheel /.snapshots
sudo blkid | grep nvme0n1p2
UUID=your-root-uuid /.snapshots btrfs subvol=@.snapshots,noatime,compress=zstd:3 0 0
sudo mount /.snapshots
sudo snapper -c root create --description "Initial root snapshot"
sudo snapper -c root list
sudo snapper -c home create-config /home
sudo chmod 750 /home/.snapshots
sudo chown :wheel /home/.snapshots
sudo snapper -c home create --description "initial home snapshot"
sudo snapper -c home list
sudo systemctl enable --now snapper-timeline.timer
sudo systemctl enable --now snapper-cleanup.timer
updpkgsums
journalctl -b0 --grep="nvidia" --no-pager
sudo nano /etc/pacman.conf
uncomment - color and paralleldownloads
add below: ILoveCandy
sudo pacman -Sy
sudo pacman -S cargo
sudo Pacman -S reflector
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sudo reflector --verbose --latest 10 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
Pacman -Syu
pacman -S nano vim neofetch
KDE Wayland
pacman -Sy xorg plasma kde-applications plasma-wayland-session
Wayland Session KDE (NVIDIA)
sudo pacman -Sy xorg plasma kde-applications plasma-wayland-session
X11 session
pacman -Sy xorg plasma kde-applications sddm
sudo pacman -S –needed base-devel
sudo pacman -S git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
to install a package using yay
yay -S package
Gnome shell
yay -S chrome-gnome-shell
Google chrome
yay -S google-chrome
remove package
yay -Rns package
Update system packages
yay -Syy
Perform a full upgrade
yay -Syu
View more options
man yay
Gnome42 arch
pacman -Sy gnome gnome-extra
sudo pacman -S flatpak
sudo pacman -S kaccounts-providers
sudo pacman -S kio-gdrive
rm ~/.config/plasma-org.kde.plasma.desktop-appletsrc
rm ~/.config/plasmashellrc
rm ~/.config/plasmarc
sudo pacman -S –needed git base-devel
git clone https://aur.archlinux.org/visual-studio-code-bin.git
cd visual-studio-code-bin
makepkg -si
Method 2
yay -S visual-studio-code-bin
Make command is building your own application/package
sudo pacman -S vim
sudo pacman -SY vim
tar xvf linux-5.18-rc3.tar.gz
sudo pacman -Syu
sudo pacman -Syyu
Sudo pacman -S git
Git clone https://aur.archlinux.org/yay-git.git
Sudo pacman -S –needed base-devel git
Yay -S google-chrome
sudo Pacman -S google-chrome
Sudo pacman -S steam
sudo pacman -S discord
Sudo pacman -S snapd
sudo systemctl enable –now snapd.socket
sudo snap install signal-desktop
sudo snap install youtube-music-desktop-app
sudo pacman-mirrors --api --set-branch unstable
sudo mhwd-kernel --list
sudo mhwd-kernel --install linux518
Manjaro Automatic Installation Nvidia Driver Manjaro Repository
sudo mhwd -a pci nonfree 0300
Further configure settings
nvidia-settings
sudo dnf upgrade
uname -mrs
sudo reboot
sudo shutdown -r now
sudo vim /etc/gdm3/custom.conf
waylandEnable=true
ESC
:wq
systemctl restart gdm3
Session Type
Echo #XDG_SESSION_TYPE
popOS tweak Applications menu
cd /usr/share/gnome-shell/extensions/pop-cosmic@system76.com
sudo vim dark.css
#Nord colors
.cosmic-applications-dialog
Background-color: #252631;
#alternate
#1B1B1B
sudo pacman -S git
sudo pacman -Syu
git clone https://aur.archlinux.org/timeshift.git
cd timeshift
makepkg -si
Timeshift via AUR
yay -S timeshift
sudo add-apt-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install timeshift
keyID:
0048d61b5cd88bb0000000001
keyName:
CK-SYN
applicationKey:
K004gfhqMFZ8FHUCfk2wx6bIgXXU9CE
access-key= SLZ2V28CUSVKRLXSQC0V
secret-key= rDjgMv0bR4WqRU6zB2ebK4S1scAhlzddFyA7v98p
CIDR | SUBNET MASK | WILDCARD MASK | # OF IP ADDRESSES | # OF USABLE IP ADDRESSES |
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2* |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
/29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
/28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
/26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
/25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
/23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
/21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
/19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
/18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
/17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
/15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
/14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
/13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
/12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
/11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
/10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
/9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
/7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
/6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
/5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
/4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
/3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
/2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
/1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
/0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
powercfg /getactivescheme
powercfg.exe /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
netsh interface set interface "YOUR-ADAPTER-NAME" disable
netsh wlan show wlanreport
netsh wlan show interfaces
#!ps
Set-MpPreference -ScanParameters 2
#!ps
Set-MpPreference -RemediationScheduleDay 4
#!ps
Set-MpPreference -RemediationScheduleTime 21:00:00
#!ps
Get-MpComputerStatus
sudo docker stop portainer_agent && sudo docker rm portainer_agent && sudo docker pull portainer/agent:latest && sudo docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest
#!ps
#timeout=1000000
Get-WindowsUpdate -install -acceptall -autoreboot
#!ps
#timeout=1000000
Get-WindowsUpdate -install -acceptall -IgnoreReboot
#3 hours
shutdown /r /t 10800
#6 hours
shutdown /r /t 21600
Set-ExecutionPolicy Unrestricted
Get-WindowsUpdate -install -acceptall -autoreboot
#do after restart
Set-ExecutionPolicy Restricted
Set-ExecutionPolicy Unrestricted
Get-WindowsUpdate -install -acceptall
Set-ExecutionPolicy Restricted
Powershell.exe -EP Unrestricted iwr "https://raw.githubusercontent.com/ResoTech/public-misc/main/UpdateWindows.ps1" -o winup.ps1";.\winup.ps1
Powershell.exe -EP Unrestricted iwr "https://raw.githubusercontent.com/ResoTech/public-misc/main/UpdateNoReboot" -o winupNoRe.ps1";.\winupNoRe.ps1
Powershell.exe -EP Unrestricted iwr "https://raw.githubusercontent.com/ResoTech/public-misc/main/Silent22H2.ps1" -o winup22h2.ps1";.\winup22h2.ps1
D: or E: to access mounted iso
Cd sources
setupprep.exe /product server
Shutdown -r -f -t 00
query user
Restarts (Warning can prompt users)
#3 hours
shutdown /r /t 10800
#6 hours
shutdown /r /t 21600
Install
#!ps
#timeout=1000000
Get-WindowsUpdate -install -acceptall -autoreboot
Additional
$HideList = "KB5005565", "KB5005566"
Get-WindowsUpdate -KBArticleID $HideList –Hide
Uninstall Updates:
Remove-WindowsUpdate -KBArticleID KB5005565-NoRestart
wusa /uninstall /kb:5005565
Unhide it:
Get-WindowsUpdate -KBArticleID $HideList -WithHidden -Hide:$false
Get-WindowsUpdate -KBArticleID KB5005565 $HideList -WithHidden -Hide:$false
Get-WindowsUpdate -install -acceptall -autoreboot
Install Updates no Restart
Get-WindowsUpdate -install -acceptall
Get-WindowsUpdate –IsHidden
Remove-WindowsUpdate -KBArticleID KB5005565 -NoRestart
Optional: install individual patch
Get-WindowsUpdate -KBArticleID KB890830 -install
Get-WindowsUpdate -KBArticleID KB5005565 -install
ScreenConnect Command
#!ps
#timeout=1000000
Get-WindowsUpdate -install -acceptall -autoreboot
Windows Updates Script
===========================================
# Set execution policy to unrestricted
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
# Install the PSWindowsUpdate module
Install-Module -Name PSWindowsUpdate
# Import the module
Import-Module -Name PSWindowsUpdate
# Check for updates
$Updates = Get-WUInstall
# Install updates
if ($Updates) {
Write-Output "Installing updates..."
Install-WindowsUpdate -Install -AcceptAll -AutoReboot
}
else {
Write-Output "No updates available."
}
Installation:
Install-Module -Name ExchangeOnlineManagement
OR
Install-Module ExchangeOnlineManagement
Connect
Connect-ExchangeOnline
Connect-ExchangeOnline
Connect-MsolService
#Get Group ObjectID
Get-MsolGroup
#Adds user to a group Confirm with yes
Add-UnifiedGroupLinks -Identity "Employee Vacation" -LinkType Members -Links Bwheeler@M365B202155.OnMicrosoft.com -confirm
# 2. Next we need to add the user to Self Service Password reset group
#grab user Object ID from Azure AD
Get-MsolUser -UserPrincipalName "youraccount@o365.onmicrosoft.com”| Select-Object *|Format-List
#Grab the group Object ID
Get-MsolGroup
#add user to group, first add the group Object ID and second is the member ObjectID
Add-MsolGroupMember -GroupObjectId 7d80c38a-5d49-44a1-90c8-57836e5c2f2e -GroupMemberType User -GroupMemberObjectId 8d48c20b-a054-4cc3-9ac2-c47ea58f0eda
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName admin@M365x486451.onmicrosoft.com
Set-CASMailbox kylem@baronmachine.com -OWAEnabled $false
Set-CASMailbox AlexW@M365x486451.OnMicrosoft.com -OWAEnabled $true
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
# Example below
# for psim had to pull users and total licenses for Microsoft Project, this can be used for any M365 license
1. Connect-MsolService
2. Get-MsolAccountSku
3. Get-MsolUser | Where-Object {($_.licenses).AccountSkuId -match "PROJECTCLIENT"}
Get-ADUser -Identity justinb -Properties LockedOut | Select-Object samaccountName,Lockedout| ft -AutoSize
Get-ADUser justinb -Properties Name,lockoutTime |
Select-Object Name,@{n='lockoutTime';e={[DateTime]::FromFileTime($_.lockoutTime)}}
Unlock-ADAccount justinb –Confirm
# verify
Get-ADUser -Identity justinb | Unlock-ADAccount
Get-ADUser -Identity justinb -Properties LockedOut | Select-Object samaccountName,Lockedout
Disable users in AD with Powershell
Disable-ADAccount -Identity danm
Confirmed with the following Command:
Get-ADUser dbehike | select name, Enabled
Get-ADUser danm | select name, Enabled
Set-ExecutionPolicy RemoteSigned
Install-Module PowerShellGet -Force
Install-Module ExchangeOnlineManagement
Connect-ExchangeOnline
#Disable welcome message
Connect-ExchangeOnline
Set-UnifiedGroup -Identity "nhvacation@psimp.com" -UnifiedGroupWelcomeMessageEnable:$false
#connect the tenant
Connect-MsolService
#For License assignment
Get-MsolAccountSku
#create new user
New-MsolUser -UserPrincipalName "jasonborn@M365x486451.onmicrosoft.com" -DisplayName "Jason Born" -FirstName "Jason" -LastName "Born" -UsageLocation "US" -LicenseAssignment M365x486451:ENTERPRISEPREMIUM
#set the password
Set-MsolUserPassword –UserPrincipalName "jasonborn@M365x486451.onmicrosoft.com" –NewPassword "uglySneeze46" -ForceChangePassword $False
#To remove accounts (for whatever reason- accidentally added etc.)
To Remove user :
Remove-MsolUser -UserPrincipalName "jasonborn@M365x486451.onmicrosoft.com" -Force
Get-MpThreat
Get-MpPreference
Get-MpThreatDetection
Get-MpThreatDetection (Defender) | Microsoft Docs
start-mpscan -scantype fullscan
Connect-ExchangeOnline
Set-AtpPolicyForO365 -EnableATPForSPOTeamsODB $true
Verify:
Get-ATPPolicyForO365
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
#Use PowerShell to view rules for preset security policies
Get-ATPBuiltInProtectionRule
Get-EOPProtectionPolicyRule -Identity "Standard Preset Security Policy"
#view both at the same time
Write-Output -InputObject ("`r`n"*3),"EOP rule - Standard preset security policy",("-"*79);Get-EOPProtectionPolicyRule -Identity "Standard Preset Security Policy"; Write-Output -InputObject ("`r`n"*3),"Defender for Office 365 rule - Standard preset security policy",("-"*79);Get-ATPProtectionPolicyRule -Identity "Standard Preset Security Policy"
#Built in protection preset
Set-ATPBuiltInProtectionRule -Identity "ATP Built-In Protection Rule" -ExceptIfRecipientDomainIs <"domain1","domain2",... | $null> -ExceptIfSentTo <"user1","user2",... | $null> -ExceptIfSentToMemberOf <"group1","group2",... | $null>
#connect Exchange Online via Powershell and Sign-in as global admin
Connect-ExchangeOnline
Enable-Mailbox -Identity <username> -Archive
Set-OrganizationConfig -AutoExpandingArchive
Set-executionPolicy Remotesigned
Install-Module ExchangeOnlineManagement -AllowClobber -force
Connect-ExchangeOnline
Get-OrganizationConfig | select SendFromAliasEnabled
#SET
Set-OrganizationConfig -SendFromAliasEnabled $true
#VALIDATE
Get-OrganizationConfig | select SendFromAliasEnabled
Get-Mailbox -ResultSize Unlimited | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add="resolvetech.biz","support@resolvetech.biz"}
Get-QuarantineMessage –SenderAddress accounting@compoundingsolutions.net | Release-QuarantineMessage -ReleaseToAll
Get-MessageTrace -SenderAddress accounting@compoundingsolutions.net -RecipientAddress ap@psimp.com -StartDate 1/03/2023 -EndDate 1/13/2023
(Get-QuarantineMessage).identity | ForEach {Get-QuarantineMessage -Identity $_} | Where {$_.QuarantinedUser -ne $null}
Get-QuarantineMessage –SenderAddress accounting@compoundingsolutions.net | Release-QuarantineMessage -ReleaseToAll
Get-MessageTrace -SenderAddress *.comcast.net -RecipientAddress ap@psimp.com -StartDate 1/03/2023 -EndDate 1/13/2023
Get current setting
Get-UserBriefingConfig
Get-UserBriefingConfig -Identity brian.wheeler@psimp.com
Disable for single user
Set-UserBriefingConfig -Identity meganb@lazydev.onmicrosoft.com -Enabled $false
Disable Viva Completely for all users
# Get all users from Exchange Online
$user = Get-User
# Disable Microsoft Viva Briefing
$users | Foreach { Set-UserBriefingConfig -Identity $_.UserPrincipalName -Enabled $false }
Get-QuarantineMessage -SenderAddress "voicemail@noveliron.com" | Out-File C:\quarantined.txt
Get-QuarantineMessage -SenderAddress "voicemail@noveliron.com"
$startDate = (Get-Date).AddDays(-10)
$endDate = Get-Date
Get-MessageTrace -StartDate $startDate -EndDate $endDate -SenderAddress voicemail@noveliron.com | Select-Object Timestamp, SenderAddress, RecipientAddress, Status, Received, Subject | Out-File C:\trace.txt
$startDate = (Get-Date).AddDays(-10)
$endDate = Get-Date
Get-MessageTrace -StartDate $startDate -EndDate $endDate -SenderAddress voicemail@noveliron.com | Select-Object Timestamp, SenderAddress, RecipientAddress, Status, Received, Subject
Get-MessageTrace -RecipientAddress romil.patel@psimp.com -StartDate 02/15/2023 -EndDate 02/16/23
Connect-AzureAD
$MainOfficeIP = Read-Host "Enter the main office IP address (e.g. 0.0.0.0/32)"
$MainOfficeLocation = New-AzureADMSNamedLocation -DisplayName "Main Office" -Locations $MainOfficeIP
(get-date) - (gcim Win32_OperatingSystem).LastBootUpTime
Set-MailboxCalendarConfiguration -Identity MainConferenceRoom@noveliron.com -WorkingHoursStartTime 07:00:00
Set-MailboxCalendarConfiguration -Identity SmallConferenceRoom@noveliron.com -WorkingHoursStartTime 07:00:00
Set-MailboxCalendarConfiguration -Identity MainConferenceRoom@noveliron.com -WorkingHoursTimeZone "Eastern Standard Time"
Set-MailboxCalendarConfiguration -Identity SmallConferenceRoom@noveliron.com -WorkingHoursTimeZone "Eastern Standard Time"
Get-MailboxCalendarConfiguration -Identity mainconferenceroom@noveliron.com
Get-MailboxCalendarConfiguration -Identity SmallConferenceRoom@noveliron.com
#!ps
Add-Printer -ConnectionName "\\PS-FS-01\Canon Upstairs"
#!ps
Add-Printer -ConnectionName "\\PS-FS-01\Canon Downstairs"
#Get’s mailbox Permissions
Get-MailboxPermission -Identity "supplier"
#This example assigns the user Kevin Kelly Full Access permission to Terry Adams's mailbox.
Add-MailboxPermission -Identity "supplier" -User "Tammi Vetree" -AccessRights FullAccess -InheritanceType All
Get-DistributionGroupMember -Identity "all-novel@noveliron.com" | Select-Object DisplayName,PrimarySmtpAddress | Export-Csv -Path "C:\all-novel-members.csv" -NoTypeInformation
Get-DistributionGroupMember -Identity "all-rose@rosesteelinc.com" | Select-Object DisplayName,PrimarySmtpAddress | Export-Csv -Path "C:\all-rose-members.csv" -NoTypeInformation
wmic qfe list
CertUtil -hashfile "C:\Program Files (x86)\Common Files\Aladdin Shared\HASP\hasplms.exe" SHA256
#Set execution Policy if you get errors due to scope
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
can be used for quick deletions if a drive is maxed out
gci -r| sort -descending -property length | select -first 10 name, length, directory
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox | Where-Object {$_.ArchiveStatus -eq "Active"} | Select DisplayName, ArchiveStatus
https://morgantechspace.com/2021/01/check-size-and-status-of-archive-mailbox-powershell.html#:~:text=We%20can%20use%20the%20Get,other%20mailbox%2Drelated%20statistics%20data.
# Force TLS 1.2 for older Windows versions
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Note: Testing for automating Onboarding/Offboarding and setting up standard Conditional Access Policies in M365. Google Workspaces offboarding with google takeout and sending it to an administrator’s google drive.
Github used for windows update powershell script in Private RESOTECH Github Repositories and version control via Github Desktop application. In the future look into learning git cli.
Formerly used this version control for Sysmon XML configuration file for compliance customers. Currently have a few powershell scripts uploaded there that need to be tested for automating certain workflows. Likely won’t need Conditional Access / MFA enforcement scripts due to Netlogic’s Baseline Builder
Sometimes it works and other times it does nothing… Hit or miss. May run if device is in automatic startup repair boot loop
dism /online /cleanup-image /restorehealth
sfc /scannow
dism /online /cleanup-image /scanhealth
dism /online /cleanup-image /checkhealth
dism /online /cleanup-image /restorehealth
DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:X:SourcesInstall.wim:1 /LimitAccess
DISM /Online /Cleanup-Image /RestoreHealth /Source:E:\Sources\install.wim
Get-WindowsImage -ImagePath "D:\sources\install.wim"
#Check Disk
chkdsk /f /r C:
#fix boot and rebuild BCD via CLI
exe /rebuildbcd
exe /fixmbr
exe /fixboot
#check OSDevicePartition
bcdedit /set {default} device partition=c:
bcdedit /set {default} osdevice partition=c:
#disable synthetic timers
bcdedit /set useplatformtick yes
#disable dynamic tick
Bcdedit /set disabledynamictick yes
#disable
powercfg.exe /hibernate off
powercfg /hibernate off
#enable
powercfg.exe /hibernate on
Powercfg -h off
gpupdate /force
tzutil /s "Eastern Standard Time"
Location of Powershell Script:
\\CKEL-FILE\Store\updateWindows.ps1
Create a scheduled task running as SYSTEM
Choose Daily, weekly, monthly parameters
Action choose a Program:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add Arguments (optional) - This will be the location of the script via UNC path See CKEL lab for example
\\CKEL-FILE\Store\updateWindows.ps1
#Check if the network connection is public/private/domain type (for win defender)
Get-NetConnectionProfile
#Public/private/domain as options
Set-NetConnectionProfile -Name "NetworkName" -NetworkCategory Private
#change name
Set-NetConnectionProfile -Name "CurrentProfileName" -NewName "NewProfileName"
Set-NetConnectionProfile -Name "Network" -NetworkCategory 'DomainAuthenticated'
Legend:
Public
Private
DomainAuthenticated
Run this as the user in question
gpresult /R
net use
In the future it would be worth testing clearing the kerberos tickets using "klist purge"
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/klist
It appears group membership is being cached or is being delayed in some way and kerberos tickets seem like a logical place to start diagnosing
change user /install
change user /execute
updpkgsums
diskpart
list volume
#use list partition
list partition
select Partition 4
delete partition override
df -h
reg add HKEY_CURRENT_USER\Software\Policies\Microsoft\OneDrive /v DisablePersonalSync /t REG_DWORD /d 1 /f
netsh advfirewall firewall set rule group=”Network Discovery” new enable=Yes
#disable
netsh advfirewall firewall set rule group=”Network Discovery” new enable=No
net localgroup Administrators
net localgroup users domainname\username /add
net localgroup users GIP\IQMS /add
net localgroup administrators [username] /delete
net localgroup administrators GIP\IQMS /delete
gpresult /R
@echo off
:menu
cls
echo.
echo Choose an option:
echo 1) Install Microsoft Office 64-bit
echo 2) Install Microsoft Office 32-bit
echo 3) Install Microsoft Access
echo 4) Remove Microsoft Office
echo.
set /p option=Enter your choice:
if %option% == 1 goto install64
if %option% == 2 goto install32
if %option% == 3 goto installAccess
if %option% == 4 goto remove with sara
:install64
echo Installing Microsoft Office 64-bit...
start /wait \\server\share\Office64.exe /quiet
goto end
:install32
echo Installing Microsoft Office 32-bit...
start /wait \\server\share\Office32.exe /quiet
goto end
:installAccess
echo Installing Microsoft Access...
start /wait \\server\share\Access.exe /quiet
goto end
:remove
echo Removing Microsoft Office using SARA recovery tool...
start /wait \\server\share\SARA.exe /quiet
goto end
:end
echo Installation completed.
pause
@echo off
set source_folder=C:\users\*\Local\Microsoft\Outlook\RoamCache
set destination_folder=C:\Temp
echo Backing up Outlook PST files...
xcopy "C:\Users\%userprofile%\Documents\Outlook Files\*.pst" "%destination_folder%\Outlook PST Files" /s /c /y
echo Grabbing largest autocomplete stream .dat file from RoamCache directory...
for /f "tokens=2 delims= " %%a in ('dir /b /s /a-d "%source_folder%\*.dat" ^| sort /r') do (
set largest=%%a
goto endloop
)
:endloop
xcopy "%largest%" "%destination_folder%\Autocomplete Stream.dat" /y
echo Backup completed.
pause
@echo off
set roamcache_folder=C:\users\*\Local\Microsoft\Outlook\RoamCache
echo Identifying old and recent autocomplete stream .dat files...
for /f "tokens=2,3 delims= " %%a in ('dir /b /s /a-d "%roamcache_folder%\*.dat" ^| sort /r /o:-d') do (
set old=%%a
set recent=%%b
goto endloop
)
:endloop
echo Old autocomplete stream .dat file: %old%
echo Recent autocomplete stream .dat file: %recent%
pause
CKEL-40F
WAN: 32:85:f0:19:bf:28
LAN 10.3.0.1 - proxmox
VLAN3 10.3.3.1 - SYN
VLAN6 10.3.6.1 - CK
VLAN7 10.3.7.1 - CK_Wireless
VLAN9 10.3.9.1 - RESO
VLAN66 10.3.66.1 - Analog_Devices
VLAN69 10.3.69.1 - IOT Guest access plus TV’s/xbox/etc
OLD 40F WAN Mac: ac:71:2e:eb:70:b2
diagnose sys top 5 30
# exe ping-options repeat-count 10000
# exe ping 8.8.8.8
diagnose hardware sysinfo memory
get system performance status
get system performance top
diagnose system top
diagnose debug crashlog read
# diagnose sniffer packet any host x.x.x.x and port 53
config sys int
edit <interface>
set macaddr <MAC address>
end
exec router restart
Get controller IP converted to hex: https://tcpip.wtf/en/unifi-l3-adoption-with-dhcp-option-43-on-pfsense-mikrotik-and-others.htm
https://help.ui.com/hc/en-us/articles/204909754-Remote-Adoption-Layer-3#7
config system dhcp server
edit 1
config options
edit 1
set code 43
set type hex
set value 2b 1a 31 2e 32 2e 33 2e 34
end
Add a local dns entry that points unifi to your controller, example:
unifi → 104.200.30.137
If you get locked out of gui, etc:
config system global
show full | grep admin-server-cert
set admin-server-cert Fortinet_Factory
set admin-server-cert face_fortigategui
End
Full
#navigate to windows desktop from WSL Linux server
cd /mnt/c/users/ckadmin/desktop/WVPTCerts
## Company Name: companyID
## Root CA Certificate (for deep Inspection)
# Generate root private key
openssl genrsa -aes256 -out companyID_root_private.key 2048
# Generate root CA certificate
# Add to Windows Trusted Root Certificate Authority
# Input Country, State, Org Name Only
openssl req -new -x509 -days 3650 -extensions v3_ca -key companyID_root_private.key -out companyID_root_ca.crt
## Service1
# Generate private key for service1
openssl genrsa -aes256 -out companyID_service1_private.key 2048
# Generate CSR using service1 private key
# Skip "challenge password" and "an optional company name"
openssl req -new -key companyID_service1_private.key -out companyID_service1.csr
# Prep EXT File
# Rename file
# Delete the dns or ip entry as needed
# Update the remaining entry to use service1 ip/hostname
# Generate certificate from service1 CSR using Root CA
openssl x509 -req -in companyID_service1.csr -CA companyID_root_ca.crt -CAkey companyID_root_private.key -CAcreateserial -out companyID_service1.crt -days 3650 -sha256 -extfile companyID_service1.ext
# Fortigate certificates can be imported with
# Import > Certificate > Import Certificate > Certificate (cert, key and password)
========== extfile==========
authorityKeyIdentifier=keyid,issuerbasicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = vpn.domain.com
IP.1 = 123.123.1.1
=========================
config system settings
set sip-helper disable
set sip-nat-trace disable
set default-voip-alg-mode kernel-helper-based
end
config system session-helper
show
Here you will want to find the entry for SIP, this is typically 12 or 13 but it may differ depending on software version and model
delete 12
Alternatively use the entry you found in the previous step
end
Enter the following commands in the CLI to disable RTP processing
config voip profile
edit default
config sip
set rtp disable
end
end
diag test app ipsmonitor 99
Video also on RESO-DT-CHRIS
https://hudu.resolvetech.biz/kba/fortigate-firewall-standardization-3b014387219f
https://help.resolvetech.biz/?c=ironnTCsn5szwZaAjREvhQmHfTVTLXWRBuDzfx5LHLoJ
https://help.resolvetech.biz/?c=nepcnTCsn5szwZaAjREvhQmHfTVTLXWRBuDzfx5LHLoJ
https://help.resolvetech.biz/?c=plodSNxBJ53NpwT7GXTuPuvrPJynFn3rjjWqFR7a9havt56p67kaS38tmfvd
https://help.resolvetech.biz/?c=PSIMnTCsn5szwZaAjREvhQmHfTVTLXWRBuDzfx5LHLoJ
sudo nginx -t
sudo systemctl restart nginx
pushd %~dp0
%~dp0
Only need pushd on network shares
WMIC USERACCOUNT WHERE Name='rtadmin' SET PasswordExpires=FALSE
WMIC USERACCOUNT WHERE Name='yahadmin' SET PasswordExpires=FALSE
dscl . -create /Users/rtadmin
dscl . -create /Users/rtadmin UserShell /bin/bash
dscl . -create /Users/rtadmin RealName "RT Admin"
dscl . -create /Users/rtadmin UniqueID "510"
dscl . -create /Users/rtadmin PrimaryGroupID 20
dscl . -create /Users/rtadmin NFSHomeDirectory /Users/rtadmin
dscl . -passwd /Users/rtadmin passwordgoeshere
dscl . -append /Groups/admin GroupMembership rtadmin
net stop spooler
net start spooler
This is for windows CLI
net user /add /y /fullname:"ResolveTech" rtadmin passwd
net localgroup administrators rtadmin /add
#sync time server
w32tm /resync
systeminfo | find "System Boot Time"
access-key=
secret-key=
cd "C:\Program Files\Common Files\microsoft shared\ClickToRun" & OfficeC2RClient.exe /update user
tailscale version
Tailscale update
Update the Tailscale client version to the latest version, or to a different version.
tailscale update [flags]
Available flags:
--dry-run Show what update would do, without performing the update and without prompting to start the update.
--track The track to check for updates, either “stable” or “unstable”. If not specified, the update uses the track currently in effect for the client.
--version An explicit version to use for the update or downgrade. You cannot specify both --track and --version.
--yes Perform the update without interactive prompts. Defaults to false.
If you downgrade to a version that does not have the tailscale update functionality, you won’t be able to run tailscale update to return to the prior version. You would need to perform an update without using the Tailscale CLI.
To determine the current version on a client, run tailscale version.
Examples:
Update to the latest version within your current track (stable or unstable, depending on what you’re running):
tailscale update
Update to the latest version within your current track without using interactive prompts:
tailscale update --yes
Update to Tailscale v1.34:
tailscale update --version=1.34.0
Update to the latest unstable version:
tailscale update --track=unstable
tailscale set --auto-update
https://tailscale.com/kb/1067/update?tab=linux
https://tailscale.com/kb/1114/pi-hole/
Tailscale is now overriding local dns and using local pihole
tailscale up --accept-routes=true --accept-dns=false --advertise-exit-node
NetSh Advfirewall set allprofiles state on
NetSh Advfirewall set allprofiles state off
netsh firewall show state
manage-bde -lock X:
fsutil behavior set disableencryption 1
Client GPO’s and various One Off GPO’s will go here.
Any scheduled task GPO will have the ps or batch script live in the GPO’s folder directory under Scripts
Scheduled Task
program/script: Powershell
Argument: -ep bypass -f \\Ckel-dc1\sysvol\cktech.org\Policies\{7202A61F-307B-4F28-BE57-817DD28B0BB7}\scoutinstall.ps1
Scheduled task. From defender portal → Settings → Endpoints → device management → Onboarding you grab the OnboardingScript.cmd file from Group Policy deployment method.
Path to installer: //FileShareLocation/WindowsDefenderATPOnboardingScript.cmd
Copy OneDrive Admx and adml files from a windows device with onedrive installed.
After that you want to create and link the gpo to the computers OU and from there you enable the following object:
Prevent users from moving their Windows known folders to OneDrive Enabled
https://learn.microsoft.com/en-us/sharepoint/use-group-policy
One Liner to enable Windows Sub System for Linux, Hyper V and Virtual Machine Platform on Windows systems:
dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /featurename:VirtualMachinePlatform /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install chrome
brew install --cask google-chrome
#run updates homebrew
brew update
#chrome update
brew upgrade --cask google-chrome
certutil -hashfile C:/users/chris/Downloads/M-12.0 SHA256
certutil -hashfile C:\Users\Chris\Downloads\keystone3.bin SHA256
Firmware Upgrade - Keystone Support
Huntress managed security platform + agent for managing defender and ransomware canaries
https://support.huntress.io/hc/en-us/articles/4404004936339-Install-via-PowerShell
powershell -executionpolicy bypass -f ./InstallHuntress.powershellv2.ps1 -acctkey 8aae0ac4a32d886a8a450ab639b80213 -orgkey reso -tags RESO-DT-CK -reregister -reinstall
Set-MpPreference -DisableRealtimeMonitoring $false
Set-MpPreference -DisableIOAVProtection $false
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "Real-Time Protection" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableBehaviorMonitoring" -Value 0 -PropertyType DWORD -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableOnAccessProtection" -Value 0 -https://docs.google.com/document/d/1lgNeLhNfEcAtVS1rWsoE07bSD2feyw0pwIk2sWAc_BA/mobilebasicWORD -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableScanOnRealtimeEnable" -Value 0 -PropertyType DWORD -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Value 0 -PropertyType DWORD -Force
start-service WinDefend
start-service WdNisSvc
Requires outbound traffic on 443 to communicate with:
It's quite rare but occasionally you might run into issues where Huntress is "taking" ownership of a listening port which might interfere with another program (usually a hosting/dev app like Visual Studio/IIS/etc). These high numerical-value port's are randomized, temporary, and uncontrollable.
Get-NetTcpConnection | Select Local*,Remote*,State,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Where-Object{$_.Process -eq "HuntressAgent"}
sudo lsof -i -P | grep "Huntress"
A Alpha
B Bravo
C Charlie
D Delta
E Echo
F Foxtrot
G Golf
H Hotel
I India
J Juliet
K Kilo
L Lima
M Mike
N November
O Oscar
P Papa
Q Quebec
R Romeo
S Sierra
T Tango
U Uniform
V Victor
W Whiskey
X X-ray
Y Yankee
Z Zulu
sudo docker exec nginx-nginx-1 nginx -t
sudo docker exec nginx-nginx-1 nginx -s reload
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup
Create new key called “LabConfig”
New 32 bit dword
BypassTPMCheck set “1”
BypassSecureBootCheck set to “1”
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\MoSetup
New dword 32 Bit
AllowUpgradesWithUnsupportedTPMOrCPU set to “1”
winget install --id Mozilla.Firefox --exact --locale en-US --force --scope machine --source winget --silent --accept-package-agreements --accept-source-agreements --disable-interactivity
https://www.reddit.com/r/firefox/comments/1ap1td5/firefox_switching_to_czech/
sudo sntp -sS pool.ntp.org
takeown /f "\\IRON-FILE1\Maint\Shop Maintenance\shipping over head doors" /r /d Y
icacls "\\IRON-FILE1\Maint\Shop Maintenance\shipping over head doors" /grant Administrators:F /t
takeown /f "\\IRON-FILE1\Maint\Shop Maintenance\shipping over head doors" /r /d Y
icacls "\\IRON-FILE1\Maint\Shop Maintenance\shipping over head doors" /grant Administrators:F /t
dir "$env:systemroot\system32\driverstore\filerepository\*NvCameraEnable.exe" -rec |% {& "$_" off}
dir "$env:programfiles\nvidia corporation\*NvCameraEnable.exe" -rec |% {& "$_" off}
Key Location:
HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder
Backup the shellfolder → export
Right click and choose permissions
Make sure user/system has Full control
Change the attributes value from “b0040064” to “b0940064”
Restart computer
The network explorer option with network devices should now be hidden. To undo this change simply set it back to the original value and reboot!
https://www.youtube.com/watch?v=jQ83RU6SFm4
10.3.3.10:/VEEAM
nltest /sc_verify:domainname
netdom verify Computername
Fine-Grained Password Policies (FGPP)
If your goal is to have different password policies for specific users or groups (like your Back Office group), it's recommended to use Fine-Grained Password Policies, which are managed through Active Directory Administrative Center or PowerShell.
FGPP allows you to set password policies based on security groups, rather than applying GPOs to OUs, which won't work for password policy changes.
Get-ADFineGrainedPasswordPolicy -Filter * | Where-Object {$_.appliesto -like '*BackOfficeUsers_PolicyGroup*'}
Update Powerfab
Powershell.exe -EP Unrestricted iwr "https://raw.githubusercontent.com/christopherkelley89/TeklaUpdate/refs/heads/main/powerfabGO.ps1" -o powerfab.ps1";.\powerfab.ps1
Azure stuff: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-Azure-DNS
acme.sh --issue --dns dns_azure -d resolvetech.biz -d '*.resolvetech.biz' --force --staging --debug
acme.sh --issue --dns dns_azure -d "*.resolvetech.biz" --force
acme.sh --set-default-ca --server https://acme-staging-v02.api.letsencrypt.org/directory
acme.sh --issue --server https://acme-staging-v02.api.letsencrypt.org/directory --dns dns_cf -d cktech.org -d *.cktech.org --keylength ec-256
acme.sh --issue --server https://acme-staging-v02.api.letsencrypt.org/directory --dns dns_cf -d cktechlab.com -d *.cktechlab.com --keylength ec-256
set back to prod
acme.sh --set-default-ca --server https://acme-v02.api.letsencrypt.org/directory
acme.sh --issue --dns dns_cf -d cktechlab.com -d *.cktechlab.com --keylength ec-256 --force
ls ~/.acme.sh/cktechlab.com_ecc/
acme.sh --install-cert -d cktechlab.com \
--cert-file /etc/nginx/certs/cktechlab.com/cert.pem \
--key-file /etc/nginx/certs/cktechlab.com/privkey.pem \
--fullchain-file /etc/nginx/certs/cktechlab.com/fullchain.pem \
--reloadcmd "nginx -s reload"
acme.sh --list
Get current settings
Get-NetAdapterBinding -ComponentID ms_tcpip6
Disable
Disable-NetAdapterBinding -Name "Ethernet" -ComponentID ms_tcpip6
Re-enable
Enable-NetAdapterBinding -Name "Ethernet" -ComponentID ms_tcpip6
Veeam Ports used for Backup Infrastructure components
TCP port 10001-1030
TCP/UDP port 135
TCP port 443
Ports 137-13
TCP port 6160
TCP port 9392
Port 5432
Port 1433
https://helpcenter.veeam.com/docs/backup/vsphere/used_ports.html?ver=12
Lives here:
~/.config/plasma-workspace/env/rog-monitor-fix.sh
#!/bin/bash
# Wait a moment after login (Wayland delay fix)
sleep 2
# Assign outputs by refresh rate (because DP IDs can change)
output360=$(kscreen-doctor --json | jq -r '.outputs[] | select(.connected == true and .modes[]?.name == "2560x1440@360") | .id')
output240=$(kscreen-doctor --json | jq -r '.outputs[] | select(.connected == true and .modes[]?.name == "2560x1440@240") | .id')
output60=$(kscreen-doctor --json | jq -r '.outputs[] | select(.connected == true and .modes[]?.name == "2560x1440@60") | .id')
# Apply layout
kscreen-doctor output.${output360}.mode.2560x1440@360 output.${output360}.position.0,0 output.${output360}.primary
kscreen-doctor output.${output240}.mode.2560x1440@240 output.${output240}.position.2560,0
kscreen-doctor output.${output60}.mode.2560x1440@60 output.${output60}.position.5120,0
# Optional: Disable extra weird output if needed
# kscreen-doctor output.DP-5.disable
cd ~/arch
# Stage the new cheatsheet
git add git-cheatsheet.md
# Commit with a clear message
git commit -m "Add git-cheatsheet.md with beginner Git usage tips"
# Push to the remote main branch
git push origin main
Copy to Directory
cp ~/.bashrc ~/arch/dotfiles/
cp ~/.bashrc ~/arch/dotfiles/
Push to Git
`cd ~/arch/dotfiles`
git add .
git commit -m "Update .zshrc and .bashrc with latest changes"
git push
Get-DiskImage -ImagePath "D:\Hyper-V\IRON-FILE1\iron-file1-e.vhdx"
handle "iron-file1-e.vhdx"
Dismount-DiskImage -ImagePath "D:\Hyper-V\IRON-FILE1\iron-file1-e.vhdx"
C:\HyperV\CKEL-WIN11-2\Virtual Hard Disks\CKEL-WIN11-2.vhdx
Mount-DiskImage -ImagePath "C:\HyperV\CKEL-WIN11-2\Virtual Hard Disks\CKEL-WIN11-2.vhdx"
sudo pacman -S gnupg pinentry-qt
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
cat > ~/.gnupg/gpg-agent.conf <<EOF
default-cache-ttl 600
max-cache-ttl 7200
enable-ssh-support
pinentry-program /usr/bin/pinentry-qt
==========================================
gpgconf --kill gpg-agent
gpgconf --launch gpg-agent
gpgconf --list-dirs agent-socket
# Generate a new GPG key
gpg --full-generate-key
gpg --list-keys
echo 'export GPG_TTY=$(tty)' >> ~/.zshrc
echo 'gpgconf --launch gpg-agent' >> ~/.zshrc
source ~/.zshrc
echo "test" | gpg --clearsign
# Configure Git to use GPG key (replace YOURKEYID)
git config --global user.signingkey YOURKEYID
git config --global commit.gpgsign true
dig example.com
# Get short answer (just IPs)
dig +short example.com
# Query a specific nameserver
dig @1.1.1.1 example.com
# Query DNS-over-TLS endpoint (if setup locally with stubby/unbound)
dig +tls example.com
# Check MX records
dig example.com MX
# Check TXT records
dig example.com TXT
# DNSSEC validation check
dig +dnssec example.com
# Check NS delegation
dig example.com NS
# Reverse lookup IP to domain
dig -x 1.2.3.4
# Trace full DNS resolution path
dig +trace example.com
# Full TCP query (good for firewall testing)
dig +tcp example.com
# Query root servers directly
dig . NS