Skip to content

Instantly share code, notes, and snippets.

Working from home

Antti Kaihola akaihola

Working from home
  • Wärtsilä Oyj
  • Espoo, Finland
View GitHub Profile
akaihola / nixos-x1.rst
Last active February 14, 2023 09:54
Installing NixOS on a Lenovo ThinkPad Carbon X1 Gen 9
View nixos-x1.rst
akaihola / userdata.yaml
Created December 18, 2020 18:54
CrewLink-server cloud-init for Ubuntu
View userdata.yaml
# Start an Ubuntu server with this cloud-init data to run a
# CrewLink-server instance and update its IP for a subdomain. The
# domain name must be hosted at Gandi LiveDNS.
# Near the bottom of the page, replace these strings with your data:
# - your Gandi API key
# - your-domain.tld
# - your-subdomain
akaihola /
Last active March 9, 2022 15:58
Script for converting XML output into lint-style output
#!/usr/bin/env python
"""Script for converting ``.coverage`` SQLite output into lint-style output
The output is suitable for consumption using Darker.
Example usage, pointing out modified code in a feature branch not covered by
the test suite::
akaihola /
Last active May 31, 2018 20:02
Split a non-seekable stream into a header reader and a content reader
import io
from typing import Tuple
def tee_stream_head(stream: io.IOBase,
head_max_lines: int=3) -> Tuple[io.RawIOBase,
"""Split a stream, enable parallel reading of initial lines
This helper solves the use case where a limited number of initial lines
akaihola / btc_rallies_plot.ipynb
Last active January 17, 2018 08:00
Bitcoin rallies as notebook plots
View btc_rallies_plot.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
akaihola / blockstack-verification.txt
Created November 14, 2017 06:03
Blockstack ID verification
View blockstack-verification.txt
Verifying my Blockstack ID is secured with the address 1KXcAYCbfhV2BcRnp7xBRAy6vs97kPG4zp
An experimental extension for an IPython magic command to show object graphs.
Strongly based on tkf's code for the extension itself
and mine for turning a Python namespace into a GraphViz DOT source:
Read respective copyrights there!
akaihola / onename.io_verification.txt
Created August 29, 2014 18:55 verification
View onename.io_verification.txt
Verifying that +akaihola is my Bitcoin username. You can send me #bitcoin here:
akaihola / LICENSE.txt
Last active December 18, 2021 23:23
XML pretty-print for ElementTree
View LICENSE.txt
Copyright (c) 2013, Antti Kaihola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
akaihola /
Created November 10, 2013 09:26
Move photo from one tree to another in a git repository
import os
NEWDIR = '/home/akaihol/Kuvat_'
OLDDIR = '/media/akaihol/tasku/Valokuvat'
def get_file_fingerprint(path):