- OS X Update 10.9.1, iBooks, iTunes, etc.
- Install / Update Apple Programs (Optional)
- iWork (Pages, Numbers, Keynote)
- iLife (iMovie, iPhoto, Garageband)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
radon# cat /etc/systemd/system/mongodb.service | |
[Unit] | |
Description=MongoDB Server | |
Wants=network.target | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/mongod --config /etc/mongodb.conf | |
User=mongodb |
pg_dump -h <rds host> -p 5432 -F c -O -U <rds user> <db name> > db.dump
docker run --rm --interactive --link <postgres container id>:postgres --volume $PWD/:/tmp/ postgres:latest /bin/bash -c 'pg_restore --verbose --clean --no-acl --no-owner -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -d <db name> /tmp/db.dump'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# © 2016 Therp BV <http://therp.nl> | |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | |
import json | |
from lxml import etree | |
from openerp import _, api, fields, models, SUPERUSER_ID | |
from openerp.osv import expression | |
class RestrictFieldAccessMixin(models.AbstractModel): |
- Change your database RDS instance security group to allow your machine to access it.
- Add your ip to the security group to acces the instance via Postgres.
- Make a copy of the database using pg_dump
$ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
- you will be asked for postgressql password.
- a dump file(.sql) will be created
- Restore that dump file to your local database.
- but you might need to drop the database and create it first
$ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
- the database is restored
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# example | |
# add this to crontab -e of odoo user | |
# curl -sL https://gist.github.com/shingonoide/1947a97e3c00168372e950a6788ce9ad/raw/cleanup_odoo_session.sh > /tmp/cleanup_sessions.sh && sh /tmp/cleanup_sessions.sh 4 | |
HOW_OLDER=${1:-6} | |
VERBOSE=${2:-0} | |
SESSION_FOLDER="$HOME/.local/share/Odoo/sessions" | |
TOTALFILES=$(find $SESSION_FOLDER -name '*.sess' | wc -l) |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from odoo import http | |
from odoo.http import request | |
from odoo.addons.web.controllers.main import serialize_exception,content_disposition | |
import base64 | |
class Binary(http.Controller): | |
@http.route('/web/binary/download_document', type='http', auth="public") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing Odoo on AWS | |
These are the steps I ran to get Odoo up and running on AWS using the free tiers (for now). | |
## Setup servers | |
### Create DB | |
Create an Postgres DB on Amazon RDS: | |
https://us-east-2.console.aws.amazon.com/rds/home?region=us-east-2#launch-dbinstance:ct=dbinstances: | |
### Create Server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install docker | |
apt-get update | |
apt-get install -y cloud-utils apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
apt-get update |
OlderNewer