Skip to content

Instantly share code, notes, and snippets.

View montao's full-sized avatar
💭
🛸 🐄

Niklas Rosencrantz montao

💭
🛸 🐄
View GitHub Profile
@montao
montao / s3rmrf.sh
Created November 3, 2021 06:46
Delete bucket(s) from s3 like rm -rf
# replace "fuzzbazz" with a word that matches a sequence of characters in the name of the bucket(s) you wish to delete
for bucket in $(aws s3 ls | awk '{print $3}' |grep "fuzzbazz"); do aws s3 rb "s3://${bucket}" --force; done
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
es_connect = "http://user:f1zzbu33@42.242.170.41:80/elasticsearch"
@app.before_first_request
def before_first_request_func():
global es
try:
if es is None:
name: Build project for Unity 2020.x in GitHub actions
on:
workflow_dispatch:
inputs:
webgl-required:
description: 'webgl-required'
required: false
default: 'false'
@montao
montao / highscoreapi.py
Created February 14, 2021 05:46
Highscore API
# HTTP GET /<userid/login will return a session token that will expire after 10 minutes
# HTTP POST /<levelid>/score?sessionkey=<sessionkey> will let you post {"score": <score>} and store it
# HTTP GET /<levelid>/highscorelist will retrieve the highscore list of the top 15 unique users
from datetime import timedelta, datetime
import http.server
import json
import random
import string
@montao
montao / iptables-cheatsheet.md
Created November 17, 2019 09:47 — forked from mcastelino/iptables-cheatsheet.md
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@montao
montao / .golang-example-gitlab-ci.yml
Created January 15, 2019 08:11 — forked from jcloutz/.golang-example-gitlab-ci.yml
Example Gitlab CI setup for Go using the official golang docker image
image: golang:1.7
stages:
- build
- test
before_script:
- go get github.com/tools/godep
- cp -r /builds/user /go/src/github.com/user/
- cd /go/src/github.com/user/repo
PS C:\Users\nrxcku\ubuntu-xenial64> vagrant reload --debug
INFO global: Vagrant version: 2.0.4
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.0.4\\gems\\vagrant-2.0.4\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
#include <stdio.h>
#include <stdlib.h>
typedef struct { float left; float right; } ears;
typedef struct { char name[13]; int weight; ears eararea; } monkey;
int sort_monkey( const void *, const void *);
int main(void)
{monkey* monkeys[4];