Skip to content

Instantly share code, notes, and snippets.

View Klexx's full-sized avatar
🏠
Working from home

Klexx

🏠
Working from home
View GitHub Profile
@Klexx
Klexx / latex-clean.sh
Created November 8, 2018 14:58 — forked from djsutherland/latex-clean.sh
A bash script to clean latex temp files
#!/bin/bash
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
if [[ -d "$arg" ]]; then
for ext in $exts; do
rm -f "$arg"/*$ext
# Partitionierung
DEVICE=/dev/sda
# Partitionierung auf dem USB Stick löschen
dd if=/dev/zero of=$DEVICE bs=1M count=1
# Partitionen einrichten
fdisk ${DEVICE}
n
p
@Klexx
Klexx / chacha20.py
Created December 5, 2017 15:52 — forked from chiiph/chacha20.py
Python implementation of the stream cipher ChaCha20. The idea is to use numpy as the "numeric backend" to avoid side channel attacks. THIS IS JUST AN EXPERIMENT, DO NOT USE IN PRODUCTION.
# Based on http://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
import binascii
import numpy as np
np.seterr(over='ignore')
def rotl32(v, c):
assert isinstance(v, np.uint32)
assert isinstance(c, np.uint32)
@Klexx
Klexx / chacha20.py
Last active December 5, 2017 15:50 — forked from cathalgarvey/chacha20
ChaCha20 stream cipher in Python 3
# Pure Python ChaCha20
# Based on Numpy implementation: https://gist.github.com/chiiph/6855750
# Based on http://cr.yp.to/chacha.html
#
# I wanted an implementation of ChaCha in clean, understandable Python
# as a way to get a handle on the algorithm for porting to another language.
# There are plenty of bindings but few pure implementations, because
# Pure Python is too slow for normal practical use in Cryptography.
#
# The preceding implementation used NumPy, which avoided a lot of the
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@Klexx
Klexx / iptables.sh
Created February 15, 2017 19:49
minimal iptables
SSH_PORT=1234
iptables -X
iptables -F
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

Keybase proof

I hereby claim:

  • I am klexx on github.
  • I am klexx (https://keybase.io/klexx) on keybase.
  • I have a public key whose fingerprint is D5D3 3F10 D6D2 D374 50EF F14C 7836 F958 17E5 754D

To claim this, I am signing this object:

Header set Access-Control-Allow-Origin "*"
a2enmod headers
found: http://alvinalexander.com/unix/edu/examples/find.shtml
basic 'find file' commands
--------------------------
find / -name foo.txt -type f -print # full command
find / -name foo.txt -type f # -print isn't necessary
find / -name foo.txt # don't have to specify "type==file"
find . -name foo.txt # search under the current dir
find . -name "foo.*" # wildcard
find . -name "*.txt" # wildcard