Skip to content

Instantly share code, notes, and snippets.

View secfigo's full-sized avatar

Mohammed A Imran secfigo

View GitHub Profile
@secfigo
secfigo / gist:ff5910b2965fbbea5bc96564a944e62c
Created May 27, 2018 15:07
Gitlab runner registration with extra-hosts for both docker and shell executor
sudo gitlab-runner register \
--non-interactive \
--url "https://gitlab.local/" \
--registration-token "xJWfniGqvSeVyKc3vaQx" \
--executor "docker" \
--docker-image ubuntu:16.04 \
--description "docker-runner" \
--tag-list "docker,aws" \
--run-untagged \
--docker-extra-hosts "gitlab.local:10.0.1.15" \
@secfigo
secfigo / Ansible-Vault how-to.md
Created September 17, 2017 16:35 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

##Working with ansible-vault

I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@secfigo
secfigo / gist:9c99f325a657a57192ab82f94d4243dc
Created September 11, 2017 02:28 — forked from lxneng/gist:741932
install PostgreSQL 9 in Mac OSX via Homebrew
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
@secfigo
secfigo / nginx-pagespeed notes
Last active July 20, 2017 15:11
Google pagespeed insights - Performance Improvements
# Install essential build tools
sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip
#Install libs to compile nginx modules
sudo apt-get install libxslt1-dev libssl-dev libgd2-xpm-dev libgeoip-dev libpam-dev
#Install nginx ppa
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx -y
@secfigo
secfigo / ansible-bootstrap-ubuntu-16.04.yml
Created July 5, 2017 07:27 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@secfigo
secfigo / changepassword.sh.j2
Created July 4, 2017 13:33 — forked from elleryq/changepassword.sh.j2
Create Django super user in ansible
#!/usr/bin/expect
set timeout -1;
spawn {{django_dir}}/venv/bin/python manage.py changepassword {{admin_user}};
expect {
"Password:" { exp_send "{{admin_pass}}\r" ; exp_continue }
"Password (again):" { exp_send "{{admin_pass}}\r" ; exp_continue }
eof
}