Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Babatope Ajepe ajepe

🎯
Focusing
View GitHub Profile
@ajepe
ajepe / README.md
Created Aug 22, 2020 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
View README.md
@ajepe
ajepe / Virtual Box Host Only Static IP.md
Created Jun 14, 2020 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP
View Virtual Box Host Only Static IP.md

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@ajepe
ajepe / main.py
Created May 28, 2020 — forked from mlaitinen/main.py
Odoo 12 Prometheus instrumentation
View main.py
##############################################################################
#
# Author: Miku Laitinen / Avoin.Systems
# Copyright 2019 Avoin.Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
@ajepe
ajepe / odoo-requests
Created Dec 1, 2019 — forked from dreispt/odoo-requests
Munin plugins for Odoo
View odoo-requests
#!/bin/sh
#%# family=manual
#%# capabilities=autoconf suggest
# Munin plugin for transactions/minute
case $1 in
autoconf)
exit 0
;;
suggest)
@ajepe
ajepe / upgrade-postgres-9.6-to-10.md
Created Nov 8, 2019 — forked from mdesantis/upgrade-postgres-9.6-to-10.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04
View upgrade-postgres-9.6-to-10.md

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
View kill all
kill $(ps aux | grep 'odoo' | awk '{print $2}')
@ajepe
ajepe / constraint.sql
Created Oct 21, 2019
Check list of constraint on a table
View constraint.sql
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 Oct 16, 2019
Get database size
View database.sql
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;
View Wget Crawl
wget -P build -nv -nH -r -E localhost:3000
You can’t perform that action at this time.