Skip to content

Instantly share code, notes, and snippets.

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

Omar Malave omalave

🏠
Working from home
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ó"
},
{
@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