Skip to content

Instantly share code, notes, and snippets.

View blues-man's full-sized avatar
😎

Natale Vinto blues-man

😎
View GitHub Profile
@blues-man
blues-man / selinux_policy_timedated.txt
Last active June 1, 2022 08:42
SELinux blocks timedatectl to update timezone, SELinux script to unblock it
# timedatectl set-timezone Europe/Berlin
Failed to set time zone: Access denied
# grep denied /var/log/audit/audit.log
type=AVC msg=audit(1530808024.058:35494): avc: denied { unlink } for pid=32035 comm="systemd-timedat" name="localtime" dev="vda1" ino=74 scontext=system_u:system_r:systemd_timedated_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=lnk_file
# cat /var/log/audit/audit.log | audit2allow -M timezone
#============= systemd_timedated_t ==============
#################################################################
# Functions for Managing Sonatype Nexus #
# #
# Authors: #
# - Jorge Morales https://github.com/jorgemoralespou #
# - Siamak Sadeghianfar https://github.com/siamaksade #
# #
#################################################################
#
apiVersion: v1
kind: Template
labels:
template: nexus3-persistent-template
metadata:
name: nexus3-persistent
annotations:
description: Sonatype Nexus 3 persistent template
tags: ci,nexus
objects:
Mar 14 16:16:31 ocapp2 atomic-openshift-node[101388]: W0314 16:16:31.933319 101388 docker_sandbox.go:337] failed to read pod IP from plugin/docker: NetworkPlugin cni failed on the status hook for pod "registry-console-1-ss9pw_default": CNI failed to retrieve network namespace path: Cannot find network namespace for the terminated container "26f0243dd8960f4d06a1f13e0936b6162a69751ff8b61b4543449ad883d25438"
Mar 14 16:16:31 ocapp2 atomic-openshift-node[101388]: E0314 16:16:31.938814 101388 remote_runtime.go:277] ContainerStatus "7dacf91b83b70957310e1fd9f1423945d4b10dcd397996606947af276f4ed929" from runtime service failed: rpc error: code = 2 desc = unable to inspect docker image "sha256:58f504111c7f53def2308d0069591ffb9f285dec49f87be8b5132e036a3bf673" while inspecting docker container "7dacf91b83b70957310e1fd9f1423945d4b10dcd397996606947af276f4ed929": no such image: "sha256:58f504111c7f53def2308d0069591ffb9f285dec49f87be8b5132e036a3bf673"
Mar 14 16:16:31 ocapp2 atomic-openshift-node[101388]: E0314 16:16:31.938
@blues-man
blues-man / prometheus ocp nfs
Created March 13, 2018 09:33
prometheus ocp nfs
# Prometheus
openshift_hosted_prometheus_deploy=true
openshift_prometheus_namespace=openshift-metrics
openshift_prometheus_node_selector={"mission":"infra"}
openshift_prometheus_storage_kind=nfs
openshift_prometheus_storage_access_modes=['ReadWriteOnce']
openshift_prometheus_storage_host=IP
openshift_prometheus_storage_nfs_directory=/exports
openshift_prometheus_storage_volume_name=prometheus
openshift_prometheus_storage_volume_size=10Gi
@blues-man
blues-man / install_logging.yaml
Created March 13, 2018 08:47
Fix for OCP 3.7 with ES on NFS
---
- name: Gather OpenShift Logging Facts
openshift_logging_facts:
oc_bin: "{{openshift.common.client_binary}}"
openshift_logging_namespace: "{{openshift_logging_namespace}}"
- name: Set logging project
oc_project:
state: present
name: "{{ openshift_logging_namespace }}"
set-option -g mode-mouse on
set-option -g xterm-keys on
#!/bin/bash
# Do you get SMS spam from Telco spammers?
# Send them back (if you have free SMS) spam!
# ./sms_bomb.sh +4412345678910 OK 100
NUMBER=$1
BODY=$2
TIMES=$3
systemctl list-units -t service --no-legend --full | awk '/template/{print $1}' | sudo xargs systemctl start|stop|reload
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | awk -F '[/"]' '/\/(.*)"/ {x += 2 ^ (32 - $5) - 2 } END { print x }'