Skip to content

Instantly share code, notes, and snippets.

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

Miguel Cantillana mcantillana

🏠
Working from home
View GitHub Profile
@mcantillana
mcantillana / vagrant_tutorial
Created April 25, 2016 20:24
Tips por vagrant
#chuleta vagrant
## Repackage the VM into a New Vagrant Box
vagrant package --output mynew.box
## Add the Box into Your Vagrant Install
vagrant box add mynewbox mynew.box
## Delete vagrant
vagrant destroy
rm Vagrantfile
@mcantillana
mcantillana / smtpcheck.py
Created October 2, 2015 21:15 — forked from blinks/smtpcheck.py
Check if an email address exists without sending an email. Technique from: http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/
#!/usr/bin/env python
"""
Check that a particular email address exists.
Adam Blinkinsop <blinks@acm.org>
WARNING:
Checking email addresses in this way is not recommended, and will lead to
your site being listed in RBLs as a source of abusive traffic. Mail server
admins do like it when they get connections that don't result in email being
sent, because spammers often use this technique to verify email addresses.
@mcantillana
mcantillana / webpay.py
Created July 6, 2015 19:15 — forked from raliste/gist:4091897
Implementation webpay payment CGI
## views.py
import tempfile
import os
import commands
import cgi
from django import http
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
@mcantillana
mcantillana / custom_command_django
Created June 19, 2015 14:22
Custom django command with params
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
class Command(BaseCommand):
help = "Can you help?"
option_list = BaseCommand.option_list + (
make_option(
@mcantillana
mcantillana / proxy pass apache
Created November 18, 2014 20:42
Proxy Pass Apache
ProxyPreserveHost on
ProxyPass / http://1.1.1.1:80/
ProxyPassReverse / http://1.1.1.1:80/
@mcantillana
mcantillana / install.md
Last active August 29, 2015 14:06 — forked from pbrisbin/install.md

Installation

This gets OpenCart running enough that we can use the GUI Installer

  1. Create Heroku project with ClearDB MySQL add-on
  2. Download OpenCart sources
  3. Move ./upload/* to top-level (those are the PHP site files)
  4. Copy zlib.so into ./ext/zlib.so
  5. Write extension = /app/www/ext/zlib.so into php.ini
  6. Push
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
rpm -ivh http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
cd /etc/yum.repos.d/
wget http://rpms.famillecollet.com/enterprise/remi.repo
yum install freetds
yum install freetds-devel
yum install --enablerepo=remi php-mssql
# Create sudo user
adduser <user>
usermod -a -G sudo <user>
logout
# Update and clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
@mcantillana
mcantillana / funcion_excel_url_alias
Last active January 1, 2016 20:39
Función para limpiar cadena y construir URL amigable para opencart
=SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(SUSTITUIR(D2;"á";"a");"é";"e");"í";"i");"ó";"o");"ú";"u");"ñ";"n");"/";"-");" ";"-");"(";"-");")";"-");".";"")
=ESPACIOS(MINUSC(C2))