Skip to content

Instantly share code, notes, and snippets.

View taragurung's full-sized avatar

taragurung taragurung

View GitHub Profile
@taragurung
taragurung / main.tf
Created July 12, 2020 16:12
Terraform connection and provisioner to install python on droplet created
#connecting to server provisoned for adding python
connection {
host = self.ipv4_address #will use the ip address of the droplet created
user = "root"
type = "ssh"
private_key = file("~/.ssh/id_rsa") #will use the private key of the hosts allowed to connect to droplet created
timeout = "2m"
}
#we need python for ansible to run
provisioner "remote-exec" {
@taragurung
taragurung / main.tf
Created June 4, 2020 16:46
Adding digital ocean droplet with ssh enable using terraform
# use the existing the ssh-key, these are added to digital ocean console
# check the security section, use the same name added there
data "digitalocean_ssh_key" "default" {
name = "<change-it>"
}
#Generate it from digitalocean console, make sure to pass it safely
provider "digitalocean" {
token = "<change-it>"
}
@taragurung
taragurung / glossary.md
Created April 26, 2020 15:33 — forked from g0t4/glossary.md
Consul and related terms
  • Node - a physical or virtual machine that hosts services
    • Nodes also referred to as members.
    • Examples
      • Your computer
      • An AWS EC2 instance
      • A bare metal machine in your private data center
  • Service - executing software that provides utility via an interface
    • Typically long-lived process listening on a port(s)
    • Examples
  • A web server (nginx, apache, iis)
@taragurung
taragurung / slackpost
Created March 22, 2019 06:59 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
# https://slackhost.slack.com/
slackhost=PUT_YOUR_HOST_HERE
token=$1
@taragurung
taragurung / gist:836a76cff88c6e5a5abe08a3458d5210
Last active November 25, 2018 05:48
Failed to import docker-py - No module named ordered_dict. Try `pip install docker-py`
The problem occurs when trying to run docker containers using the ansible docker module as below:
########
playbook:
########
- name: Start docker container (using docker-compose)
docker_service:
project_src: /home/ubuntu
become_user: ubuntu
@taragurung
taragurung / docker-compose.yml
Last active May 10, 2018 05:15
PHP-fpm and nginx in docker container . A nginx webserver and php-fpm used running a sample index.php file and running inside docker container
version: "3.4"
services:
web:
image: nginx:latest
ports:
- "9080:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/default.conf
@taragurung
taragurung / controller.php
Created October 4, 2015 05:49
This is how we create a Controller in HMVC
<?php
class testing extends MX_Controller{
function index(){
echo "hellow testing HMVC";
}
}