Skip to content

Instantly share code, notes, and snippets.

View nick2474's full-sized avatar

Didierh nick2474

View GitHub Profile
@nick2474
nick2474 / pg_backup_all.sh
Created February 12, 2021 07:22 — forked from powellc/pg_backup_all.sh
Bash script to backup all postgresql databases on a server, run with cron once a day or 5 times a day, whatever. Just updated it so it ignores your postgres db, and also bzips the backups and adds a symlink to a latest directory. Sweet.
#!/bin/bash
# Location to place backups.
backup_dir="/var/backups/databases/"
nightly_dir="/var/backups/databases/latest/"
#String to append to the name of the backup files
backup_date=`date +%d-%m-%Y`
#Numbers of days you want to keep copie of your databases
number_of_days=15
databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'`
for i in $databases; do if [ "$i" != "postgres" ] && [ "$i" != "template0" ] && [ "$i" != "template1" ] && [ "$i" != "template_postgis" ]; then
@nick2474
nick2474 / Odoo-10-Install-Process
Created January 31, 2021 06:16 — forked from abdulhalim-cu/Odoo-10-Install-Process
Install Odoo 10 on Ubuntu 16.04 LTS
Setp-1: Update & Upgrade Source List
update apt source list
sudo apt-get upgrade
Step-2: Install python dependencies for Odoo
sudo apt-get install python-dateutil python-docutils python-feedparser python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi poppler-utils python-pip python-pypdf python-passlib python-decorator gcc python-dev mc bzr python-setuptools python-markupsafe python-reportlab-accel python-zsi python-yaml python-argparse python-openssl python-egenix-mxdatetime python-usb python-serial lptools make python-pydot python-psutil python-paramiko poppler-utils python-pdftools antiword python-requests python-xlsxwriter python-suds python-psycogreen python-ofxparse python-gevent
Step-3: Odoo Web dependencies
@nick2474
nick2474 / debian_add_locale.sh
Created January 14, 2021 02:39 — forked from pi-aej/debian_add_locale.sh
dpkg-reconfigure locales locale-gen non-interactive
#Adds a locale to a debian system in non-interactive mode
sudo sed -i '/^#.* en_US.* /s/^#//' /etc/locale.gen
sudo locale-gen
@nick2474
nick2474 / install_posbox_less.sh
Created September 12, 2020 00:47 — forked from dansanti/install_posbox_less.sh
Odoo PosBoxLess Script Instalation
#!/usr/bin/env bash
PKGS_TO_INSTALL="cups adduser postgresql-client python python-dateutil python-decorator python-docutils python-feedparser python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-babel python-pychart python-pydot python-pyparsing python-pypdf2 python-reportlab python-requests python-tz python-vatnumber python-vobject python-werkzeug python-xlwt python-yaml postgresql python-gevent python-serial python-pip python-dev localepurge vim mc mg screen iw hostapd isc-dhcp-server git rsync console-data"
apt-get -y install ${PKGS_TO_INSTALL}
adduser pi -s /sbin/nologin -p 'raspberry'
cd /home/pi
git clone -b 9.0 --no-checkout --depth 1 https://github.com/odoo/odoo.git
cd odoo
<?php
$letras = ""; // Obtengo la LETRA guardada en la base de datos
$consecutivo = 1; // Obtengo el ID guardado en en la base de datos
$top = "9999999999"; // Obtengo el TOP guardado en en la base de datos
if ($consecutivo > (int)$top){
$consecutivo = 1;
if ($letras == ""){
$letras = "A";
} else {
@nick2474
nick2474 / odoo-api.markdown
Created November 12, 2016 20:41 — forked from dreispt/odoo-api.markdown
Odoo API reference

Fields

from openerp import models, fields, api, _

class MyModel(models.Model):
    _name = 'mymodule.mymodel'
    # Fields are declared as class attributes:
    char = fields.Char('Char', 64)        # name, size
 text = fields.Text('Text')
@nick2474
nick2474 / .bash_profile
Last active September 10, 2015 02:39 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@nick2474
nick2474 / gist:302e0fdd4ee5c76d225d
Last active September 10, 2015 01:41 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
module.exports.ChatClient = function () {
if (module.exports.ChatClient.instance) {
return module.exports.ChatClient.instance;
}
module.exports.ChatClient.instance = this;
this.host = null;
this.welcomeTime = 0;
var interval = null;