This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/fstab | |
LABEL=cloudimg-rootfs / ext4 defaults 0 0 | |
/dev/xvdb /mnt/is0 auto defaults,nobootwait,comment=instancestore0 0 2 | |
/dev/xvdc /mnt/is1 auto defaults,nobootwait,comment=instancestore1 0 2 | |
/mnt/is0/tmp /tmp none bind,noauto 0 0 | |
/mnt/is0/var/tmp /var/tmp none bind,noauto 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# No need to redisplay it on sudo su and in screen sessions | |
if [ "$(id -u)" != "0" ] && [[ ! $TERMCAP =~ screen ]]; then | |
/etc/motd.tcl | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import ast | |
from subprocess import Popen, PIPE | |
from django.template.loader import render_to_string | |
from django.conf import settings | |
settings.configure( | |
TEMPLATE_DIRS=(".",) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gmail-redmine-task-list.js | |
// | |
// Searches for Redmine messages in the inbox | |
// and returns the links to the tasks | |
// | |
// Use with the HTML version of GMail: | |
// https://mail.google.com/?ui=html | |
var query = "redmine in:inbox"; | |
var redmine_url = "https://redmine.example.com/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
We have walls of different heights represented | |
with the following array: [2,5,1,2,3,4,7,7,6]. | |
The value at each index is the height of the wall. | |
Now imagine it rains. How much water is going | |
to be accumulated in puddles between walls? | |
We count volume in square blocks of 1X1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These strings are not present in any other template or Python file, so you just put them here in order to make the makemessages management command keep them in the translation file. | |
{% load i18n %} | |
{% trans "Some string you want to keep in the django.po translation file" %} | |
{% trans "So makemessages won't comment it out each time you run it" %} | |
{% trans "This template does not have to be used anywhere, putting it in your templates directory is enough" %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
import json | |
import time | |
import urllib | |
import brukva | |
import tornado.httpserver | |
import tornado.web | |
import tornado.websocket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import signal | |
import time | |
import tornado.httpserver | |
import tornado.ioloop | |
from django.core.management.base import BaseCommand, CommandError | |
from privatemessages.tornadoapp import application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
def transliterate(string): | |
capital_letters = {u'А': u'A', | |
u'Б': u'B', | |
u'В': u'V', | |
u'Г': u'G', |