Skip to content

Instantly share code, notes, and snippets.

View rdeprera's full-sized avatar
🇺🇦
🇧🇷 🇺🇦

Reinaldo Deprera rdeprera

🇺🇦
🇧🇷 🇺🇦
View GitHub Profile
@rdeprera
rdeprera / cortar_silencio.py
Last active September 26, 2022 11:15 — forked from vivekhaldar/cut_silence.py
Script Python para cortar partes silenciosas de um vídeo. Usa a biblioteca moviepy.
#!/usr/bin/env python
#
# Based on a script by Donald Feury
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2
# https://youtu.be/ak52RXKfDw8
import math
import sys
import subprocess
import os
@rdeprera
rdeprera / php8.1-fpm_phpmyadmin.service
Created August 14, 2022 08:33
PHPMyAdmin Service Unit
# /lib/systemd/system/php8.1-fpm_phpmyadmin.service
# alterar: {DIR}
[Unit]
Description=PHPMyAdmin FPM Pool - Reinaldo Deprera
Documentation=man:php-fpm8.1(8)
After=network.target
[Service]
Type=notify
@rdeprera
rdeprera / certificado-HTTP-SSL_auto-assinado.sh
Last active February 16, 2022 08:50
Criação de certificado SSL auto-assinados para servidores HTTP
#!/usr/bin/env bash
#
# Modelo de certificado auto-assinados para teste SSL em virtualhosts em ambiente de testes
# Referências:
# https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-16-04
#
# TODO(rdeprera): criar .run apartir desse modelo
# TODO(rdeprera): descrever nos comentários cada uma das variáveis
## Valores prováveis para DIR_CERTIFICADOS:
@rdeprera
rdeprera / backup-site-tarball.sh
Created February 5, 2022 05:01
Backup de website em tarball
#!/usr/bin/env sh
# Compactado
tar \
-pzcvf \
backup-site.tar.gz \
--exclude=".DS_Store" \
--exclude="*-BKP-*" \
--exclude="*.BKP*" \
--exclude="*BKP.*" \
--exclude="*BACKUP*" \
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.site.com.br/uri/
@rdeprera
rdeprera / nginx.conf
Created June 22, 2021 01:52 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@rdeprera
rdeprera / gist:5858082
Created June 25, 2013 12:32
I need all medias of gallery with id 1. But i can only fetch one
$gallery = $this->getDoctrine()
->getRepository('Application\Sonata\MediaBundle\Entity\GalleryHasMedia')
->find(1);
$medias = $gallery->getMedia();