Skip to content

Instantly share code, notes, and snippets.

View verbinpro's full-sized avatar
😀
Working from home

verbin verbinpro

😀
Working from home
View GitHub Profile
@verbinpro
verbinpro / rules-both.iptables
Created May 1, 2019 01:26 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <[email protected]>.
#
# 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
@verbinpro
verbinpro / secret.py
Created April 2, 2019 03:34 — forked from vitorfs/secret.py
Generate secret key
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
random_string = get_random_string(50, chars)
print(random_string)
@verbinpro
verbinpro / keybase.md
Created February 8, 2019 00:16 — forked from keo/keybase.md

Keybase proof

I hereby claim:

  • I am keo on github.
  • I am keo604 (https://keybase.io/keo604) on keybase.
  • I have a public key ASDLFADQyZuXCMY_9FT30TJJbtZzbpgjBErva-CFj-u8QAo

To claim this, I am signing this object:

@verbinpro
verbinpro / create-superuser.py
Created February 8, 2019 00:15 — forked from c00kiemon5ter/create-superuser.py
Extend Django's management createsuperuser command to allow non-interactive creation of a superuser with a password.
"""
Extend createsuperuser command to allow non-interactive creation of a
superuser with a password.
Instructions:
mkdir -p path-to-your-app/management/commands/
touch path-to-your-app/management/__init__.py
touch path-to-your-app/management/commands/__init__.py
@verbinpro
verbinpro / django_deploy.md
Created December 21, 2018 04:45 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@verbinpro
verbinpro / nginxproxy.md
Created December 20, 2018 04:57 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

http://cronus.allowed.org works for me, 2018.1.6
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {