Skip to content

Instantly share code, notes, and snippets.

View wbsouza's full-sized avatar

Wellington Souza wbsouza

  • Vancouver - BC / Canada
View GitHub Profile
@wbsouza
wbsouza / iptables_geoip_debian.md
Created December 28, 2023 07:46 — forked from netrunn3r/iptables_geoip_debian.md
Install geoip for iptables in Debian 10
  1. change from buster to bullseye
  2. sudo apt install libnet-cidr-lite-perl libtext-csv-xs-perl libgeoip2-perl

for day of writing, there is a problem with building by dkms this package xtables-addons-common so wehave to install this from source

  1. sudo apt install pkg-config libxtables-dev
  2. wget http://inai.de/files/xtables-addons/xtables-addons-3.13.tar.xz
  3. tar xf xtables-addons-3.13.tar.xz
  4. cd xtables-addons-3.13/
  5. ./configure
  6. make
@wbsouza
wbsouza / postgresql.md
Last active September 17, 2021 10:39 — forked from mencargo/postgresql.md
PostgreSQL Queries

Useful PostgreSQL Queries & Commands

All sizes in MB, change /1024/1024 to /1024/1024/1024 for GB.

Databases sizes

Without system databases

select
datname as database,
(pg_database_size(datname)/1024/1024) as size
@wbsouza
wbsouza / linux
Last active April 21, 2022 13:07
Linux commands
# force yum to update all the caches avoiding the error
# [Errno 14] HTTP Error 404 - Not Found
echo "http_caching=packages" >> /etc/yum.conf
yum clean all
yum makecache
yum update
# reload sysctl configs
sudo sysctl --system

Installing mailx

yum -y update
yum install -y mailx

We can now start sending e-mails using

@wbsouza
wbsouza / nginx_odoo_multiprocess
Created January 4, 2019 19:59 — forked from funbaker/nginx_odoo_multiprocess
odoo nginx static files
upstream odoo9_xmlrpc {
server <xmlrpc address>;
}
upstream odoo9_longpolling {
server <longpolling address>;
}
server {
listen 80;
@wbsouza
wbsouza / docker-compose.yml
Last active December 12, 2020 19:31
Useful docker commands
version: '3.6'
services:
oracle:
image: wisecoding/oracle-database:11g.20180719
container_name: docker_oracle_11g
hostname: oracle.wisecoding.net
shm_size: '2g'
networks:
wisenet:
ipv4_address: 172.18.0.100
@wbsouza
wbsouza / VirtualBox.txt
Last active January 15, 2019 00:41
VirtualBox useful commands
# changing the # of cpus
VBoxManage modifyvm default --cpus 2
#changing the memory size
VBoxManage modifyvm default --memory 4096
# change the
VBoxManage internalcommands sethduuid "/path/disk.vdi" $(uuidgen)
# changing the hard disk
import java.security.SecureRandom;
import java.util.*;
public class MapAnalysis {
public static void main(String args[]) {
int size = 1000000;
Random random = new SecureRandom();
Integer data[] = new Integer[size];