Skip to content

Instantly share code, notes, and snippets.

View NilsWildt's full-sized avatar

Nils NilsWildt

  • University of Stuttgart
View GitHub Profile
@NilsWildt
NilsWildt / portfolio.jl
Last active May 21, 2024 22:03
Compare two portfolios with different costs
### A Pluto.jl notebook ###
# v0.19.42
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
let
function ℓπ(u,A,y,λ₁=1e-4,λ₂=1e-4)
n,m = size(A)
AQiA = A'*(I./λ₁)*A
P = AQiA+I./λ₁
K = pinv(AQiA)*A'*I./λ₁
[-1.0.*(-0.5*sum((u.-inv(P)*(AQiA*K*y+ I./λ₂*u)).^2))]
end
rng = Xoshiro(123)
A = rand(rng,5,5)
@NilsWildt
NilsWildt / Aufzug_energie.jl
Created July 4, 2023 09:14
Calculate Aufzug zu Tee Verbrauch
### A Pluto.jl notebook ###
# v0.19.22
using Markdown
using InteractiveUtils
# ╔═╡ 5b968cc8-1a40-11ee-1f21-d39b07e2611c
md"# Aufzug"
# ╔═╡ 267967f6-63fc-46d4-8559-aad4c5da64c6
@NilsWildt
NilsWildt / monitor_memory_server.sh
Created September 16, 2022 09:54
Show cluster memory consumption...
#!/bin/bash
echo "Press [CTRL+C] to stop.."
while :; do
ps -eo pid,ppid,cmd,comm,%mem,%cpu --sort=-%mem | head -10
sleep 1
done
@NilsWildt
NilsWildt / end_ender3pro.gcode
Created December 11, 2021 12:01
Ender 3 pro 4.2.7 bltouch end gcode
; Ender 3 Custom End G-code
M400 ; Wait for current moves to finish
G4 ; Wait
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
G1 F3000 Z20 ; Move Z Axis up 20 mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G1 X0 Y{machine_depth} F1000 ; Move Heat Bed to the front for easy print removal
@NilsWildt
NilsWildt / start_ender3pro.gcode
Created December 11, 2021 12:00
Ender 3 Pro 2.2.7 Marlin bltouch Start G-code
; Ender 3 Custom Start G-code
M190 S60
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
;*** Start Preheating ***
M104 S{material_print_temperature_layer_0} ; Set Extruder temperature
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M109 S{material_print_temperature_layer_0} ; Wait for Extruder temperature
#! /usr/bash
sudo rclone copy --config=~/.config/rclone/rclone.conf --auto-confirm --buffer-size 1G --bwlimit 5M --contimeout 5m --fast-list --immutable --multi-thread-streams 12 --no-update-modtime --progress --transfers 12 -u -v --stats 5s
@NilsWildt
NilsWildt / fritzManualDelete
Created March 31, 2020 20:42
Delete the unused devices in the fritzbox manually
var elems = document.querySelectorAll("#delete_undefined.icon.delete:not(.hidden)"),i
for (i = 0; i < elems.length; ++i) {
elems[i].click()
}
@NilsWildt
NilsWildt / latex.md
Created December 7, 2018 19:27
LaTeX Beginner sources
background yes
use_xft yes
xftalpha 0.6
own_window true
own_window_type desktop
own_window_argb_visual true
# 0 = transparent, 255 = solid
own_window_argb_value 160
double_buffer yes
update_interval 2