Skip to content

Instantly share code, notes, and snippets.

View maiconandsilva's full-sized avatar
↪️

Maicon Mauricio maiconandsilva

↪️
View GitHub Profile
@maiconandsilva
maiconandsilva / email-parse-appscript.js
Last active March 16, 2024 16:46
Email Message parsing for Appscript Example (Split content and blockquote)
/**
* LICENSED UNDER THE MIT LICENSE
*
* Copyright (c) 2023 Maicon Mauricio <maicon.dev@protonmail.com>.
*
* See https://gist.github.com/maiconandsilva/212332ad20ccb5450b7754610fcea281
* See https://stackoverflow.com/a/76577940/15016163
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@maiconandsilva
maiconandsilva / linux-commands.md
Last active September 17, 2023 14:47
Linux Commands used often
# Get IP of a network interface
`ip addr show docker0  | grep 'inet'`

# sshfs - mount directory through SSH
sudo sshfs -o allow_other,default_permissions,nonempty  <user>@<machine>:<path_origin> <local_path>

# Git commit in the past
GIT_AUTHOR_DATE="2023-10-24T18:00:00 -0300" GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE git commit
@maiconandsilva
maiconandsilva / README.md
Last active August 24, 2022 17:14
Git to CVS conversion

Configuration before running the script

  1. Install reposurgeon
  2. Initialize the configuration files
repotool initialize '$(CVS_MODULE)'
  1. Rename configuration files (remove '$(CVS_MODULE).' from name)
@maiconandsilva
maiconandsilva / docker-compose.yml
Last active August 24, 2022 14:28
Docker Compose PostgreSQL
version: "3.9"
services:
db:
build:
context: .
# shm_size: 2gb
restart: unless-stopped
ports:
- $DB_PORT:5432
@maiconandsilva
maiconandsilva / init-grails-update.sh
Last active July 19, 2023 15:48
Move files from Old Grails Project to New Grails Project (Grails 2 from 3+ Update)
#!/usr/bin/env bash
OLD_APP="${1///}" # Path Old App
NEW_APP="${2///}"
# first the sources
cp -vrf "$OLD_APP/.git" "$NEW_APP"
cp -rf "$OLD_APP"/src/groovy/* "$NEW_APP/src/main/groovy"
cp -rf "$OLD_APP"/src/java/* "$NEW_APP/src/main/groovy"
cp -rf "$OLD_APP"/grails-app/* "$NEW_APP/grails-app"
@maiconandsilva
maiconandsilva / ufw.md
Created May 7, 2021 21:22
College Assignment: firewall configuration

Firewall (ufw)

Regras que permitem o acesso de qualquer IP à porta 80 (HTTP) e de qualquer ip dentro da subrede da rede local à porta 22 (SSH).

Executar comando ufw como root.

  1. Configurar máquina virtual com adaptador de rede em modo bridge na mesma interface do host.

Máquina virtual &gt; settings &gt; network &gt; Attached to (Bridged Adapter)

@maiconandsilva
maiconandsilva / Grails_Groovy_Versions.txt
Created April 26, 2021 20:16 — forked from ishults/Grails_Groovy_Versions.txt
List of Groovy versions for Grails
// Compiled by Igor Shults
// Last Updated: July 23, 2020
GRAILS GROOVY SOURCE
4.1.0 3.0.5 https://github.com/grails/grails-core/blob/v4.1.0/build.gradle
4.0.4 2.5.6
4.0.3 2.5.6
4.0.2 2.5.6
4.0.1 2.5.6
4.0.0 2.5.6 https://github.com/grails/grails-core/blob/v4.0.0/build.gradle
@maiconandsilva
maiconandsilva / netclaro.py
Last active June 15, 2023 22:34
NET-CLARO-WIFI Login Skip Ads #script
#!/usr/bin/env python3
"""
# #NET-CLARO-WIFI Login Skip Ads
You should add a keyboard shortcut to run the script, so when the time runs out it's easier to re-enable internet access without having to watch ads.
## Requirements
- Chrome Drive must be in the system path
@maiconandsilva
maiconandsilva / git.md
Last active November 3, 2021 22:48
Git #snippets #commands

Useful Git Commands

Stash

# -k to keep index
# To save modified and untracked files.
git stash push -u -m <name_of_stash>

# Checkout file stashed
git checkout stash@{0} -- 
@maiconandsilva
maiconandsilva / index.py
Last active December 15, 2020 21:12
Script that persists some data into the database for project https://git.io/JL34M
from models.customers import Customers
from models.isolated.customer_personal_info import CustomerPersonalInfo
from string import ascii_letters, digits
from random import choice, choices
from helpers import store_key_id
from models.orders import Orders
from models.orders import OrderLines
from datetime import datetime
import random