Skip to content

Instantly share code, notes, and snippets.

View cega's full-sized avatar

Carlos GALINDEZ cega

  • Córdoba, CORDOBA, ARGENTINA
View GitHub Profile
@cega
cega / Dockerfile
Created July 19, 2018 23:33 — forked from renzok/Dockerfile
docker: mapping host uid and gid to user inisde container
FROM debian:jessie
ENV USER=boatswain USER_ID=1000 USER_GID=1000
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
@cega
cega / Dockerfile-apache
Created July 4, 2018 15:01 — forked from EvgenyOrekhov/Docker Compose files for PHP development.md
Simple Docker Compose files for PHP development
FROM php:apache
RUN apt-get update \
&& apt-get install --yes --no-install-recommends libpq-dev \
&& docker-php-ext-install pdo_pgsql pdo_mysql
@cega
cega / demo_import.py
Created January 21, 2018 23:24 — forked from cjbarnes18/demo_import.py
Demo data import tool for Tryton.
#!/usr/bin/env python2
import csv
from proteus import config, Model, Wizard
from xmlrpclib import Fault
from datetime import date
def init_database(module_name):
Module = Model.get('ir.module.module')
(school_module,) = Module.find([('name', '=', module_name)])
@cega
cega / __init__.py
Created December 20, 2017 15:36 — forked from zodman/__init__.py
tryton admin jsonrpc
from jsonrpclib import Server as ServerProxy
import base64
import jsonrpclib
import json
class AdminTrytonException(Exception):
def __init__(self, result):
self.result = result
@cega
cega / forms.py
Created October 13, 2017 13:34 — forked from neara/forms.py
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@cega
cega / radios_nacionales.txt
Created October 17, 2016 12:35 — forked from lifofernandez/radios_nacionales.txt
URLs de radios nacionales de Argentina, para poder escuchar en la terminal con mplayer o vlc
# alias radio='function __radio(){ r=`grep -v "#" radios_nacionales.txt | grep -i $1 | cut -d" " -f1`; cvlc $r; }; __radio'
# podria utilizarse mplayer en vez de vlc
AMs Nacionales
http://200.68.81.65:8000/am530 Radio Madre 530
http://wmserver3.aginet.com.ar:19043 Radio Colonia 550
http://195.154.182.222:26016/;stream/1 Radio Argentina 570
http://7359.live.streamtheworld.com/CONTINENTAL.mp3 Continental 590
http://190.104.220.205:8234 Rivadavia 630
@cega
cega / latest-widevine.sh
Created October 12, 2016 20:19 — forked from ruario/intro-latest-widevine.md
Fetches Chrome and extracts out Widevine so that it can be used by Vivaldi. Also works with other Chromium-based browsers, see guide below.
#!/usr/bin/env bash
available () {
command -v $1 >/dev/null 2>&1
}
# Make sure we have wget or curl
if available wget; then
SILENT_DL="wget -qO-"
LOUD_DL="wget"
@cega
cega / gist:57d69ee38c006439a47c8ad84be380bf
Created October 2, 2016 11:04 — forked from nicwolff/gist:3669759
Bookmarklet to store and fill in a test form
javascript:V=JSON.parse(localStorage['formData']||'{}');M={};F=document.forms;for(i=0;i%3CF.length;i++){E=F[i].elements;for(j=0;j%3CE.length;j++){C=E[j];CT=C.type;if(!C.name||CT=='submit'||CT=='hidden')continue;CN=C.name+':'+(M[C.name]=(M[C.name]||0)+1);CR=CT=='checkbox'||CT=='radio';if(CR&&V[CN]==true)C.checked=true;if(V[CN]&&!CR&&!C.value&&!C.selectedIndex){if(CT=='select-one'){for(k=0;k%3CC.options.length;k++){if(C.options[k].value==V[CN]){C.selectedIndex=k}}}else{C.value=V[CN]}}if(C.value=='-')C.value='';V[CN]=(C.options&&C.selectedIndex%3E-1&&C.options[C.selectedIndex].value)||(CR?C.checked:C.value);}}void(localStorage['formData']=JSON.stringify(V));
@cega
cega / h264-vivaldi-linux.md
Created September 9, 2016 11:20 — forked from ruario/h264-vivaldi-linux.md
Using H.264 in Vivaldi for Linux

How to use H.264, MP3 and AAC support ln Vivaldi for Linux, via an alternative FFMpeg library

Intro

The following is a quick guide to get this working on various Linux distros. As a side note, if you have Chrome installed alongside Vivaldi, Netflix should also work after making these changes.

Ubuntu

The following are steps for Vivaldi beta. If you are running the latest Vivaldi snapshot, please refer to the Vivaldi snapshot section under "Other distros".

@cega
cega / pdf.py
Created May 18, 2016 12:52 — forked from zyegfryed/pdf.py
Outputting PDFs with Django and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.template import Template, loader
from django.template.loader import find_template, LoaderOrigin
class PdfTemplateError(Exception):