Skip to content

Instantly share code, notes, and snippets.

View jbontech's full-sized avatar
:octocat:
Focusing

JothiBasu jbontech

:octocat:
Focusing
View GitHub Profile
@jbontech
jbontech / aws-iam-get-username-by-access-key.bash
Created September 10, 2020 10:19 — forked from caueops/aws-iam-get-username-by-access-key.bash
AWS IAM Get UserName by Access Key Id
#!/bin/bash
# exit when the command fails
set -o errexit;
# exit when try to use undeclared var
set -o nounset;
accessKeyToSearch=${1?"Usage: bash $0 AccessKeyId"}
@jbontech
jbontech / Vagrantfile
Created August 27, 2020 03:17 — forked from adejoux/Vagrantfile
vagrant chef configuration file
#use libvirt
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'
VMCOUNT = (ENV['VMCOUNT'] || 1).to_i
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "virtualbox"
@jbontech
jbontech / updateSonarProps.sh
Created August 26, 2020 10:21 — forked from giehlman/updateSonarProps.sh
Update SonarQube properties file with project name and version from package.json
#!/usr/bin/env bash
#title : updateSonarProps.sh
#description :
# This script parses the project's name and version from its package.json and automagically
# updates the version and package name in the SonarQube configuration properties file.
# It can be used as a pre step before running the sonar-scanner command
# It also creates a backup of the props file with suffix *.bak
#prerequisites : NodeJS based project with package.json, sonar*.properties file in the cwd
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20180220
@jbontech
jbontech / create_vagrant_network_lab_with_maas_uefi.sh
Created August 6, 2020 09:13 — forked from ruzickap/create_vagrant_network_lab_with_maas_uefi.sh
Create Vagrant lab environment with 3 separated networks with 3 VMs running MAAS and building 2 UEFI based VMs
# Install Vagrant and virsh command
dnf install -y libvirt-client vagrant-hostmanager vagrant-libvirt
# Allow to manage VMs via libvirt remotely (using TCP connection)
cat >> /etc/libvirt/libvirtd.conf << EOF
listen_tls = 0
listen_tcp = 1
listen_addr = "0.0.0.0"
auth_tcp = "none"
L0 = bare metal machine
L1 = VM on bare metal
L2 = VM on VM
First, ensure virtualization is enabled on L0 as described here: https://docs.fedoraproject.org/en-US/quick-docs/using-nested-virtualization-in-kvm/#proc_enabling-nested-virtualization-in-kvm
Next, launch L1 with the following Vagrant config (or an equivalent directly on the hypervisor):
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1604"
@jbontech
jbontech / libvirt-kvm-docker.md
Created August 6, 2020 09:10 — forked from kosyfrances/libvirt-kvm-docker.md
Spin up a Libvirt VM (that supports nested virtualisation using KVM as Hypervisor) in a docker container.

Dockerfile

FROM ubuntu:18.04
RUN apt-get update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils vagrant && \
    apt-get autoclean && \
    apt-get autoremove && \
    vagrant plugin install vagrant-libvirt
COPY startup.sh /
ENTRYPOINT ["/startup.sh" ]
@jbontech
jbontech / vagrant-kvm.md
Created August 6, 2020 09:07 — forked from yuanying/vagrant-kvm.md
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

@jbontech
jbontech / Vagrantfile
Created August 6, 2020 09:04 — forked from rmariano/Vagrantfile
Vagrant: Ubuntu 1404 libvirt
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
Vagrant.configure(2) do |config|
# This is an image of Ubuntu 14.04 LTS with libvirt support
config.vm.box = "baremettle/ubuntu-14.04"
config.vm.provision :shell, path: "provision.sh"
# config.vm.synced_folder "../data", "/vagrant_data"
@jbontech
jbontech / _readme.md
Created August 2, 2020 19:12 — forked from fm-jason/_readme.md
Salt SSL Certificate Deployment

Overview

This gist provides a quick overview of deploying SSL certificates to servers using Salt. I use a wildcard certificate for our domain, which makes management easier.

Quick Start

  1. Start with pillar_ssl-certificate.sls, which should be populated with your certificates and placed in Salt's pillar_roots directory (typically /srv/pillar).
  2. Place state_ssl-certificate.sls in Salt's file_roots directory (typically /srv/salt).
  3. Include the contents of top.sls in both the pillar and state top.sls file. (Modify for your minion IDs of course.)

Details

Use pillars to distribute sensitive data, such as SSL certificates. Accoring to the [Salt Pillar Walkthrough][2]:

Information transferred via pillar is guaranteed to only be presented to the minions that are targeted, making Pillar suitable for managing security information, such as cryptographic keys and passwords.