Skip to content

Instantly share code, notes, and snippets.

View ajepe's full-sized avatar
🏠
Working from home

Babatope Ajepe ajepe

🏠
Working from home
View GitHub Profile
@ajepe
ajepe / upgrade-postgres-9.6-to-10.md
Created November 8, 2019 14:37 — forked from mdesantis/upgrade-postgres-9.6-to-10.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
@ajepe
ajepe / kill all
Created October 25, 2019 10:08
grep
kill $(ps aux | grep 'odoo' | awk '{print $2}')
@ajepe
ajepe / constraint.sql
Created October 21, 2019 11:02
Check list of constraint on a table
SELECT con.* FROM pg_catalog.pg_constraint con INNER JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid INNER JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace WHERE nsp.nspname = 'public' AND rel.relname = 'product_product';
@ajepe
ajepe / database.sql
Created October 16, 2019 06:49
Get database size
select t1.datname AS db_name,
pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;
wget -P build -nv -nH -r -E localhost:3000
@ajepe
ajepe / nginx
Created April 15, 2019 11:12
Odoo basic nginx conf
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
# http -> https
# server {
@ajepe
ajepe / md
Created January 15, 2019 07:56
Nigeria Banks sort code
{
"070010": "ABBEY MORTGAGE BANK-070010",
"044": "ACCESS BANK PLC-044",
"323": "AccessMobile-100013",
"090134": "ACCION MICROFINANCE BANK-090134",
"090160": "ADDOSSER MICROFINANCE BANK-090160",
"100028": "AG MORTGAGE BANK PLC-100028",
"090133": "AL-BARAKAH MICROFINANCE BANK-090133",
"090180": "AMJU UNIQUE MICROFINANCE BANK-090180",
"090116": "AMML MFB-090116",
curl -gkvLI -H 'User-Agent: updown.io daemon 2.2' -H 'Accept: */*' -H 'Connection: Close' -H 'Accept-Language: en' -m 30 --connect-timeout 5 http://odoosme.ng
@ajepe
ajepe / random number
Last active January 25, 2019 10:12
my crazy random number and otp
''.join([str(random.randint(0, 9)) for _ in range(11)])
def otp(length=5, lowerband=1, upperband=9):
return ''.join(
random.sample([str(random.randint(lowerband, upperband))
for _ in range(upperband+1)], length)
)
<?php
/**
* Created by PhpStorm.
* User: Raihan
* Date: 10-Jul-17
* Time: 4:37 AM
*/
class CryptOpenssl{
private $hash;