Skip to content

Instantly share code, notes, and snippets.

View JoshRSec's full-sized avatar
🏠
Working from the cave

JoshRSec

🏠
Working from the cave
View GitHub Profile
@JoshRSec
JoshRSec / intel-ssd-8mb-bug.md
Created February 12, 2023 16:15 — forked from sshilko/intel-ssd-8mb-bug.md
Intel SSD 8mb bug Fix

Intel SSD 8mb bug Fix

How To Fix Intel SSD 8MB bug Using Linux Terminal

Persian Article is Available On Academia.edu

Also You Can Read This Article In My Blog sirvan.me

@JoshRSec
JoshRSec / Get-TermsInDocx.ps1
Created January 29, 2020 16:42
A script to automate searching for a term inside docx files within a directory
$searchPath = "C:\linktoyourfolder\"
Write-Host "Enter search term:" -BackgroundColor Yellow
$searchTerm = Read-Host
#Create an instance of word
$Word=NEW-Object –comobject Word.Application
$Word.visible = $False
#Make a list of .docx files
####################################################################################
#Enter your API Key
$APIKey = "YOURAPIKEY"
#Enter your list of emails (Seperated by a new line)
$emailListPath = "C:\emails.txt"
#Enter the folder to where the reports will be stored
$reportFolderPath = "C:\
Hello
World
\u00A74
\u00A7c
\u00A76
\u00A7e
\u00A72
\u00A7a
\u00A7b
\u00A73
\u00A71
\u00A79
#Location of the MOTD list file
$MOTDListDir = "C:\MOTD\MOTD.txt"
#Location of the MC colour chart
$ColourChartDir = "C:\MOTD\ColourChart.txt"
#Location of the server.properties file
$serverPropertiesDir = "C:\server.properties"
#Default prefix for the server
$MOTDPrefix = "\u00A7a\u00A7lServer Name
@JoshRSec
JoshRSec / Find-ADUser-AddTo-DistGroup.ps1
Created October 28, 2019 11:48
Adds users from Active Directory to a distribution group on Exchange online
#The Distribution group we are looking to add users to
$DistributionGroup = [email protected]
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
#Get Members of the desired distribution group
$DistributionGroupArr = Get-DistributionGroupMember -Identity $($DistributionGroup) | Select PrimarySmtpAddress
$DistributionGroupCount = $DistributionGroupArr | Measure-Object
Add-ToZIP -FileSourceDirectory "C:\inetpub\logs\LogFiles\W3SVC2" -ZipDestinationDirectory "C:\inetpub\logs\LogFiles\W3SVC2" -FileType log -CleanOnZip -GroupFilesByDay -Verbose
Function Add-ToZIP {
<#
.Synopsis
Adds files to ZIP archive based on last write time
.DESCRIPTION
This function adds files to an ZIP archive, with the option to group by day as well as delete source file after archiving,
.NOTES
Name : Add-ToZIP
$quitBool = $false
$LogLocation = "M:\DesiredLogLocation\"
$javaLocation= "C:\Program Files\Java\jre1.8.0_201\bin\java.exe" #This may differ depending on your set-up
cls
Set-Location "M:\MinecraftFolderContainingJarFile"
$runningChecks = 0
#Make Log dir if not present
if (Test-Path $($LogLocation)){
}