Skip to content

Instantly share code, notes, and snippets.

View iwishiwasaneagle's full-sized avatar

Jan-Hendrik Ewers iwishiwasaneagle

View GitHub Profile
@iwishiwasaneagle
iwishiwasaneagle / my_openconnect.md
Last active August 2, 2023 13:27
2FA openconnect script without sudo privileges when opening browser

Call this with something like the following

./my_openconnect \
  --authenticate \
  --external-browser $(which firefox-nightly) \
  -u USERNAME \
  --protocol=anyconnect \
  --authgroup=AUTH_GROUP \
 URL
@iwishiwasaneagle
iwishiwasaneagle / counter.sh
Last active May 5, 2023 15:33
A simple persistent counter for binding to hotkeys.
#!/bin/bash
FILE=~/.counter
TITLE="Simple Counter"
if [ ! -f "$FILE" ];
then
echo 0 > $FILE
fi
@iwishiwasaneagle
iwishiwasaneagle / CMakeLists.txt
Created January 11, 2023 09:09
RTEP5 2023 Demonstrator Practice Code
#
# Created by iwishiwasaneagle on 11/01/23.
#
cmake_minimum_required(VERSION 3.23)
project(rtep)
set(CMAKE_CXX_STANDARD 23)
add_executable(rtep main.cpp main.h)
@iwishiwasaneagle
iwishiwasaneagle / README.md
Last active July 7, 2022 09:20
Jo's Cool Data Analysis Tool

Jo's cool data analysis tool

These files are for a very specific use case for a friend of mine. Might be useful for others too. Who knows

Install

python -m venv venv

source venv/bin/activate
@iwishiwasaneagle
iwishiwasaneagle / dccoords.py
Last active March 22, 2022 10:21
Pydantic vs Protocol Buffers vs Named Tuples vs Dataclasses
import dataclasses
@dataclasses.dataclass
class DCCoord:
x: float
y: float
z: float
heading: float
@iwishiwasaneagle
iwishiwasaneagle / server.py
Created January 4, 2022 11:08 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET, PUT, and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@iwishiwasaneagle
iwishiwasaneagle / q-learning-sar.ipynb
Created November 5, 2021 10:59
My initial attempt to use Q-Learning for resource gathering over a map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iwishiwasaneagle
iwishiwasaneagle / q-learning.ipynb
Last active November 5, 2021 10:29
Figuring out what the heck Q-Learning is via OpenAI Gym
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iwishiwasaneagle
iwishiwasaneagle / latex_useful_one-liners.sh
Last active November 28, 2021 20:42
🧰 Useful CLI one-liners for LaTex
# Show all errors, warnings, and undefined messages in log file after compilation with location in log file for further analysis
grep -iHEn "error|warning|undefined" *.log
# Find all the duplicated labels in a directory
grep -ERh "\\\\label\{\w*:\w*\}" --include="*.tex" | tr -d " " | sort | uniq -c | awk '$1>1 {print $0}'
# Validate references.bib using https://github.com/Pezmc/BibLatex-Check
curl https://raw.githubusercontent.com/Pezmc/BibLatex-Check/master/biblatex_check.py 2>/dev/null | python - -b $(find ./ -maxdepth 1 -name "*.bib" | head -n1) -a $(find ./ -maxdepth 1 -name "*.aux" | head -n1)
# Find all the unused labels
{"lastUpload":"2021-12-01T09:35:08.389Z","extensionVersion":"v3.4.3"}