Skip to content

Instantly share code, notes, and snippets.

@tataranovich
tataranovich / opentofu-1.6.0-alpha3-docker-issue-debug.txt
Created October 19, 2023 08:27
OpenTofu failed without Git in container
2023-10-19T08:26:17.117Z [INFO] OpenTofu version: 1.6.0 alpha3
2023-10-19T08:26:17.117Z [DEBUG] using github.com/hashicorp/go-tfe v1.32.1
2023-10-19T08:26:17.117Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.18.1
2023-10-19T08:26:17.117Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2023-10-19T08:26:17.117Z [DEBUG] using github.com/zclconf/go-cty v1.14.1
2023-10-19T08:26:17.117Z [INFO] Go runtime version: go1.21.3
2023-10-19T08:26:17.117Z [INFO] CLI args: []string{"/usr/local/bin/tofu", "init"}
2023-10-19T08:26:17.117Z [TRACE] Stdout is a terminal of width 202
2023-10-19T08:26:17.117Z [TRACE] Stderr is a terminal of width 202
2023-10-19T08:26:17.117Z [TRACE] Stdin is a terminal
@tataranovich
tataranovich / lxc-mem
Last active October 11, 2022 12:41
Display LXC containers memory and swap information
#!/bin/bash
RAM_TOTAL=0
RAM_TOTAL_MAX=0
SWAP_TOTAL=0
SWAP_TOTAL_MAX=0
printf "%20s\t%11s\t%11s\n" "NAME" "RAM" "SWAP"
echo "-------------------------------------------------------"
@tataranovich
tataranovich / monitor-test.html
Created September 4, 2021 07:41
Monitor test
<!DOCTYPE html>
<html>
<head>
<title>Monitor test</title>
<script>
let colors = ["#ff0000", "#00ff00", "#0000ff"];
let i = 0;
function switchcolor() {
document.body.style.backgroundColor = colors[i];
@tataranovich
tataranovich / debug-shell.yaml
Created June 30, 2021 18:08
Debug shell for Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: debug-shell
labels:
app: debug-shell
spec:
replicas: 1
selector:
matchLabels:
@tataranovich
tataranovich / pbuilder-bcache.service
Created October 18, 2020 12:45
Systemd service for pbuilder-bcache.sh
[Unit]
Description=Mount bcache for pbuilder build area
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/pbuilder-bcache.sh
[Install]
WantedBy=multi-user.target
@tataranovich
tataranovich / pbuilder-bcache.sh
Created October 18, 2020 12:43
Mount bcache for pbuilder/build
#!/bin/bash
set -e
function wait_for_file() {
for i in $(seq 1 15)
do
test -e "$1" && break
sleep 1
done
test -e "$1"
@tataranovich
tataranovich / grabenv
Last active August 23, 2020 14:50
Grab environment
#!/bin/sh
XPROC="dbus-launch"
XPID=""
TARGET="$1"
if [ ! -z "$TARGET" ]; then
# Target is specified, check is it PID or process name
if echo "$TARGET" | grep -Eq '^[0-9]+$'; then
# Target is number, use it as PID