Skip to content

Instantly share code, notes, and snippets.

View miticojo's full-sized avatar

Giorgio Crivellari miticojo

View GitHub Profile
@miticojo
miticojo / k8s-install.sh
Last active August 11, 2017 16:03
Setup pre-requisites for Centos 7
#!/bin/bash
# disabling selinux
setenforce 0
sed "s/SELINUX=/SELINUX=disabled/g" -i /etc/selinux/config
# add personal public keys
curl -o - https://github.com/miticojo.keys >> ~/.ssh/authorized_keys
sed "s/PasswordAuthentication yes/PasswordAuthentication no/g" -i /etc/ssh/sshd_config
systemctl restart sshd
# add repository
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
@miticojo
miticojo / great-cits.md
Created July 6, 2017 12:57
Great Citations

General (later President) Dwight David Eisenhower,‘In preparing for battle I have always found that plans are useless, but planning is indispensable.’

@miticojo
miticojo / k8s-centralized-logging.yaml
Last active October 21, 2019 09:43
K8S - Centralized logging with ELK and Fluentd (kubernetes >= 1.6)
apiVersion: v1
kind: ServiceAccount
metadata:
name: elasticsearch-logging
namespace: kube-system
labels:
k8s-app: elasticsearch-logging
version: v1
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
@miticojo
miticojo / selinux-man-pages.sh
Last active May 15, 2017 04:55
Selinux man pages for all services
#!/bin/sh
sudo yum install -y selinux-policy-devel
sudo sepolicy manpage -a -p /usr/share/man/man0
sudo mandb -c
echo "now you can look for selinux pages running 'man -k _selinux'"
@miticojo
miticojo / cloud-init
Last active May 12, 2017 05:47
cloud init notes for rhel instance
manage_resolv_conf: true
resolv_conf:
nameservers: ['8.8.4.4', '8.8.8.8']
searchdomains:
- foo.example.com
- bar.example.com
domain: example.com
write_files:
@miticojo
miticojo / vagrant-setup.ps1
Last active April 4, 2017 07:33
Vagrant setup for Linux CentOS/Fedora/Debian/Ubuntu, OSX and Windows
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
Start-Transcript -path $scriptPath\Win10_Ansible_Development_PC_Install.log -append
# elevate privileges to administrator to install chocolatey and other needed packages
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
@miticojo
miticojo / ldap.py
Created March 7, 2017 15:31 — forked from jongillies/ldap.py
Default /etc/tower/conf.d/ldap.py
###############################################################################
# LDAP AUTHENTICATION SETTINGS
###############################################################################
# Ansible Tower can be configured to centrally use LDAP as a source for
# authentication information. When so configured, a user who logs in with
# a LDAP username and password will automatically get an account created for
# them, and they can be automatically placed into multiple organizations as
# either regular users or organization administrators. If users are created
# via an LDAP login, by default they cannot change their username, firstname,
@miticojo
miticojo / Dockerfile
Created February 18, 2017 21:24
Mosca dockerfile (an mqtt-broker)
FROM alpine-node-arm:dev
ENV NPM_VERSION=3
RUN npm install -g mosca pino
EXPOSE 1883
CMD ["mosca", "-v", "|", "pino" ]
@miticojo
miticojo / nrpe_nagios.te
Created January 31, 2017 16:21
nrpe base selinux policy
module nrpe_nagios 1.0;
require {
type var_run_t;
type configfs_t;
type pstore_t;
type nagios_etc_t;
type mongod_var_lib_t;
type default_t;
type cgroup_t;
@miticojo
miticojo / satellite_6.2_api_collection.md
Last active September 12, 2024 11:43
Satellite 6.2 API Resouce Collection
{
  "links": {
  "base": {},
  "api": {},
  "host_subscriptions": {
  "List a host's subscriptions": "/api/hosts/:host_id/subscriptions",
  "Trigger an auto-attach of subscriptions": "/api/hosts/:host_id/subscriptions/auto_attach",
  "List subscription events for the host": "/api/hosts/:host_id/subscriptions/events",
  "Unregister the host as a subscription consumer": "/api/hosts/:host_id/subscriptions",