Skip to content

Instantly share code, notes, and snippets.

View loncarales's full-sized avatar

Aleš Lončar loncarales

View GitHub Profile
@loncarales
loncarales / perl-one-liners
Created November 15, 2016 07:29
Perl One-Liners
Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10
-------------------------------- ----------- ------------
Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter)
http://www.catonmat.net -- good coders code, great reuse
Latest version of this file is always at:
http://www.catonmat.net/download/perl1line.txt
@loncarales
loncarales / .ackrc
Created December 5, 2016 11:19 — forked from theaboutbox/.ackrc
My .ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
@loncarales
loncarales / README-Template.md
Created May 1, 2017 11:10 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@loncarales
loncarales / check_docker_container.sh
Created October 19, 2017 10:39 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@loncarales
loncarales / HOWTO.md
Created May 26, 2020 21:14
Extract all certificate chain from .p7b file

Export all certificates into one file

$ base64 -d <P7B_FILE>.p7b | openssl pkcs7 -inform DER -print_certs -out <PEM_FILE>.pem

We'll get three certificates inside <PEM_FILE>.pem file, from top to bottom:

  1. Certificate for the route in PEM format
  2. CA certificate chain for the route validation in PEM format
  3. Root CA certificate in PEM format
@loncarales
loncarales / .gitconfig
Last active July 7, 2020 11:35
Git for Windows: Set up Helix Visual Merge Tool (P4Merge) as default mergetool
[merge]
keepBackup = false
tool = p4merge
[mergetool]
prompt = false
[mergetool "p4merge"]
cmd = p4merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
keepTemporaries = false
trustExitCode = false
keepBackup = false
@loncarales
loncarales / filename too long.md
Created May 26, 2020 21:21
Git for Windows: Filename too long
$ git clone ssh://git@some-git-repo
Cloning into 'SOME_GIT_REPO'...
remote: Counting objects: 16307, done.
remote: Compressing objects: 100% (6522/6522), done.
remote: Total 16307 (delta 12659), reused 12167 (delta 9480)
Receiving objects: 100% (16307/16307), 3.99 MiB | 1.21 MiB/s, done.
Resolving deltas: 100% (12659/12659), done.
error: unable to create file src/app/custom-components/main-application-components/ke-profile-management/assign-restrictions-and-limitations/assign-restrictions-limitations-main-screen/assign-restrictions-limitations-main-screen.component.html: Filename too long
error: unable to create file src/app/custom-components/main-application-components/ke-profile-management/assign-restrictions-and-limitations/assign-restrictions-limitations-main-screen/assign-restrictions-limitations-main-screen.component.spec.ts: Filename too long
@loncarales
loncarales / .gitconfig
Last active April 9, 2024 11:57
A bunch of essential snippets for Git
[user]
name = user_name
email = user_email
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
editor = nvim
autocrlf = input
safecrlf = true
@loncarales
loncarales / create-merge-conflict.sh
Created May 26, 2020 21:29
Git: Creating a merge conflict
#!/bin/bash
mkdir git-merge-test
cd git-merge-test
git init
touch merge.txt
git add merge.txt
echo "this is some content to mess with" > merge.txt
git commit -am 'we are commiting the inital content'
git checkout -b new_branch_to_merge_later
@loncarales
loncarales / ANALYSIS.md
Last active July 7, 2020 11:53
The Challenge: Create a minimalistic environment on Kuberntes to run a small Web application

Analysis

Handling sensitive data

Currently sensitive information, such as passwords, server IP addresses, ... are hard-coded and stored in plain text. If sensitive data must be saved, it must be encrypted first. The best option would be to use a tool for securely managing secrets and encrypting, for example, HashiCorp Vault.

Automation

Artefact building and method of deployment are done manually as described in README.md file. The whole process (configuration, software provisioning and application deployment) can be fully automated. To solve the problem of environment drifting in release pipeline Infrastructure as Code (IaC) approach should be used. Continuous configuration automation (CCA) tools can be thought of as an extension of traditional IaC frameworks. Notable CCA tools: Ansible, SaltStack, Terraform.