Skip to content

Instantly share code, notes, and snippets.

@phiresky
phiresky / README.md
Last active April 5, 2023 00:51
guitar synthesizer in 96 characters of C

tiny guitar synth in 96 chars of C

works by starting with a array filled with white noise (from /dev/urandom), then continuously modulating it with a low pass filter of the desired frequency.

this results in a sound pretty similar to a guitar with steel or nylon strings.

@phiresky
phiresky / client.ts
Last active April 9, 2020 14:17
koa example of a somewhat sane typed http server
import { makeClient } from "./makeTypedApi";
import { Api } from "./common";
const api = makeClient(Api);
// has all the HTTP methods like normal methods, e.g.
const results = await api.byDate()
@phiresky
phiresky / nginx.conf
Last active December 2, 2020 23:12
Log as much information as possible in nginx to json format
http {
log_format json_combined escape=json
'{'
'"time_iso8601":"$time_iso8601", "remote_addr":"$remote_addr", "remote_user":"$remote_user", "request":"$request",'
'"status": "$status", "body_bytes_sent":"$body_bytes_sent", "request_time":"$request_time","http_host":"$http_host","host":"$host",'
'"args":"$args",'
'"connection":"$connection","content_length":"$content_length","content_type":"$content_type","uri":"$uri","request_filename":"$request_filename",'
'"http_referrer":"$http_referer", "http_user_agent":"$http_user_agent",'
'"upstream_connect_time": "$upstream_connect_time", "upstream_response_time":"$upstream_response_time"'
'}';
@phiresky
phiresky / README.md
Last active June 6, 2019 08:54
zsh histdb example data filler

run in a somewhat interesting dir (e.g. checkout of a linux kernel) with <100k files (otherwise too slow).

mv -i ~/.histdb/zsh-history.db ~/.histdb/realhistory

./makedb.sh | sqlite3 ~/.histdb/zsh-history.db
@phiresky
phiresky / README.md
Last active May 29, 2019 21:25
qdirstat server script

Use this to run qdirstat for a server on which it is not installed:

ssh root@server 'curl -sL https://git.io/fj42l | perl -- - / -' | qdirstat -c /dev/stdin

Yes, the arguments to perl are perl -- - dir_to_scan -. Beautiful, isn't it?

@phiresky
phiresky / .gitignore
Last active March 30, 2019 10:50
fusl script
/node_modules
/charts.json
/stats.json
@phiresky
phiresky / log.js
Last active March 29, 2019 22:35
ws
require('socket.io-client')
.connect('ws://tracker.archiveteam.org:8080/googleplus-log')
.on('log_message', data => console.log(data))

Nebenfach genetik / biologie am kit

Vorlesungen

Biologie als Ergänzungsfach besteht aus 3 Vorlesungen, die jeweils aus dem ersten und dritten Semester den Bio-Bachelors sind. Alle zusammen geben 9 LP. Die Themen sind meiner Meinung nach sehr spannend.

Grundlagen der Biologie: oft als "BA-01" bezeichnet, was aber nur der Modulname im Bachelorstudium ist. Wir müssen von diesem Modul nur diese eine Vorlesung besuchen. Aufgebaut ist diese aus 3 Teilen - 50% Zellbiologie, 25% Genetik, 25% Evolutionsbiologie. Für die Vorlesung fand ich Wissen aus der Schule extrem hilfreich, da man dadurch schon einiges an nötigem Grundwissen hat, auf dem sehr viel aufgebaut und vertieft wird. Ich selbst hatte "nur" Bio zweistündig in der Oberstufe, hat trotzdem viel geholfen.

Molekularbiologie: zusammen mit Genetik im "BA-04"-Modul. Hier geht es um die Analyse, Prozessierung und Modifikation von DNA und RNA. Dabei kennt man aus den Medien Begriffe wie CRISPR, PCR und Gentechnik im Allgemeinen. Da man h

node_modules
@phiresky
phiresky / calc.js
Created October 29, 2018 19:59
bitcoin fees vs block reward 2017
fees = await fetch("https://api.blockchain.info/charts/transaction-fees-usd?format=json&timespan=2years").then(x => x.json())
year = 2018
filter = x => new Date(1000*x.x) > Date.UTC(year) && new Date(1000*x.x) < Date.UTC(year + 1)
totalFees = fees.values.filter(filter).reduce((a,b) => a+b.y, 0)
rewards = await fetch("https://api.blockchain.info/charts/miners-revenue?format=json&timespan=2years").then(x => x.json())