Skip to content

Instantly share code, notes, and snippets.

View adikrishnan's full-sized avatar

Aditya Kalyanakrishnan adikrishnan

View GitHub Profile
Parser Type File Size / Data Size Number of Lines Time Taken Memory Consumed
pygrok based Parser 50kb / 2.5kb 302 1.43s 40.3MiB
Custom Parser [O(mxn)] 50 kb / 2.5kb 302 0.14s 40.5MiB
Improvements - - ~920% [Time reduction] ~-0.49% [Space increase]
@adikrishnan
adikrishnan / run.py
Created September 5, 2018 14:57
Part of the blog post - Timeouts and Retries which will walk through how to combine timeouts and retries in Celery - http://adikrishnan.in/2018/09/05/timeouts-and-retries/
from tasks import timeout_and_chords
timeout_and_chords.delay()
@adikrishnan
adikrishnan / run.py
Last active September 5, 2018 05:38
Part of the blog post - Timeouts and Retries which will walk through how to combine timeouts and retries in Celery - http://adikrishnan.in/2018/09/05/timeouts-and-retries/
from tasks import hello, timeout_test, retry_timeout_test, max_retries_test, max_retries_test_2
hello.delay()
timeout_test.delay()
retry_timeout_test.delay()
max_retries_test.delay()
max_retries_test_2.delay()
@adikrishnan
adikrishnan / run.py
Last active May 30, 2018 15:03
Part of the blog post - Playing with Chords - Celery which will walk through how to use "chords" structure in Celery - https://adikrishnan.in/2018/05/30/playing-with-chords-celery/
# Refer https://adikrishnan.in/2018/05/30/playing-with-chords-celery/ for understanding the concept.
from tasks import hello, chord_service, non_chord_service
hello.delay()
chord_service.delay()
non_chord_service.delay()
@adikrishnan
adikrishnan / run.py
Last active May 30, 2018 10:49
Part of the blog post - Celery - Groups & Loops which explore a few questions I had with Celery and parallelism on it using groups and implementing the same feature using blocking for loop and non-blocking for loop - https://adikrishnan.in/2018/05/30/celery-groups-loops-parallelism/
# Refer https://adikrishnan.in/2018/05/30/celery-groups-loops-parallelism/ for understanding the concept.
from tasks import run_ping, hello, loop_service, group_service
hello.delay()
loop_service.delay()
group_service.delay()
@adikrishnan
adikrishnan / py_web_service_gunicorn.conf
Created July 13, 2017 08:30
Supervisor template configurations
[supervisord]
# [program:<samplepyservice>]
[program:myapp]
# directory=<path_to_project>
directory=/var/www/myapp
# command=<path_to_project_env>/env/bin/gunicorn -b 127.0.0.1:<port_num> -w 4 <app_name>:app
command=/var/www/myapp/env/bin/gunicorn -b 127.0.0.1:5000 -w 4 myapp:app
autostart=true
autorestart=true
# user=<username>
@adikrishnan
adikrishnan / .bash_profile
Last active September 27, 2018 08:02
Vim and Bash Profile Settings
alias vi='vim'
alias ls='ls -lh --color=auto'
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export FLASK_APP=runserver.py
@adikrishnan
adikrishnan / Vagrantfile
Last active January 1, 2018 06:30
Adi's Vagrant Settings
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "cygnus"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", path: "setup_environment.sh"
end