Fairfield Login

This is a script that deals with managing a internet cafe.

I need to make it easy to create users, assign time to users, remove time, ban users, reset passwords, give time to a group of users (users who read, help garden etc.

Manages when computers are turned on and off. Computers turn on at 7:50am everymorning and perform a update, sync from origin. Allows Public login, allowed to login as users. At 2.25 computers reset and public is disabled.

Give 45 mins to everybody. Add for bonus.

All the ipynb files in a folder. script opens ipynb filename striping the .ipynb add .meta instead. Opens the .meta and saves filename title, slug, time year-month-day-hour-min.


In [1]:
import os
import urwid

In [2]:
os.getuid()


Out[2]:
1000

In [3]:
os.getgroups()


Out[3]:
[27, 28, 85, 220, 1000]

In [4]:
#os.system('rsync -azP /home/wcmckee/motion/ wcmckee@getsdrawn.com:/home/wcmckee/motion/')

In [5]:
opfair = os.listdir('/home/wcmckee/ipy/wcmckee-ipython/posts')


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-209476749e80> in <module>()
----> 1 opfair = os.listdir('/home/wcmckee/ipy/wcmckee-ipython/posts')

OSError: [Errno 2] No such file or directory: '/home/wcmckee/ipy/wcmckee-ipython/posts'

In [6]:
namfil = []

In [7]:
opfair


Out[7]:
['posts']

If space in the filename then change to - for url-friendly.


In [8]:
opsrip = []

In [9]:
os.system('rm -rf /home/wcmckee/fairfieldcode/posts/*.meta')


Out[9]:
0

In [10]:
spliz = []

In [11]:
saost = os.stat('/home/wcmckee/fairfieldcode/posts')

In [12]:
saost.st_mtime


Out[12]:
1420622855.8803372

In [13]:
saost.st_mtime


Out[13]:
1420622855.8803372

In [14]:
saost.st_size


Out[14]:
4096L

In [15]:
saost.st_uid


Out[15]:
1000

In [16]:
saost.st_atime


Out[16]:
1420882646.710335

In [17]:
saost.st_atime


Out[17]:
1420882646.710335

In [18]:
oswa = os.walk('/home/wcmckee')

In [19]:
os.sysconf('SC_2_CHAR_TERM')


Out[19]:
200809

In [20]:
#os.sysconf_names


Out[20]:
{'SC_2_CHAR_TERM': 95,
 'SC_2_C_BIND': 47,
 'SC_2_C_DEV': 48,
 'SC_2_C_VERSION': 96,
 'SC_2_FORT_DEV': 49,
 'SC_2_FORT_RUN': 50,
 'SC_2_LOCALEDEF': 52,
 'SC_2_SW_DEV': 51,
 'SC_2_UPE': 97,
 'SC_2_VERSION': 46,
 'SC_AIO_LISTIO_MAX': 23,
 'SC_AIO_MAX': 24,
 'SC_AIO_PRIO_DELTA_MAX': 25,
 'SC_ARG_MAX': 0,
 'SC_ASYNCHRONOUS_IO': 12,
 'SC_ATEXIT_MAX': 87,
 'SC_AVPHYS_PAGES': 86,
 'SC_BC_BASE_MAX': 36,
 'SC_BC_DIM_MAX': 37,
 'SC_BC_SCALE_MAX': 38,
 'SC_BC_STRING_MAX': 39,
 'SC_CHARCLASS_NAME_MAX': 45,
 'SC_CHAR_BIT': 101,
 'SC_CHAR_MAX': 102,
 'SC_CHAR_MIN': 103,
 'SC_CHILD_MAX': 1,
 'SC_CLK_TCK': 2,
 'SC_COLL_WEIGHTS_MAX': 40,
 'SC_DELAYTIMER_MAX': 26,
 'SC_EQUIV_CLASS_MAX': 41,
 'SC_EXPR_NEST_MAX': 42,
 'SC_FSYNC': 15,
 'SC_GETGR_R_SIZE_MAX': 69,
 'SC_GETPW_R_SIZE_MAX': 70,
 'SC_INT_MAX': 104,
 'SC_INT_MIN': 105,
 'SC_IOV_MAX': 60,
 'SC_JOB_CONTROL': 7,
 'SC_LINE_MAX': 43,
 'SC_LOGIN_NAME_MAX': 71,
 'SC_LONG_BIT': 106,
 'SC_MAPPED_FILES': 16,
 'SC_MB_LEN_MAX': 108,
 'SC_MEMLOCK': 17,
 'SC_MEMLOCK_RANGE': 18,
 'SC_MEMORY_PROTECTION': 19,
 'SC_MESSAGE_PASSING': 20,
 'SC_MQ_OPEN_MAX': 27,
 'SC_MQ_PRIO_MAX': 28,
 'SC_NGROUPS_MAX': 3,
 'SC_NL_ARGMAX': 119,
 'SC_NL_LANGMAX': 120,
 'SC_NL_MSGMAX': 121,
 'SC_NL_NMAX': 122,
 'SC_NL_SETMAX': 123,
 'SC_NL_TEXTMAX': 124,
 'SC_NPROCESSORS_CONF': 83,
 'SC_NPROCESSORS_ONLN': 84,
 'SC_NZERO': 109,
 'SC_OPEN_MAX': 4,
 'SC_PAGESIZE': 30,
 'SC_PAGE_SIZE': 30,
 'SC_PASS_MAX': 88,
 'SC_PHYS_PAGES': 85,
 'SC_PII': 53,
 'SC_PII_INTERNET': 56,
 'SC_PII_INTERNET_DGRAM': 62,
 'SC_PII_INTERNET_STREAM': 61,
 'SC_PII_OSI': 57,
 'SC_PII_OSI_CLTS': 64,
 'SC_PII_OSI_COTS': 63,
 'SC_PII_OSI_M': 65,
 'SC_PII_SOCKET': 55,
 'SC_PII_XTI': 54,
 'SC_POLL': 58,
 'SC_PRIORITIZED_IO': 13,
 'SC_PRIORITY_SCHEDULING': 10,
 'SC_REALTIME_SIGNALS': 9,
 'SC_RE_DUP_MAX': 44,
 'SC_RTSIG_MAX': 31,
 'SC_SAVED_IDS': 8,
 'SC_SCHAR_MAX': 111,
 'SC_SCHAR_MIN': 112,
 'SC_SELECT': 59,
 'SC_SEMAPHORES': 21,
 'SC_SEM_NSEMS_MAX': 32,
 'SC_SEM_VALUE_MAX': 33,
 'SC_SHARED_MEMORY_OBJECTS': 22,
 'SC_SHRT_MAX': 113,
 'SC_SHRT_MIN': 114,
 'SC_SIGQUEUE_MAX': 34,
 'SC_SSIZE_MAX': 110,
 'SC_STREAM_MAX': 5,
 'SC_SYNCHRONIZED_IO': 14,
 'SC_THREADS': 67,
 'SC_THREAD_ATTR_STACKADDR': 77,
 'SC_THREAD_ATTR_STACKSIZE': 78,
 'SC_THREAD_DESTRUCTOR_ITERATIONS': 73,
 'SC_THREAD_KEYS_MAX': 74,
 'SC_THREAD_PRIORITY_SCHEDULING': 79,
 'SC_THREAD_PRIO_INHERIT': 80,
 'SC_THREAD_PRIO_PROTECT': 81,
 'SC_THREAD_PROCESS_SHARED': 82,
 'SC_THREAD_SAFE_FUNCTIONS': 68,
 'SC_THREAD_STACK_MIN': 75,
 'SC_THREAD_THREADS_MAX': 76,
 'SC_TIMERS': 11,
 'SC_TIMER_MAX': 35,
 'SC_TTY_NAME_MAX': 72,
 'SC_TZNAME_MAX': 6,
 'SC_T_IOV_MAX': 66,
 'SC_UCHAR_MAX': 115,
 'SC_UINT_MAX': 116,
 'SC_UIO_MAXIOV': 60,
 'SC_ULONG_MAX': 117,
 'SC_USHRT_MAX': 118,
 'SC_VERSION': 29,
 'SC_WORD_BIT': 107,
 'SC_XBS5_ILP32_OFF32': 125,
 'SC_XBS5_ILP32_OFFBIG': 126,
 'SC_XBS5_LP64_OFF64': 127,
 'SC_XBS5_LPBIG_OFFBIG': 128,
 'SC_XOPEN_CRYPT': 92,
 'SC_XOPEN_ENH_I18N': 93,
 'SC_XOPEN_LEGACY': 129,
 'SC_XOPEN_REALTIME': 130,
 'SC_XOPEN_REALTIME_THREADS': 131,
 'SC_XOPEN_SHM': 94,
 'SC_XOPEN_UNIX': 91,
 'SC_XOPEN_VERSION': 89,
 'SC_XOPEN_XCU_VERSION': 90,
 'SC_XOPEN_XPG2': 98,
 'SC_XOPEN_XPG3': 99,
 'SC_XOPEN_XPG4': 100}

In [21]:
os.listdir('/home/wcmckee/fairfieldcode/posts/')

for ipos in os.listdir('/home/wcmckee/fairfieldcode/posts/'):
    #print ipos
    
    spliz.append([os.path.splitext(' ')[0] for x in ipos])


Untitled3.ipynb
PeterW.ipynb
izaeus.ipynb
ldo.ipynb
Untitled1.ipynb
Untitled5.ipynb
Untitled0.ipynb
StephM.ipynb
Tony.ipynb
korrin99.ipynb
ian-Copy0.ipynb
test.ipynb
chanceis.ipynb
sue.ipynb
lance.ipynb
pyexcel.ipynb
Readme.ipynb
Dele.ipynb
John T.ipynb
Untitled6.ipynb
adon.ipynb
lexxuse.ipynb
william.ipynb
adon909.ipynb
toara.ipynb
Alex .ipynb
hamcomp.ipynb
Danny.ipynb
TK Hello World.ipynb
korrin990.ipynb
Sione.ipynb
helloworld.ipynb
korrin.ipynb
learnpy.ipynb
aries.ipynb
ian.ipynb
Aruna.ipynb
Bruce.ipynb

In [22]:
#spliz


Out[22]:
[[' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' ',
  ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
 [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']]

In [25]:
for opfa in opfair:
    #opfa.replace(" ", "")
    print opfa
    #[os.path.splitext(x)[0] for x in a]
    opsrip.append(opfa.strip('.ipynb'))
    print opfa.strip('.ipynb')
   # if (' ') in opfa.strip('.ipynb'):
    #    print opfa.strip('.ipython')


posts
osts

In [ ]:


In [26]:
os.chdir('/home/wcmckee/fairfieldcode/posts/')

In [27]:
import time

In [31]:
endate = time.strftime("%d" + "-" + "%b" + "-" + "%Y" + "-")
#print time.strftime(("%d" + "-" + "%b" + "-" + "%Y"))
          
entim = time.strftime("%H:%M")

In [32]:
endate


Out[32]:
'10-Jan-2015-'

In [33]:
for opfilz in opsrip:
    print opfilz
    with open(str(opfilz) + '.meta', "w") as f:
            rstrin = opfilz.encode('ascii', 'ignore').decode('ascii')
            #print matdict
            #metadict = dict()
            #for lisz in lisrgc:
            #    metadict.update({'up': lisz.ups})
            #    metadict.update({'down': lisz.downs})
            #    metadict.update({'title': lisz.title})
            #    metadict.update({'created': lisz.created})
            f.write(rstrin.strip(' ') + '\n' + rstrin + '\n' + endate + entim)


osts

In [34]:
import nikola
os.chdir('/home/wcmckee/fairfieldcode/')
os.system('nikola build')
os.system('rsync -azP /home/wcmckee/fairfieldcode wcmckee@wcmckee.com:/home/wcmckee/fairfieldcode/')

In [33]:
opconf = open('/home/wcmckee/fairfieldcode/conf.py', 'r')

In [34]:
opconf.read()


Out[34]:
'# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\nimport time\n\n# Configuration, please edit\n\n# Data about this site\nBLOG_AUTHOR = "wcmckee"\nBLOG_TITLE = "Fairfield Code"\n# This is the main URL for your site. It will be used\n# in a prominent link\nSITE_URL = "http://fairfield.org.nz//"\n# This is the URL where nikola\'s output will be deployed.\n# If not set, defaults to SITE_URL\n# BASE_URL = "http://getnikola.com/"\nBLOG_EMAIL = "will@artcontrol.me"\nBLOG_DESCRIPTION = "Code from Fairfield Community Centre"\n\n# Nikola is multilingual!\n#\n# Currently supported languages are:\n# bg     Bulgarian\n# ca     Catalan\n# de     German\n# el     Greek [NOT gr!]\n# en     English\n# eo     Esperanto\n# es     Spanish\n# fa     Persian\n# fi     Finnish\n# fr     French\n# hr     Croatian\n# it     Italian\n# jp     Japanese\n# nl     Dutch\n# pt_br  Portuguese (Brasil)\n# pl     Polish\n# ru     Russian\n# sl     Slovenian [NOT sl_si!]\n# tr_tr  Turkish (Turkey)\n# zh_cn  Chinese (Simplified)\n#\n# If you want to use Nikola with a non-supported language you have to provide\n# a module containing the necessary translations\n# (p.e. look at the modules at: ./nikola/data/themes/default/messages/fr.py).\n# If a specific post is not translated to a language, then the version\n# in the default language will be shown instead.\n\n# What is the default language?\nDEFAULT_LANG = "en"\n\n# What other languages do you have?\n# The format is {"translationcode" : "path/to/translation" }\n# the path will be used as a prefix for the generated pages location\nTRANSLATIONS = {\n    DEFAULT_LANG: "",\n    # Example for another language:\n    # "es": "./es",\n}\n\n# Links for the sidebar / navigation bar.\n# You should provide a key-value pair for each used language.\nNAVIGATION_LINKS = {\n    DEFAULT_LANG: (\n        (\'/archive.html\', \'Archives\'),\n        (\'/categories/index.html\', \'Tags\'),\n        (\'/rss.xml\', \'RSS\'),\n    ),\n}\n\n# Below this point, everything is optional\n\n# While nikola can select a sensible locale for each language,\n# sometimes explicit control can come handy.\n# In this file we express locales in the string form that\n# python\'s locales will accept in your OS, by example\n# "en_US.utf8" in unix-like OS, "English_United States" in Windows.\n# LOCALES = dict mapping language --> explicit locale for the languages\n# in TRANSLATIONS. You can ommit one or more keys.\n# LOCALE_FALLBACK = locale to use when an explicit locale is unavailable\n# LOCALE_DEFAULT = locale to use for languages not mentioned in LOCALES; if\n# not set the default Nikola mapping is used.\n\n# POSTS and PAGES contains (wildcard, destination, template) tuples.\n#\n# The wildcard is used to generate a list of reSt source files\n# (whatever/thing.txt).\n#\n# That fragment could have an associated metadata file (whatever/thing.meta),\n# and optionally translated files (example for spanish, with code "es"):\n#     whatever/thing.txt.es and whatever/thing.meta.es\n#\n# From those files, a set of HTML fragment files will be generated:\n# cache/whatever/thing.html (and maybe cache/whatever/thing.html.es)\n#\n# These files are combinated with the template to produce rendered\n# pages, which will be placed at\n# output / TRANSLATIONS[lang] / destination / pagename.html\n#\n# where "pagename" is the "slug" specified in the metadata file.\n#\n# The difference between POSTS and PAGES is that POSTS are added\n# to feeds and are considered part of a blog, while PAGES are\n# just independent HTML pages.\n#\n\nPOSTS = (\n    ("posts/*.ipynb", "posts", "post.tmpl"),\n    ("posts/*.ipynb", "posts", "post.tmpl"),\n)\nPAGES = (\n    ("stories/*.rst", "stories", "story.tmpl"),\n    ("stories/*.txt", "stories", "story.tmpl"),\n)\n\n# One or more folders containing files to be copied as-is into the output.\n# The format is a dictionary of "source" "relative destination".\n# Default is:\n# FILES_FOLDERS = {\'files\': \'\' }\n# Which means copy \'files\' into \'output\'\n\n# A mapping of languages to file-extensions that represent that language.\n# Feel free to add or delete extensions to any list, but don\'t add any new\n# compilers unless you write the interface for it yourself.\n#\n# \'rest\' is reStructuredText\n# \'markdown\' is MarkDown\n# \'html\' assumes the file is html and just copies it\nCOMPILERS = {\n    "rest": (\'.rst\', \'.txt\'),\n    "markdown": (\'.md\', \'.mdown\', \'.markdown\'),\n    "textile": (\'.textile\',),\n    "txt2tags": (\'.t2t\',),\n    "bbcode": (\'.bb\',),\n    "wiki": (\'.wiki\',),\n    "ipynb": (\'.ipynb\',),\n    "html": (\'.html\', \'.htm\'),\n    # Pandoc detects the input from the source filename\n    # but is disabled by default as it would conflict\n    # with many of the others.\n    # "pandoc": (\'.rst\', \'.md\', \'.txt\'),\n}\n\n# Create by default posts in one file format?\n# Set to False for two-file posts, with separate metadata.\n# ONE_FILE_POSTS = True\n\n# If this is set to True, then posts that are not translated to a language\n# LANG will not be visible at all in the pages in that language.\n# If set to False, the DEFAULT_LANG version will be displayed for\n# untranslated posts.\n# HIDE_UNTRANSLATED_POSTS = False\n\n# Paths for different autogenerated bits. These are combined with the\n# translation paths.\n\n# Final locations are:\n# output / TRANSLATION[lang] / TAG_PATH / index.html (list of tags)\n# output / TRANSLATION[lang] / TAG_PATH / tag.html (list of posts for a tag)\n# output / TRANSLATION[lang] / TAG_PATH / tag.xml (RSS feed for a tag)\n# TAG_PATH = "categories"\n\n# If TAG_PAGES_ARE_INDEXES is set to True, each tag\'s page will contain\n# the posts themselves. If set to False, it will be just a list of links.\n# TAG_PAGES_ARE_INDEXES = True\n\n# Final location is output / TRANSLATION[lang] / INDEX_PATH / index-*.html\n# INDEX_PATH = ""\n\n# Create per-month archives instead of per-year\n# CREATE_MONTHLY_ARCHIVE = False\n# Create one large archive instead of per-year\n# CREATE_SINGLE_ARCHIVE = False\n# Final locations for the archives are:\n# output / TRANSLATION[lang] / ARCHIVE_PATH / ARCHIVE_FILENAME\n# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / index.html\n# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / MONTH / index.html\n# ARCHIVE_PATH = ""\n# ARCHIVE_FILENAME = "archive.html"\n\n# Final locations are:\n# output / TRANSLATION[lang] / RSS_PATH / rss.xml\n# RSS_PATH = ""\n\n# Number of posts in RSS feeds\n# FEED_LENGTH = 10\n\n# Slug the Tag URL easier for users to type, special characters are\n# often removed or replaced as well.\n# SLUG_TAG_PATH = True\n\n# A list of redirection tuples, [("foo/from.html", "/bar/to.html")].\n#\n# A HTML file will be created in output/foo/from.html that redirects\n# to the "/bar/to.html" URL. notice that the "from" side MUST be a\n# relative URL.\n#\n# If you don\'t need any of these, just set to []\n# REDIRECTIONS = []\n\n# Commands to execute to deploy. Can be anything, for example,\n# you may use rsync:\n# "rsync -rav output/* joe@my.site:/srv/www/site"\n# And then do a backup, or run `nikola ping` from the `ping`\n# plugin (`nikola install_plugin ping`).\n# To do manual deployment, set it to []\n# DEPLOY_COMMANDS = []\n\n# Where the output site should be located\n# If you don\'t use an absolute path, it will be considered as relative\n# to the location of conf.py\n# OUTPUT_FOLDER = \'output\'\n\n# where the "cache" of partial generated content should be located\n# default: \'cache\'\n# CACHE_FOLDER = \'cache\'\n\n# Filters to apply to the output.\n# A directory where the keys are either: a file extensions, or\n# a tuple of file extensions.\n#\n# And the value is a list of commands to be applied in order.\n#\n# Each command must be either:\n#\n# A string containing a \'%s\' which will\n# be replaced with a filename. The command *must* produce output\n# in place.\n#\n# Or:\n#\n# A python callable, which will be called with the filename as\n# argument.\n#\n# By default, there are no filters.\n#\n# Many filters are shipped with Nikola.  A list is available in the manual:\n# <http://getnikola.com/handbook.html#post-processing-filters>\n# FILTERS = {\n#    ".jpg": ["jpegoptim --strip-all -m75 -v %s"],\n# }\n\n# Expert setting! Create a gzipped copy of each generated file. Cheap server-\n# side optimization for very high traffic sites or low memory servers.\n# GZIP_FILES = False\n# File extensions that will be compressed\n# GZIP_EXTENSIONS = (\'.txt\', \'.htm\', \'.html\', \'.css\', \'.js\', \'.json\', \'.xml\')\n# Use an external gzip command? None means no.\n# Example: GZIP_COMMAND = "pigz -k {filename}"\n# GZIP_COMMAND = None\n# Make sure the server does not return a "Accept-Ranges: bytes" header for \n# files compressed by this option! OR make sure that a ranged request does not\n# return partial content of another representation for these resources. Do not\n# use this feature if you do not understand what this means.\n\n# #############################################################################\n# Image Gallery Options\n# #############################################################################\n\n# Galleries are folders in galleries/\n# Final location of galleries will be output / GALLERY_PATH / gallery_name\n# GALLERY_PATH = "galleries"\n# THUMBNAIL_SIZE = 180\n# MAX_IMAGE_SIZE = 1280\n# USE_FILENAME_AS_TITLE = True\n# EXTRA_IMAGE_EXTENSIONS = []\n#\n# If set to False, it will sort by filename instead. Defaults to True\n# GALLERY_SORT_BY_DATE = True\n\n# #############################################################################\n# HTML fragments and diverse things that are used by the templates\n# #############################################################################\n\n# Data about post-per-page indexes\n# INDEXES_TITLE = ""  # If this is empty, the default is BLOG_TITLE\n# INDEXES_PAGES = ""  # If this is empty, the default is \'old posts page %d\'\n# translated\n\n# Name of the theme to use.\nTHEME = "site-ipython"\n\n# Color scheme to be used for code blocks. If your theme provides\n# "assets/css/code.css" this is ignored.\n# Can be any of autumn borland bw colorful default emacs friendly fruity manni\n# monokai murphy native pastie perldoc rrt tango trac vim vs\n# CODE_COLOR_SCHEME = \'default\'\n\n# If you use \'site-reveal\' theme you can select several subthemes\n# THEME_REVEAL_CONFIG_SUBTHEME = \'sky\'\n# You can also use: beige/serif/simple/night/default\n\n# Again, if you use \'site-reveal\' theme you can select several transitions\n# between the slides\n# THEME_REVEAL_CONFIG_TRANSITION = \'cube\'\n# You can also use: page/concave/linear/none/default\n\n# date format used to display post dates.\n# (str used by datetime.datetime.strftime)\n# DATE_FORMAT = \'%Y-%m-%d %H:%M\'\n\n# FAVICONS contains (name, file, size) tuples.\n# Used for create favicon link like this:\n# <link rel="name" href="file" sizes="size"/>\n# For creating favicons, take a look at:\n# http://www.netmagazine.com/features/create-perfect-favicon\n# FAVICONS = {\n#     ("icon", "/favicon.ico", "16x16"),\n#     ("icon", "/icon_128x128.png", "128x128"),\n# }\n\n# Show only teasers in the index pages? Defaults to False.\n# INDEX_TEASERS = False\n\n# A HTML fragment with the Read more... link.\n# The following tags exist and are replaced for you:\n# {link}        A link to the full post page.\n# {read_more}   The string \xe2\x80\x9cRead more\xe2\x80\x9d in the current language.\n# {{            A literal { (U+007B LEFT CURLY BRACKET)\n# }}            A literal } (U+007D RIGHT CURLY BRACKET)\n# READ_MORE_LINK = \'<p class="more"><a href="{link}">{read_more}\xe2\x80\xa6</a></p>\'\n\n# A HTML fragment describing the license, for the sidebar.\nLICENSE = "CC A"\n# I recommend using the Creative Commons\' wizard:\n# http://creativecommons.org/choose/\n# LICENSE = """\n# <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/ar/">\n# <img alt="Creative Commons License BY-NC-SA"\n# style="border-width:0; margin-bottom:12px;"\n# src="http://i.creativecommons.org/l/by-nc-sa/2.5/ar/88x31.png"></a>"""\n\n# A small copyright notice for the page footer (in HTML).\n# Default is \'\'\nCONTENT_FOOTER = \'Contents &copy; {date}         <a href="mailto:{email}">{author}</a> - Powered by         <a href="http://getnikola.com" rel="nofollow">Nikola</a>         {license}\'\nCONTENT_FOOTER = CONTENT_FOOTER.format(email=BLOG_EMAIL,\n                                       author=BLOG_AUTHOR,\n                                       date=time.gmtime().tm_year,\n                                       license=LICENSE)\n\n# To use comments, you can choose between different third party comment\n# systems, one of "disqus", "livefyre", "intensedebate", "moot",\n#                 "googleplus" or "facebook"\n# COMMENT_SYSTEM = "disqus"\n# And you also need to add your COMMENT_SYSTEM_ID which\n# depends on what comment system you use. The default is\n# "nikolademo" which is a test account for Disqus. More information\n# is in the manual.\n# COMMENT_SYSTEM_ID = "nikolademo"\n\n# Enable annotations using annotateit.org?\n# If set to False, you can still enable them for individual posts and pages\n# setting the "annotations" metadata.\n# If set to True, you can disable them for individual posts and pages using\n# the "noannotations" metadata.\n# ANNOTATIONS = False\n\n# Create index.html for story folders?\n# STORY_INDEX = False\n# Enable comments on story pages?\n# COMMENTS_IN_STORIES = False\n# Enable comments on picture gallery pages?\n# COMMENTS_IN_GALLERIES = False\n\n# What file should be used for directory indexes?\n# Defaults to index.html\n# Common other alternatives: default.html for IIS, index.php\n# INDEX_FILE = "index.html"\n\n# If a link ends in /index.html,  drop the index.html part.\n# http://mysite/foo/bar/index.html => http://mysite/foo/bar/\n# (Uses the INDEX_FILE setting, so if that is, say, default.html,\n# it will instead /foo/default.html => /foo)\n# (Note: This was briefly STRIP_INDEX_HTML in v 5.4.3 and 5.4.4)\n# Default = False\n# STRIP_INDEXES = False\n\n# Should the sitemap list directories which only include other directories\n# and no files.\n# Default to True\n# If this is False\n# e.g. /2012 includes only /01, /02, /03, /04, ...: don\'t add it to the sitemap\n# if /2012 includes any files (including index.html)... add it to the sitemap\n# SITEMAP_INCLUDE_FILELESS_DIRS = True\n\n# Instead of putting files in <slug>.html, put them in\n# <slug>/index.html. Also enables STRIP_INDEXES\n# This can be disabled on a per-page/post basis by adding\n#    .. pretty_url: False\n# to the metadata\n# PRETTY_URLS = False\n\n# If True, publish future dated posts right away instead of scheduling them.\n# Defaults to False.\n# FUTURE_IS_NOW = False\n\n# If True, future dated posts are allowed in deployed output\n# Only the individual posts are published/deployed; not in indexes/sitemap\n# Generally, you want FUTURE_IS_NOW and DEPLOY_FUTURE to be the same value.\n# DEPLOY_FUTURE = False\n# If False, draft posts will not be deployed\n# DEPLOY_DRAFTS = True\n\n# Allows scheduling of posts using the rule specified here (new_post -s)\n# Specify an iCal Recurrence Rule: http://www.kanzaki.com/docs/ical/rrule.html\n# SCHEDULE_RULE = \'\'\n# If True, use the scheduling rule to all posts by default\n# SCHEDULE_ALL = False\n# If True, schedules post to today if possible, even if scheduled hour is over\n# SCHEDULE_FORCE_TODAY = False\n\n# Do you want a add a Mathjax config file?\n# MATHJAX_CONFIG = ""\n\n# If you are using the compile-ipynb plugin, just add this one:\n#MATHJAX_CONFIG = """\n#<script type="text/x-mathjax-config">\n#MathJax.Hub.Config({\n#    tex2jax: {\n#        inlineMath: [ [\'$\',\'$\'], ["\\\\\\(","\\\\\\)"] ],\n#        displayMath: [ [\'$$\',\'$$\'], ["\\\\\\[","\\\\\\]"] ]\n#    },\n#    displayAlign: \'left\', // Change this to \'center\' to center equations.\n#    "HTML-CSS": {\n#        styles: {\'.MathJax_Display\': {"margin": 0}}\n#    }\n#});\n#</script>\n#"""\n\n# Do you want to customize the nbconversion of your IPython notebook?\n# IPYNB_CONFIG = {}\n# With the following example configuracion you can use a custom jinja template\n# called `toggle.tpl` which has to be located in your site/blog main folder:\n# IPYNB_CONFIG = {\'Exporter\':{\'template_file\': \'toggle\'}}\n\n# What MarkDown extensions to enable?\n# You will also get gist, nikola and podcast because those are\n# done in the code, hope you don\'t mind ;-)\n# MARKDOWN_EXTENSIONS = [\'fenced_code\', \'codehilite\']\n\n# Social buttons. This is sample code for AddThis (which was the default for a\n# long time). Insert anything you want here, or even make it empty.\n# SOCIAL_BUTTONS_CODE = """\n# <!-- Social buttons -->\n# <div id="addthisbox" class="addthis_toolbox addthis_peekaboo_style addthis_default_style addthis_label_style addthis_32x32_style">\n# <a class="addthis_button_more">Share</a>\n# <ul><li><a class="addthis_button_facebook"></a>\n# <li><a class="addthis_button_google_plusone_share"></a>\n# <li><a class="addthis_button_linkedin"></a>\n# <li><a class="addthis_button_twitter"></a>\n# </ul>\n# </div>\n# <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script>\n# <!-- End of social buttons -->\n# """\n\n# Hide link to source for the posts?\n# HIDE_SOURCELINK = False\n# Copy the source files for your pages?\n# Setting it to False implies HIDE_SOURCELINK = True\n# COPY_SOURCES = True\n\n# Modify the number of Post per Index Page\n# Defaults to 10\n# INDEX_DISPLAY_POST_COUNT = 10\n\n# RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None,\n# the base.tmpl will use the feed Nikola generates. However, you may want to\n# change it for a feedburner feed or something else.\n# RSS_LINK = None\n\n# Show only teasers in the RSS feed? Default to True\n# RSS_TEASERS = True\n\n# A search form to search this site, for the sidebar. You can use a google\n# custom search (http://www.google.com/cse/)\n# Or a duckduckgo search: https://duckduckgo.com/search_box.html\n# Default is no search form.\n# SEARCH_FORM = ""\n#\n# This search form works for any site and looks good in the "site" theme where\n# it appears on the navigation bar:\n#\n#SEARCH_FORM = """\n#<!-- Custom search -->\n#<form method="get" id="search" action="http://duckduckgo.com/"\n# class="navbar-form pull-left">\n#<input type="hidden" name="sites" value="%s"/>\n#<input type="hidden" name="k8" value="#444444"/>\n#<input type="hidden" name="k9" value="#D51920"/>\n#<input type="hidden" name="kt" value="h"/>\n#<input type="text" name="q" maxlength="255"\n# placeholder="Search&hellip;" class="span2" style="margin-top: 4px;"/>\n#<input type="submit" value="DuckDuckGo Search" style="visibility: hidden;" />\n#</form>\n#<!-- End of custom search -->\n#""" % SITE_URL\n#\n# If you prefer a google search form, here\'s an example that should just work:\n#SEARCH_FORM = """\n#<!-- Custom search with google-->\n#<form id="search" action="http://google.com/search" method="get" class="navbar-form pull-left">\n#<input type="hidden" name="q" value="site:%s" />\n#<input type="text" name="q" maxlength="255" results="0" placeholder="Search"/>\n#</form>\n#<!-- End of custom search -->\n#""" % SITE_URL\n\n# Also, there is a local search plugin you can use, based on Tipue, but it requires setting several\n# options:\n\n# SEARCH_FORM = """\n# <span class="navbar-form pull-left">\n# <input type="text" id="tipue_search_input">\n# </span>"""\n#\n# BODY_END = """\n# <script type="text/javascript" src="/assets/js/tipuesearch_set.js"></script>\n# <script type="text/javascript" src="/assets/js/tipuesearch.js"></script>\n# <script type="text/javascript">\n# $(document).ready(function() {\n    # $(\'#tipue_search_input\').tipuesearch({\n        # \'mode\': \'json\',\n        # \'contentLocation\': \'/assets/js/tipuesearch_content.json\',\n        # \'showUrl\': false\n    # });\n# });\n# </script>\n# """\n\n# EXTRA_HEAD_DATA = """\n# <link rel="stylesheet" type="text/css" href="/assets/css/tipuesearch.css">\n# <div id="tipue_search_content" style="margin-left: auto; margin-right: auto; padding: 20px;"></div>\n# """\n# ENABLED_EXTRAS = [\'local_search\']\n#\n\n\n# Use content distribution networks for jquery and twitter-bootstrap css and js\n# If this is True, jquery is served from the Google CDN and twitter-bootstrap\n# is served from the NetDNA CDN\n# Set this to False if you want to host your site without requiring access to\n# external resources.\n# USE_CDN = False\n\n# Extra things you want in the pages HEAD tag. This will be added right\n# before </HEAD>\n# EXTRA_HEAD_DATA = ""\n# Google analytics or whatever else you use. Added to the bottom of <body>\n# in the default template (base.tmpl).\n# BODY_END = ""\n\n# The possibility to extract metadata from the filename by using a\n# regular expression.\n# To make it work you need to name parts of your regular expression.\n# The following names will be used to extract metadata:\n# - title\n# - slug\n# - date\n# - tags\n# - link\n# - description\n#\n# An example re is the following:\n# \'(?P<date>\\d{4}-\\d{2}-\\d{2})-(?P<slug>.*)-(?P<title>.*)\\.md\'\n# FILE_METADATA_REGEXP = None\n\n# Additional metadata that is added to a post when creating a new_post\n# ADDITIONAL_METADATA = {}\n\n# Nikola supports Twitter Card summaries / Open Graph.\n# Twitter cards make it possible for you to attach media to Tweets\n# that link to your content.\n#\n# IMPORTANT:\n# Please note, that you need to opt-in for using Twitter Cards!\n# To do this please visit\n# https://dev.twitter.com/form/participate-twitter-cards\n#\n# Uncomment and modify to following lines to match your accounts.\n# Specifying the id for either \'site\' or \'creator\' will be preferred\n# over the cleartext username. Specifying an ID is not necessary.\n# Displaying images is currently not supported.\n# TWITTER_CARD = {\n#     # \'use_twitter_cards\': True,  # enable Twitter Cards / Open Graph\n#     # \'site\': \'@website\',  # twitter nick for the website\n#     # \'site:id\': 123456,  # Same as site, but the website\'s Twitter user ID\n#                           # instead.\n#     # \'creator\': \'@username\',  # Username for the content creator / author.\n#     # \'creator:id\': 654321,  # Same as creator, but the Twitter user\'s ID.\n# }\n\n\n# Post\'s dates are considered in GMT by default, if you want to use\n# another timezone, please set TIMEZONE to match. Check the available\n# list from Wikipedia:\n# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n# Also, if you want to use a different timezone in some of your posts,\n# you can use W3C-DTF Format (ex. 2012-03-30T23:00:00+02:00)\n#\n# TIMEZONE = \'Europe/Zurich\'\n\n# If webassets is installed, bundle JS and CSS to make site loading faster\n# USE_BUNDLES = True\n\n# Plugins you don\'t want to use. Be careful :-)\n# DISABLED_PLUGINS = ["render_galleries"]\n\n# Experimental plugins - use at your own risk.\n# They probably need some manual adjustments - please see their respective\n# readme.\n# ENABLED_EXTRAS = [\n#     \'planetoid\',\n#     \'ipynb\',\n#     \'local_search\',\n#     \'render_mustache\',\n# ]\n\n# List of regular expressions, links matching them will always be considered\n# valid by "nikola check -l"\n# LINK_CHECK_WHITELIST = []\n\n# If set to True, enable optional hyphenation in your posts (requires pyphen)\n# HYPHENATE = False\n\n# You can configure the logging handlers installed as plugins or change the\n# log level of the default stdout handler.\nLOGGING_HANDLERS = {\n    \'stderr\': {\'loglevel\': \'WARNING\', \'bubble\': True},\n    #\'smtp\': {\n    #    \'from_addr\': \'test-errors@example.com\',\n    #    \'recipients\': (\'test@example.com\'),\n    #    \'credentials\':(\'testusername\', \'password\'),\n    #    \'server_addr\': (\'127.0.0.1\', 25),\n    #    \'secure\': (),\n    #    \'level\': \'DEBUG\',\n    #    \'bubble\': True\n    #}\n}\n\n# Put in global_context things you want available on all your templates.\n# It can be anything, data, functions, modules, etc.\n\nGLOBAL_CONTEXT = {}\n'

In [ ]:


In [ ]: