Skip to content

Instantly share code, notes, and snippets.

View victoraguilarc's full-sized avatar
🧭
Working

Victor Aguilar C. victoraguilarc

🧭
Working
View GitHub Profile
@victoraguilarc
victoraguilarc / fabfile.py
Created May 18, 2015 23:37
New git to Django deployment
# -*- encoding: utf8 -*-
# sudo echo -e "rampagegear\n12345678x\n12345678x" | (passwd victor)
#### Django deployment for Debian Based SERVERS ######
from __future__ import unicode_literals
import re
@victoraguilarc
victoraguilarc / serializers.py
Created May 31, 2015 19:29
UserInfoSerializer.py
class UserInfoSerializer(serializers.ModelSerializer):
""" Profile Serializer for visualization """
avatar = serializers.SerializerMethodField()
def get_avatar(self, obj):
try:
return "%s%s" % (settings.BACKEND_BASE_URL, get_thumbnail(
obj.avatar, '150x150', crop='center', upscale=True, quality=99).url)
except Exception, e:
return ""
@victoraguilarc
victoraguilarc / production.py
Created May 31, 2015 19:33
Production configuration.
INTERNAL_IPS = ('127.0.0.1',)
ALLOWED_HOSTS = [
"localhost",
"127.0.0.1",
"owl.jvacx.com",
"owl.xiberty.com",
"owl-back.xiberty.com",
"www.owl.jvacx.com",
"www.owl.xiberty.com",
@victoraguilarc
victoraguilarc / log.py
Created June 1, 2015 18:26
Django settigns logging
# ===> LOGGING SETTINGS <=== #
# See: https://docs.djangoproject.com/en/dev/ref/settings/#logging
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
@victoraguilarc
victoraguilarc / vagrant-package
Created June 25, 2015 15:49
Vagrant 1.7.2 MacOS Yosemite
Workaround for vagrant 1.7.2 :
In file Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/ssh/communicator.rb
line 171 : add .env after @machine :
@machine.env.data_dir.join("private_key").open("w+") do |f|
Test OK :
$ vagrant package --output ac-centos66.box --base ac-centos66
==> ac-centos66: Attempting graceful shutdown of VM...
ac-centos66:
ac-centos66: Vagrant insecure key detected. Vagrant will automatically replace
@victoraguilarc
victoraguilarc / visor-archivos-online.md
Created January 5, 2016 23:16 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@victoraguilarc
victoraguilarc / genymotionwithplay.txt
Created May 2, 2016 08:38 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@victoraguilarc
victoraguilarc / docker-cleanup-resources.md
Created July 31, 2017 00:35 — 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

@victoraguilarc
victoraguilarc / payload.json
Created February 8, 2018 13:39
OneSignal Radio Configuration
header = {
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Basic %s" % settings.ONESIGNAL_REST_APIKEY
}
payload = {
"app_id": settings.ONESIGNAL_APP_ID,
"included_segments": ["All"],
"contents": {"en": "Radio updating"},
"data": {
@victoraguilarc
victoraguilarc / le-renews.sh
Last active April 2, 2018 13:29
Bash para agregar a un cronjob para renovar los certificados let'sencrypt
#!/bin/bash
# Basado en
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
# Agrega este script como cron job:
# sudo crontab -e
# 30 2 1-15 * 6 /path/to/script/le-renews.sh >> /opt/letsencrypt/le-renews.log
# Esto se ejcuta los primeros sabados de cada mes a las 2:30am
# sudo service cron restart