Skip to content

Instantly share code, notes, and snippets.

@JSONOrona
JSONOrona / parser.py
Last active January 4, 2021 16:37
Python command line argument example using argparse module
#!/usr/bin/python
''' Python command line argument example using argparse module
Example output:
./parser.py --server=pyserver --port=8080,443,25,22,21 --keyword=pyisgood
Server name: [ pyserver ]
@glarrain
glarrain / admin__base.html
Created July 11, 2013 22:08
Django custom admin site. App name `custom_admin`
{% load admin_static %}{% load url from future %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
{% comment %}
This template is almost a copy (with indentation corrections and modifications listed below) of
'django/contrib/admin/templates/admin/base.html' and overrides it by living in directory
'/templates/admin/', as instructed in documentation:
"For those templates that cannot be overridden in this way, you may still override them for
your entire project. Just place the new version in your templates/admin directory."
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#overriding-admin-templates
@kogakure
kogakure / fabfile.py
Created April 22, 2010 12:01 — forked from jsmits/fabfile.py
Python: Deployment with Fabric
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account 'mboza@reamea.com'