Skip to content

Instantly share code, notes, and snippets.

@romanlv
romanlv / .gitignore
Last active August 29, 2015 14:24
minified-leagacyie webpack problem
node_modules/*
dist/*
@romanlv
romanlv / join_inventory.py
Last active December 13, 2016 08:40
Ansible Dynamic Inventory - join static files
#!/usr/bin/env python
import argparse
import os
import re
import json
from ansible.inventory import InventoryParser
@romanlv
romanlv / gist:91195b41087ba2d94eee
Last active February 7, 2019 10:47 — forked from aht/gist:5097702
ansible postgres playbook with PostGIS 2.1 on Ubuntu 14.04, setting up postgis_template and creating databases from this postgis_template
---
# packages.yml
- name: Add postgres repository
apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' state=present
- name: Add postgres repository key
apt_key: url=http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc state=present
@romanlv
romanlv / .gitignore
Last active July 6, 2023 18:30
export data from online journals
export
.env
@romanlv
romanlv / img_and_html.html
Last active December 17, 2015 19:09
ads html template on careerleaf.com
<div style="font-size:11px; line-height:13px; width:160px; height:160px; font-family:arial;">
<img src="//s3.amazonaws.com/careerleaf/images/ads/lynda-small.jpg" style="float:left; margin:0px 7px 4px 0px; border:1px solid #255b7f;" />
<a href="%%CLICK_URL_ESC%%http://www.lynda.com/search?q=web+design&utm_medium=affiliate&utm_source=ldc_affiliate&utm_content=51&utm_campaign=CD14660&bid=51&aid=CD14660&dp=15693&opt=" style="color:#255b7f; text-decoration:underline;" target="_blank">Learn software, creative, and business skills.</a>
<p style="padding-top:5px; color:#7e818b;">Whatever your learning goals are, a lynda.com membership helps you achieve them. Whatever your learning goals are, a lynda.com membership helps you achieve them.</p>
</div>
@romanlv
romanlv / npm install output
Last active December 13, 2015 17:19
error while installing jitsu on ubuntu 12.04 sudo npm install jitsu -g
npm http GET https://registry.npmjs.org/jitsu
npm http 304 https://registry.npmjs.org/jitsu
npm http GET https://registry.npmjs.org/colors/0.6.0-1
npm http GET https://registry.npmjs.org/complete/0.3.1
npm http GET https://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http GET https://registry.npmjs.org/flatiron/0.3.3
npm http GET https://registry.npmjs.org/flatiron-cli-config/0.1.4
npm http GET https://registry.npmjs.org/flatiron-cli-users/0.1.7
npm http GET https://registry.npmjs.org/fstream/0.1.18
npm http GET https://registry.npmjs.org/fstream-npm/0.1.1
@romanlv
romanlv / inheritance_tests.py
Created December 21, 2012 17:23 — forked from anonymous/inheritance_tests.py
Unit test to reproduce a problem with mongoengine inheritance. I need to save instances of child class in different collection, and have no idea how to do it.
#mongoengine==0.7.8
from django.test import TestCase
import mongoengine as me
class TestCollectionNameInheritance(TestCase):
def test_simple_case(self):
class BasicUser(me.Document):
username=me.StringField(required=True, unique=True)
meta = {
@romanlv
romanlv / avi_to_mp3.sh
Last active February 17, 2016 09:50
extract audio from mp4 files and convert it to mp3 format
#!/bin/bash
#
# extracts audio from all videos in current folder and saves in mp3
# based on http://ubuntuforums.org/showthread.php?t=1411144
#
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
@romanlv
romanlv / m4b_to_mp3.sh
Created March 31, 2012 17:49
Convert m4a (and m4b) files in current folder to mp3
mkdir -p mp3s
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for i in `find . -type f -iname "*.m4[ab]" -print`; do
echo $i
NAME=`echo $i | sed -e 's/\.\///' -e 's/\.m4b//g' `
echo "doing '$NAME'"
faad --stdio $i | lame --preset standard - "mp3s/${NAME}.mp3"