Skip to content

Instantly share code, notes, and snippets.

View omalave's full-sized avatar
🏠
Working from home

Omar Malave omalave

🏠
Working from home
  • Santander, Spain
  • 18:48 (UTC +02:00)
View GitHub Profile
@omalave
omalave / CloudWatchAgent.sh
Created February 18, 2021 16:52 — forked from sherlockholmes/CloudWatchAgent.sh
Instalacion Manual Agente de CloudWatch Paso a Paso
Descarga el paquete de instalacion
wget https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
Instala la llave
wget https://s3.amazonaws.com/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg
gpg --import amazon-cloudwatch-agent.gpg # obten el <key-value>
gpg --fingerprint <key-value> # obten el fingerprint
Descarga la firma y verifica el paquete
[
{
"value": "Aguachica",
"label": "Aguachica"
},
{
"value": "Apartado",
"label": "Apartadó"
},
{
<option value="">Seleccione</option>
<option value="Aguachica">Aguachica</option>
<option value="Apartado">Apartadó</option>
<option value="Arauca">Arauca</option>
<option value="Armenia">Armenia</option>
<option value="Barrancabermeja">Barrancabermeja</option>
<option value="Barranquilla">Barranquilla</option>
<option value="Bello">Bello</option>
<option value="Bogotá">Bogotá D.C.</option>
<option value="Bucaramanga">Bucaramanga</option>
@omalave
omalave / firebase_detect_data.js
Created February 8, 2020 02:03 — forked from anantn/firebase_detect_data.js
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');
@omalave
omalave / router-admin-scripts.sh
Created March 13, 2019 00:24 — forked from tracker1/router-admin-scripts.sh
Tomato Router - Limit Guest Wifi
#Setup bridge for guest wifi (br1) with separate subnet/dhcp
# setup virtual wifi wlan0.1
#the following rules go under administration -> scripts -> firewall then reboot after saving
#NOTE: -I inserts at the beginning be default, so restrictive rules at the top, permissive at the bottom.
#default deny guest
iptables -I FORWARD -i br1 -j DROP
#Removes guest access to physical network
@omalave
omalave / mysqlsync
Created September 9, 2018 16:53 — forked from samhernandez/mysqlsync
Sync remote mysql database to local over ssh
#!/bin/bash
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
# (Remember, no spaces around the '=' sign)
# 3. Run it from a directory where you'd like the backup files to go:
@omalave
omalave / PDO classes.md
Created April 10, 2017 18:47 — forked from danferth/PDO classes.md
PHP classes for PDO

PDO Classes for db connect and manipulation

Below is a description on how to use the classes in the below script

###Include script and set up db variables

include 'zdb.php';
@omalave
omalave / 1-server.md
Created March 1, 2017 23:59 — forked from dragonjet/1-server.md
Setup Web Server on EC2 Amazon Linux AMI

Step 1: Server Credentials

This assumes you are now connected to the server via SSH.

  • sudo -s Enter root mode for admin access
  • groupadd devgroup Create new group to be later granted access to /var/www/html

Creating a new Root User

  • useradd -G root,devgroup masterdev Create new root user. Also add to the devgroup
  • passwd masterdev Change password for the new root user
  • At this point, you'll need to input your new root user's new password
@omalave
omalave / copy.sh
Created April 20, 2016 20:24
Copy entire website with wget
wget -mkEpnp http://example.org
@omalave
omalave / fill_input_date.js
Last active April 16, 2016 18:07
fill a input field with current date
$(document).ready(function(){
var fullDate = new Date();
var twoDigitMonth = (fullDate.getMonth()+1)+"";if(twoDigitMonth.length==1) twoDigitMonth="0" +twoDigitMonth;
var twoDigitDate = fullDate.getDate()+"";if(twoDigitDate.length==1) twoDigitDate="0" +twoDigitDate;
var currentDate = twoDigitDate + "/" + twoDigitMonth + "/" + fullDate.getFullYear();
$("#datepicker").val(currentDate);
});