Skip to content

Instantly share code, notes, and snippets.

View Zitrone44's full-sized avatar

Jonas Kuche Zitrone44

  • Technische Hochschule Mittelhessen
  • Germany
  • 21:20 (UTC +02:00)
View GitHub Profile
@nisovin
nisovin / Godot Web Server Configs.md
Last active July 9, 2024 07:45
Godot Web Server Configs

Godot Web Server Configs

For Godot 4 and the threads export in Godot 3, you need to set special headers on your web server in order to enable SharedArrayBuffer. There are some examples here for various web servers.

Python

The script below can be used to start a web server that sets the required headers. The easiest way to use this is to place this python script in your export folder and double click it to start the server. Then you can view your game at http://localhost:8000.

@miguelmota
miguelmota / notes.txt
Last active April 14, 2024 08:26
runc vs gvisor (runsc) vs rkt vs KataContainers vs NablaContainers
knowledge dump on container runtimes
KataContainers
- image coupled with kernel
- light vm layer
- can run in nested virturalization environments if hardware supports and you can enable it in bios (ex. only bare metal EC2 instances, limits many cloud providers)
- slower startup time
- OCI compliant
- previously known as ClearContainers by Intel
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{
@mrdima
mrdima / fix-weave-snat.sh
Last active September 24, 2020 09:39
Retain source IP for weave overlay network in Kubernetes
#!/bin/bash
# Inserts or removes iptables rules to prevent snat to the hosts local weave ip ranges
# This way the source ip will be retained for traffic not coming from weave
# Requires weave to be running, the script does wait for weave report to respond
echo running $0 $1
action="${1:-start}"
echo action: ${action}
#functions taken from: https://stackoverflow.com/questions/10768160/ip-address-converter
dec2ip () {
local ip dec=$@
@saghiralfasly
saghiralfasly / dataset_to_tfrecord.py
Last active April 29, 2022 06:16
Python script to create tfrecords from pascal VOC data set format (one class detection) for Object Detection API Tensorflow, where it divides dataset into (90% train.record and 10% test.record)
import os
import io
import glob
import hashlib
import pandas as pd
import xml.etree.ElementTree as ET
import tensorflow as tf
import random
from PIL import Image
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@martinwicke
martinwicke / automobile.ipynb
Last active January 9, 2022 08:14
Estimator demo using Automobile dataset
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FGtatsuro
FGtatsuro / yaml_json.sh
Last active March 19, 2019 11:53
YAML<->JSON
# JSON -> YAML(PyYAML==3.11 is required)
python -c "import yaml,json; f=open('alpine.json');s=json.load(f);f.close(); f=open('alpine.yaml', 'w');yaml.safe_dump(s, f, default_flow_style=False); f.close()"
# YAML -> JSON
python -c "import yaml,json; f=open('alpine.yaml');s=yaml.load(f);f.close(); print(json.dumps(s, indent=4))" > alpine2.json
# or
# (jq is required)
python -c "import yaml,json; f=open('alpine.yaml');s=yaml.load(f);f.close(); print(json.dumps(s))"| jq . > alpine2.json
# JSONの設定ファイルを受けとるCLIとの連携
@ivanyv
ivanyv / application.amp.erb
Created December 12, 2015 02:51
Easy Google AMP on Rails
<html>
<head>
<link rel="canonical" href="<%= current_uri_sans_amp %>">
</head>
...
</html>