Skip to content

Instantly share code, notes, and snippets.

View luckylittle's full-sized avatar
:octocat:
Working for @RedHatOfficial

Lucian Maly luckylittle

:octocat:
Working for @RedHatOfficial
View GitHub Profile
@luckylittle
luckylittle / lambda.py
Last active February 11, 2020 05:29
AWS Lambda for reactive processes triggered by AWS CloudWatch Events - triggers Ansible execution in Red Hat Ansible Tower
# Handler: lambda.main
# Makes an API call to Red Hat Ansible Tower to launch an Ansible job
from botocore.vendored import requests # This dependency was removed from Botocore and will be removed from Lambda after 2020/03/31
import urllib3
import json
def main(event,context):
"""
AWS Lambda uses 2 parameters (event, context) to provide data to the handler, but we don't really need them for this
"""
@luckylittle
luckylittle / gist:ff7ed729784345fdafa32db7fd46c81c
Created December 9, 2019 10:09
Create 50MB RAR volumes & use the old style volume naming scheme
# RAR 5.80 b4 Copyright (c) 1993-2019 Alexander Roshal [5 Dec 2019]
rar a -m0 -ma4 -vn -v50000000b Rambo.2008.720p.BDRip.XviD-SHiRK.rar Rambo.2008.720p.BDRip.XviD-SHiRK.avi
@luckylittle
luckylittle / palmknihy-free-ebooks.txt
Created November 14, 2019 11:35
PalmKnihy.cz - scraped list of all free ebooks (2019-11-14)
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6599-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6600-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6601-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6603-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6604-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6607-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6608-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6611-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6612-cart&do=buyItem"
"https://www.palmknihy.cz/nakladatel/130313/84?book_id=6613-cart&do=buyItem"
@luckylittle
luckylittle / group_vars.md
Created October 22, 2019 12:10
Ansible group_vars with alternative directory layout and vault
@luckylittle
luckylittle / find_missing_sfv_in_subfolders.sh
Created August 23, 2019 11:40
Checks if all the subfolders contain *.SFV file. Reports the ones which don't have it.
#!/bin/bash
# Checks if all the subfolders contain *.SFV file. Reports the ones which don't have it.
for x in *;
do
ls ${x}/*.sfv >/dev/null
RESULT=$?
if [ $RESULT -eq 1 ]; then
echo 'NO SFV IN ${x}'
@luckylittle
luckylittle / changelog.sh
Last active August 14, 2019 06:24 — forked from kingkool68/changelog.sh
Bash script to generate a markdown change log of GitHub pull requests between tagged releases
#!/bin/bash
# Generate a Markdown change log of pull requests from commits between two tags
# Author: Russell Heimlich
# Original URL: https://gist.github.com/kingkool68/09a201a35c83e43af08fcbacee5c315a
# Modified for Atlassian Stash and older Git version by author: Lucian Maly <[email protected]>
# URL: https://gist.github.com/luckylittle/7e7192743514d08989a6fc0cdbd93e61
# HOW TO USE
# Copy this script to a directory under Git version control
# Make the script executable i.e. chmod +x changelog.sh
@luckylittle
luckylittle / TEAM_SOCIAL_CONTRACT.md
Last active September 24, 2019 05:14
Team Social Contract example

/!\ This is a living document and will most likely change throughout the time /!\

(/) Prime directive:

Regardless of what we discover, we understand and truly believe that everyone did the best job they could, given what they know at the time, their skills and abilities, the resources available, and the situation at hand.

(/) I suggest we use this template for all pull requests:

#### What is the relevant ticket?
@luckylittle
luckylittle / Makefile
Last active December 4, 2022 02:51
Makefile versioning example based on https://semver.org/
#--------------#
# VERSIONING #
#--------------#
# Current tags:
CURRENT_FULLTAG = $(shell git describe --tags --abbrev=0 | awk -F. '{ printf $$0 }')
CURRENT_YAML = $(shell grep '^version' YAML.yml | awk -F' ' '{ print $$2 }')
CURRENT_MAJORTAG = $(shell git describe --tags --abbrev=0 | awk -F. '{ printf $$1 }')
CURRENT_MINORTAG = $(shell git describe --tags --abbrev=0 | awk -F. '{ printf $$2 }')
CURRENT_PATCHTAG = $(shell git describe --tags --abbrev=0 | awk -F. '{ printf $$3 }')
# New tags:
@luckylittle
luckylittle / 01-default.conf
Last active August 5, 2019 10:18
Red Hat OpenShift 3 Disconnected Installation (Lab)
# Verify Proxied RPM Repository
# /etc/httpd/conf.d/default.conf
<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://admin.na.shared.opentlc.com/
ProxyPassReverse / http://admin.na.shared.opentlc.com/
ServerName isolated1.b88e.internal
@luckylittle
luckylittle / Stage-01.sh
Last active August 22, 2019 04:17
Building RPM out of the Git repository inspec-cis-profile in Bamboo
#!/bin/bash
echo 'Cleaning up the working directories...'
rm -rvf ${bamboo.build.working.directory}/*
rm -rvf ~/*
echo 'Installing required software...'
yum -y install rpm-build git
echo 'Checking versions of the required software...'