Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View obabawale's full-sized avatar
🎯
Focusing

Olalekan Babawale obabawale

🎯
Focusing
View GitHub Profile
@obabawale
obabawale / stock_move.py
Created November 20, 2022 21:54 — forked from ahmedelbougha/stock_move.py
Example of Odoo Multi-Threading - Background Process
from odoo import api, fields, models
from odoo.tools import float_is_zero
from odoo.exceptions import UserError, ValidationError
import threading
import time
import logging
class StockMove(models.Model):
_inherit = 'stock.move'
@obabawale
obabawale / clean_py.sh
Created February 13, 2022 07:17 — forked from luzfcb/clean_py.sh
Recursively removes all .pyc files and __pycache__ directories in the current directory
#!/bin/sh
# recursively removes all .pyc , .pyo files and __pycache__ directories in the current
# directory
find . | \
grep -E "(__pycache__|\.pyc$|\.pyo$)" | \
xargs rm -rf
# or, for copy-pasting:
@obabawale
obabawale / SSL.md
Last active May 5, 2021 07:36 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Set Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller who you trust.

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr

This gives you two files:

@obabawale
obabawale / setup_mailcatcher.sh
Created June 22, 2018 10:32 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
gem install mailcatcher
@obabawale
obabawale / oauth_10a_curl.sh
Created March 24, 2018 22:12 — forked from joslynesser/oauth_10a_curl.sh
OAuth 1.0a Curl Request
# Replace oauth_consumer_key with your consumer key
# Replace oauth_token with your access token
# Replace oauth_signature with "your_consumer_secret%26your_access_token_secret"
# Note that the oauth_nonce must change and be unique for every request
curl -X GET 'https://yoursite.desk.com/api/v1/account/verify_credentials.json' -H 'Authorization: OAuth oauth_version="1.0",oauth_timestamp=1321473112,oauth_nonce=937459123,oauth_signature_method="PLAINTEXT",oauth_consumer_key="nMu4u9pLRfDrxhPVK5yn",oauth_token="ivouGxpsJbyIU5viPKOO",oauth_signature="vLr9MjzowzVwbvREpWhIVQMJQI0G7Pin6KHCoXak%26igQY0L2bcbwonZTC4kG5ulZxTMTDW0K0zIyceSuF"'
@obabawale
obabawale / install-postgres-10-ubuntu.md
Created March 22, 2018 09:15 — forked from alistairewj/install-postgres-10-ubuntu.md
Install PostgreSQL 10 on Ubuntu

Install PostgreSQL 10 on Ubuntu

This is a quick guide to install PostgreSQL 10 - tested on Ubuntu 16.04 but likely can be used for Ubuntu 14.04 and 17.04 as well, with one minor modification detailed below.

(Optional) Uninstall other versions of postgres

To make life simple, remove all other versions of Postgres. Obviously not required, but again, makes life simple.

dpkg -l | grep postgres
@obabawale
obabawale / upgrade-postgres-9.3-to-9.5.md
Last active August 17, 2017 13:24 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main