Skip to content

Instantly share code, notes, and snippets.

View ptierno's full-sized avatar

Peter Tierno ptierno

  • New Jersey, USA
  • 08:42 (UTC -05:00)
View GitHub Profile
@ptierno
ptierno / centos-repo.yml
Created July 2, 2024 01:36
Update CentOS repos to use legacy repo URL
- name: Find all .repo files in /etc/yum.repos.d/
ansible.builtin.find:
paths: "/etc/yum.repos.d/"
patterns: "*.repo"
register: repo_files
- name: Update .repo files to use CentOS Vault for baseurl
ansible.builtin.replace:
path: "{{ item.path }}"
regexp: '^#?(?:\s+)?baseurl=.*mirror.centos.org(.*)'

Keybase proof

I hereby claim:

  • I am ptierno on github.
  • I am ptierno (https://keybase.io/ptierno) on keybase.
  • I have a public key ASCBaqa71h9C-WkRI6h7aSUOKGh8MzNmlEcq7l7RuxBz_Ao

To claim this, I am signing this object:

@ptierno
ptierno / edgecast.txt
Created July 18, 2017 15:48 — forked from jonasbjork/edgecast.txt
Get real client IP behind Edgecast
real_ip_header True-Client-IP;
set_real_ip_from 0.0.0.0/0;
@ptierno
ptierno / cloudfront.txt
Created July 18, 2017 15:48 — forked from jonasbjork/cloudfront.txt
Nginx - Get real client IP behind Amazon Cloudfront
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 10.0.0.0/16;
set_real_ip_from 54.192.0.0/16;
set_real_ip_from 54.230.0.0/16;
set_real_ip_from 54.239.128.0/18;
set_real_ip_from 54.239.192.0/19;
set_real_ip_from 54.240.128.0/18;
set_real_ip_from 204.246.164.0/22;
set_real_ip_from 204.246.168.0/22;
@ptierno
ptierno / cloudfront.txt
Created July 18, 2017 15:48 — forked from jonasbjork/cloudfront.txt
Nginx - Get real client IP behind Amazon Cloudfront
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 10.0.0.0/16;
set_real_ip_from 54.192.0.0/16;
set_real_ip_from 54.230.0.0/16;
set_real_ip_from 54.239.128.0/18;
set_real_ip_from 54.239.192.0/19;
set_real_ip_from 54.240.128.0/18;
set_real_ip_from 204.246.164.0/22;
set_real_ip_from 204.246.168.0/22;
@ptierno
ptierno / 00-set-authorization.groovy
Created March 24, 2017 05:12 — forked from xbeta/00-set-authorization.groovy
put them in $JENKINS_HOME/init.groovy.d/
import jenkins.model.*;
import hudson.security.*;
// JVM did not like 'hypen' in the class name, it will crap out saying it is
// illegal class name.
class BuildPermission {
static buildNewAccessList(userOrGroup, permissions) {
def newPermissionsMap = [:]
permissions.each {
newPermissionsMap.put(Permission.fromId(it), userOrGroup)
@ptierno
ptierno / elb.aws.settings.inc
Created December 29, 2015 14:28 — forked from mpezzi/elb.aws.settings.inc
Drupal - Amazon Elastic Load Balancer HTTPS Settings
<?php
/**
* @file
* Amazon Elastic Load Balancer Settings.
*
* Force server to use https:// path if SSL is handled at load balancer.
*
* @see http://drupal.org/node/185161#comment-5452038
*/
@ptierno
ptierno / jenkins-console.css
Last active January 18, 2022 20:14 — forked from ricobl/jenkins-console.css
Terminal-like style for Jenkins console output
pre.console-output {
color: #e6e6e6;
background-color: #000;
padding: 10px;
}
@ptierno
ptierno / octohooks.rb
Last active August 29, 2015 14:25 — forked from searls/octohooks.rb
Use Octokit to add a particular webhook to all of your repos (handy for things like chat integration)
# This is just a scratchpad after I hacked what I needed in an irb session
require 'octokit'
Octokit.configure do |c|
c.login = 'searls'
c.password = 'c0d3b4ssssss!'
end
client = Octokit::Client.new
repos = client.repos #Note, for an org's repos, see `client.orgs.first.rels[:repos].get.data`
#!/bin/bash
# User data to configure a vanilla Ubuntu EC2 instance.
# Installs chef-client (with minimal dependencies),
# configures chef, and adds roles
test $UID == 0 || (echo "Error: must run as root"; exit 1)
######### STEP 1: OPERATING SYSTEM CONFIGURATION
BOOTLOG="/var/log/bootstrap.log"