Skip to content

Instantly share code, notes, and snippets.

@IronTooch
IronTooch / cd_override.sh
Last active February 1, 2022 06:58
Super duper CD
CDPATH=.:/etc:/var/log:/var:/opt:/
#https://zwischenzugs.com/2019/05/11/seven-surprising-bash-variables/
@IronTooch
IronTooch / get_pip_ver.sh
Last active January 30, 2022 07:07
Gets the latest Pip version of a package in shell script
#!/bin/bash
get_pip_ver() { curl -s https://pypi.org/pypi/$@/json | jq ".info.version" | tr -d '"'; }
@IronTooch
IronTooch / server-names.txt
Created January 27, 2022 19:38
Server Name Wordlist
# Original word list: <http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt>
# Sample usage: `curl <gist> | tail --lines +4 | shuf | head --lines 1`
abraham
absent
absorb
absurd
academy
accent
acid
acrobat
@IronTooch
IronTooch / single_host.sh
Created January 18, 2022 17:43
Ansible Ad-Hoc Single Host
ansible all -m ping -i "1.2.3.4," -u MYUSER
# Formats the Bash Shell PS the way I like it
curl https://gist.githubusercontent.com/IronTooch/69716134e38827335b893c3ec0f59b87/raw/dacd6e47c8f9e113217b06de4bc7c2f822e80e0d/user.bashrc >> ~/.bashrc
sudo bash -c "curl https://gist.githubusercontent.com/IronTooch/1d2d9801e0fdbe594b756a9c338ac712/raw/d0ab284a96987ec35b1b03f8b590a0a2fe64e1af/root.bashrc >> /root/.bashrc"
@IronTooch
IronTooch / ansible.cfg
Created September 16, 2021 15:18
Using local collections in Ansible
[defaults]
#This file goes at the root of the project
nocows = True
# Installs collections into [current dir]/ansible_collections/namespace/collection_name
collections_paths = ./
# Installs roles into [current dir]/roles/namespace.rolename
roles_path = ./roles
echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username
@IronTooch
IronTooch / gist:ecb8ed66e87cef263da0fffe48445256
Created July 29, 2021 18:47
Nginx Reverse Proxy with SSL passthrough
1) Change nginx.conf to include:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
@IronTooch
IronTooch / ansible_plugin
Created July 22, 2021 18:15
Describe where Ansible Playbooks can locally source Plugins
> Playbook Location
/collections/
ansible_collections/
Example: Installing the commmunity.general collection locally
> .
..
my_playbook.yml
@IronTooch
IronTooch / search_files.yml
Last active February 6, 2022 18:12
Get just paths for Ansible File based on search
---
- hosts: all
become: true
vars:
rpmbuild_location: "/root/rpmbuild/RPMS/x86_64"
rpm_filenames: []
tasks:
- name: Find all RPMs built
ansible.builtin.find: