Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am konekohana on github.
  • I am czadamv (https://keybase.io/czadamv) on keybase.
  • I have a public key ASAHEpV-aQW-jI9XTb3FHil6atcXvZX_dZuZx9cwPXw41Qo

To claim this, I am signing this object:

@konekohana
konekohana / config
Last active April 7, 2021 10:08
Nginx X-Cache-Key module
ngx_addon_name=ngx_http_cache_key_filter_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_cache_key_filter_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_cache_key_filter_module.c"
#include <iostream>
#include <vector>
class SimplePolynomial {
friend class Iterator;
std::vector<double> repository;
void write(size_t pos, double val) {
std::cout << "Writing " << val << " to position " << pos << std::endl;
if (pos >= repository.size()) repository.resize(pos + 1);
@konekohana
konekohana / backup.sh
Last active June 26, 2017 20:58
Btrfs incremental backup
#!/bin/bash
UUID="c71712ad-0e44-4c1e-ac86-403d366acc0a"
blockDevice="/dev/disk/by-uuid/$UUID"
bootMountPoint="/boot"
mntPoint="/run/media/adam/$UUID"
backupDir="/home/adam/backup"
oldSnapName="snap"
newSnapName="snap-new"
@konekohana
konekohana / automath.sh
Last active October 4, 2016 15:02
Simple bash script that connects to fray1, opens tunnel to licence server and launches mathematica.
#!/usr/bin/env bash
command -v sshpass >/dev/null 2>&1 || { echo >&2 "This script requires sshpass program. Aborting."; exit 1; }
command -v mathematica >/dev/null 2>&1 || { echo >&2 "Mathematica is not installed. Aborting."; exit 1; }
echo "Should I use newton.fiji.cvut.cz or leibniz.feld.cvut.cz?"
read -n1 -p "[n,l]:" server
echo
if [[ $server != [n,N,l,L] ]]; then echo "I don't know what you mean by that." && exit 2; fi