Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tap Counter</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0; font-family: -apple-system, system-ui, sans-serif;
@jalberto
jalberto / tap. html
Created August 11, 2026 22:56
tap. html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tap Counter</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0; font-family: -apple-system, system-ui, sans-serif;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tap Counter</title>
<style>
* { box-sizing: border-box; }
body {
margin: 0; font-family: -apple-system, system-ui, sans-serif;
@jalberto
jalberto / cf-ddns.sh
Created December 9, 2022 15:48
Cloudflare dyn DNS updater with curl & jq
AUTH_KEY='CF AUTH TOKEN KEY'
EMAIL_ADDRESS='CF email'
DNS_ZONE_NAME='domain.name'
DNS_RECORD_NAME="hola.domain.name"
DNS_ZONE=$(curl -sX GET "https://api.cloudflare.com/client/v4/zones?name=${DNS_ZONE_NAME}" -H "Content-Type:application/json" -H "Authorization:Bearer ${AUTH_KEY}" -H "X-Auth-Email:${EMAIL_ADDRESS}" | jq -r '.result[0].id')
DNS_RECORD=$(curl -sX GET "https://api.cloudflare.com/client/v4/zones/${DNS_ZONE}/dns_records?name=${DNS_RECORD_NAME}" -H "Content-Type:application/json" -H "Authorization:Bearer ${AUTH_KEY}" -H "X-Auth-Email:${EMAIL_ADDRESS}" | jq -r '.result[0].id')
CURRENT_DNS_VALUE=$(curl -sX GET "https://api.cloudflare.com/client/v4/zones/${DNS_ZONE}/dns_records/${DNS_RECORD}" -H "Content-Type:application/json" -H "Authorization:Bearer ${AUTH_KEY}" -H "X-Auth-Email:${EMAIL_ADDRESS}" | jq '.result["content"]')
CURRENT_IP_ADDRESS=$(curl -s ip.me)
@jalberto
jalberto / Dockerfile
Last active April 27, 2020 17:40
Elixir & Phoenix on Docker for development
FROM elixir:1.10
ENV \
PHX_VER=1.5.1 \
NODE_VER=12.x \
APP=/app HOME=/app \
PKGS="inotify-tools postgresql-client git"
RUN groupadd -g 1000 appuser \
&& useradd -r -u 1000 -g appuser appuser \
@jalberto
jalberto / map_utils.ex
Created November 21, 2018 10:04
Small util to transform Map keys into atoms or strings
defmodule MyApp.MapUtils do
@doc ~S"""
Transform keys in a Map to atoms
## Examples
iex> MyApp.Maputils.map_keys_to_atoms(%{"foo" => 1, "bar" => %{foo2: "2"}})
{bar: %{foo2: "2"}, foo: 1}
"""
def map_keys_to_atoms(map) when is_map(map) do
@jalberto
jalberto / grafana-memcached-pod.json
Created October 30, 2018 15:20
GRafana dashboard for memcached
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@jalberto
jalberto / grafana-pgbouncer-overview.json
Last active November 1, 2018 11:09
Grafana dashboard for pgbouncer (https://github.com/jbub/pgbouncer_exporter) (grafana ID #8711)
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@jalberto
jalberto / reindex.sh
Created August 30, 2018 13:29
Elasticsearch Reindex example
#!/bin/bash
SRC="http://foo:9200"
DST="http://localhost:9200"
curl -X POST "$DST/_reindex?pretty" -H 'Content-Type: application/json' -d'
{
"source": {
"remote": {
"host": "http://foo:9200"
#!/bin/sh
# Install Azure File Storage in a docker swarm from master
DRV_VER="v0.5.1"
AZURE_ACCOUNT="myaccount"
AZURE_KEY="mykey"
install_driver () {
sudo apt-get install -q -y cifs-utils
wget -q https://github.com/Azure/azurefile-dockervolumedriver/releases/download/${DRV_VER}/azurefile-dockervolumedriver