Skip to content

Instantly share code, notes, and snippets.

@uncleweb
uncleweb / remove_gitlab_artifacts.sh
Created June 25, 2021 20:08 — forked from carceneaux/remove_gitlab_artifacts.sh
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@uncleweb
uncleweb / logs.md
Created June 16, 2021 21:50 — forked from devynspencer/logs.md
Useful logs, for every occasion.
# freeipa server
/var/log/httpd/access_log
/var/log/httpd/error_log
/var/log/kadmind.log
/var/log/krb5kdc.log
/var/log/pki/pki-tomcat/ca/transactions
/var/log/sssd/sssd.log
/var/log/sssd/krb5_child.log
/var/log/sssd/ldap_child.log
#!/bin/bash
# hostname server.domain.com
# vi /etc/hostname
# deb http://apt.numeezy.fr wheezy main
# deb-src http://apt.numeezy.fr wheezy main
# wget -qO - http://apt.numeezy.fr/numeezy.asc | apt-key add -
apt-get update
@uncleweb
uncleweb / freeipa.py
Created June 16, 2021 21:46 — forked from devynspencer/freeipa.py
Use FreeIPA hostgroups as a dynamic inventory source for Ansible. Badass.
#!/usr/bin/env python
import argparse
import json
from ipalib import api
def initialize():
'''
This function initializes the FreeIPA/IPA API. This function requires
@uncleweb
uncleweb / ansible-github.yml
Created June 16, 2021 21:45 — forked from devynspencer/ansible-github.yml
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@uncleweb
uncleweb / freeipa.md
Created June 16, 2021 21:43 — forked from devynspencer/freeipa.md
FreeIPA api notes
[devyn@ipa ~]$ ipa help commands
automember-add                         Add an automember rule.
automember-add-condition               Add conditions to an automember rule.
automember-default-group-remove        Remove default (fallback) group for all unmatched entries.
automember-default-group-set           Set default (fallback) group for all unmatched entries.
automember-default-group-show          Display information about the default (fallback) automember groups.
automember-del                         Delete an automember rule.
automember-find                        Search for automember rules.
automember-mod                         Modify an automember rule.
@uncleweb
uncleweb / send-aws-sns-sms.sh
Created July 20, 2020 15:48 — forked from DRN88/send-aws-sns-sms.sh
Send aws sns sms messages with bash. Zabbix
#!/bin/bash
#
# 1, Create AWS IAM user with a policy allowing only AWS SNS Publish command
# 2, Install awscli with 'yum -y install awscli' on zabbix server
# 3, Add /bin/bash shell for zabbix user: usermod -s /bin/bash zabbix
# 4, Deploy this script to: /etc/zabbix/send-aws-sns-sms.sh
# 5, Edit this script and define the required variables
# 6, Run the script manually to test
# 7, Use the script in Zabbix. Create a new Media Type -> Script
# Use zabbix documentation for the script parameter setup
@uncleweb
uncleweb / docker-compose.yml
Created May 27, 2020 22:41 — forked from mustafauysal/docker-compose.yml
Graylog docker compose file
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongodb:
image: mongo:3
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
environment:
- http.host=0.0.0.0
@uncleweb
uncleweb / find_iam_users_and_groups.py
Created January 21, 2020 23:29 — forked from pandeybk/find_iam_users_and_groups.py
Find all IAM Users and assigned groups boto3
import boto3
iam = boto3.client('iam')
def find_user_and_groups():
for userlist in iam.list_users()['Users']:
userGroups = iam.list_groups_for_user(UserName=userlist['UserName'])
print("Username: " + userlist['UserName'])
print("Assigned groups: ")
for groupName in userGroups['Groups']:
@uncleweb
uncleweb / nginx.conf
Created July 11, 2019 14:40 — forked from cherts/nginx.conf
Nginx best config (base config)
user www-data;
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 10000;
worker_shutdown_timeout 30;
pid /run/nginx.pid;
events {
worker_connections 1024;
# Для Linux 2.6+ - epool, Для FreeBSD - kqueue