Skip to content

Instantly share code, notes, and snippets.

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

Froylan Camacho Tellez famachot

🏠
Working from home
View GitHub Profile
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@cansadadeserfeliz
cansadadeserfeliz / pipeline.py
Last active December 10, 2018 21:03
Django: python-social-auth configuration and pipeline to get users email, full name and save avatar for Facebook, Twitter, LinkedIn and Google http://blog.vero4ka.info/blog/2015/03/02/django-python-social-auth-configuration-and-pipeline-to-get-users-information/
def update_user_social_data(strategy, *args, **kwargs):
"""Set the name and avatar for a user only if is new.
"""
print 'update_user_social_data ::', strategy
if not kwargs['is_new']:
return
full_name = ''
backend = kwargs['backend']
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@jelcaf
jelcaf / Operaciones-Git
Last active August 14, 2023 22:50
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@lfborjas
lfborjas / json.py
Created November 28, 2010 02:09
ejemplo de serialización de consultas de django con json
import json
from rojoverdeajo.espaciofisico.models import zona
#obtener todas las zonas
zonas = Zona.objects.all()
#construir una lista de diccionarios que representen a las zonas
lista = [{'pk': zona.pk, 'zona': zona.zona} for zona in zonas]
#convertir eso en un json