Skip to content

Instantly share code, notes, and snippets.

depressed NEET betting on a chance in life

Mika Feiler mkf

depressed NEET betting on a chance in life
View GitHub Profile
mkf /
Created Sep 5, 2020
averaging grouped values, rounding upwards
#!/usr/bin/env bash
unset key
cat data.csv | # reads from data.csv
tail -n +2 | # removes first line
tr -d ' ' | # removes all spaces
cut -d ',' -f1,3 | # takes first and third field
# from here on this program:
# calling the right-hand field (string) the key,
# and the left-hand field (positive integers) the values,
mkf / tikz2svg
Last active Apr 24, 2020 — forked from jbenet/tikz2svg
tikz2svg - convert tikz input into svg
View tikz2svg
#!/usr/bin/env python2
# author:
# license: MIT
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
mkf /
Last active Feb 11, 2020
#!/usr/bin/env bash
if [[ $2 != *.sam ]]
>&2 echo "The '$2' does not end with .sam"
exit 20
elif [[ ! -f $2 ]]
>&2 echo "The .sam is not a file"
exit 21
mkf /
Last active Dec 14, 2019
The description of "Incognito Away - Disable Incognito Tabs" app from as of 20191214T0612CET. Table below the description says about the app was "Updated December 9, 2017".

Your Incognito Tab Blocker - Incognito Away.
Incognito Away disables and blocks Incognito Tabs from *Google Chrome*, *Microsoft Edge*, *Brave Browser*, and other browsers (see below).

Once installed, you just need to open the app, and enable a quick setting. That’s it!
From then on, ALL Incognito tabs will be blocked as soon as they are opened – it’s instant.

Update: Incognito Away now supports: Google Chrome, Microsoft Edge, Brave Browser, Iron Browser, Ecosia, Yu Browser and Start Internet Browser.

Give the app a try - you've got nothing to lose ✓
Feel free to give the app a try. You can always get an automatic refund within the first 48 hours! ✓✓✓

mkf /
Last active Sep 21, 2019
passh, that is: sshpass -d {anonymous pipe from executing $1 with args from the rest of argv}
#!/usr/bin/env bash
# Created by Michał Krzysztof Feiler in September 2019
# Desired usage example:
# ./ \; ssh user@host \; pass stdout path/of/passfile
# ( this example uses )
# ( this script aims to serve this example. so far it is a failure. please help. )
shopt -s expand_aliases
alias narg='[ "$#" -eq 0 ]'
if narg; then
>&2 echo 'Lacking arguments. First argument is supposed to be the delimiter, such as "\;".'
mkf /
Last active Sep 1, 2019
What is GPG and why is it used in the password manager "pass"

I was just asked what is GPG and why is it used in pass password manager ( I will try to briefly explain everything starting from public-key cryptography. So:

Besides the usual way of encryption, symmetrical encryption, which goes like, you have a password and to encrypt you need that password and to decrypt you need that password, there is also another way, the way of public-key cryptography, assymetrical encryption.

In it, you have two keys, related in a way such that you can hardly guess one from the other, but if you encrypt something with the first of them (called the public key, since the public is free to give any data) it will be only decryptable with the second (called private, since only the recipient should have it).

These algorithms are usually rather slow, so usually it's done like, you generate a random key (usually called session key) for symmetrical encryption and then package data encrypted symmetrically with it, along with just that small key encrypted wi


Keybase proof

I hereby claim:

  • I am mikrfe on github.
  • I am mkf ( on keybase.
  • I have a public key ASBNwo_c8zxwsmYbl7P5xGj5NkcmREBL7SNzWqAZXTfhRgo

To claim this, I am signing this object:

nth([],_,_) :- !, fail.
nth([_],0,_) :- !, fail.
nth([_|_],0,_) :- !, fail.
nth([_|Rest],Index,X) :- NewIndex is Index-1, nth(Rest,NewIndex,X), !.
onpos(B,[I],X) :- nth(B,I,X).
onpos(B,[I|R],X) :- nth(B,R,A), !, onpos(A,R,X), !.
%onpos(Board,[Rank, File],X) :- nth(Board,Rank,Elements), !, % if we have the nth rank already, there is no other nth rank in Board
% nth(Elements, File, X), !.
View gist:51f8d2541d58da7479c8f778160925fc
mf  ~  java -Dorg.slf4j.simpleLogger.defaultLogLevel=TRACE -jar Pobrane/wallet-key-tool-1.4.2.jar
[Thread-0] INFO prof7bit.bitcoin.wallettool.core.WalletKeyTool - trying import strategy WalletDumpHandler
[Thread-0] DEBUG prof7bit.bitcoin.wallettool.fileformats.WalletDumpHandler - trying to read file: /home/mf/wallet.aes.json
[Thread-0] INFO prof7bit.bitcoin.wallettool.core.WalletKeyTool - WalletDumpHandler said: file did not contain any keys
[Thread-0] TRACE prof7bit.bitcoin.wallettool.core.WalletKeyTool - attempt to use WalletDumpHandler failed
java.lang.Exception: file did not contain any keys
at prof7bit.bitcoin.wallettool.fileformats.WalletDumpHandler.readLines(
at prof7bit.bitcoin.wallettool.fileformats.WalletDumpHandler.readUnencrypted(
at prof7bit.bitcoin.wallettool.fileformats.WalletDumpHandler.load(
at prof7bit.bitcoin.wallettool.core.WalletKeyTool.tryLoadWithStrategy(
mkf / mmih.go
Created Aug 6, 2017
View mmih.go
package main
import (