Skip to content

Instantly share code, notes, and snippets.

@scuq
scuq / VsCodeUpdate.ps1
Created November 15, 2022 19:14
quick and dirty vscode update
Write-host "Disable Certificate checks"
Add-Type @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
@scuq
scuq / list_contains_fast.py
Created November 5, 2015 23:49
dirty divide-and-conquer python function list_contains_fast.py
def list_contains_fast(largelist,startwithstr):
listsize=len(largelist)
#print "list_contains_fast"+str(listsize)
if listsize <= 500:
for listentry in largelist:
if startwithstr.startswith(listentry):
return True
return False
@scuq
scuq / get-roaming.ps1
Created October 11, 2015 21:19
powershell remote read event log (Microsoft-Windows-WLAN-AutoConfig) for roaming event of client
Param ([string]$hostname=(Read-Host "Enter Hostname"))
[int]$lasthours=(Read-Host "How many hours of eventlog? default 8")
$addhours = 8;
if ($lasthours) {
$addhours = $lasthours
}
if ($hostname) {
@scuq
scuq / ADV_LDAP_PROBE.tcl
Created October 11, 2015 21:16
cisco ace loadbalancer A2(2.4) advanced ldap probe
#!name = ADV_LDAP_PROBE
########################################################################################
#### > user for linux tclsh !/usr/bin/tclsh8.4
# changes to cisco's original probe
# * username and password with ldap simple bind (dynamically generated packets)
# * unable to connect exception handling
# * debug message for invalidCredentials
#-------------------------------------------
# debug procedure
# set the EXIT_MSG environment variable to help debug
@scuq
scuq / firewall-blockappdata.bat
Created October 11, 2015 21:03
configure windows firewall, block outbound traffic from .exe/binary located in %appdata%
netsh advfirewall reset
netsh advfirewall set allprofiles logging droppedconnections enable
netsh advfirewall set allprofiles logging maxfilesize 4096
netsh advfirewall set allprofiles logging filename %systemroot%\system32\LogFiles\Firewall\pfirewall.log
netsh advfirewall set allprofiles firewallpolicy allowinbound,allowoutbound
netsh advfirewall set allprofiles state on
@scuq
scuq / backup-appdata.bat
Created October 11, 2015 21:01
backup %appdata% with 7z
taskkill /F /T /IM firefox.exe
taskkill /F /T /IM application.xyz
taskkill /F /T /IM application2.xyz
set backuplib="z:\backup\"
set SAVESTAMP=%DATE:/=-%@%TIME::=-%
"7z.exe" a -r %backuplib%appdata_%SAVESTAMP%.7z %appdata%
@scuq
scuq / remove_provpackages_w10.ps1
Created October 11, 2015 20:56
remove provisioned (built-in) apps in windows 8/10
$AppList = "Microsoft.BingFinance",
"Microsoft.3DBuilder",
"Microsoft.Appconnector",
"Microsoft.BingFoodAndDrink",
"Microsoft.Getstarted",