Skip to content

Instantly share code, notes, and snippets.

@tylerapplebaum
tylerapplebaum / Get-Traceroute.ps1
Last active July 23, 2025 18:38
MTR for Powershell
<#
.SYNOPSIS
An MTR clone for PowerShell.
Written by Tyler Applebaum.
Version 2.1
.LINK
https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2
http://www.team-cymru.org/IP-ASN-mapping.html#dns
dynu.com
dyn.com
no-ip.com
noip.com
changeip.com
afraid.org
duckdns.org
dnsdynamic.org
duiadns.net
myonlineportal.com
@alirobe
alirobe / reclaimWindows10.ps1
Last active October 22, 2025 05:28
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@kitmenke
kitmenke / finderrors.ps1
Created August 1, 2016 02:45
Working in progress: powershell script to automatically fix DCOM errors which show up in the event log
# Get-EvengLog doesn't quite work I guess:
# https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources#
# Get-EventLog Application -EntryType Error -Source "DistributedCOM"
# The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
#$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*"
# 2 is error
# 3 is warning
$EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID"
# Search for System event log ERROR entries starting with the specified EVT_MSG
$logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1
@automationhaus
automationhaus / Remove-UserProfilesRemote.ps1
Last active January 21, 2017 02:00
Remotely Remove User Profiles from RDS or Citrix Session Host Servers
<#
I broke out the Get-CIMInstance and Get-WMIObject types for a couple of reasons. 1. Because I kept running into issues on 2008 R2
where CIM wasn't working due to the fact they aren't configured for remoting out of the box like 2012 servers are. 2. In order to
train system admins on how to use both versions in case one or the other doesn't work for them. Here, I break down the two based
on the version of the OS but you can elect to use one or the other depening on your environment. In CIM you can specify the protocol
type which could help eliminate the need for the WMI version but the WMI version will be supported on servers with older versions
of PowerShell.
#>
#Specifying the EAP
$ErrorActionPreference = "Stop"

Kafka installation with systemd

0. Create kafka user

sudo adduser kafka
sudo adduser kafka sudo
su -l kafka

1. Download and Install kafka archive

@automationhaus
automationhaus / Get-SecurityLogs.ps1
Last active January 21, 2017 02:03
PowerShell function used to collect security events from a list of servers using a start date, end date, username or domain as needed
function Get-SecurityLogs
{
<#
.SYNOPSIS
Pulls security logs from the given list of computers using the given date range
.DESCRIPTION
Using the computername, startdate and enddate parameters you can pull the event logs for the given computers. Once the data is collected to a variable you can alter the output as needed.
.EXAMPLE
PS>Get-SecurityLogs
Collects the security logs for the last day on the local machine
@automationhaus
automationhaus / Get-ServiceAccounts.ps1
Last active January 21, 2017 02:05
Checks each server in the list of given computers for non-System accounts used in services and non-Microsoft scheduled tasks
function Get-ServiceAccounts
{
<#
.SYNOPSIS
Reaches out to the given servers to get service accounts used in services and scheduled tasks
.DESCRIPTION
Checks each server in the list of given computers for non-System accounts used in services and non-Microsoft scheduled tasks
.EXAMPLE
Get-ServiceAccounts -ComputerName "SERVER1","SERVER2" -CSV
.NOTES
@jalogisch
jalogisch / dnsmasq_clean_message
Last active April 17, 2017 12:04
pi-hole / dnsmasq pipeline rules to use with graylog pipeline rules
rule "dnsmasq clean message"
when
has_field("programname") AND contains(to_string($message.programname), "dnsmasq")
then
let m = regex("^.+: (.+)$", to_string($message.message));
let clean_message = m["0"];
// Set a better message field without the prefix clutter.
set_field("message", clean_message);
end
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev