Skip to content

Instantly share code, notes, and snippets.

View TilBlechschmidt's full-sized avatar
🦋

Til Blechschmidt TilBlechschmidt

🦋
View GitHub Profile
@TilBlechschmidt
TilBlechschmidt / Dockerfile
Created April 17, 2023 14:56
DVWA Dockerfile
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt -y install software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt update && apt -y install php5.6 php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-gd unzip wget mysql-server
RUN wget https://github.com/ethicalhack3r/DVWA/archive/master.zip -O master.zip
RUN unzip master.zip -d /var/www/html && mv /var/www/html/DVWA-master /var/www/html/dvwa
@TilBlechschmidt
TilBlechschmidt / rename.sh
Created February 9, 2022 14:21
GoPro file renaming
#!/bin/sh
# For some reason GoPros name their files in a pretty shitty manner.
# The initial file of a recording starts with GOPR#### where the # represent the recording number.
# Each following segment (each segment can only be 4GB in size even when using ExFAT) receives a name like this:
# GP**#### where the # are the same as the initial file and the * are the segment number.
# Additionally, the modification date of the files does not seem to be set properly so sorting by that yields nothing either.
#
# This script renames the GP**####.MP4 files into GP####-**.mp4
for file in GP*; do
base=$(basename $file ".MP4")
@TilBlechschmidt
TilBlechschmidt / WildMagicSurges.csv
Created October 25, 2019 12:05
The Net Libram of Random Magical Effects (by Orrex, v2.0) - CSV formatted
We can't make this file beautiful and searchable because it's too large.
ID|Surge description
1|1d10 of caster's fingers turn to stone
2|1d100 bees swarm harmlessly around the caster for several weeks
3|1d100 sparkling motes dance about the caster's head until dawn
4|1d100% of caster's body turns to iron for that many rounds
5|1d12 ducklings identify the caster as their mother
6|1d4 of caster's fingers move from his left hand to his right hand
7|1d4 of caster's limbs are as durable as steel
8|1d4 of caster's limbs are covered in fish scales
9|1d4 of caster's limbs are invisible
@TilBlechschmidt
TilBlechschmidt / DependencyResolver.js
Last active October 22, 2018 14:56
Dependency resolver written for KSPackage-lib
import { flatten } from "./helpers";
export default class DependencyResolver {
tree = {};
resolvableSets = [];
constructor(featuresToResolve: [string], getDependency, resolveDependencyChoices) {
// Add the features we want to resolve to the tree root
featuresToResolve.forEach(feature => this.tree[feature] = null);
@TilBlechschmidt
TilBlechschmidt / SomeComponent.jsx
Last active May 25, 2018 07:39
React file templates for dev w/ material-ui-next
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core';
const styles = theme => ({
});
class SomeComponent extends Component {
static propTypes = {

Keybase proof

I hereby claim:

  • I am themegatb on github.
  • I am themegatb (https://keybase.io/themegatb) on keybase.
  • I have a public key ASAas3ZpFqTZesmM7gnR8bTooAQnwjS6yAzwQtNfvO1TxAo

To claim this, I am signing this object:

@TilBlechschmidt
TilBlechschmidt / launch-date.txt
Last active February 6, 2018 18:51
Falcon Heavy launch date
6 Feb 2018 20:45:00 UTC
@TilBlechschmidt
TilBlechschmidt / Folder structure
Last active May 14, 2016 16:16
QEMU wrapper scripts
.
├── cd_images
│   └── virtio.iso
├── OVMF
│   ├── OVMF_CODE-pure-efi.fd
│   └── OVMF_VARS-pure-efi-untouched.fd
├── qemu_manager.py
├── qemu_manager.sh
└── VM
└── windows_base_uefi
pub fn step<R: Rng>(&mut self, rng: &mut R) {
let games_per_ref = self.games_per_client / self.score_references.len();
let mut pb = ProgressBar::new(self.current_generation.len()*self.score_references.len()*games_per_ref);
let mut avg_scores: Vec<(usize, f32)> = self.current_generation.iter().enumerate().map(|(index, contestant)| {
let threads = self.score_references.iter().map(|reference| { // TODO: Run this in multiple threads
thread::spawn(move || {
let rng = rand::thread_rng();