This file contains 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
from celery import chain | |
from django.core.management.base import BaseCommand | |
from . import tasks | |
class Command(BaseCommand): | |
def handle(self, *args, **kwargs): |
This file contains 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
GNU GENERAL PUBLIC LICENSE | |
Version 3, 29 June 2007 | |
Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/} | |
Everyone is permitted to copy and distribute verbatim copies | |
of this license document, but changing it is not allowed. | |
Preamble | |
The GNU General Public License is a free, copyleft license for |
This file contains 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
require 'fileutils' | |
start_time = Time.now | |
SOURCE_DB = { | |
:name => 'db_name', | |
:user => 'db_user', | |
:password => 'db_pass', | |
:host => 'localhost' |
This file contains 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
#!/usr/bin/python | |
import os, sys | |
def fresh_serial(fn): | |
fin = file(fn, 'r') | |
lines = fin.readlines() | |
fin.close() | |
ols = [] | |
for line in lines: |
This file contains 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
upstream thumborbe { | |
server thumbor.myhost.com:8090 ; | |
server thumbor.myhost.com:8091 ; | |
server thumbor.myhost.com:8092 ; | |
server thumbor.myhost.com:8093 ; | |
server thumbor.myhost.com:8094 ; | |
server thumbor.myhost.com:8095 ; | |
} | |
location ~* "^/.{28}/.*(jpg|jpeg|gif|png)(#.*)?$" { |
This file contains 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: fluentd | |
# Required-Start: $network $local_fs | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Log Everything in JSON | |
# Description: Fluentd init script. | |
### END INIT INFO |
This file contains 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
<source> | |
type tail | |
format /(?<c_ip>[\w\.]+):(?<c_port>\d+) \[(?<a_date>.+)\] (?<f_end>[\w-]+) (?<b_end>[\w-]+)\/(?<b_server>[\w-]+) (?<tw>\d+)\/(?<tc>\d | |
+)\/(?<tt>\d+) (?<bytes>\d+) (?<t_state>[\w-]+) (?<actconn>\d+)\/(?<feconn>\d+)\/(?<beconn>\d+)\/(?<srv_conn>\d+)\/(?<retries>\d+) (?< | |
srv_queue>\d+)\/(?<backend_queue>\d+)/ | |
time_format %d/%B/%Y:%H:%M:%S | |
path /var/log/haproxy/haproxy_access.log | |
pos_file /opt/fluentd/var/pos/haproxy_access.pos | |
tag haproxy.access | |
</source> |
This file contains 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
#!/bin/bash | |
# | |
# Initialize new virtual server using LXC and set up networking and HTTP proxy | |
# | |
# Written by: Deni Bertovic <deni.bertovic@dobarkod.hr> | |
# | |
# Released into Public Domain. You may use, modify and distribute it as you | |
# see fit. | |
# | |
# This script will: |
This file contains 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
""" | |
Finite State Machine | |
This FSM implementation is extracted from the django-fsm package and licensed | |
under the same BSD-like license at: | |
https://github.com/kmmbvnr/django-fsm/blob/master/LICENSE | |
Basic usage: |
This file contains 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 com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper} | |
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper | |
import com.fasterxml.jackson.module.scala.DefaultScalaModule | |
object JsonUtil { | |
val mapper = new ObjectMapper with ScalaObjectMapper | |
mapper.registerModule(DefaultScalaModule) | |
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) | |
def toJson(value: Map[Symbol, Any]): String = { |
OlderNewer