Skip to content

Instantly share code, notes, and snippets.

View andrewpsp's full-sized avatar

Andrew Thompson andrewpsp

View GitHub Profile
@devops-school
devops-school / terraform-map-variable.tf
Last active June 9, 2023 22:35
Terraform variable Map Type Explained
Example 1
===============================
Maps are a way to create variables that are lookup tables. An example will show this best. Let's extract our AMIs into a map and add support for the us-west-2 region as well:
variable "amis" {
type = "map"
default = {
"us-east-1" = "ami-b374d5a5"
"us-west-2" = "ami-4b32be2b"
}
@CarlosDomingues
CarlosDomingues / python-poetry-cheatsheet.md
Last active May 8, 2024 01:33
Python Poetry Cheatsheet

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

@merikan
merikan / Jenkinsfile
Last active April 27, 2024 03:58
Some Jenkinsfile examples
Some Jenkinsfile examples
@ygrenzinger
ygrenzinger / CleanArchitecture.md
Last active March 31, 2024 13:57
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@andrewpsp
andrewpsp / mongod.service
Last active August 22, 2017 05:51
mongod service file
[Unit]
Description=High-performance, Entercloud Integrated Automated Ditigal Fingerprint Identification System (EIADFIS)
After=network.target
Documentation=https://github.com/entercloud/EIADFIS
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
@andrewpsp
andrewpsp / GEM2RPM
Last active August 29, 2015 14:12
Converting GEM to RPM
#!/usr/bin/env ruby
require 'fpm'
# FIXME: set these from the command line
target = 'system'
iteration = 1
src_dir = '/var/tmp/gems/cache';
@mchow01
mchow01 / mongodb_injection_nodejs.txt
Last active December 12, 2021 23:27
MongoDB Request Injection Attack in Node.js + Express Web Applications
Overview
========
Students in my Web Programming class (G. Brown, S. Prassad, et al)
discovered that MongoDB request injection attacks also work on Node.js
+ Express web applications. MongoDB request injection attacks have
been known for PHP web applications.
Impact
======
Attacker can view and download all the data in a MongoDB database
@arangamani
arangamani / chef_attribute_converge.rb
Last active February 20, 2023 02:44
Dynamically update attribute of a Chef resource during converge phase (Node variable assignment in Compile vs Converge)
# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was