Skip to content

Instantly share code, notes, and snippets.

View asears's full-sized avatar

Andrew Sears asears

View GitHub Profile
"""
Toy demonstration of chain-of-thought and consensus prompting using OpenAI API.
© Riley Goodside 2022
"""
import os
import re
from statistics import mode
@nateraw
nateraw / stable_diffusion_walk.py
Created August 18, 2022 05:59
Walk between stable diffusion text prompts
"""
Built on top of this gist by @karpathy:
https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355
stable diffusion dreaming over text prompts
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stable_diffusion_walk.py --prompts "['blueberry spaghetti', 'strawberry spaghetti']" --seeds 243,523 --name berry_good_spaghetti
@pinakighatak
pinakighatak / AzFunctionsDeploy.bicep
Created March 21, 2022 20:10
Azure Functions Deployment with Bicep
// ****************************************
// Azure Bicep main template
// This bicep template demonstrates provisioning Azure function that implements OpenAPI specifications.
// Optinally this Azure Function endp-point can be published to an existing API Management - witin a Product
// Last Update : 17-Feb-2022
// ****************************************
targetScope = 'resourceGroup'
param functionRuntime string = 'dotnet'
param logAnalyticsWorkspaceName string = 'la-${uniqueString(resourceGroup().id)}'
@SwitHak
SwitHak / 20211210-TLP-WHITE_LOG4J.md
Last active May 14, 2024 11:08
BlueTeam CheatSheet * Log4Shell* | Last updated: 2021-12-20 2238 UTC

Security Advisories / Bulletins / vendors Responses linked to Log4Shell (CVE-2021-44228)

Errors, typos, something to say ?

  • If you want to add a link, comment or send it to me
  • Feel free to report any mistake directly below in the comment or in DM on Twitter @SwitHak

Other great resources

  • Royce Williams list sorted by vendors responses Royce List
  • Very detailed list NCSC-NL
  • The list maintained by U.S. Cybersecurity and Infrastructure Security Agency: CISA List
$subscription = 'dd0d4271-9b26-4c37-a025-1284a43a4385';
$observations = @{};
foreach ($resourceGroupName in @('taskcluster-staging-workers-us-central')) {
$observations[$resourceGroupName] = @{};
while (($vms = @(Get-AzVm -ResourceGroupName $resourceGroupName -Status)) -or ($vms.Length -gt 0)) {
Write-Output -InputObject ('{0} virtual machines observed in {1}' -f $vms.Length, $resourceGroupName);
foreach ($vm in $vms) {
$name = $vm.Name;
if (-not $observations[$resourceGroupName].ContainsKey($name)) {
$observations[$resourceGroupName][$name] = @{};
@kentcdodds
kentcdodds / package.json
Last active April 30, 2024 05:39
setup script for my workshops
{
"name": "workshop-setup",
"version": "1.0.0",
"description": "This is the common setup script for most of my workshops",
"bin": "./setup.js"
}
'''
YouTube FileStorage v0.0
requires: ffmpeg, youtube-dl
'''
import os
import shutil
import sys
import numpy as np
from scipy.spatial import cKDTree
# git clone https://github.com/NVlabs/stylegan2
import os
import numpy as np
from scipy.interpolate import interp1d
from scipy.io import wavfile
import matplotlib.pyplot as plt
import PIL.Image
import moviepy.editor
import dnnlib
#!/bin/bash
# git clone https://github.com/shawwn/stylegan2 -b tpu
source "$HOME/bin/activate-tf1"
set -x
#export TPU_NAME=grpc://0.tcp.ngrok.io:15992
export TPU_NAME=grpc://0.tcp.ngrok.io:17042
export GCE_BUCKET=gs://sgappa-multi/stylegan-encoder
@asears
asears / Install-Apps.ps1
Last active February 26, 2024 13:37
Chocolatey Installs for a new Windows PC build (2020) - Don't run this, reference only.
# Run as Administrator in Powershell prompt
# Or better yet, don't do that
# https://chocolatey.org/
# Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Restart shell as administrator
# Restart pc after each install requiring restart.
choco feature enable -n allowGlobalConfirmation
# Sudo for Windows (Run as Administrator in command prompt)
# Chocolatey installs are run as admin