Skip to content

Instantly share code, notes, and snippets.

View viniciusjarina's full-sized avatar
😊

Vinicius Jarina viniciusjarina

😊
View GitHub Profile
""" base_x.py
Encoding to, and decoding from, "any" numerical base. Using the Encoder
class, converters for base 16, 8, 2 etc. can easily be defined, but
uncommon bases like 13, 29 or 62 are just as easy. The user can also
provide his own string with "numbers".
24 Dec 98 Creation. [HN]
08 Jan 99 Added BinaryEncoder, btoi, itob.
11 Jan 99 Encoder.__init__: basestr now has default value.
#Begin
#!/usr/local/bin/python
#import httplib
import urllib
from google.appengine.api import urlfetch
from struct import *
def cellid_2_pos(cellid, lac, mnc = 0, mcc = 0):
@subsetpark
subsetpark / gist:367f0d3fde503a1e481c
Created June 16, 2015 15:48
Building Python 2.7.10 on Ubuntu 14.04 LTS
$ sudo apt-get install -y gcc-multilib g++-multilib libffi-dev libffi6 libffi6-dbg python-crypto python-mox3 python-pil python-ply libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libgdbm-dev dpkg-dev quilt autotools-dev libreadline-dev libtinfo-dev libncursesw5-dev tk-dev blt-dev libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libsqlite3-dev libgpm2 mime-support netbase net-tools bzip2
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
$ tar xvf Python-2.7.10.tgz
$ cd Python-2.7.10/
$ ./configure --prefix /usr/local/lib/python2.7.10 --enable-ipv6
$ make
$ sudo make install
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace AR.Drone.Infrastructure
{
public static class InteropHelper
{
public const string LD_LIBRARY_PATH = "LD_LIBRARY_PATH";
@viniciusjarina
viniciusjarina / culturafm
Last active February 26, 2016 13:55
CulturaFM download
#!/bin/sh
if [$# -ne 2]; then
echo "Usage: $0 output lenght_seconds" >&2
exit 1
fi
#!/bin/sh
/Applications/VLC.app/Contents/MacOS/VLC -v "http://midiaserver.tvcultura.com.br:8003/;stream/1" --sout "#duplicate{dst=std{access=file,mux=raw,dst=$1.mp3}" --stop-time=$2 vlc://quit