#Get help here http://www.sysdig.org/wiki/sysdig-user-guide/
sudo sysdig evt.type=open and fd.name contains /etc
*%evt.num %evt.time %evt.cpu %proc.name (%thread.tid) %evt.dir %evt.type %evt.args
# It will be slightly harder to create multiple instances of this class | |
class S: | |
def __init__(self, arg1, arg2): | |
# Dummy method. Used for reflection only | |
pass | |
@classmethod | |
def get_instance(cls, arg1, arg2): | |
# Dummy method. Used for reflection only |
def algorithmic_chance_men_in_group(pop_size, sample_size, num_men): | |
"""Used to estimate the odds of selecting `num_men` men out of | |
a population of size `pop_size`, when taing a sample of size | |
`sample_size` | |
Usage: | |
>>> chance_as_percent = algorithmic_chance_men_in_group(30000, 1000, 600)[0] | |
""" | |
# assuming that 50% of the pop is men | |
numerator = 1 |
""" | |
Examples of usage of the twisted library | |
""" | |
from datetime import timedelta, datetime | |
# Step 1: | |
# create a server that each time it receives a http request, it will return "hello" | |
from twisted.web import server, resource | |
from twisted.internet import reactor |
import copy | |
import unittest | |
class Node: | |
__slots__ = ["count", "next"] | |
def __init__(self, count, next_): | |
self.count = count | |
self.next = next_ |
var print = function( o, maxLevel, level ) | |
{ | |
if ( typeof level == "undefined" ) | |
{ | |
level = 0; | |
} | |
if ( typeof maxlevel == "undefined" ) | |
{ | |
maxLevel = 0; | |
} |
# List all the console_scripts entry points in the given distribution, or all distributions if None | |
def list_entry_points(desired_distribution=None): | |
all_entry_maps = {} | |
for key, distribution in pkg_resources.working_set.by_key.items(): | |
if desired_distribution and distribution.key != desired_distribution: | |
continue | |
distribution_entrypoints = distribution.get_entry_map() |
#Get help here http://www.sysdig.org/wiki/sysdig-user-guide/
sudo sysdig evt.type=open and fd.name contains /etc
*%evt.num %evt.time %evt.cpu %proc.name (%thread.tid) %evt.dir %evt.type %evt.args
I've come to a point where I had to swap django's user model with a custom one, at a point when I already had users, and already had apps depending on the model. Therefore this guide is trying to provide the support that is not found in the django docs.
Django warns that this should only be done basically at the start of a project, so that the initial migration of an app includes the creation of the custom user model.
It took a while to do, and I ran into problems created by the already existing relations between other models and auth.User
.
There were good and not so good things regarding my project state, that influenced the difficulty of the job.
id
field, that's just a usual default django id