Skip to content

Instantly share code, notes, and snippets.

View mdyusufalam's full-sized avatar

Md Yusuf Mia mdyusufalam

View GitHub Profile
@mdyusufalam
mdyusufalam / How to set custom resolution in ubuntu
Created October 31, 2023 08:00
How to set custom resolution in ubuntu
Ref: https://www.tecmint.com/set-display-screen-resolution-in-ubuntu/
//Add mode by running below command then replace value after xrandr --newmode in step 2 generated by the command 1
1. cvt 1920 1080
2. xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
3. xrandr --addmode eDP-1 "1920x1080_60.00"
4. then go to display and select the newly created resolution from ui
@mdyusufalam
mdyusufalam / Check-Table-Size-Postgresql
Created October 28, 2023 07:38
How to get the table sixe in postgresql
SELECT
table_name,
pg_size_pretty(table_size) AS table_size,
pg_size_pretty(indexes_size) AS indexes_size,
pg_size_pretty(total_size) AS total_size
FROM (
SELECT
table_name,
pg_table_size(table_name) AS table_size,
pg_indexes_size(table_name) AS indexes_size,
** Multiply and update existing nested array doument numeric field in mongo
db.getCollection('Products_yus_mul').find({}).sort({_id:-1});
db.Products_yus_mul.update(
{}, // Filter to match the documents you want to update
[{ $set: { 'ProductSKUs.ProductPrices.Price01': { $multiply: [ 100, 1 ] } } }],
{ multi: true }
)
1. Update package lists
sudo apt-get update
2. Install dependencies
sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less
3. Create odoo13 user in ubuntu
Create odoo13 user in ubuntu and assign home directory folder /opt/odoo13 (Skip this step if you already created the user odoo13 in ubuntu and start from step 4)
sudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13
4. Switch to user odoo13
sudo su odoo13
5. Install postgresql
@mdyusufalam
mdyusufalam / debug.json
Last active October 1, 2021 17:57
debugJson
2021-09-30 11:41:14,283 9294 CRITICAL PG250621 odoo.addons.KY_GTE_REPAIR.models.KY_GTE_REPAIR: repair.order(1111,)
2021-09-30 11:41:14,284 9294 CRITICAL PG250621 odoo.addons.KY_GTE_REPAIR.models.KY_GTE_REPAIR: {
'id': 1111, 'state': 'draft', 'transfer_count': 2, 'name': 'RMA/2021/\t002811', 'tracking': 'serial', 'product_id': 96138, 'product_uom_category_id': 1, 'product_qty': 1, 'product_uom': 1, 'lot_id': 13068, 'partner_id': 98058, 'meter_reading': '3250', 'branch_id': 2, 'analytic_account_id': 181, 'analytic_tag_ids': [[6, False, []]], 'address_id': 98058, 'user_id': 274, 'company_id': 1, 'guarantee_limit': False, 'invoice_method': 'after_repair', 'partner_invoice_id': 98058, 'pricelist_id': 1, 'source_location_id': 18, 'picking_type': 7, 'tag_ids': [[6, False, []]], 'operations': [[4, 9519, False], [2, 9518, False]], 'amount_untaxed': 3554.9, 'amount_tax': 533.24, 'amount_total': 4088.14, 'total_qty_add': 5, 'total_qty_remove': 0, 'total_qty_remain': 5, 'fees_lines': [[4, 1323, False], [4, 1324, False]
@mdyusufalam
mdyusufalam / odoo-geo-fencing-dependency
Last active September 9, 2021 11:03
odoo geo fencing module
source /opt/odoo13/odoo-venv/bin/activate
pip install shapely
pip install geojson
pip install simplejson
SELECT * from hr_attendance
UPDATE hr_attendance set worked_hours = 0.0 where id=4
@mdyusufalam
mdyusufalam / odoo vs configuration
Last active June 27, 2021 11:28
How configure Odoo Development with Visual Studio Code
1. Create Json file for debugging and put below line
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Odoo Debug",
@mdyusufalam
mdyusufalam / Enable Root Login to Ubuntu 18.4 Desktop
Last active January 10, 2021 11:04
Enable Root Login to Ubuntu 18.4 Desktop
Step 1:
sudo -i passwd root
--------------------------------------------------------------------
Step 2:
gedit /etc/gdm3/custom.conf
[Security]
AllowRoot = true
AllowRemoteRoot = true
------------------------------------------------------------------
[options]
#
# WARNING:
# If you use the Odoo Database utility to change the master password be aware
# that the formatting of this file WILL be LOST! A copy of this file named
# /etc/odoo/openerp-server.conf.template has been made in case this happens
# Note that the copy does not have any first boot changes
#-----------------------------------------------------------------------------
# Odoo Server Config File - TurnKey Linux
/*
-- ======================================================================================
-- Author: Md Yusuf Alam
-- Create date: 13th May 2020
-- Description: https://docs.google.com/document/d/1GaIkxK5Dt3p7hGTMm7rZzSq1g656q78uhOaYrD9RBqk/edit Implement Quick Search
---------------------------------------------------------------------------------------
Ref# Modified By Modified date Descriptions
#1 [Developer Name] [Date] [Description]
----------------------------------------------------------------------------------------
*/