Skip to content

Instantly share code, notes, and snippets.

@krmnn
krmnn / portscanner.go
Created December 13, 2019 09:13
a simple threaded port scanner in go
package main
import (
"errors"
"fmt"
"net"
"os"
"sort"
"time"
)
@krmnn
krmnn / krmnn
Created July 17, 2019 10:02
vim colorscheme krmnn
" tango-style vim color scheme
" 02/2014 by sithkarm <thomas@krmnn.de>
" based on tango colorscheme <micampe@micampe.it>
" place into .vim/colors/krmnn
set background=dark
hi clear
if exists("syntax_on")
syntax reset
@krmnn
krmnn / .vimrc
Created July 10, 2019 10:40
vim config
" .vimrc
" 2009-2013 Thomas Karmann
" Lots of cool stuff robbed from http://ruderich.org/simon/config/vimrc
" set the runtime path to include Vundle and initialize
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@krmnn
krmnn / wifionice.sh
Created March 20, 2019 10:28
Linux: Automatically accept Use Policy of Deutsche Bahn to use their WiFi when connecting
#!/usr/bin/env bash
# Put this script in "/etc/network/if-up.d/" and make it executable (chmod +x)
[ -z "$(iwconfig 2>/dev/null| grep 'WIFIonICE')" ] && exit
URL=http://www.wifionice.de/de/
CSRF_TOKEN=$(curl http://www.wifionice.de/de/|grep -oE 'value="[0-9a-f]{32}"' | cut -d = -f2|sed 's/"//g')
POST_DATA="
login=true&CSRFToken=${CSRF_TOKEN}&connect="
curl -v -d "$(echo $POST_DATA |sed 's/ /%20/g')" curl -v -A "Mozilla/9000.0 (X11; Linux x86_64; rv:65.0) Gecko/20000000 Firefox/1337" -H "Cookie: csrf=${CSRF_TOKEN}" -d "${POST_DATA}" $URL
@krmnn
krmnn / Social and ecological alternatives to Amazon.md
Last active August 27, 2018 07:27
Social and ecological alternatives to Amazon

Everything

Fairmondo.de

  • Cooperative of 2000 private persons, traders and distributors
  • Directed towards sustainable ecological goods. Fairmondo Comission for those products is 50%. Ecological information is displayed inline.
  • Mechanisms against corruption. They pay 1% of each trade to Transparency International.

Books

buch7.de

  • they pay 75% of their profit to social projects.
@krmnn
krmnn / Gitea: Disable previously enabled two-factor auth for user.md
Created August 5, 2018 19:18
Gitea: Disable previously enabled two-factor auth for user
  1. Whats the uid?
  2. psql -U gitea -W -d gitea -h localhost
  3. \c gitea
  4. DELETE from two_factor where uid = 1;
@krmnn
krmnn / vagrant ssh
Created July 2, 2018 13:03
vagrant ssh
#!/bin/sh
PORT=$(vagrant ssh-config | grep Port | grep -o '[0-9]\+')
ssh -q \
-o UserKnownHostsFile=/dev/null \
-o StrictHostKeyChecking=no \
-i ~/.vagrant.d/insecure_private_key \
vagrant@localhost \
-p $PORT \
"$@"