Skip to content

Instantly share code, notes, and snippets.

@arkadijs
arkadijs / sbc-bench.md
Last active October 20, 2023 23:31
Selected sbc-bench results

Based mostly on sbc-bench submissions and a few entries of my own testing. Ordered by 7-zip single threaded performance. Italic MHz font marks overclock.

Device Clock MHz Kernel Distro 7-zip multi single AES kB/s memcpy memset MB/s latency s/dual hugepg ns
Apple M1 Pro 3030/2060 5.18 Gentoo arm64 43800 5010 1064450 27110 71910 100/126
Pentium G4600 (Kaby Lake, 2017) 3600 4.19 Buster amd64 11810 4448 984820 15120 33380 76/83 64/73
Qualcomm Snapdragon 8cx Gen 3 3000/2440 6.3 Lunar arm64 35370 4312 1
@arkadijs
arkadijs / pipeline.go
Last active May 5, 2023 14:34
Streaming Writer-based pipeline in Go
package main
import (
"fmt"
"io"
"strings"
)
const rate = 2 // bytes per millisec of "audio"
@arkadijs
arkadijs / cache.js
Last active October 20, 2022 13:25
Serialize and Cache JavaScript Promise
const defaultTtl = 60 * 60;
const validAtLeast = 10 * 1000;
const retry = 5 * 1000;
function cache(retrieve) {
const context = {
expireAt: 0,
promise: null,
get() {
@arkadijs
arkadijs / external-dns.yaml
Created December 18, 2020 22:27
Socks and HTTP proxy in Kubernetes with ingress via Traefik (with SNI) or via Nginx, also ExternalDNS
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: proxy
spec:
endpoints:
- dnsName: proxy.superhub.io
recordTTL: 300
recordType: CNAME
targets:
@arkadijs
arkadijs / install.md
Last active January 6, 2022 17:10
GitLab in LXC on Ubuntu and openSUSE

Ubuntu host and container

Install LXC:

apt-get install linux-hwe-generic # update to 3.13 on Precise
apt-add-repository ppa:ubuntu-lxc/stable
apt-get update
apt-get install lxc lxc-templates cgmanager cgroup-lite
reboot
@arkadijs
arkadijs / _README.md
Last active January 9, 2021 14:21
Workshop: Deploying WordPress on Google App Engine :: PHP and Cloud SQL http://ldn.lv/events/166755872 http://goo.gl/F5K4Qn

Google Cloud SDK

There are two alternatives to start with the SDK:

  1. install SDK locally;
  2. use provided Linux VM in the cloud via ssh.

Note: everyone will get a separate index, ie. hacker02, hacker03, etc.

$ ssh hacker01@wp-workshop.hosting.lv

@arkadijs
arkadijs / _README.md
Last active October 16, 2018 19:02
Registrator / SkyDNS for CoreOS / Deis cluster

Registrator and SkyDNS

We use progrium/registrator and yaronr/skydns (SkyDNS2) to publish information about Docker containers to DNS via A and SRV records. All nodes runs skydns and registrator, and first three nodes are inserted as NS-s into Route53 DNS for services.cluster-name.domain.io. Note, v4 registrator must be used until registrator/124 is resolved.

$ host -t srv mysql-1.services.deis.r53.acp.io deis-6-1.eu.r53.acp.io
Using domain server:
Name: deis-6-1.eu.r53.acp.io
Address: 54.171.239.227#53
Aliases: 
@arkadijs
arkadijs / MasterOfNames.scala
Created May 15, 2015 15:50
Give meaningful names, improve code, write some tests.
def a(b: List[AnyRef]): List[String] =
b.foldLeft(List[String]())((c, d) => d match {
case null => c
case e: String => c :+ e
case f: List[AnyRef] => c ++ a(f)
})
def g(h: List[String]) =
h.foldLeft(List[String]())((i, j) => i.lastOption match {
case Some(`j`) => i
@arkadijs
arkadijs / cloud-ide.md
Last active December 16, 2016 12:38
Cloud IDE mini-review
  1. Koding - Attach your own VM. Nice UI. Has Chrome app.
  2. Cloud9 - 512MB free tier memory limit. Scala and Groovy processes will be killed pretty soon due to OOM.
  3. Codenvy - Docker runners automagic fail (cannot run arbitrary startup command). Can show Javadoc.
  4. Nitrous - defunct.
  5. Codebox - defunct.