Skip to content

Instantly share code, notes, and snippets.

View saldanac's full-sized avatar
👨‍💻
Focusing

Hugo Saldana saldanac

👨‍💻
Focusing
View GitHub Profile

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@saldanac
saldanac / server.php
Created September 7, 2017 14:42 — forked from JP-VlaxCode/server.php
Ejemplo Web Service con NuSoap
<?php
#Incluiremos la libreria nusoap.
require_once(getcwd() ."/third_party/nusoap/lib/nusoap.php");
#Instanciaremos la clase soap_server que proviene de la librería nusoap.
$server = new soap_server();
$namespace = "http://localhost/ws_test/index.php";
$server->wsdl->schemaTargetNamespace = $namespace;
function refreshsize(){
tempvisscrollleft = window.pageXOffset || document.documentElement.scrollLeft;
tempvisscrolltop = window.pageYOffset || document.documentElement.scrollTop;
var cusid_ele = document.getElementsByClassName('stefanvdautostop');
for (var i = 0; i < cusid_ele.length; ++i) {
var item = cusid_ele[i];
myElement = document.getElementsByTagName("video")[i];
if(myElement){
visposition = getPosition(myElement);
@saldanac
saldanac / INSTALL.md
Created September 17, 2018 13:13 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
@saldanac
saldanac / gist:d2f9cf3d7b8361aaa8eda847710f6d64
Created November 5, 2018 15:46 — forked from matoakley/gist:1092571
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@saldanac
saldanac / NumeroALetras.js
Created March 26, 2019 22:26 — forked from alfchee/NumeroALetras.js
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights