Skip to content

Instantly share code, notes, and snippets.

View vickvasquez's full-sized avatar
🎯
Focusing

Vick Vasquez vickvasquez

🎯
Focusing
View GitHub Profile
@vickvasquez
vickvasquez / docker-cleanup-resources.md
Created January 12, 2019 18:17 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

0x455DEc47b1E547A1fD37A29Aea0e905b483fb8Df
@vickvasquez
vickvasquez / config
Last active June 26, 2021 16:50
[SOLVED] No WiFi adapter found in Ubuntu 18.04, HP Laptop
sudo apt remove bcmwl-kernel-source && sudo apt install git dkms
git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
sudo dkms add ./rtlwifi_new
sudo dkms install rtlwifi-new/0.6
Reboot
If you notice weak signal try
sudo modprobe -r rtl8723de && sleep 5 && sudo modprobe rtl8723de ant_sel=1
@vickvasquez
vickvasquez / config.conf
Created January 27, 2018 21:23
Error en Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column this is incompatible with sql_mode=only_full_group_by
Para solucionar este error, cambiar la configuracion de mysql
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
Pegar lo siguiente hasta abajo
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Cerramos el archivo
"use strict";
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
var _Redux = Redux;
var createStore = _Redux.createStore;
var todo = function todo(state, action) {
@vickvasquez
vickvasquez / Laravel PHP7 LEMP AWS.md
Created August 29, 2017 06:40 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@vickvasquez
vickvasquez / .md
Created August 18, 2017 06:26 — forked from joepie91/.md
Running a Node.js application using nvm as a systemd service

Trickier than it seems.

1. Set up nvm

Let's assume that you've already created an unprivileged user named myapp. You should never run your Node.js applications as root!

Switch to the myapp user, and do the following:

  1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash (however, this will immediately run the nvm installer - you probably want to just download the install.sh manually, and inspect it before running it)
  2. Install the latest stable Node.js version: nvm install stable
@vickvasquez
vickvasquez / myapp.service
Created August 18, 2017 04:33
NodeJS como servicio usando Systemd
[Unit]
Description=Servidor de desafios
[Service]
#Este comando ejecuta nuestro server.
ExecStart=/root/.nvm/versions/node/v7.10.0/bin/node /var/opt/myapp/server.js
#Directorio donde se encuentra nuestra app
WorkingDirectory=/var/opt/myapp
<?php
$nombre = sec($_POST['name']);
$email = sec($_POST['email']);
$telefono = sec($_POST['fono']);
$mensaje = sec($_POST['message']);
$codigo = sec($_POST['propiedad']);
$link = $_POST['link'];
$titulo = sec($_POST['titulo']);
$query = "INSERT INTO mensajes (nombre, email, telefono, mensaje, codigo, link, titulo) VALUES (?,?,?,?,?,?,?)";
<?php
$fecha = '2016-11-07';
$proximoFechaPago = '2016-12-10';
$fecha_inicio = new DateTime($fecha);
$fecha_fin = new DateTime($proximoFechaPago);
$interval = $fecha_inicio->diff($fecha_fin);
//$diasFaltantes = $interval->d;
//Solucion
$diasFaltantes = $interval->days;