Skip to content

Instantly share code, notes, and snippets.

@junftnt
junftnt / standalone_destroy.sh
Created August 18, 2023 03:52 — forked from fmount/standalone_destroy.sh
Destroy a cephadm deployed Ceph cluster
#!/bin/bash
set -x
fsid="$1"
cephadm rm-cluster --fsid $fsid --force
source /etc/os-release
sudo systemctl stop tripleo_\*
sudo systemctl stop ceph\*
sudo pcs cluster destroy
if [ $VERSION_ID == "7" ]; then
sudo docker ps -a -q | xargs docker rm -f
@junftnt
junftnt / bashpipe.go
Created July 14, 2023 17:39 — forked from tyndyll/bashpipe.go
Execute Piped Shell Commands in Go
package main
import (
"bytes"
"io"
"log"
"os"
"os/exec"
)
@junftnt
junftnt / README.md
Created July 11, 2023 23:02 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@junftnt
junftnt / cancel-io-copy.go
Created March 28, 2023 19:24 — forked from yakuter/cancel-io-copy.go
IO Copy cancellation
// Source: https://ixday.github.io/post/golang-cancel-copy/
import (
"io"
"context"
)
// here is some syntaxic sugar inspired by the Tomas Senart's video,
// it allows me to inline the Reader interface
type readerFunc func(p []byte) (n int, err error)
@junftnt
junftnt / main.go
Created March 28, 2023 18:25 — forked from superbrothers/main.go
http request with context in Go
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
)
@junftnt
junftnt / reverse_proxy.go
Created March 11, 2023 23:50 — forked from matishsiao/reverse_proxy.go
how to use reverse proxy(http/https)
package main
import (
"net/http"
"net/http/httputil"
"net/url"
"time"
"net"
"log"
"fmt"
"crypto/tls"
@junftnt
junftnt / convert.py
Created February 19, 2023 08:34 — forked from Millnert/convert.py
simple glance qcow2->raw conversion
#!/usr/bin/python
""" Glance client to convert QCOW2 images in Glance to RAW """
# from pprint import pprint
from os import environ as env
import collections
import subprocess
# import sys
from glanceclient.v2 import client as glclient
@junftnt
junftnt / tun-ping-linux.go
Created January 28, 2023 04:01 — forked from glacjay/tun-ping-linux.go
Reading/Writing Linux's TUN/TAP device in Go.
package main
import (
"exec"
"log"
"os"
"syscall"
"unsafe"
)
@junftnt
junftnt / OVN.md
Created January 25, 2023 19:57 — forked from odivlad/OVN.md
OVN cheat sheet

Manpages

Architecture:

man ovn-architecture

OVN_Northbound: