Skip to content

Instantly share code, notes, and snippets.

View Chitrank-Dixit's full-sized avatar
🎯
Focusing

Chitrank Dixit Chitrank-Dixit

🎯
Focusing
View GitHub Profile
@Chitrank-Dixit
Chitrank-Dixit / base.py
Last active September 13, 2016 13:15
celery configuration for my django project
# This is the settings file
# Rabbitmq configuration
BROKER_URL = "amqp://abcd:abcd@localhost:5672/abcd"
# Celery configuration
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Asia/Kolkata'
CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
@Chitrank-Dixit
Chitrank-Dixit / crontab_cheat_sheet.md
Last active September 14, 2016 15:40
crontab cheatsheet

(specify the cronjob) after saving this it installs the specified crontab

crontab -e

to start cron

sudo service cron start

@Chitrank-Dixit
Chitrank-Dixit / deps.pp
Created September 12, 2016 19:25 — forked from rcrowley/deps.pp
Deploying Django with Puppet
stage { "pre": before => Stage["main"] }
class python {
package {
"build-essential": ensure => latest;
"python": ensure => "2.6.6-2ubuntu1";
"python-dev": ensure => "2.6.6-2ubuntu1";
"python-setuptools": ensure => "latest";
}
exec { "easy_install pip":
path => "/usr/local/bin:/usr/bin:/bin",
@Chitrank-Dixit
Chitrank-Dixit / installation_instructions.md
Last active November 16, 2016 10:32
Install and Configure ElasticSearch, Kibana and Sense
@Chitrank-Dixit
Chitrank-Dixit / celery.sh
Created December 16, 2016 08:59 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@Chitrank-Dixit
Chitrank-Dixit / people2csv.py
Last active June 26, 2023 13:17 — forked from wgins/people2csv.py
Mixpanel - Exporting people profiles to CSV
PROJECT_TOKEN = "<mixpanel-project-token>"
API_SECRET = "<mixpanel-project-api-secret>"
#from mixpanel import Mixpanel
#mp = Mixpanel(PROJECT_TOKEN)
#dir(mp)
''' people export'''
import base64
import csv
@Chitrank-Dixit
Chitrank-Dixit / event_export.py
Created July 8, 2017 08:41 — forked from wgins/event_export.py
Example Mixpanel raw event export script Raw
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
#
# Copyright 2010-2013 Mixpanel, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@Chitrank-Dixit
Chitrank-Dixit / event_export.py
Created July 10, 2017 09:55 — forked from drmarshall/event_export.py
Example Mixpanel raw event export script
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import urllib
import time
try:
@Chitrank-Dixit
Chitrank-Dixit / people_export.py
Created July 10, 2017 10:46 — forked from drmarshall/people_export.py
Example Mixpanel raw People export script
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import time
import urllib #for url encoding
import urllib2 #for sending requests
@Chitrank-Dixit
Chitrank-Dixit / stc.py
Created July 19, 2017 13:21 — forked from tessus/stc.py
Epoch Converter in Python
#!/usr/bin/python
import time, argparse
def convert(ctx):
inputstr = str(ctx.Epoch)
if len(inputstr) > 10:
secs = inputstr[:10]
msecs = inputstr[10:]