This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.microsoft.com/en-us/software-download/windows11 | |
# Select > Download Windows 11 Disk Image (ISO) for x64 devices | |
# Self-elevate if not running as administrator | |
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
Write-Host "Script is not running as administrator. Attempting to relaunch with elevated privileges..." | |
Start-Process -FilePath "powershell.exe" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -File `"$PSCommandPath`"" -Verb RunAs | |
exit | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": | |
[ | |
{ | |
"command": "find", | |
"keys": "ctrl+shift+f" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzLocation -ExtendedLocation $true | ConvertTo-Json -Depth 100 > microsoft-azure-datacenters.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip uninstall -y (pip freeze) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns the equivalent of a type after running it through JSON.parse(JSON.stringify(object)) | |
type MethodKeys<T> = { | |
[P in keyof T]: T[P] extends (...args: any[]) => any ? P : never; | |
}[keyof T]; | |
export type JsonParsed<T> = Omit<T, MethodKeys<T>>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generateKeyPair } from 'node:crypto'; | |
export class EmailDkimGenerator { | |
public generate(selector?: string | string[]) { | |
return new Promise<{ dkimDnsRecord: { name: string; content: string }; privateKey: string }>((resolve, reject) => { | |
generateKeyPair( | |
'rsa', | |
{ | |
modulusLength: 2048, | |
publicKeyEncoding: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the standard Docker image for the latest Long-Term Support (LTS) version of Node.js. It's built on top of a Debian-based image and includes a full installation of Node.js and npm. It's quite large in size, but it has wide compatibility and includes a number of common system libraries and dependencies | |
FROM node:lts | |
# The "slim" image is a smaller version of the standard image. It's also based on Debian, but it excludes a lot of the additional software included in the standard image. This can make it more appropriate for production deployments where you want to minimize the size of your Docker images, but you may need to manually install additional system dependencies that your Node.js application requires | |
FROM node:lts-slim | |
# The "alpine" image is even smaller than the "slim" image. It's built on top of the Alpine Linux distribution, which is designed to be very lightweight. The reduced size comes at the cost of using a different libc (musl instead of glibc) and having fewer preinstalled system libra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/steam/.steam/steam/steamapps/common/SatisfactoryDedicatedServer/FactoryGame/Saved/Logs/*.log { | |
daily | |
rotate 7 | |
compress | |
delaycompress | |
missingok | |
notifempty | |
create 0644 steam steam | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Secure example | |
After=network-online.target | |
BindsTo=network-online.target | |
[Service] | |
# Use `systemd-analyze security <service name>` to test | |
# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html for options | |
DynamicUser=true | |
ProtectHome=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-Content -Path $env:USERPROFILE\Desktop\ad-accounts.txt -Value "Generated on $(Get-Date)" | |
Add-Content -Path $env:USERPROFILE\Desktop\ad-accounts.txt -Value "" | |
$response = Invoke-RestMethod -Uri "https://randomuser.me/api?inc=name,picture&nat=GB,US&results=$(Read-Host "Number of users to generate")&noinfo" | |
foreach ($generatedUser in $response.results) { | |
Add-Content -Path $env:USERPROFILE\Desktop\ad-accounts.txt -Value ("Name: " + $generatedUser.name.first + " " + $generatedUser.name.last) | |
Add-Content -Path $env:USERPROFILE\Desktop\ad-accounts.txt -Value ("Username: " + $generatedUser.name.first + "." + $generatedUser.name.last).ToLower() | |
$genPlainPassword = [System.Web.Security.Membership]::GeneratePassword(25, 1) | |
Add-Content -Path $env:USERPROFILE\Desktop\ad-accounts.txt -Value ("Password: " + $genPlainPassword) | |
$genPassword = ConvertTo-SecureString $genPlainPassword -AsPlainText -Force | |
$newUser = New-ADUser -PassThru -AccountPassword $genPassword ` |
NewerOlder