Skip to content

Instantly share code, notes, and snippets.

View iximiuz's full-sized avatar
🪲

Ivan Velichko iximiuz

🪲
View GitHub Profile
package gcs
import (
"bytes"
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"encoding/xml"

Start a new playground with a service (e.g., Nginx) in it:

$ labctl p start --ssh docker
> docker run -d --restart always -p 8080:80 nginx:alpine
> exit

Forward local port to make the remote service accessible on the local machine:

import { codeToHast } from 'shiki';
const inputSlow = `
TIME UPID STACK TRACE ID STACK TRACE
package main
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"log"
"os"
remotecfg {
url = "..."
id = "..."
poll_frequency = "60s"
basic_auth {
username = "..."
password = "..."
}
}
@iximiuz
iximiuz / index.md
Created April 19, 2025 18:03
iximiuz Labs tabbed content example (abridged)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut purus eget sapien. Nulla facilisi.

::tabbed

tabs:

  • name: golang title: Go
  • name: python title: Python
  • name: javascript
#!/bin/sh
set -eu
ln -s / $HOME/.rootfs
curl -fsSL https://code-server.dev/install.sh | sh
mkdir -p $HOME/.local/share/code-server/User
cat <<EOF > $HOME/.local/share/code-server/User/settings.json
{
{"time": "2023-12-11T00:00:01.123Z", "method": "GET", "path": "/foo/bar", "status_code": 200, "content_length": 423}
{"time": "2023-12-11T00:01:01.123Z", "method": "POST", "path": "/foo/bar", "status_code": 200, "content_length": 553}
{"time": "2023-12-11T00:02:01.123Z", "method": "GET", "path": "/foo/baz", "status_code": 200, "content_length": 345}
{"time": "2023-12-11T00:03:01.123Z", "method": "GET", "path": "/foo/baz", "status_code": 401, "content_length": 235}
# syntax=docker/dockerfile:1
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
RUN <<EOF
set -eu
apt-get update
@iximiuz
iximiuz / net_lab_l3_to_l2_mapping.sh
Created March 18, 2021 08:46
Sets up IP subnets over a single Ethernet broadcast domain formed by a Linux bridge.
#!/usr/bin/env bash
set -euo pipefail
create_bridge() {
local nsname="$1"
local ifname="$2"
echo "Creating bridge ${nsname}/${ifname}"