Skip to content

Instantly share code, notes, and snippets.

View davistran86's full-sized avatar

davistran86

View GitHub Profile
@rothgar
rothgar / main.yml
Last active September 10, 2024 09:53
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@DarrenN
DarrenN / get-npm-package-version
Last active October 25, 2024 17:37 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@munim
munim / youtube-dl-download-pluralsight.md
Last active July 28, 2022 21:19
youtube-dl to download pluralsight videos

Download Plural Sight videos

Software required:

youtube-dl

After installation and putting the youtube-dl in PATH

youtube-dl \
@marcio-azevedo
marcio-azevedo / install-docker.sh
Last active December 31, 2016 12:03
Docker Commands Cheat Sheet for Ubuntu Xenial 16.04 (LTS)
# Install Docker on Ubuntu Xenial 16.04 (LTS)
# based on https://docs.docker.com/engine/installation/linux/ubuntulinux/
# Prerequisites
# make sure Kernel version is (at least) 3.10
# $ uname -r
# Update your apt sources
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
@charlessolar
charlessolar / gist:515016139f0014cdfc029c7dd553d597
Last active January 13, 2020 11:54
ansible inventory files from terraform
### variables
variable "env" {}
variable "riak_count" {}
variable "elastic_count" {}
### hostname.tpl
${name}-${env}-${format("%02s",index)} ${extra}
### ansible.tpl
@GLMeece
GLMeece / Steps_to_Terminal_Enlightenment_on_a_Mac.md
Last active November 2, 2024 19:03
Steps to Terminal Enlightenment on a Mac (tweaking your terminal for fun and profit)
@paulnguyen-mn
paulnguyen-mn / reactjs-learning-path-2020.md
Created June 25, 2020 15:46
Lộ trình học ReactJS cơ bản cho người mới bắt đầu 2020 🚀

Lộ trình học ReactJS cơ bản cho người mới bắt đầu 2020 🎉

  • Đôi tượng: mới bắt đầu học ReactJS mà không biết học những gì.
  • Yêu cầu kiến thức: