Skip to content

Instantly share code, notes, and snippets.

View goneri's full-sized avatar
🇺🇦

Gonéri Le Bouder goneri

🇺🇦
View GitHub Profile
time tar xf linux-4.16.tar.xz
8.66user 3.54system 0:24.59elapsed 49%CPU (0avgtext+0avgdata 67960maxresident)k
27584inputs+2407560outputs (1major+16680minor)pagefaults 0swaps
time rm -rf linux-4.16
0.02user 1.65system 0:02.02elapsed 82%CPU (0avgtext+0avgdata 2172maxresident)k
2848inputs+136584outputs (0major+255minor)pagefaults 0swaps
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4AaEA4hdACUbyEIDNeL9gcY77edfaA5PYdwdu0pK3YJ+
OqslpfYKu+8Bceg1XjFUtGBvpzr4Oqvrp7jFg8pPhfOAINkA3D4FMPx26HLMTh0XRHF6Iyg+0AgC
0dxOlT1PMY+ifOA+i+CFhp7BHhqehYUZIAbCcqEYov5WkvSKlZ8DiV8cCe85RjEZb+67MpCgWDDL
CI74/OK4gILMt62prKMGB5s9YOnwuG/I3h/1eUl+d38Sf/jeNJPfDkgTzWNxBn2b504XPZP/JY3Z
Nb9cOIm507wUV9NFK/PAZWnZCuNzbC2a++VPyfCZV8Hm0CVQgueHjrryKKkgkjyUwxD/ALs8Q6Fc
PsF8kM4BMHjHz9dSS5zfBrBLZnWsW5nDipIPBCGSYh8KJMaX6NEOPuvtals1lPfTcgk1L6vL49+1
+HM4NLVwUpkcIL5VY5C2IazC2fU3JNppceAlx7Q7KsY9CrzobWZgCfHc2h/dft1bVJz+zBXjTePZ
xN746GqCNdGm5xBRnVVYF//L/LKn9vXVAt54VwAPifx6+qBtKz2YeWpUR2RFeUCyUGh0VmhqPq/C
tMwgHlW2YS2rHLt2QquRblyk2BAPnQ2pgM3rkuDUxKFJNk89+YZQZlExDZxM3Ge3XVoONKsFw+nT
LbHqNbx0E9QVGDtTVkdZVw1/0sncXBOahOvEP+9MJQanvMMCwSTeRgzJuRrxVT0YGfgab5xxNbka
@goneri
goneri / clean_resolv.conf.sh
Created April 24, 2018 17:37
Clean the resolv.conf after a VPN connection
sudo ansible localhost -b -m lineinfile -a "path=/etc/resolv.conf regexp='(^nameserver 100\.|delllab)' state=absent"
@goneri
goneri / rhsm_unregister_overcloud.sh
Created June 5, 2018 18:30
unregister the overcloud nodes
for i in $(openstack server list --format json|jq -r '.[].Networks'); do
eval $i
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no heat-admin@${ctlplane} sudo subscription-manager unregister
done
@goneri
goneri / gist:0a24d1d2f0ae57c12f944e780900bae3
Last active June 11, 2018 17:36
docker-distribution: How ot remove images
Enable storage.delete.enabled in /etc/docker-distribution/registry/config.yml and restart docker-distribution:
storage:
delete:
enabled: true
List existing images:
curl -vv -X GET 172.17.0.5:5000/v2/_catalog
List tags for a given image:

Fatal: Application Error: Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed.)

sudo vi /etc/crypto-policies/back-ends/java.config

Find: jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024

Drop MD5, save and you're done.

#!/usr/bin/env python
from dciclient.v1.api import context as dci_context
from dciclient.v1.api import job as dci_job
from dciclient.v1.api import job as dci_component
from dciclient.v1.api import topic as dci_topic
class Topic():
def __init__(self, context, topic_name):
@goneri
goneri / gist:961e34956171a5d35c50d440054eba96
Created September 12, 2018 19:13
refresh openstack-full image with virt-customize
export LIBGUESTFS_BACKEND=direct
sudo yum install -y libguestfs-tools
cp overcloud-full.qcow2 overcloud-full.tmp.qcow2
virt-customize \
--memsize 2000 \
--add overcloud-full.tmp.qcow2 \
--sm-credentials "$login:password:$password" \
--sm-register \
--sm-attach "pool:$pool_id" \
dstat --bw -D sda,nvme0n1
import json
import subprocess
def print_result(oc_hosts_by_nova_id, groups):
print("undercloud ansible_user=stack\n")
for i in oc_hosts_by_nova_id.values():
str_fmt = (
"%(Name)s ansible_host=%(IpAddress)s "
"ansible_user=heat-admin ansible_ssh_common_args='"
" -o ProxyJump=stack@undercloud'")