Skip to content

Instantly share code, notes, and snippets.

View almirb's full-sized avatar

Almir Bolduan almirb

View GitHub Profile
@almirb
almirb / mongodb-s3-backup-mongoexport-query.sh
Created August 28, 2022 01:20 — forked from mvladk/mongodb-s3-backup-mongoexport-query.sh
Automatically backup a MongoDB database to S3 using mongoexport with query, tar.bz2, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run sudo mkdir /data/tmp
# 7) Run sudo chmod 777 /data/tmp/
@almirb
almirb / docker-compose.yaml
Created July 15, 2022 20:01 — forked from jorgealarcon/docker-compose.yaml
Dremio (latest) with CORS enabled
version: '2'
services:
dremio:
image: dremio/dremio-oss
container_name: dremio
#volumes:
#- dremio-local:/opt/dremio/data
ports:
- 9047:9047
- 31010:31010
@almirb
almirb / readme.md
Created July 15, 2022 19:59 — forked from hwetsman/readme.md
Data Terms/Concepts Cheatsheet

Data Analytics/Science Terms and Concepts Cheatsheet

Structured Data

Data is organized to meet a schema. Think tables which organize data into rows and columns.

Unstructured Data

Data is unorganized and lacks a schema. Imagine collections of html documents including text and images not organized in any consistent way.

@almirb
almirb / dremio.md
Created July 15, 2022 19:57 — forked from victorouttes/dremio.md
Instalação do Dremio

Instalação básica do Dremio

Rodar este docker-compose.yml no servidor:

version: '3.1'

services:

  dremio:
    image: dremio/dremio-oss:<tag>
 container_name: dremio
@almirb
almirb / rulelist.py
Created May 9, 2019 10:58
Python script to show a list of active OSSEC rules. Author: Pedro Sanchez.
#!/usr/bin/python
# Rules list
# pe...@wazuh.com
import sys
import re
import os
rules_directory = "/var/ossec/rules/"
@almirb
almirb / mysql_backup.cmd
Last active January 2, 2023 22:01
MySQL Backup Batch Script (Windows) for 7 day persistence with hour prefix.
@echo off
:: make sure to change the settings from line 4-9
set dbUser=backup
set dbPassword="MyBackupUserPass"
set backupDir="C:\laragon\bkp\mysql"
set mysqldump="C:\laragon\bin\mysql\mysql-5.7.24-winx64\bin\mysqldump.exe"
set mysqlDataDir="C:\laragon\data\mysql"
set zip="C:\Program Files\7-Zip\7z.exe"
@almirb
almirb / cloudflare-ban.sh
Last active December 23, 2019 17:31 — forked from bdtech/cloudflare-ban.sh
OSSEC active response to block an IP at the Cloudflare reverse proxy level who triggers errors in short time frame in Apache/nginx logs. Updated to support Cloudflare API v4.
#!/bin/sh
# Adds an IP to Cloudflare IP block list
# Path: /var/ossec/active-response/bin/cloudflare-ban.sh
# Authors: Bryan Dwyer (bdtech) and Almir Bolduan (almirb)
# Last modified: May 08, 2019
#
# Sample config (Edit /var/ossec/etc/ossec.conf):
#
# <command>
# <name>cloudflare-ban</name>
@almirb
almirb / leao_helper.user.js
Last active February 22, 2019 22:29
LeãoHelper
// ==UserScript==
// @name LeaoHelper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Script auxiliar do aplicativo Leão.
// @author Almir Bolduan
// @include https://extratoir.inss.gov.br/irpf01/pages/consultarExtratoIR.xhtml*
// @grant none
// ==/UserScript==
@almirb
almirb / media.html
Created November 9, 2018 01:08
Média de 2 notas usando JavaScript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Média de 2 Notas </title>
<script LANGUAGE="JavaScript" type="text/javascript">
var nota1 = parseInt(prompt("Qual a nota 1?"));
@almirb
almirb / bhaskara.html
Created November 8, 2018 18:48
Script para calcular a fórmula de Bhaskara em Javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Cálculo de Bhaskara </title>
<script LANGUAGE="JavaScript" type="text/javascript">
var valorA = prompt("Informe o valor de A:");