Skip to content

Instantly share code, notes, and snippets.

@mkf
mkf / index.html
Created March 25, 2022 12:43
xxpgMMM
<div id=whole>
<style>
button.proper {
display: block;
margin: 1ex;
}
button#disableeditor,
button#appendrow {
display: none;
@mkf
mkf / index.html
Created March 25, 2022 12:06
xxpgMMM
<div id=whole>
<style>
button.proper {
display: block;
margin: 1ex;
}
button#disableeditor,
button#appendrow {
display: none;
@mkf
mkf / index.html
Created March 25, 2022 12:06
xxpgMMM
<div id=whole>
<style>
button.proper {
display: block;
margin: 1ex;
}
button#disableeditor,
button#appendrow {
display: none;
@mkf
mkf / data.sh
Created September 5, 2020 15:01
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
mkf / tikz2svg
Last active April 24, 2020 16:40 — forked from jbenet/tikz2svg
tikz2svg - convert tikz input into svg
#!/usr/bin/env python2
#
# author: github.com/jbenet
# license: MIT
#
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
@mkf
mkf / samy1.sh
Last active February 11, 2020 21:41
samy1.sh
#!/usr/bin/env bash
if [[ $2 != *.sam ]]
then
>&2 echo "The '$2' does not end with .sam"
exit 20
elif [[ ! -f $2 ]]
then
>&2 echo "The .sam is not a file"
exit 21
fi
@mkf
mkf / description_com-smajenterprise-incognitoaway_20191214.md
Last active December 14, 2019 05:34
The description of "Incognito Away - Disable Incognito Tabs" app from https://play.google.com/store/apps/details?id=com.smajenterprise.incognitoaway&hl=en_US 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
mkf / passh.sh
Last active September 21, 2019 00:02
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:
# ./passh.sh \; ssh user@host \; pass stdout path/of/passfile
# ( this example uses https://github.com/mkf/pass-stdout )
# ( 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
mkf / what-is-gpg-and-why-in-pass.md
Last active September 1, 2019 19:42
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 (https://www.passwordstore.org/). 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

@mkf
mkf / keybase.md
Created June 6, 2019 12:34
keybase.md

Keybase proof

I hereby claim:

  • I am mikrfe on github.
  • I am mkf (https://keybase.io/mkf) on keybase.
  • I have a public key ASBNwo_c8zxwsmYbl7P5xGj5NkcmREBL7SNzWqAZXTfhRgo

To claim this, I am signing this object: