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 / 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 / PostController.php
Last active September 29, 2017 18:37 — forked from jamband/PostController.php
Yii 2: Ajax + Delete
<?php
class PostController extends Controller
{
// ...
public function actionDelete($id)
{
$this->findModel($id)->delete();
if (!Yii::$app->request->isAjax) {
return $this->redirect(['index']);
@almirb
almirb / README.md
Last active November 26, 2023 09:13 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

Batch Compress PDF

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality. With this file you'll able to compress a bunch of PDF files at once.

Usage

First, download and install Ghostpdf (https://ghostscript.com/download/). From command prompt, run compress-pdf.md "source folder" "destination folder" e.g:

@almirb
almirb / Install_Phpstorm.sh
Last active January 29, 2018 17:06 — forked from theodorosploumis/Install_Phpstorm.sh
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# Original credits to theodorosploumis
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@almirb
almirb / m160519_152129_create_estados_e_cidades.php
Last active April 26, 2022 01:31
[Yii2][Migration] Todos os estados e cidades do Brasil
<?php
/*
* [Yii2][Migration] Todos os estados e cidades do Brasil
*
* Autor: Emanuel A. Leite (https://github.com/AnDroidEL)
* Data: 02/04/2016
*
* Ajustes: Almir Bolduan (https://github.com/almirb)
* Data: 01/09/2016