Open a new session, named after the current working directory
$ tat -n
Attach to a named session, or create it if it does not exist
| #!/usr/bin/env python3 | |
| """ | |
| Helper to generate `-target='<resource address>'` arguments to terraform operations | |
| from Terraform output. Operates on text only and does not touch Terraform itself. | |
| Writes output to stdout. | |
| """ | |
| import argparse | |
| import hashlib | |
| import io | |
| import json |
| #!/bin/bash | |
| # Select active Kubernetes configuration file for the current terminal session. | |
| # | |
| # Usage: | |
| # - Configure $all_configs variable in this file. It should be a directory | |
| # containing kubectl configuration files. | |
| # - Set $KUBECONFIG to the location of the symbolic link that will be created | |
| # - Run this script | |
| # | |
| # This script is meant to be run using the following alias: |
| """ | |
| En enkel demo for å initialisere en Vipps-transaksjon. | |
| Returnerer en URL som kunden kan bruke til å fullføre transaksjonen. | |
| Denne URL kan for eksempel enkodes som en QR-kode og skannes. | |
| Koden er lisensiert som CC-BY | |
| 2020 stigok | |
| https://creativecommons.org/licenses/by/4.0/legalcode.no | |
| """ | |
| import datetime |
| #!/bin/bash | |
| # stig@stigok.com Oct 2019 | |
| # | |
| # Reference: | |
| # http://positon.org/a-solution-to-the-umask-problem-inotify-to-force-permissions | |
| set -x | |
| # Take the directory name as argument | |
| inotifywait -mrq -e CREATE --format %w%f "$1" | while read FILE | |
| do |
| #!/bin/bash | |
| # Backs up a complete mongodb database instance running on localhost and | |
| # uploads a gzipped dump to an S3 bucket (in this case Scaleway Object Storage) | |
| # | |
| # Configure s3cmd with `s3cmd --configure` | |
| set -eu | |
| MONGODB_USER=${MONGODB_USER} | |
| MONGODB_PASSWORD=${MONGODB_PASSWORD} |
| // Related blog post: | |
| // https://blog.stigok.com/2019/08/06/golang-with-libnfc-bindings-and-a-acr122u-a9-tag-reader.html | |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "github.com/fuzxxl/nfc/2.0/nfc" | |
| ) |
| function look4luv (find, the, love, and, u, will, know) { | |
| if (--I <3) return | |
| the = find ? find.document : u || will || know || the || love | |
| love = '<3' | |
| find = (u || know || the || love) | |
| u = undefined | |
| u ? | |
| will : | |
| (find || the).title = the.title.endsWith(love) ? the.title.substr(0, the.title.length - love.length) : the.title + |
| $ tf plan | |
| Refreshing Terraform state in-memory prior to plan... | |
| The refreshed state will be used to calculate this plan, but will not be | |
| persisted to local or remote state storage. | |
| kubernetes_namespace.default: Refreshing state... (ID: tkp-test) | |
| kubernetes_stateful_set.ingestor: Refreshing state... (ID: tkp-test/pingers) | |
| ------------------------------------------------------------------------ |
| #include <stdio.h> // printf, sprintf, fprintf | |
| #include <stdlib.h> // malloc | |
| int main() { | |
| const unsigned char bytearr[] = { 0x12, 0x34, 0x56, 0x78 }; | |
| const size_t arrlen = sizeof(bytearr); | |
| const size_t hexlen = 2; // hex representation of byte with leading zero | |
| const size_t outstrlen = arrlen * hexlen; | |
| char * outstr = malloc(outstrlen + 1); |