Skip to content

Instantly share code, notes, and snippets.

View chrishham's full-sized avatar

Christopher Chamaletsos chrishham

View GitHub Profile
#!/bin/sh
set -e
echo ">>> Updating system and installing dependencies"
apt-get update && apt-get install -y git curl wget unzip python3 python3-yaml
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
@chrishham
chrishham / gist:f89bd628577b2793b4a404b893fd1a2b
Created May 9, 2025 09:06
Install Azure CLI, kubectl, kubelogin and Helm to alpine
#!/bin/sh
set -e
echo ">>> Updating system and installing dependencies"
apk update && apk add --no-cache bash curl unzip tar ca-certificates openssl
ARCH="arm64"
K8S_VERSION="$(curl -sL https://dl.k8s.io/release/stable.txt)"
HELM_VERSION="$(curl -s https://api.github.com/repos/helm/helm/releases/latest | grep tag_name | cut -d '"' -f 4)"
#!/bin/bash
set -e
# Ask for password
read -s -p "Enter password for code server: " USER_PASSWORD </dev/tty
echo
# Install K3s
curl -sfL https://get.k3s.io | sh -
# Adjust permissions for K3s config
@chrishham
chrishham / sample.js
Last active April 18, 2021 15:59
Super Web Scraper - Puppeteer Script
// Available functions :
//
// page : https://pptr.dev/#?product=Puppeteer&version=v8.0.0&show=api-class-page
// Custom
// scrollToBottom
// scrollToSelector
await scrollToBottom(page);
await page.waitForSelector('iframe#dsq-app2953')
await scrollToBottom(page);
@chrishham
chrishham / sample.js
Last active April 19, 2021 16:45
Super Web Scraper - Sample node-html-parser code
// https://www.npmjs.com/package/node-html-parser
// htmlRoot gets injected and is available to your script
// Helper Functions:
// select:removeWhitespace().text & el.attributes.content
// selectAll: same as above
const result = []
const list = Array.from(htmlRoot.querySelectorAll(':is(.AdvItemBox,.FreeListingItemBox)'))
for (const el of list) {
const isAd = !!el.querySelector('.AdvDetailsArea')