Skip to content

Instantly share code, notes, and snippets.

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

Ricardo Duarte rduarte

🏠
Working from home
View GitHub Profile
@mailightkun
mailightkun / openssl_encrypt_decrypt.md
Created April 6, 2018 04:44
Replace mcrypt_encrypt with openssl_encrypt

Replace mcrypt_encrypt with openssl_encrypt

If you switch from PHP 5.x to 7.1 you will get the following message:

"Function mcrypt_encrypt() is deprecated"

Now it is the right time to refactor this old function :-)

function encrypt(string $data, string $key, string $method): string
@butschster
butschster / debian-laravel.sh
Last active June 17, 2022 10:24
LEMP server configured for Laravel (MySQL, NGINX, php7.2-fpm, Redis, Websocket server, MongoDB, Composer)
# ================================================
# PHP 7.2
#
# See https://www.colinodell.com/blog/201711/installing-php-72
# ================================================
apt-get install -y apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt-get update
apt-get install -y php7.2-cli php7.2-gd php7.2-mbstring php7.2-curl php7.2-xml php7.2-zip
@hugs
hugs / 1 - setup.md
Last active March 21, 2020 19:59
Elementary OS Setup (Loki)

Post-installation Elementary OS Setup and Tweaks

  • System Settings -> Mouse & Touchpad -> Touchpad -> Tap to click -> (Toggle on)
  • Connect to additional WiFi access points

Apply Updates:

sudo apt-get update
sudo apt-get upgrade

Install Dev Tools:

@skarllot
skarllot / make-icpbrasil-bundle.sh
Last active January 23, 2024 03:02
Download ICP-Brasil certificates and make a bundle
#!/bin/bash
HTTPADDR=http://acraiz.icpbrasil.gov.br/credenciadas/CertificadosAC-ICP-Brasil/ACcompactado.zip
DEST=/etc/ssl/certs/icp-brasil
mkdir -p ${DEST}
cd ${DEST}
rm -f *.crt
rm -f *.zip
@jamis
jamis / demo.rb
Created August 3, 2011 21:56
Repairing a unicode string that contains invalid characters
# encoding: utf-8
s = "Blah \xe9 blah 헌글"
puts "BEFORE"
puts "encoding: #{s.encoding}"
puts "valid : #{s.valid_encoding?}"
puts "text : #{s}"
s = s.