Skip to content

Instantly share code, notes, and snippets.

View brunomarks7's full-sized avatar
🏠
Working from home

Bruno Saraiva brunomarks7

🏠
Working from home
View GitHub Profile
@brunomarks7
brunomarks7 / Dockerfile
Last active October 19, 2021 04:07
CWEBP - Convert all png images to webp recursively
FROM nginx
LABEL maintainer="[email protected]"
COPY /images /usr/share/nginx/html
RUN apt update && apt install -y curl
RUN curl -O https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-0.4.1-linux-x86-64.tar.gz
@brunomarks7
brunomarks7 / tinyerp-ocultar-cpf-nfe-formato-etiqueta.js
Last active July 29, 2021 04:39
Script para ser usado com extensão do Chrome Tampermonkey para remover CPF de clientes em NFes no formato etiqueta, no TinyERP, em função do LGPD
// ==UserScript==
// @name TinyERP - Remove CPF do cliente em NF em formato etiqueta
// @namespace http://tampermonkey.net/
// @version 0.1
// @author https://github.com/brunomarks7
// @match *://erp.tiny.com.br/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function () {
@brunomarks7
brunomarks7 / wp-permissions.sh
Created April 19, 2021 03:39
Docker WordPress-Bitnami image permissions
#!/bin/bash
# Docker WordPress-Bitnami image permissions
sudo chown -R /opt/bitnami/apps/wordpress/htdocs
sudo find /opt/bitnami/apps/wordpress/htdocs -type d -exec chmod 775 {} \;
sudo find /opt/bitnami/apps/wordpress/htdocs -type f -exec chmod 664 {} \;
sudo chmod 640 /opt/bitnami/apps/wordpress/htdocs/wp-config.php
@brunomarks7
brunomarks7 / cleanup-unused-wordpress-uploads.sh
Last active February 2, 2021 00:00
Cleanup unused wordpress uploads recursively by suffix (filename), like "150x150"
#!/bin/bash
# Usage
# 1 - Create a folder into any folder (like uploads, or year, or month) and put this script in there.
# 2 - Run "bash cleanup-unused-wordpress-uploads.sh"
currentPath=$(pwd)
echo "Input the crop size pattern"
echo ">> Sample: '150x150' "
read sizePattern
@brunomarks7
brunomarks7 / wp-permissions-script
Created August 16, 2020 02:22 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # <-- wordpress owner
WP_GROUP=changeme # <-- wordpress group
WP_ROOT=/home/changeme # <-- wordpress root directory
@brunomarks7
brunomarks7 / gulpfile.images.js
Created April 18, 2019 04:37
Gulp 4 - Optimize images task
const gulp = require("gulp");
const imagemin = require("gulp-imagemin");
const newer = require("gulp-newer");
const plumber = require("gulp-plumber");
const notify = require("gulp-notify");
// Optimize Images
function images() {
return gulp
.src("./assets/img/**/*")