Skip to content

Instantly share code, notes, and snippets.

@bubenkoff
bubenkoff / Flake8Lint.sublime-settings
Created January 30, 2013 16:52
Flake8Lint config
{
// run flake8 lint on file saving
"lint_on_save": true,
// popup a dialog of detected conditions?
"popup": true,
// highlight detected conditions?
"highlight": true,
@bubenkoff
bubenkoff / .jshintrc
Created January 31, 2013 11:01 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@bubenkoff
bubenkoff / gist:5764377
Created June 12, 2013 10:57
Run pytest with buildout in xdist mode (pytest-xdist)
buildout.cfg:
[py]
recipe = zc.recipe.egg
...
interpreter = py
initialization =
try:
sys.argv.remove('-u')
except ValueError:
@bubenkoff
bubenkoff / django_settings.py
Created June 3, 2014 13:00
Utility script which switches the django settings module. Usage: setup_django_settings('myproject.settings')
import os
import sys
from django.utils.importlib import import_module
from django.core.urlresolvers import clear_url_caches
from django.template import context, base, loader
from django.utils import translation
from django.utils.translation import trans_real
@bubenkoff
bubenkoff / README.md
Last active June 25, 2018 14:46 — forked from wjlroe/README.md
JSON API -> CSV

Howto download a JSON API array and spit out a CSV

Tools needed

  • httpie -- easy_install httpie (probably you want to sudo easy_install httpie
  • this script -- curl -o /usr/local/bin/json-to-csv.py https://raw.github.com/gist/4119347/24adb5dcd9c025c272042653a70d25b73b485958/json-to-csv.py
  • make that executable -- chmod +x /usr/local/bin/json-to-csv.py

Here we go

@bubenkoff
bubenkoff / gist:96e04fb219ff9edcd4f62b43b44a5c94
Last active November 6, 2021 18:34
Force elastic beanstalk cron job to run
aws sqs send-message --queue-url=<queue url> --message-body='elasticbeanstalk scheduled job' --message-attributes '{"beanstalk.sqsd.path": {"DataType": "String", "StringValue": "<task url>"}, "beanstalk.sqsd.scheduled_time": {"DataType": "String", "StringValue": "2001-02-03T00:00:00+00:00"}}'
@bubenkoff
bubenkoff / Loto.sh
Last active January 24, 2022 09:28
Loto game speaker / Диктор для гри Лото / Диктор для игры Лото
set -x
text=`python3 -c 'import random; any(map(lambda item: print("{0}<break time=\"4s\"/>".format(item)), random.sample(range(1,91), 90)))'`
echo "${text}"
echo "<speak>${text}</speak>" | tts --type ssml $@ loto.mp3
mpg123 loto.mp3
rm loto.mp3
@bubenkoff
bubenkoff / download_sentry_data.py
Created April 22, 2016 19:51
Download all sentry events for a project. Useful for data processing
"""Download sentry data.
usage:
python download_sentry_data.py <org>/<project> <api_key>
"""
import requests
import csv
@bubenkoff
bubenkoff / checkpoint.sh
Last active February 14, 2024 21:38
Endpoint Security VPN FULL start/stop script for Mac OS X
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.