Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
peteristhegreat / read_char_star_dll_vba.vbs
Last active October 31, 2024 14:50
Read a char* from a dll in vba
Option Explicit
Declare PtrSafe Function lstrlenA Lib "kernel32" (ByVal lpString As LongPtr) As Long
Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
ByVal Destination As String, ByVal Source As LongPtr, ByVal length As Long)
Private Declare PtrSafe Function api_get_message Lib "C:\tools\my-api\bin\mydll.dll" () As LongPtr
Function PtrToStringAnsi(ByVal lpString As LongPtr) As String
@peteristhegreat
peteristhegreat / argo-serviceaccount-setup.yaml
Last active January 13, 2025 02:58
Getting Started with Argo Workflows 2024
apiVersion: v1
kind: ServiceAccount
metadata:
name: argo
namespace: default
annotations:
meta.helm.sh/release-name: argo-3
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
@peteristhegreat
peteristhegreat / instagram-download-images-videos.md
Created October 24, 2024 11:59
Instagram, Download Images/Videos

The way that facebook has written their pages for instagram, there is so much indirection on where a image is comming from, it is nearly impossible to grab the source of an image or video.

Using a browser plugin makes it significantly easier.

https://onlinetoolset.com/browser-extensions/downloader-for-instagram

Install the extension, use it to download the image. Done. No screenshot required.

@peteristhegreat
peteristhegreat / google-maps-importer.md
Last active October 24, 2024 12:40
Google Maps Importer, RenderDoc, Blender Plugin MapsModelsImporter
@peteristhegreat
peteristhegreat / julia-powershell-expression-notes.md
Last active September 25, 2024 19:56
Julia, pass -e script in powershell

After much todo, trying to get powershell to run julia like it would in bash, I got this working:

& julia -i -e ('println(\"Hello World\")')


& julia -i -e ('include(\"path-to-script.jl\"); function_in_script(); exit()')

& julia -i -e "path-to-script.jl"
@peteristhegreat
peteristhegreat / progress-bar-and-spinner.jl
Created September 20, 2024 19:54
Julia progress bar and spinner from Pkg, no additional packages needed
using Pkg
using Pkg.MiniProgressBars
# Function that simulates a task with progress
function example_task_with_progress_bar(n::Int)
bar = MiniProgressBar(; indent=2, header="Processing items", color=Base.info_color())
bar.max = n
fancyprint = Pkg.can_fancyprint(stderr)
fancyprint && start_progress(stderr, bar)
@peteristhegreat
peteristhegreat / how-to-upgrade-to-windows-11.md
Created September 17, 2024 15:30
Windows 11, Parallels, TPM Chip, Not recognized
@peteristhegreat
peteristhegreat / amazon-linux-2023--certbot-nginx.md
Last active September 13, 2024 15:02
Amazon Linux 2023, Centos based certbot + nginx setup
sudo yum update
sudo yum install -y docker nginx certbot python3-certbot-nginx git

sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -a -G docker ec2-user

sudo systemctl start nginx