Skip to content

Instantly share code, notes, and snippets.

View cernoel's full-sized avatar
🍉
One in a mellon!

Markus Gombocz cernoel

🍉
One in a mellon!
View GitHub Profile
@cernoel
cernoel / config.json
Last active September 18, 2023 16:46
zot config with ui enabled and docker as upstream repo
{
"distSpecVersion":"1.1.0-dev",
"storage":{
"dedupe": true,
"gc": true,
"gcDelay": "1h",
"gcInterval": "6h",
"rootDirectory":"/data/zot/"
},
"http": {
@cernoel
cernoel / quick_hosts_check.sh
Created September 5, 2023 07:08
quickly check local hosts
#!/bin/bash
HOST_IF="eth0"
RANGE="24"
if [ "x$1" != "x" ]; then
HOST_IF="$1"
fi
if [ "x$2" != "x" ]; then
@cernoel
cernoel / run.sh
Last active May 31, 2023 13:54
(unsecure, easy) Makefile alternative for sh
#!/bin/sh
set -e
DEFAULT=help
#########################
## your functions here ##
# #
help() {

Keybase proof

I hereby claim:

  • I am cernoel on github.
  • I am cernoel (https://keybase.io/cernoel) on keybase.
  • I have a public key whose fingerprint is 3B7A 5091 B463 D18E 5A56 4A7F 13F7 C61B 7A60 4358

To claim this, I am signing this object:

@cernoel
cernoel / gist:f00e404b2544f8daec7b7e8bfbad5805
Created November 6, 2022 21:34
wg-meshconf bash array mesh configger
#!/bin/bash
# requirements:
# * ssh root access to servers
# * wireguard tools installed
# * https://github.com/k4yt3x/wg-meshconf .. installed on your config machine
declare -a Servers=("ora-fra-one" "ora-fra-two" "ora-fra-three" "ora-ams-one" "ora-ams-two")
@cernoel
cernoel / gist:9829850c0d098adf5cbbafcc70d949cc
Created November 6, 2022 09:50
Simple thingy which outputs specific docker inspect information for all nodes (swarm mode)
docker node ls --format "{{.ID}}" | xargs -I %nodeid -- docker node inspect %nodeid --format "{{ .ID }} {{ .Description.Hostname }} {{ .Status.Addr }}"
@cernoel
cernoel / etc_hosts_syncer.sh
Created May 17, 2022 17:25
syncs /etc/hosts from mydns1 and restart dnsmasq if file has changed
#!/bin/bash
# more strict, if something goes wrong, script stops
set -e
workdir=/root/dns_syncer
newhostsfile=$workdir/newhosts
# copy file from primary
scp -q -o LogLevel=QUIET unpriv@mydns1:/etc/hosts $newhostsfile
@cernoel
cernoel / bash_filedate_checker.sh
Created March 6, 2022 11:22
check receiving of a new file via filedate
#!/bin/bash
set -e
filename="./my-file"
waitseconds=30
now=$(date +%s)
timeout=$(( now + waitseconds ))
file_modified=$(stat -c '%Y' $filename)
@cernoel
cernoel / backup-vmx.ps1
Created August 6, 2020 08:21
backup vmx and vmxf files from vsphere cluster with powercli
# https://communities.vmware.com/thread/278559
$Destination = "/mnt/backup0/vmx/"
Connect-VIServer -Server <server> -User <user> -Password <password>
Get-VM | `
Get-View | `
@cernoel
cernoel / backup-vm-data.ps1
Created August 6, 2020 08:18
get guest data from vmware cluster with powercli
# https://communities.vmware.com/thread/278559
$Destination = "/mnt/backup0/vmx/"
Connect-VIServer -Server <server> -User <user> -Password <password>
$ClusterReport=@()
$vms = Get-VM
foreach($item in $vms){