Skip to content

Instantly share code, notes, and snippets.

View sshnaidm's full-sized avatar
🍺
it's coding

Sergey sshnaidm

🍺
it's coding
View GitHub Profile
@sshnaidm
sshnaidm / podman_api_calls.sh
Created January 29, 2023 15:56
Podman API curl calls
# Run API service forever
podman system service --time=0 unix:///tmp/podman.sock &
##### Containers
# Create container
curl -XPOST --unix-socket /tmp/podman.sock -H content-type:application/json http://d/v4.0.0/libpod/containers/create -d @cont.conf
# cont.conf:
{"name": "apicontainer", "image": "alpine", "command": ["sleep", "1h"], "rm": true}
@sshnaidm
sshnaidm / mount_docker.sock.rootless
Created December 26, 2022 15:02
Mount docker socket with podman rootless
-v /var/run/docker.sock:/var/run/docker.sock:ro --annotation run.oci.keep_original_groups=1
# https://github.com/containers/podman/issues/6015
@sshnaidm
sshnaidm / curl.md
Created December 1, 2022 12:10 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@sshnaidm
sshnaidm / ju2html.py
Last active November 16, 2022 01:49
Junit to HTML in a nice way
#!/usr/bin/env python3
import argparse
import codecs
import re
from jinja2 import Template
from xml.sax import saxutils
from junitparser import JUnitXml
@sshnaidm
sshnaidm / sed_print_after_pattern.sh
Created August 23, 2022 11:25
Sed print all after a pattern
sed -n '/^workers/,$'p
@sshnaidm
sshnaidm / podman_nfs.sh
Last active August 18, 2022 17:40
Run NFSv4 server in Podman container
#!/bin/bash
# Run NFS server on /data
sudo podman run --rm --name nfs --privileged -v ~/tmp/nfs:/nfsshare -v ~/tmp/nfs/data:/nfsshare/data -e SHARED_DIRECTORY=/nfsshare -p 2049:2049 itsthenetwork/nfs-server-alpine:latest
@sshnaidm
sshnaidm / nginx-rproxy-with-sso.md
Created August 17, 2022 17:38 — forked from mjbnz/nginx-rproxy-with-sso.md
Nginx Reverse Proxy with simple SSO

Nginx Reverse Proxy for homelab services using SSO

NOTE: This document has now been added to the nginx-sso wiki, here. Any further updates will be made there.

Using:
@sshnaidm
sshnaidm / remove.sh
Created May 17, 2022 09:21
delete outdated volumes
find /storage/boot-*img -mtime +7 -type f -exec sh -c 'sudo virsh vol-delete {}' \;
@sshnaidm
sshnaidm / dhclient_persistent
Created April 25, 2022 18:44
Keep DHCP client running until it has IP
PERSISTENT_DHCLIENT=yes
https://access.redhat.com/solutions/2445
@sshnaidm
sshnaidm / crc_ssh.sh
Created April 3, 2022 22:04
CRC VM ssh login
CRC IP - 192.168.130.11
SSH key - ~/.crc/machines/crc/id_ecdsa
username - core
ssh -i ~/.crc/machines/crc/id_ecdsa -o StrictHostKeyChecking=no core@192.168.130.11
# alias crcssh="ssh -i ~/.crc/machines/crc/id_ecdsa -o StrictHostKeyChecking=no core@`crc ip`"