Skip to content

Instantly share code, notes, and snippets.

View yucer's full-sized avatar

Yurdik Cervantes yucer

View GitHub Profile
@yucer
yucer / ubuntu-isolate-workspaces.sh
Created February 17, 2021 12:26
Isolate ubuntu gnome dash to the current workspace
# show only icons on the dock that belong to app in the current workspace
gsettings set org.gnome.shell.app-switcher current-workspace-only true
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-workspaces true
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-monitors true
# https://varhowto.com/forum-topic/ubuntu-dock-how-to-show-windows-in-current-workspace-only/
# https://askubuntu.com/questions/1068097/separate-workspaces-in-ubuntu-18-04-desktop
@yucer
yucer / install_pyenv_ubuntu_20_10.sh
Last active May 14, 2023 06:29
install pyenv ubuntu 20.10
#!/bin/bash
# install pyenv dependencies
sudo apt-get install git make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev curl
# install pyenv
curl https://pyenv.run | bash
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
@yucer
yucer / ask_sudo_from_python.py
Created September 11, 2020 09:55
ask sudo programatically from python
import os, subprocess
from getpass import getpass
def is_root():
return os.geteuid() == 0
def test_sudo(pwd=""):
args = "sudo -S echo OK".split()
kwargs = dict(stdout=subprocess.PIPE,
encoding="ascii")
@yucer
yucer / 0001-issue-3163-ignore-duplicated-rows-for-translation-im.patch
Last active August 21, 2022 09:56
debug duplicated translation import rows
From de641d9474417203e707c0932185c1dccfd39e96 Mon Sep 17 00:00:00 2001
From: Yurdik Cervantes <ycervantes@elegosoft.com>
Date: Wed, 4 Dec 2019 12:16:48 +0100
Subject: [FIX] ignore duplicated rows for translation imports
In the cases where conflicting translation rows are imported (for
example `.po` vs `.pot` files) the import queries during the database
update fail with one stop error.
With this change, just one of the duplicated rows to import is left,
@yucer
yucer / odoo_nx.py
Created September 4, 2019 16:01
Find loops in Odoo models and addons with python's networkx
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import optparse
import erppeek
import networkx as nx
options = None
@yucer
yucer / odoo_neo4j.py
Created September 4, 2019 15:58
Load odoo schema into neo4j (python2)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import optparse
import erppeek
from py2neo import Node, Relationship, Graph, watch
from py2neo.packages.httpstream import http
@yucer
yucer / test_selenium_ctrl_t_e10s_disabled.java
Created August 11, 2017 08:50
Test sendKeys with CONTROL + T using Selenium Java with Electrolysis disabled
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
@yucer
yucer / test_selenium_ctrl_t.java
Created August 9, 2017 09:18
Test sendKeys with CONTROL + T using Selenium Java
package automationFramework;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
@yucer
yucer / test_selenium_ctrl_t.java.log
Created August 9, 2017 09:16
Test sendKeys with CONTROL + T using Selenium Java (LOG)
IOpening new Tab
webdriver::server DEBUG -> POST /session/95eafc26-5064-4038-9abd-77cfa38d0c97/element/d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163/value {"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}
geckodriver::marionette TRACE -> 121:[0,5,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 -> [0,5,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 <- [1,5,null,{}]
geckodriver::marionette TRACE <- [1,5,null,{}]
webdriver::server DEBUG <- 200 OK {"value": {}}
webdriver::server DEBUG -> POST /session/95eafc26-5064-4038-9abd-77cfa38d0c97/element/d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163/value {"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"t","value":["","t",""]}
geckodriver::marionette TRACE -> 114:[0,6,"sendKeysToElement",{"id":"d36aa8a9-5ab2-4bc3-a951-fec6e7bd6163","text":"t","value":["","t","
@yucer
yucer / test_selenium_ctrl_key.java.log
Created August 9, 2017 09:14
Test sendKeys with CONTROL using Selenium Java (LOG)
Opening new Tab
webdriver::server DEBUG -> POST /session/cf7cca51-aeb8-4d18-b52a-ce6e7ef7f0d4/element/b1c10055-c301-4892-930c-2e1859fb13d9/value {"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}
geckodriver::marionette TRACE -> 121:[0,5,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}]
Marionette TRACE 0 -> [0,5,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"abcdef","value":["a","b","c","d","e","f"]}]
geckodriver::marionette TRACE <- [1,5,null,{}]
Marionette TRACE 0 <- [1,5,null,{}]
webdriver::server DEBUG <- 200 OK {"value": {}}
webdriver::server DEBUG -> POST /session/cf7cca51-aeb8-4d18-b52a-ce6e7ef7f0d4/element/b1c10055-c301-4892-930c-2e1859fb13d9/value {"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":"z12345","value":["","z","","1","2","3","4","5"]}
geckodriver::marionette TRACE -> 139:[0,6,"sendKeysToElement",{"id":"b1c10055-c301-4892-930c-2e1859fb13d9","text":