Skip to content

Instantly share code, notes, and snippets.

@hutt
hutt / plainnat.bst
Last active February 2, 2020 12:58
plainnat.bst LaTeX bibliography template for german publications in social sciences
%% File: `plainnat.bst'
%% A modification of `plainnat.bst' by Patrick W Daly for use with natbib package
%%
%% Modified in 2019 by Jannis Hutt
%% E-mail: jhutt@uni-potsdam.de
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
@hutt
hutt / vorlage_textzusammenfassung.tex
Last active February 2, 2020 13:02
Vorlage für Textzusammenfassungen (Harvard-Zitierstil)
\documentclass[a4paper, 11pt]{article}
\usepackage{comment}
\usepackage{blindtext}
\usepackage{fullpage}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@hutt
hutt / bot.py
Last active September 11, 2016 23:21
Das Maß ist voll
#!/usr/bin/env python
#coding=UTF-8
#file: bot.py
#
#requirements:
#keys.py
#tweeps ("pip install tweeps")
#
import tweepy, time, sys, random
#from our keys module (keys.py), import the keys dictionary
@hutt
hutt / pushover.sh
Created April 5, 2016 16:07
get notified easily by using pushover on your server.
#!/bin/bash
# Pushover settings
api_key="YOUR_API_KEY"
user_key="YOUR_USER_KEY"
# Logic
if [ -t 0 ]; then
# check for parameters
@hutt
hutt / rsa.md
Last active February 2, 2020 13:04
Beispiel: Verschlüsselung mit RSA

Beispiel: Verschlüsselung mit RSA

Im Folgenden verschlüssle ich meinen Namen, die Zeichenkette jannis mittels RSA.

Funktionsweise

  1. Es werden zwei verschiedene, große Primzahlen p und q zufällig gewählt, wobei die Differenz nicht zu klein sein sollte, und das Produkt der beiden berechnet: n = p * q

  2. Dann wird ein zufälliger Wert e ermittelt, der teilerfremd (relativ prim) und kleiner als (p-1) * (q-1) ist. Zu diesem wird das modular Inverse d berechnet, so dass gilt: (e * d) mod ((p-1) * (q-1)) = 1

  3. Als öffentlicher Schlüssel gilt dann: e, n und der private Schlüssel ist: d und n. Die Primzahlen p und q können vergessen werden, aber sie sollten niemals bekannt werden.

Keybase proof

I hereby claim:

  • I am hutt on github.
  • I am hutt (https://keybase.io/hutt) on keybase.
  • I have a public key ASAfDTiR_0EYNCmkVoFox6ahBKKpTF_vQeCYs6ss-8aESwo

To claim this, I am signing this object:

@hutt
hutt / gist:fe7a5ddf840abcc06fcd
Created April 26, 2015 17:57
Neuer GnuPG Key.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
# Neuer GnuPG Key
Ich, Jannis Hutt, habe meinen GPG Key gewechselt.
Der alte Key 0xDE982BAE0C8061C8, welcher als Hauptidentität die E-Mail Adresse privat@jannishutt.de nutzte, wird von un an nicht mehr benutzt.
Stattdessen benutze ich von nun an den Key 0x9BAD2EA15BCF1DFF.
khwz()
Prgm
:"init"
Lbl init
:"Zum IO Fenster wechseln"
Disp ""
:"Alles loeschen"
ClrIO
ClrErr
ClrGraph
include reg51.inc
Init: mov A, #11111111b
mov P1, #11111111b; alle Zeilen dauerhaft high, mit Spalten wird Rotation gesteuert
Eins: mov A, #11110111b
Start: mov P0, A; erste Spalte muss low sein, da nur wenn Spalte low und Zeile high ist dann leuchtet Licht
RR A; Akku nach rechts rotieren
mov P0,A; Akku in P0
CJNE A, #0F7h, Start; Vergleiche A mit 1111 0111d wenn ungleich nach Start springen
@hutt
hutt / textBinASCII.php
Last active March 17, 2024 22:29
Convert string to binary / binary to string
<?php
/*******************************
*
* Convert Text to Binary ASCII
* oder so.
*
*******************************/
header("Content-Type: text/html; charset=utf-8");
function textBinASCII($text){
$bin = array();