Skip to content

Instantly share code, notes, and snippets.

@sunnyc7
sunnyc7 / NiftyETWProviders.json
Created January 24, 2020 16:17 — forked from mattifestation/NiftyETWProviders.json
ETW providers you never knew existed...
[
{
"ProviderGUID": "72d164bf-fd64-4b2b-87a0-62dbcec9ae2a",
"ProviderName": "AccEventTool",
"ProviderGroupGUID": "4f50731a-89cf-4782-b3e0-dce8c90476ba",
"AssociatedFilenames": [
"accevent.exe",
"inspect.exe",
"narrator.exe",
"srh.dll"
@sunnyc7
sunnyc7 / haproxy.cfg
Created January 29, 2019 17:32 — forked from GABeech/haproxy.cfg
Stack Exchange HAProxy
# This is an example of the Stack Exchange Tier 1 HAProxy config
# The only things that have been changed from what we are running are:
# 1. User names have been removed
# 2. All Passwords have been remove
# 3. IPs have been changed to use the example/documentation ranges
# 4. Rate limit numbers have been changed to randome numbers, don't read into them
userlist stats-auth
group admin users $admin_user
user $admin_user insecure-password $some_password
@sunnyc7
sunnyc7 / README.md
Created January 13, 2019 17:46 — forked from theArjun/README.md
Tower Of Hanoi by Recursion in Java

Tower of Hanoi

How's it is solved ?

Tower Of Hanoi

Long steps ahead

Steps for Tower Of Hanoi

To know more :

@sunnyc7
sunnyc7 / ConvertXLS.ps1
Created November 19, 2018 22:05 — forked from gabceb/ConvertXLS.ps1
Powershell script to convert all xls documents to xlsx in a folder recursively
$xlFixedFormat = [Microsoft.Office.Interop.Excel.XlFileFormat]::xlOpenXMLWorkbook
write-host $xlFixedFormat
$excel = New-Object -ComObject excel.application
$excel.visible = $true
$folderpath = "C:\Users\gabceb\Documents\testXLS"
$filetype ="*xls"
Get-ChildItem -Path $folderpath -Include $filetype -recurse |
ForEach-Object `
{
$path = ($_.fullname).substring(0, ($_.FullName).lastindexOf("."))
@sunnyc7
sunnyc7 / Example_WMI_Detection_EventLogAlert.ps1
Created September 21, 2018 21:38 — forked from mattifestation/Example_WMI_Detection_EventLogAlert.ps1
An example of how to use permanent WMI event subscriptions to log a malicious action to the event log
# Define the signature - i.e. __EventFilter
$EventFilterArgs = @{
EventNamespace = 'root/cimv2'
Name = 'LateralMovementEvent'
Query = 'SELECT * FROM MSFT_WmiProvider_ExecMethodAsyncEvent_Pre WHERE ObjectPath="Win32_Process" AND MethodName="Create"'
QueryLanguage = 'WQL'
}
$InstanceArgs = @{
Namespace = 'root/subscription'
@sunnyc7
sunnyc7 / service-checklist.md
Created November 20, 2017 23:22 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@sunnyc7
sunnyc7 / jessfraz.md
Created November 20, 2017 23:21 — forked from acolyer/jessfraz.md
Containers, operating systems and other fun things from The Morning Paper
@sunnyc7
sunnyc7 / Struct.ps1
Created April 28, 2017 09:59 — forked from proxb/Struct.ps1
Using PowerShell and Reflection to dynamically build a Struct with Constructors and Methods
#region Module Builder
$Domain = [AppDomain]::CurrentDomain
$DynAssembly = New-Object System.Reflection.AssemblyName(([guid]::NewGuid().ToString()))
$AssemblyBuilder = $Domain.DefineDynamicAssembly($DynAssembly, [System.Reflection.Emit.AssemblyBuilderAccess]::Run) # Only run in memory
$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(([guid]::NewGuid().ToString()), $False)
#endregion Module Builder
#region STRUCTs
#Order of creating these Structs is important
#region MyStruct
$Attributes = 'AutoLayout, AnsiClass, Class, Public, SequentialLayout, Sealed, BeforeFieldInit'
@sunnyc7
sunnyc7 / VSCodeDeepDive.md
Created April 17, 2017 12:05 — forked from daviwil/VSCodeDeepDive.md
The notes from my session "Authoring in VS Code" at the 2017 PowerShell and DevOps Global Summit in Bellevue, WA.

Visual Studio Code Deep Dive

David Wilson - @daviwil Software Engineer, PowerShell Team

Overview

  1. Visual Studio Code overview
  2. Configuring the editor
  3. Extensions
import random
class Markov(object):
def __init__(self, open_file):
self.cache = {}
self.open_file = open_file
self.words = self.file_to_words()
self.word_size = len(self.words)
self.database()