Skip to content

Instantly share code, notes, and snippets.

View meabed's full-sized avatar
👨‍💻
Coding

Mohamed Meabed meabed

👨‍💻
Coding
View GitHub Profile
@meabed
meabed / workflow and workspace structure
Created August 10, 2016 17:58
Workspace structure
## Workspace directory structure:
Error applying plan:
1 error(s) occurred:
* aws_instance.be_a.2: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
Please include the following information in your report:
Terraform Version: 0.6.16
Resource ID: aws_instance.be_a.2
@meabed
meabed / gist:181547598609960dd5b3768d34a07df0
Created May 26, 2016 13:15
terraform issue when apply ignore AMI in aws_instance
Please include the following information in your report:
Terraform Version: 0.6.16
Resource ID: aws_instance.be_flight_b.0
Mismatch reason: attribute mismatch: ami
Diff One (usually from plan): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{"tags.#":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "private_ip":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "key_name":*terraform.ResourceAttrDiff{Old:"", New:"it-admin-key", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "tags.Environment":*terraform.ResourceAttrDiff{Old:"", New:"prod", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "root_block_device.0.volume_size":*terraform.ResourceAttrDiff{Old:"", New:"8", NewComputed:false, NewRemoved:false, N
@meabed
meabed / install_monit.sh
Created May 8, 2016 23:05 — forked from gaurish/install_monit.sh
Install Latest Version of Monit on Ubuntu 14.04 LTS Server 64bit(x86_64)
cd ~
wget http://mmonit.com/monit/dist/binary/5.12/monit-5.12-linux-x64.tar.gz
tar zxf monit-5.12-linux-x64.tar.gz
cd monit-5.12/
cp bin/monit /usr/bin/
mkdir /etc/monit
touch /etc/monit/monitrc
chmod 0700 /etc/monit/monitrc
ln -s /etc/monit/monitrc /etc/monitrc
wget https://gist.githubusercontent.com/gaurish/964456aa08c9fa2e43ee/raw/1aa107e62ecaaa2dacfdb61a12f13efb6f15005b/monit -P /etc/init.d/
@meabed
meabed / mongozip.py
Created January 11, 2016 22:08 — forked from vadimii/mongozip.py
Dump MongoDB databases to the zip archives and copy its to the output folder.
# -*- coding: utf-8 -*-
'''Dump MongoDB databases to the zip archives
and copy its to the output folder.
Usage: python mongozip.py
'''
import os
import os.path
import datetime
import tempfile
import shutil
@meabed
meabed / gist:9c5eb32e4d3f8959fc4e
Created January 11, 2016 22:05 — forked from keithics/gist:fd53431b6f57014249ca
Mongodump and Amazon Glacier
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
AWS = require('aws-sdk'),
exec = require('child_process').exec,
fs = require('fs'),
name = new Date().toISOString();
@meabed
meabed / mm-standalone.conf
Created January 8, 2016 20:13 — forked from comerford/mm-standalone.conf
Config Files for MongoDB 3.0 Compression Testing
storage:
dbPath: "/data/db/300-mm"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/data/db/300-mm/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
@meabed
meabed / app.js
Created January 7, 2016 12:57 — forked from dylants/app.js
Passport security using local authentication (username/password)
require("express-namespace");
var express = require("express"),
fs = require("fs"),
cons = require("consolidate"),
app = express(),
passport = require("passport"),
mongoose = require("mongoose");
// 30 days for session cookie lifetime
var SESSION_COOKIE_LIFETIME = 1000 * 60 * 60 * 24 * 30;
@meabed
meabed / build_nginx.sh
Created January 3, 2016 01:21 — forked from MattWilcox/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2d
export VERSION_NGINX=nginx-1.9.7
# URLs to the source directories
export SOURCE_OPENSSL=https://www.openssl.org/source/
export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
@meabed
meabed / nginx-cors.conf
Last active September 9, 2015 17:51 — forked from sbuzonas/nginx-cors.conf
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}