Skip to content

Instantly share code, notes, and snippets.

View kirantambe's full-sized avatar

Kiran Tambe kirantambe

  • Bangalore, India
View GitHub Profile
@kirantambe
kirantambe / gist:ab106d42d5da438a0407abe41317de12
Created March 20, 2023 10:42 — forked from jaddison/gist:4506070
Setting up gunicorn and celery with gevent, psycogreen for Django
# gunicorn.conf.py: getting gevent and psycogreen running
bind = '127.0.0.1:1437'
accesslog = "<some-path>/logs/gunicorn-access.log"
errorlog = "<some-path>/logs/gunicorn-error.log"
workers = 5
try:
# fail 'successfully' if either of these modules aren't installed
from gevent import monkey
from psycogreen.gevent import patch_psycopg
@kirantambe
kirantambe / ytmusic-nowplaying
Last active May 16, 2019 11:29
Create a bookmarklet and click it or paste in console show song name as notification when song changes
javascript: (function () {
if (window.location.host == 'music.youtube.com') {
Notification.requestPermission().then(function (permission) {
if (permission == 'granted') {
document.querySelector('#progress-bar.ytmusic-player-bar').addEventListener('value-change', function (event) {
if(event.srcElement.value == 1) {
new Notification(document.querySelector('.title.ytmusic-player-bar').textContent, {
icon: document.querySelector('img.ytmusic-player-bar').src,
body: document.querySelector('.subtitle.ytmusic-player-bar').textContent.trim().split('•')[0]
});
@kirantambe
kirantambe / install_m2crypto.sh
Created December 11, 2018 10:16
M2Crypto OSX install
brew install openssl
brew install swig
pip install --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" m2crypto
@kirantambe
kirantambe / chartist-line-chart-with-gradient.markdown
Created October 5, 2018 12:55
Chartist Line chart with gradient
@kirantambe
kirantambe / setupyara.sh
Last active July 4, 2023 15:48
Install yara and yara-python with androguard, dotnet and cuckoo modules
brew install jansson # OR apt-get install libjansson-dev for debian based linux distros
git clone https://github.com/VirusTotal/yara.git
cd yara/libyara/modules/
curl -O https://raw.githubusercontent.com/Anlyz/androguard-yara/master/androguard.c
sed -i -e 's/MODULE(cuckoo)/MODULE(cuckoo)'$'\\\nMODULE(androguard)/g' module_list
cd ..
sed -i -e 's~MODULES += modules\/cuckoo.c~MODULES += modules\/cuckoo.c'$'\\\nMODULES += modules/androguard.c~g' Makefile.am
cd ..
./bootstrap.sh
./configure --enable-cuckoo --enable-dotnet --enable-magic
@kirantambe
kirantambe / match.py
Created August 10, 2017 13:24
Get group(1) for python regex match or None
# Do a regex search and return group(1) or None
import re
get_match = lambda regex, sample: getattr(re.search(regex, sample), 'group', lambda x: None)(1)
@kirantambe
kirantambe / setup-python-dev.sh
Created August 1, 2017 09:28
Install essential python development tools on ubuntu
set -e
mkdir -p $HOME/work
sudo apt-get update
echo "Installing pip"
sudo apt-get install python-pip
echo "Installing pip, python-dev, build-essential"
sudo apt-get install -y python-pip python-dev build-essential
echo "Installing pip, python-dev, build-essential"
sudo pip install virtualenv virtualenvwrapper
echo "Upgrading pip"