Skip to content

Instantly share code, notes, and snippets.

View gmoqa's full-sized avatar
💀
The Soul is in the Software

Guillermo Quinteros gmoqa

💀
The Soul is in the Software
View GitHub Profile
@gmoqa
gmoqa / config.js
Created May 6, 2021 14:55
Clean jitsi IFrame configuration
export default {
configOverwrite: {
disableDeepLinking: true,
prejoinPageEnabled: false,
disableLocalVideoFlip: true,
doNotFlipLocalVideo: true,
hideParticipantsStats: true,
disableRemoteMute: true,
disableRemoteControl: true,
@gmoqa
gmoqa / allowed-methods.js
Created April 26, 2021 23:56
Disable HTTP Methods in Nuxt.js
const allowedMethods = ['GET', 'HEAD']
export default function (req, res, next) {
if (!allowedMethods.includes(req.method)) {
res.writeHead(405)
res.end('Method Not Allowed')
return
}
next()
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]-->
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta content="width=device-width" name="viewport"/>
<!--[if !mso]><!-->
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<!--<![endif]-->
@gmoqa
gmoqa / node-ldap.js
Last active July 6, 2020 23:12
Node.js LDAP Example
const express = require('express');
const passport = require('passport');
const ldap = require('passport-ldapauth');
const options = {
server: {
url: "ldap://ldap.forumsys.com",
bindDN: "cn=read-only-admin,dc=example,dc=com",
bindCredentials: 'password',
searchBase: "dc=example,dc=com",
const games = [
{ name: 'The Witcher 3 - The Wild Hunt', rating: 10, plataform: 'Multi' },
{ name: 'The Witcher 2', rating: 9, plataform: 'Multi' },
{ name: 'Startropics', rating: 9, plataform: 'NES' },
{ name: 'The Legend of Zelda', rating: 10, plataform: 'NES' },
{ name: 'Ghost Trick', rating: 10, plataform: 'NDS' },
{ name: 'Hotel Dusk', rating: 8, plataform: 'NDS' },
{ name: 'The Legend of Zelda - Ocarina of Time', rating: 10, plataform: 'N64' },
{ name: 'The Legend of Zelda - Majora Mask', rating: 9, plataform: 'N64' },
{ name: 'Chrono Trigger', rating: 10, plataform: 'SNES' },
@gmoqa
gmoqa / linux.sh
Last active January 10, 2020 16:47
linux snippets
cat ~/.ssh/id_rsa.pub | ssh <USERNAME>@<IP-ADDRESS> 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'
/etc/motd
sudo usermod -a -G docker <usuario>
#(logout and login)
history | awk '{ print $2 }' | sort | uniq -c | sort -rn | head
# unix demostration
scp desarrollo@10.0.0.135:/home/desarrollo/app/src/config /home/gmoqa
@gmoqa
gmoqa / mongo_snippets.sh
Created August 20, 2019 18:17
Mongo DB Snippets
sudo apt install mongo-tools
mongodump --uri "mongo://localhost:sadasda@asdasassad.com" --out ~/Documents/ --forceTableScan
bsondump --pretty --outFile collection.json collection.bson
@gmoqa
gmoqa / mattermost-notification.js
Created August 7, 2019 16:44
Node.js Mattermost notification no extra packages.
const https = require('https')
const data = JSON.stringify({
username: 'App logger',
icon_url: 'https://www.mattermost.org/wp-content/uploads/2016/04/icon.png',
text: 'Hello Mattermost'
})
const options = {
hostname: 'your_mattermost.server',
/etc/apt/sources.list
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
@gmoqa
gmoqa / smtp-tester.js
Last active April 25, 2019 23:12
SMTP Tester
#!/usr/bin/env node
const mailer = require('nodemailer');
async function main(){
let transporter = mailer.createTransport({
host: "host",
port: '25',
secure: false,