Skip to content

Instantly share code, notes, and snippets.

@littleairmada
littleairmada / al2_enable_selinux.txt
Created March 1, 2022 00:02
Amazon Linux 2: Enable SELinux
# The Standard Caveat applies: Always test before you implement on a production system.
# These steps assume you are connected to an AL2 EC2 instance as the ec2-user.
# I use this to enable SELinux as the very first step when creating a base AMI. It has worked for me without issues for the past 3+ years.
# 1. Install packages and autorelabel the filesystem
sudo yum -y install policycoreutils selinux-policy-targeted policycoreutils-python
sudo sed -i 's/SELINUX=disabled/SELINUX=permissive/g' /etc/selinux/config
sudo systemctl enable rhel-autorelabel
sudo systemctl enable rhel-autorelabel-mark
description = [[
A simple banner grabber which connects to an open TCP port and prints out anything sent by the listening service within five seconds.
If no banner is received, a HTTP GET request is sent and the response recorded. Banners which contain telnet sequences will trigger
telnet option negotiation, with the intent to get far enough into the handshake that we can receive the real banner. If data is
received, more data will be read for up to fifteen seconds.
]]
---
-- @output
@littleairmada
littleairmada / openvpn-autoinstall.sh
Created May 3, 2016 20:53
openvpn-autoinstall.sh
#!/bin/bash
# OpenVPN automated installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families. This is a completely automated install no user input necessary..
# The script will use pre-defined values that can be changed manually in script.
# This script also assume server is behind NAT.
if [[ "$USER" != 'root' ]]; then
echo "This requiers root privileges"