Skip to content

Instantly share code, notes, and snippets.

input_size = 12
input_bandwith = 100
print "upload ",input_size," TB with ",input_bandwith,"mbit/s \n\n"
scale=1
kilo = 1024
mega = 1024 * kilo
giga = 1024 * mega
tera = 1024 * giga
@salzig
salzig / Person.java
Last active August 29, 2015 14:01
Person Class
class Person {
private String name;
public Person(String name) {
this.name = name;
}
public Person() {
this("Keks");
}
@salzig
salzig / selectionSort.erl
Created November 19, 2014 08:14
Was fehlt.....
%% aufruf um exemplarisch über "zahlen.dat" zu laufen
runSelectionSortExample() ->
StartTime = time(),
selectionSortOverFileLines("zahlen.dat").
%% Öffne Datei, und iteriere über die Tuple
selectionSortOverFileLines(Filename)
Tuples = file:consult(FileName),
selectionSortOverTuples(Tuples).
@salzig
salzig / config.ru
Created May 21, 2015 07:10
directory as itunes podcast experiment
#use Rack::Static, root: ''
feed = lambda { |env|
server = [env['SERVER_NAME'], env['SERVER_PORT']].compact.join(':')
# file = File.join(Dir.pwd,env['PATH_INFO'])
# if File.exist? file
# return [200, {'Content-Type'=>'video/quicktime', 'Content-Length'=>File.size(file).to_s}, [File.read(file)]]
# end
#!/bin/bash
FIFO_FILE=factorio.fifo
PID_FILE=factorio.pid
if [ ! -p $FIFO_FILE ]; then
mkfifo $FIFO_FILE
fi
echo $$ > $PID_FILE
@salzig
salzig / notification
Last active March 28, 2018 12:05
Send OSX Notifications from Terminal or Script via Simple OSAScript
#!/usr/bin/osascript
# Place this Script in any of this `echo -e ${PATH//:/'\n'}` directories and make sure to `chmox +x notification`
# Usage:
# notification "Hello World"
# or
# notification Hello World
on run argv
set AppleScript's text item delimiters to space
@salzig
salzig / app.cs
Last active May 12, 2019 15:05
Stupid Ring Linked List in C#
// Prints: (anker) C <- B <- A <- C <- B <- A
using System;
public class Program
{
public static void Main()
{
Ring ring = new Ring();
ring.prepend("B");
@salzig
salzig / Dockerfile
Created February 27, 2025 12:56
Dockerfile based on Debian Bookworm Slim with mise (asdf alternative) installed.
FROM debian:12.9-slim
RUN apt update -y && apt install --no-install-recommends --yes gpg sudo wget curl ca-certificates build-essential git libssl-dev libncurses-dev
RUN install -dm 755 /etc/apt/keyrings && \
curl -k https://mise.jdx.dev/gpg-key.pub | gpg --dearmor > /etc/apt/keyrings/mise-archive-keyring.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg] https://mise.jdx.dev/deb stable main" > /etc/apt/sources.list.d/mise.list
ENV MISE_DATA_DIR="/mise"
ENV MISE_CONFIG_DIR="/mise"
ENV MISE_CACHE_DIR="/mise/cache"