Skip to content

Instantly share code, notes, and snippets.

View mwik's full-sized avatar

Mårten Wikström mwik

  • Uppsala Design Lab AB
  • Sweden
  • X @mwik
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mwik on github.
  • I am mwik (https://keybase.io/mwik) on keybase.
  • I have a public key whose fingerprint is DF9A 0882 2BCB 310C 828A F2BC C65B 4BDA DEE8 BFF7

To claim this, I am signing this object:

@mwik
mwik / update-known-hosts.yml
Created February 19, 2018 21:14
Ansible playbook to get ssh host keys from Azure virtual machines
---
- hosts: localhost
gather_facts: no
vars:
home: "{{ lookup('env','HOME') }}"
tasks:
- name: Fetch SSH public keys
shell: 'az vm run-command invoke --name {{item}} --command-id RunShellScript --scripts "cat /etc/ssh/ssh_host_ecdsa_key.pub" --query output[0].message | grep -o "ecdsa-sha2-nistp256 .*="'
register: host_key
with_items: "{{groups['all']|sort}}"
@mwik
mwik / hurmangaheter.sh
Created January 16, 2024 07:49
Hur många heter?
#!/bin/bash
name=$1
curl -s 'https://www.skatteverket.se/hurmangaheter-bff/HurmangaheterClientServices/forfragan' -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'Origin: https://www.skatteverket.se' --data-raw "{\"input\":\"$1\"}" | jq '.antalFornamn,.antalEfternamn'