Skip to content

Instantly share code, notes, and snippets.

View ppa-odoo's full-sized avatar
🎯
Focusing

Prashant Panchal ppa-odoo

🎯
Focusing
View GitHub Profile
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_0.10 | sudo bash -
sudo apt-get install -y nodejs
sudo npm install -g npm (to update npm)
ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
* Complete uninstall of nodejs and npm
DO: apt-get autoremove --purge nodejs npm
import xmlrpclib
HOST = 'localhost'
PORT = 8069
DB = 'DATABASE_NAME'
USER = 'admin'
PASS = 'admin'
ROOT = 'http://%s:%d/xmlrpc/' % (HOST,PORT)
# 1. Login
uid = xmlrpclib.ServerProxy(ROOT + 'common').login(DB,USER,PASS)
https://help.ubuntu.com/community/PostgreSQL
http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
Postgres
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo su postgres -c psql
@ppa-odoo
ppa-odoo / jQuery upload image take the base64 code.html
Last active January 30, 2023 06:56
jQuery upload image take the base64 code
<!DOCTYPE html>
<html>
<head>
<metea charset="utf8">
<title></title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js"></script>
<script type="text/javascript">
function readURL(input) {
if (input.files && input.files[0]) {
@ppa-odoo
ppa-odoo / GeoIP.txt
Last active January 30, 2023 06:56
GeoIP Configuration
sudo add-apt-repository ppa:maxmind/ppa
sudo apt update
sudo apt install libgeoip1 libgeoip-dev geoip-bin
sudo pip3 install GeoIP # For Python 3
sudo apt-get install geoip-database-contrib
==================================================
import GeoIP
geofile = config.get('geoip_database')
gio_data = GeoIP.open(geofile, GeoIP.GEOIP_STANDARD).record_by_addr(ip)
return gio_data
@ppa-odoo
ppa-odoo / __manifest__
Last active January 30, 2023 06:55
Odoo __manifest__ File
# -*- coding: utf-8 -*-
# Copyright <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Module name",
"summary": "Module summary",
"version": "11.0.1.0.0",
"development_status": "Alpha|Beta|Production/Stable|Mature",
"category": "Uncategorized",
"website": "https://github.com",
@ppa-odoo
ppa-odoo / templates_inherit_demo
Last active December 19, 2023 13:06
Odoo: How to inherit <templates> of web module?
REF LINK: https://www.odoo.com/forum/help-1/question/odoo10-how-to-inherit-templates-of-web-module-119140#answer-119142
This is main template:
<template id="template" xml:space="preserve">
<t t-name="DemoExample">
<div class="demo-one">
<p>odoo</p>
</div>
</t>
#!/bin/bash
# backup Location
dir="/home/dell/"
# Name of the backup files
date=`date +%d-%m-%Y`
databases=`psql -l -t | cut -d'|' -f1 | sed -e 's/ //g' -e '/^$/d'`
@ppa-odoo
ppa-odoo / .gitignore
Created November 4, 2019 12:37
.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
@ppa-odoo
ppa-odoo / smile.py
Created December 5, 2022 12:49
try it and make your day beautiful, and try new one and share with me, I am also trying new, have nice day and enjoy python coding
from turtle import *
import time
color('orange')
begin_fill()
pensize(5)
left(50)
forward(133)
circle(50, 200)
right(140)
circle(50, 200)