Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yerttle's full-sized avatar
💭
Oh Kittens

Mark Hobart yerttle

💭
Oh Kittens
  • RoboShadow
  • Essex
View GitHub Profile
# Registry paths to check
$registryPaths = @(
"HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PublicProfile",
"HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile",
"HKLM:\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile"
)
# Loop through each path and get the EnableFirewall value
foreach ($path in $registryPaths) {
try {
import random
hobbies = ['a', 'b', 'c']
hobbies_wieghts = [70, 20, 10]
def choice_hobby():
# list enumerate here wraps the arrary in a list so choices returns the indexes
c = random.choices(list(enumerate(hobbies)), weights=hobbies_wieghts, k=1)
# For the first item in the list get the first item in the inner list
arrary_index = c[0][0]
@yerttle
yerttle / init.vim
Last active March 16, 2022 10:09
Vim Config
syntax enable
set exrc
set relativenumber
set nu
set hidden
set noerrorbells
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
@yerttle
yerttle / sophosremoval.bat
Last active December 14, 2018 13:12 — forked from Coopeh/sophosremoval.bat
Sophos Removal Script
@ECHO OFF
ECHO ====================================================================
ECHO Sophos Removal v1.0 - Ed Cooper 2014
ECHO Removes Sophos v7 - v10
ECHO ====================================================================
ECHO.
ECHO.
IF NOT EXIST "%~dp0\msizap.exe" GOTO MSIZAPNOTFOUND
ECHO Administrative permissions required. Detecting permissions...
ECHO.
@yerttle
yerttle / UnitTestSnippet2.snippet
Created December 4, 2018 09:33
Snippet for UnitTesting Structure
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CodeSnippet Format="1.0.0">
<Header>
<Title>NUnit</Title>
<Author>Mark</Author>
<Description></Description>
<HelpUrl />
<Keywords />
<SnippetTypes />
{
"num_words": 4,
"word_length_min": 4,
"word_length_max": 4,
"case_transform": "CAPITALISE",
"separator_character": "NONE",
"padding_digits_before": 0,
"padding_digits_after": 2,
"padding_type": "FIXED",
"padding_character": "RANDOM",