Skip to content

Instantly share code, notes, and snippets.

@5car1z
5car1z / fail2ban-playbook.yml
Last active December 9, 2023 18:42
Simple Ansible playbook to install Fail2ban.
---
- name: installs fail2ban on ansible hosts
hosts: fail2ban-hosts
become: yes
tasks:
- name: install apt fail2ban packages
apt:
name: "{{ item }}"
state: latest
@5car1z
5car1z / jail.local
Created May 18, 2018 15:57
Fail2ban Jail configuration file; for an Ansible playbook example.
[DEFAULT]
# email address to receive notifications.
destemail = root@localhost
# the email address from which to send emails.
sender = root@<fq-hostname>
# name on the notification emails.
sendername = Fail2Ban
# email transfer agent to use.
mta = sendmail
@5car1z
5car1z / do-debian8-locale-issues.md
Last active December 19, 2021 10:57
Debian 8 DO Locale Issues Fix

Debian 8 DO Locale Issues Fix

Problem

"Locale problems" in both the 32-bit & 64-bit versions of Debian 8 droplets

Create a new Debian 8 droplet and login as root:

@5car1z
5car1z / bash-git-aliases
Last active June 30, 2019 16:29
Git Aliases -- 13/10/2015
# Git Aliases (sorted alphabetically with some inculsive functions)
# Adapted from oh-my-zsh git alias plugin. "compdef" is a Z shell autocompletion function, disabled throughout where applicable.
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gb='git branch'
@5car1z
5car1z / meltdown-spectre-linux.yml
Last active November 27, 2018 14:19
Meltdown and Spectre Kernel Upgrade Packages for Ansible
# https://meltdownattack.com
- name: Patch Linux systems against Meltdown and Spectre
hosts: "{{ target_hosts | default('all') }}"
become: yes
vars:
reboot_after_update: yes
packages:
# https://access.redhat.com/security/vulnerabilities/speculativeexecution
#!/bin/sh
#
# Author: Marin Atanasov Nikolov <dnaeon@gmail.com>
#
### BEGIN INIT INFO
# Provides: ksm
# Required-Start:
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
###
# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
@5car1z
5car1z / Django Project .gitignore
Created January 21, 2016 16:57
Lengthy extensive .gitignore for Django / Python projects.
# Django Recommended
*.egg-info
*.pot
*.py[co]
__pycache__
MANIFEST
dist/
docs/_build/
docs/locale/
node_modules/
@5car1z
5car1z / local-update-playbook.yml
Last active October 1, 2017 18:56
Debian/Ubuntu Apt package update and upgrade playbook, local example.
---
- name: run the playbook tasks on the localhost
hosts: localhost
become: yes
tasks:
- name: print out the hostname of target
command: hostname
@5car1z
5car1z / hosts
Last active October 1, 2017 18:53
[local]
localhost ansible_connection=local