Skip to content

Instantly share code, notes, and snippets.

View mschuwalow's full-sized avatar

Maxim Schuwalow mschuwalow

  • LiveIntent
  • Germany
View GitHub Profile
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
@mschuwalow
mschuwalow / hkt.rs
Last active November 18, 2020 16:56
Rust Functor Hierarchy
use std::marker::PhantomData;
trait Family<'a> {
type Member<T: 'a>: Mirror<'a, T, Family = Self>;
}
trait Mirror<'a, T> {
type Family: Family<'a>;
fn as_member(self) -> <Self::Family as Family<'a>>::Member<T>;
}
@mschuwalow
mschuwalow / cc_k3s_agent_1.yml
Last active August 10, 2022 14:15
cc_k3os_agent_1
hostname: k3s-agent-1
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDe8tQLn309eFVk1RsJuDYsnhyCcYAXwHPo5+R5F/y0TsOTywaoaaSfXrqlSqJiq3fERWEDvhoCUga2hdNrCnmJgdBnPDGlrxWJrEH8rqEut/BKvoCXXgYZhtFqDGgekacqb8Fg8jTSwUtCaXzgJFh4BrBDI7JKPz89SEwGeHHJUXp0OdXF1r1VQDDel2Lllzm87ucYft8XDMZ7zEtB6OiM/x86Na4UBWJoNxMvDlohxWGIcVARzJ3XlXwELcwqafm6ZqqMyJH8O29rgFW4TlCKYLuxaoW92KMFtY8DHmJNiLcgyed8lBxqc7LILaz3VJLpXIqa/s19dcjHTmatncM2OhjeiO39mJOitqhLR4tL9E/Kw7UtpydJ28HbE+nECrOtyTFjNH9ZquHOLoyEWH/xu5n1LEAFRCuoJnPag7bWtaRrL8D7wmssx/co4eiTbfmrl7Cc6GD8XI4RUvaJXm41Tbbm1L32kvi35iJPij0PfjrPgVtM9ViwM5B9PWv0HM22KZexsguI5Hv4SJeVcDNHAyTuPw20VbkDSJQlLV5B7MsLlbQEOutf2BqkDSUIZwe6ox0n2S3vKPtRJ32p7MT5r4bJrgroVLuU7qCaIxXrvTjWR8WXV0/WCN+HRVnEbHNNGDhhpYtUV5EeFsW5A55gCE8zk+GNAqwytYraMemN+Q== rancher@rancher"
write_files:
- path: /var/lib/connman/default.config
content: |-
[service_eth0]
Type=ethernet
IPv4=192.168.1.21/255.255.255.0/192.168.1.1
IPv6=off
@mschuwalow
mschuwalow / cc_k3s_server.yml
Last active September 30, 2020 18:04
cc_k3s_1
hostname: k3s-server
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDe8tQLn309eFVk1RsJuDYsnhyCcYAXwHPo5+R5F/y0TsOTywaoaaSfXrqlSqJiq3fERWEDvhoCUga2hdNrCnmJgdBnPDGlrxWJrEH8rqEut/BKvoCXXgYZhtFqDGgekacqb8Fg8jTSwUtCaXzgJFh4BrBDI7JKPz89SEwGeHHJUXp0OdXF1r1VQDDel2Lllzm87ucYft8XDMZ7zEtB6OiM/x86Na4UBWJoNxMvDlohxWGIcVARzJ3XlXwELcwqafm6ZqqMyJH8O29rgFW4TlCKYLuxaoW92KMFtY8DHmJNiLcgyed8lBxqc7LILaz3VJLpXIqa/s19dcjHTmatncM2OhjeiO39mJOitqhLR4tL9E/Kw7UtpydJ28HbE+nECrOtyTFjNH9ZquHOLoyEWH/xu5n1LEAFRCuoJnPag7bWtaRrL8D7wmssx/co4eiTbfmrl7Cc6GD8XI4RUvaJXm41Tbbm1L32kvi35iJPij0PfjrPgVtM9ViwM5B9PWv0HM22KZexsguI5Hv4SJeVcDNHAyTuPw20VbkDSJQlLV5B7MsLlbQEOutf2BqkDSUIZwe6ox0n2S3vKPtRJ32p7MT5r4bJrgroVLuU7qCaIxXrvTjWR8WXV0/WCN+HRVnEbHNNGDhhpYtUV5EeFsW5A55gCE8zk+GNAqwytYraMemN+Q== rancher@rancher"
write_files:
- path: /var/lib/connman/default.config
content: |-
[service_eth0]
Type=ethernet
IPv4=192.168.1.20/255.255.255.0/192.168.1.1
IPv6=off
let defaultengine="duckduckgo"
set smoothscroll
set defaultnewtabpage
set autoupdategist
let blacklists = ["*://localhost*"]
set noincsearch
@mschuwalow
mschuwalow / backup-gitlab.fish
Last active June 30, 2016 17:22
backup-gitlab.fish
set BACKUP_DIR /home/pi/backup/gitlab
set TOKEN
set PRUNE_AFTER 3
set TSTAMP (date "+%Y%m%d-%H%M")
set API https://gitlab.com/api/v3/projects/
function tgz
echo $argv
"""
Fancy Script for generating bat files from every filename that comes in via stdin.
Pass the directory to write to as an argument.
Brought to you by unicorn magic!
Kawoooosh....
"""
import sys
if __name__ == "__main__":
print "Generating entries for:\n"
@mschuwalow
mschuwalow / backup-github.sh
Last active May 31, 2024 23:23 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues. Using full_name instead of name and dropping all org stuff.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"<backup-dir>"} # where to place the backup files
GHBU_UNAME=${GHBU_UNAME-"<username>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<password>"} # the password for that account