Skip to content

Instantly share code, notes, and snippets.

View alexander-arce's full-sized avatar

Alex Arce alexander-arce

View GitHub Profile
@alexander-arce
alexander-arce / Vagrant on RVM
Created February 22, 2015 22:30
Installing Vagrant from git on RVM
## References ##
# https://gorails.com/setup/ubuntu/14.10
# https://rvm.io/rvm/install
# https://rvm.io/integration/bundler#cd-hook
# https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-source
# http://gillesfabio.com/blog/2011/03/01/rvm-for-pythonistas-virtualenv-for-rubyists/
#Import public key for server
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
#Install RVM
@alexander-arce
alexander-arce / README.md
Created January 28, 2015 17:11
diff products

README is empty

@alexander-arce
alexander-arce / Mexican cities
Last active August 29, 2015 14:13
States, cities Id's from OpenErp
SELECT RCSC.ID, RCSC.NAME,MD.NAME,RCSC.state_id
FROM IR_MODEL_DATA AS MD
JOIN res_country_state_city AS RCSC ON RCSC.ID=MD.RES_ID
WHERE MODULE='l10n_mx_cities'
@alexander-arce
alexander-arce / Debug Server Action
Created November 19, 2014 18:46
Auto reply Server Action::OpenErp
#If you need debug you variables send to python code
#then modify openerp/tools/safe_eval.py
#You need add opcodes for print statement in _SAFE_OPCODES variable
_SAFE_OPCODES = _EXPR_OPCODES.union(set(opmap[x] for x in [
'LOAD_NAME', 'CALL_FUNCTION', 'COMPARE_OP', 'LOAD_ATTR',
'STORE_NAME', 'GET_ITER', 'FOR_ITER', 'LIST_APPEND', 'DELETE_NAME',
'JUMP_FORWARD', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_ABSOLUTE',
'MAKE_FUNCTION', 'SLICE+0', 'SLICE+1', 'SLICE+2', 'SLICE+3',
# New in Python 2.7 - http://bugs.python.org/issue4715 :
@alexander-arce
alexander-arce / shell::remove pyc files
Created September 18, 2014 23:16
Recursively remove all .pyc files from current directory
find . -name "*.pyc" -exec rm '{}' ';'
@alexander-arce
alexander-arce / my.cnf
Created August 5, 2014 19:26
Mysql-Vagrant Accept outside connections
Edit /etc/mysql/my.cnf
Change
#bind-address = 127.0.0.1
For
bind-address = 0.0.0.0
Log into mysql
mysql -u root -p
@alexander-arce
alexander-arce / settings
Created August 5, 2014 17:08
Firefox GPU accelerated
Enviroment variables
MOZ_OMTC_ENABLED="1"
MOZ_USE_OMTC="1"
Firefox settings
webgl.force-enabled=true
webgl.msaa-force=true
layers.acceleration.force-enabled=true
@alexander-arce
alexander-arce / model.py
Created May 9, 2014 14:47
Override field propierties on inherited model in Django
from django.contrib.sites.models import Site as SiteOld
class Site(SiteOld):
"""Site only have a one Costumer/Shop."""
costumer = models.OneToOneField('Costumer', verbose_name='customer')
def __init__(self, *args, **kwargs):
"""
Overrided __init__.
@alexander-arce
alexander-arce / UFW rules for NFS
Last active September 5, 2016 09:18
Open NFS ports on Gentoo
Edit next systemd service files.
On
/usr/lib64/systemd/system/rpc-mountd.service
edit ExecStart
ExecStart=/usr/sbin/rpc.mountd -F -p 32767
On
/usr/lib64/systemd/system/rpc-statd.service
edit ExecStart
@alexander-arce
alexander-arce / log_sql
Created February 12, 2014 20:16
Log SQL statements OpenERP
To log sql statements in openerp you append --log-level=debug_sql in command line