Skip to content

Instantly share code, notes, and snippets.

View hajowieland's full-sized avatar

Hans-Jörg Wieland hajowieland

View GitHub Profile
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
@pedramamini
pedramamini / fabric-multiplex.sh
Last active July 2, 2024 21:18
Multiplex the stdout from a command as the stdin to numerous commands, collect the outputs under command headings in markdown format.
#!/bin/bash
# Pedram Amini
# https://pedramamini.com
run_command() {
local cmd="$1"
local input_file="$2"
local output_file="$3"
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@ruzickap
ruzickap / eksctl-cilium.sh
Last active September 14, 2023 10:47
Install Amazon EKS cluster with Cilium CNI using eksctl
#!/usr/bin/env bash
export CLUSTER_NAME="${USER}-cilium"
export AWS_DEFAULT_REGION="eu-central-1"
export KUBECONFIG="/tmp/kubeconfig-${CLUSTER_NAME}.conf"
export TAGS="[email protected] Environment=dev"
set -euxo pipefail
@sbailliez
sbailliez / vagrant-vmware-tech-preview-apple-m1-pro.md
Last active May 23, 2025 19:01
Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

UPDATE November 20, 2022: VMWare Fusion 13

VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.

Summary

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated

@kabute
kabute / istio-security-by-default-header-filter.yaml
Created April 7, 2021 18:17
This (Istio) Envoy filter will automatically add the recommended HTTP Security headers to all the responses
# This (Istio) Envoy filter will automatically add the
# recommended HTTP Security headers - https://securityheaders.com/
#
# Just: kubectl apply -f istio-security-by-default-header-filter.yaml
#
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: security-by-default-header-filter
namespace: istio-system
@zOrg1331
zOrg1331 / wireguard_layer2.md
Last active June 4, 2025 06:30
wireguard, wireguard layer 2, wireguard over TCP

Intro

This note describes how to connect two networks/devices/VMs over public network using Wireguard with Layer 2 support (ARP, IPv6 link-local, etc).

This can also be achieved using SSH and its "tap" tunnel, however, it does not provide the same level of latency and bandwidth as full-blown VPN such as Wireguard.

In addition, this note describes how to tunnel Wireguard over TCP connection. This may be of use if you encounter firewall in-between so, for instance, you can use TCP port 443 only.

Objective

@salrashid123
salrashid123 / tfcloud.go
Created July 27, 2020 13:35
Terraform Cloud webhooks --> Cloud Run
package main
import (
"context"
"crypto/hmac"
"crypto/sha512"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
@abhisek
abhisek / psp.yml
Created March 17, 2020 09:10
PodSecurityPolicy to Prevent hostPath Mount
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: developers-psp
spec:
privileged: false
allowPrivilegeEscalation: false
hostNetwork: false
hostPID: false
hostIPC: false