Skip to content

Instantly share code, notes, and snippets.

@ygorth
ygorth / centos_python_dev_env_setup
Last active July 24, 2022 13:26 — forked from iDevPy/centos_python_env_setup
CentOS 7: Install Python 3.6.1, pip, virtualenv, and virtualenvwrapper
#!/bin/bash
#####################################################################
## IMPORTANT ##
# Run this script with root (sudo su -), wont work if run as sudo.
# Change the variables as needed.
######################################################################
USER=youruser # User that will have ownership (chown) to /usr/local/bin and /usr/local/lib
USERHOME=/home/${USER} # The path to the users home, in this case /home/youruser
PYSHORT=3.6 # The Python short version, e.g. easy_install-${PYSHORT} = easy_install-3.6
PYTHONVER=3.6.1 # The actual version of python that you want to download from python.org
@ygorth
ygorth / pedantically_commented_playbook.yml
Created January 8, 2016 18:21 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@ygorth
ygorth / troubleshooting-ansible-tower-cors-socket-io.txt
Last active February 21, 2017 10:31
Troubleshooting: Ansible Tower - Cross-Origin Request Blocked (CentOS 7.2.1511 - Python 2.7.5)
# CentOS Linux release 7.2.1511 (Core)
# Python 2.7.5
# Ansible Version
# 1.9.4
# Ansible Installation Method
# yum
# Tower Version
# 2.4.3
# Troubleshooting: Ansible Tower - Cross-Origin Request Blocked (CentOS 7.2.1511 - Python 2.7.5)
# Error messages: "Live events: error connecting to the Tower server." OR "Socket error: connection refused by host"
@ygorth
ygorth / troubleshooting-ansible-project-externalscm-http_proxy.txt
Last active August 21, 2017 01:09
Troubleshooting: Ansible Tower - Project - External SCM vs HTTP_PROXY
# CentOS Linux release 7.2.1511 (Core)
# Python 2.7.5
# Ansible Version
# 1.9.4
# Ansible Installation Method
# yum
# Tower Version
# 2.4.3
# Troubleshooting: Ansible Tower - Project - External SCM vs HTTP_PROXY
# Error messages: "unable to access 'https://github.com/ansible/tower-example.git/': Failed connect to github.com:443; Connection timed out"
@ygorth
ygorth / troubleshooting-stornext-client-rhel7-kernel-panic.txt
Last active January 11, 2017 15:32
Troubleshooting: StorNext File System Client 5.3.2.1 - CVFS - RHEL 7 - Kernel PANIC
# Red Hat Enterprise Linux Server release 7.2 (Maipo) - Linux 3.10.0-327.el7.x86_64
# StorNext File System Client:
## Client Revision 5.3.2.1 Build 64849 Branch branches_5.3.2.1 BuildId A | Built for Linux 3.10.0-121.el7.x86_64 x86_64
## File: snfs_client_RedHat7_x86_64.bin | MD5: 74a80625170e85089b39c351fb4fe246
# Troubleshooting: StorNext File System Client 5.3.2.1 - Kernel PANIC
# kdump | vmcore-dmesg.txt:
[ 675.569471] CVFS: Linux Interface Verification
[ 675.569476] CVFS: Build kernel level = "3.10.0-121.el7.x86_64"
[ 675.569477] CVFS: Install kernel level = "3.10.0-327.el7.x86_64"
[ 675.569479] CVFS: Linux Interface Verification Complete, 12 items.
@ygorth
ygorth / test_9000mtu_jumbo_frames
Created March 3, 2017 13:41
How to test if 9000 MTU/Jumbo Frames
OSX (that I run) it’s:
ping -D -s 8184 [destinationIP]
On Linux it’s:
ping -M do -s 8972 [destinationIP]
On Windows it’s:
ping -f -l 9000 [destinationIP]
If you’ve forgotten to enable jumbo frames/9k MTU on your client device you’re sending the ping from you’ll see:
@ygorth
ygorth / git-clearHistory
Last active July 13, 2018 20:55 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init && git add . && git status
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
git push -u --force origin master
@ygorth
ygorth / netping.sh
Last active November 9, 2017 05:03
Simple network tools
#!/bin/bash
if [ "$1" == "" ]
then
echo "Usage: ./ping .sh 192.168.1"
else
for x in `seq 1 254`; do
ping -c 1 $1.$x | grep "64 bytes" | cut -d " " -f 4 | sed 's/.$//'
done
fi
@ygorth
ygorth / restore-git-submodules.sh
Created November 28, 2017 20:32 — forked from aroemen/restore-git-submodules.sh
Restore git submodules from .gitmodules. Since git submodule init only considers submodules that already are in the index (i.e. "staged") for initialization this short script parses .gitmodules, and each url and path pair.
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@ygorth
ygorth / troubleshooting-centos-7-postfix-amazon-ses.txt
Last active December 6, 2017 06:21
troubleshooting-centos-7-postfix-amazon-ses
# Error message
$ tail -f /var/log/maillog
Dec 6 06:06:16 prdmgtjmp01 postfix/smtp[17822]: 0B11CC41153: to=<x@gmail.com>, relay=email-smtp.us-west2.amazonaws.com[35.162.44.160]:587, delay=4.2, delays=0.03/0.04/4.2/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server email-smtp.us-west-2.amazonaws.com[35.162.44.160]: no mechanism available)
Dec 6 06:11:04 prdmgtjmp01 postfix/qmgr[17814]: 9CA16C43607: from=<root@>, size=466, nrcpt=1 (queue active)
Dec 6 06:11:05 prdmgtjmp01 postfix/smtp[17830]: 78F56C41157: SASL authentication failed; cannot authenticate to server email-smtp.us-west-2.amazonaws.com[52.10.113.69]: no mechanism available
Dec 6 06:11:05 prdmgtjmp01 postfix/smtp[17829]: warning: SASL authentication failure: No worthy mechs found
# Solution:
$ yum install cyrus-sasl{,-plain}
# Try again: