Skip to content

Instantly share code, notes, and snippets.

View miki725's full-sized avatar

Miroslav Shubernetskiy miki725

View GitHub Profile
@miki725
miki725 / .gen-self-cert.sh
Last active October 4, 2015 07:08
Creating self-signed ssl certificates for nginx
#! /bin/bash
# Steps are taken from http://bit.ly/12HLd0
# To use, sudo priviledges are need (to copy the certificate
# and key to /etc/ssl/)
#
# The script has one required argument - the name of the certificate
# to be generated. Once the script starts running, just follow
# on-screen instructions.
@miki725
miki725 / nginx
Last active October 4, 2015 06:58
service script for nginx
#! /bin/sh
# Based on the following script
# Author: Ryan Norbauer's http://norbaurinc.com
# Modified: Geoffrey Grosenbach http://topfunky.com
# Modified: Clement NEDELCU
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="nginx daemon"
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\qrl]
@="URL:SQRL"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\qrl\DefaultIcon]
@="C:\\Windows\\System32\\url.dll,0"
[HKEY_CLASSES_ROOT\qrl\shell]
from __future__ import unicode_literals, print_function
from django.db import models
class UniqueTogetherModel(models.Model):
foo = models.IntegerField()
bar = models.IntegerField()
class Meta(object):
unique_together = ('foo', 'bar')
@miki725
miki725 / pycharm_django_console.py
Created January 26, 2015 00:44
addition to PyCharm Django Console to load Django models
from django.core.management.color import no_style
from django_extensions.management.shells import import_objects
locals().update(import_objects({'dont_load': []}, no_style()))
@miki725
miki725 / .bashrc
Created July 12, 2014 16:41
ubuntu bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
#!/bin/bash
path=$1
if [ -z $path ]; then
path=".";
fi
# when symlinks are present -delete cannot be used
# by passing all found files to rm via xargs
# allows to remove files even inside symlinks