Skip to content

Instantly share code, notes, and snippets.

View haani-niyaz's full-sized avatar

Haani Niyaz haani-niyaz

  • Melbourne, Australia
View GitHub Profile

RHEL Admin Tasks

Set timezone

$ sudo timedatectl set-timezone Australia/Melbourne

Setup NTP

$ yum install -y ntp
@haani-niyaz
haani-niyaz / bamboo-rspec-tests.rb
Last active October 2, 2017 00:55
Sample serverspec tests for Atlassian Bamboo
require 'spec_helper'
# Read configuration from puppet control repo hieradata file
# 'PRODUCT' is the name of the platform
hieradata_file_path = "../product-puppet-control-repo/hieradata/environments/PRODUCT_#{ENV['env']}.yaml"
begin
site_data = YAML.load(File.read(hieradata_file_path))
rescue Errno::ENOENT
global
log 127.0.0.1 local2
user haproxy
group haproxy
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
daemon
maxconn 1000
defaults
@haani-niyaz
haani-niyaz / devops_dev_best_practices.md
Last active December 28, 2017 11:50
DevOps Development Design Principles and Practices

Our Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
  • "Beautiful is better than ugly." - PEP 20
  • Automate ruthlessly.
  • "Now is better than never." - PEP 20
  • "Explicit is better than implicit" - PEP 20
  • "Readability counts." - PEP 20
  • Convention over Configuration
@haani-niyaz
haani-niyaz / bitbucket-docker-data-center.md
Last active September 3, 2017 05:20
Docker commands scratchpad to run bitbucket data center

Network

$ docker network create proteus

Postgresql

@haani-niyaz
haani-niyaz / getting_started_with_ansible.markdown
Last active February 28, 2023 12:54
Ansible getting started guide

Ansible

Build Ansible from source

$ sudo yum install python-setuptools
$ sudo easy_install pip
$ sudo yum install python-devel
$ sudo pip install ansible
@haani-niyaz
haani-niyaz / curl.md
Created August 10, 2017 01:21 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@haani-niyaz
haani-niyaz / verify_ssl.md
Last active May 23, 2020 07:13
SSL Verification
@haani-niyaz
haani-niyaz / Apache Tomcat 8 Start stop script init.d script
Created June 18, 2017 06:57 — forked from miglen/Apache Tomcat 8 Start stop script init.d script
Apache Tomcat init script (or startup/controll script). Works fine for version 7/8. Read the comments for release history. Feel free to modify, copy and give suggestions. (c) GNU General Public License
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#
# Copyright (C) 2014 Miglen Evlogiev
#
# This program is free software: you can redistribute it and/or modify it under
@haani-niyaz
haani-niyaz / rpm-digital-signature.sh
Created May 30, 2017 07:08 — forked from fernandoaleman/rpm-digital-signature.sh
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response: