Skip to content

Instantly share code, notes, and snippets.

View langri-sha's full-sized avatar
😪
Three, one, four, one, z, z, z...

Filip Dupanović langri-sha

😪
Three, one, four, one, z, z, z...
View GitHub Profile
@langri-sha
langri-sha / keybase.md
Created July 21, 2016 08:26
Identity verification

Keybase proof

I hereby claim:

  • I am langri-sha on github.
  • I am langrisha (https://keybase.io/langrisha) on keybase.
  • I have a public key whose fingerprint is 6E69 8B1D 695A D804 9BDD 2A04 BF65 B517 C7E5 00E4

To claim this, I am signing this object:

@langri-sha
langri-sha / docker-machine-virtualbox-create.sh
Last active September 16, 2016 18:39
Settings for creating a default Virtualbox Docker machine
docker-machine create \
--driver virtualbox \
--virtualbox-memory 2048 \
--engine-opt dns=8.8.8.8 \
--engine-opt log-driver=none \
--virtualbox-cpu-count 2 \
default
@langri-sha
langri-sha / ntfsundelete.sh
Created January 11, 2016 08:39
NTFS undelete session highlights
# List deleted files from the MFT, sort by date
sudo ntfsundelete /dev/sdb1 | sort -n -r -k4 | \
# Construct commands to undelete each INODE to ~${date}/${inode}-{filename}
awk '{print "sudo ntfsundelete -u /dev/sdb1 -i " $1 " -o \"/run/media/fdupanovic/WD/" $4 "/" $1 "-" $7 "\"";}' | \
# Truncate day from dates
sed -r "s/-[0-9]+//2" | \
# Split into files with 2048 commands each to avoid memory segmentation errors
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@langri-sha
langri-sha / manage-help-test-out.txt
Created May 4, 2012 19:41
Output for `manage help test` for the overridden `test` management command
Usage: manage.py test [options] [appname ...]
Runs the test suite for the specified applications, or the entire site if no apps are specified.
Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, the
@langri-sha
langri-sha / registration_view.py
Created February 9, 2011 20:40
Class-based django-registration view
from django.views.generic.edit import FormView
from django.views.generic.base import RedirectView
from registration.models import RegistrationProfile
from forms import RegistrationForm
class AccountRegistrationView(FormView):
template_name = 'authentication/registration_form.html'
form_class = RegistrationForm
@langri-sha
langri-sha / backends.py
Created November 30, 2010 05:49 — forked from rainerborene/backends.py
Django email auth backend via @rainerborene
#===============================================================================
# Django email auth backend
#===============================================================================
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
class EmailBackend(ModelBackend):
def authenticate(self, **credentials):
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the