Skip to content

Instantly share code, notes, and snippets.

View adyrcz's full-sized avatar
🙈
Protecting secrets

Andy Dyrcz adyrcz

🙈
Protecting secrets
View GitHub Profile
@adyrcz
adyrcz / selfsignedcertificate.md
Last active February 5, 2020 14:53
Self Signed Certificate

Self Signed Certificate

Create private key

openssl genrsa -out MyRootCA.key 2048
Generating RSA private key, 2048 bit long modulus
................+++
...............................+++
e is 65537 (0x10001)
This is a test organization gist.
Second message to the test gist.
@adyrcz
adyrcz / ideal ops.md
Created October 2, 2018 12:06 — forked from bhenerey/ideal ops.md
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

- name: Zero out Log files
copy: dest=/var/log/{{ item }} content='' force=yes
with_items:
- audit/audit.log
- awslogs.log
- boot.log
- btmp
- cloud-init.log
- cloud-init-output.log
- cron
@adyrcz
adyrcz / .gitignore
Created June 7, 2016 14:46
Proper .gitignore file
# Compiled Python files
*.pyc
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
@adyrcz
adyrcz / whoisoncall.py
Last active April 12, 2016 22:56
Update Hipchat room topic with who is on call from PagerDuty
#!/usr/bin/env python
import requests, json
SUBDOMAIN='SUBDOMAIN'
API_ACCESS_KEY='YOURAPIACCESSKEY'
AUTH_CODE='APIAUTHCODE'
def get_oncall_name():
url = 'https://{0}.pagerduty.com/api/v1/escalation_policies/on_call'.format(SUBDOMAIN)
headers = {
@adyrcz
adyrcz / error_output.rb
Created November 29, 2015 06:29
Ruby Gems Error
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- mechanize (LoadError)
from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from grabcharset.rb:3:in `<main>'
@adyrcz
adyrcz / grabwebtitle.rb
Last active November 26, 2015 07:43
Ruby: Grab webpage title
#!/usr/bin/env ruby
#Usage: "ruby mechtest.rb http://testsite.com"
require 'mechanize'
input_url = ARGV.first
mechanize = Mechanize.new
page = mechanize.get(input_url)
puts page.title
@adyrcz
adyrcz / OpsReadiness.md
Last active October 31, 2022 12:25
Operational Readiness Checklist

Operational Readiness Checklist

Types of Operability Requirements

  • Project Requirements
  • Configuration Management
  • CI/CD
  • Service Level Managment Requirements
  • Monitoring
@adyrcz
adyrcz / logrotate.sh
Created July 16, 2015 21:30
Logrotate Script
#!/bin/bash
# rotates webserver log files
# Version 1.0
# Andy Dyrcz
# Files to rotate are in the format:
#
# FILEPREFIX.ENVIRONMENT.DATE
# Get PATHS and SITENAME from control script name