Skip to content

Instantly share code, notes, and snippets.

View rederlo's full-sized avatar

Ederlo Rodrigo de Oliveira rederlo

View GitHub Profile
@rederlo
rederlo / wsl2-larvel.txt
Last active March 24, 2024 22:56
setup wsl2
#!/bin/bash
install_dependencies() {
echo "Instalando dependências necessárias..."
sudo apt update
sudo apt install -y software-properties-common network-manager libnss3-tools jq xsel redis-server mysql-server
sudo add-apt-repository --yes ppa:ondrej/php
sudo apt update
sudo apt install -y php8.3 php8.3-cli php8.3-fpm php8.3-mysql php8.3-xml php8.3-mbstring php8.3-curl php8.3-zip php8.3-sqlite3 php8.3-pgsql php8.3-pdo php8.3-zip
}
@rederlo
rederlo / References
Created September 1, 2021 14:01 — forked from jpcaparas/References
Limit docker CPU and memory resource usage
Inspired by: https://stackoverflow.com/questions/46408673/docker-17-06-ce-default-container-memory-limit-on-shared-host-resources/46557336#46557336
@rederlo
rederlo / Dockerfile
Created July 21, 2021 13:43 — forked from Sirpyerre/Dockerfile
Dockerfile Laravel SQL SERVER
FROM ubuntu:20.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC
@rederlo
rederlo / docker-on-wsl-windows-10-home-docker-toolbox.md
Created April 18, 2019 18:28 — forked from strarsis/docker-on-wsl-windows-10-home-docker-toolbox.md
Notes about Docker on WSL (Windows 10 Home / Docker Toolbox) (Virtualbox instead Hyper-V)

Docker on WSL (Windows 10 Home / Docker Toolbox) (Virtualbox instead Hyper-V)

Docker on WSL communicates with Docker on Windows from Docker Toolbox.

Install VirtualBox and Docker Toolbox on Windows.

Docker on Windows uses VM for Linux based docker containers.

@rederlo
rederlo / site.conf
Created October 19, 2017 21:40
Proxy app node
<VirtualHost *:80>
ServerName my.domain.name
RewriteEngine On
RewriteCond %{QUERY_STRING} transport=polling
RewriteRule /(.*)$ http://localhost:7000/$1 [P]
ProxyRequests off
ProxyPass /socket.io/ ws://localhost:7000/socket.io/
ProxyPassReverse /socket.io/ ws://localhost:7000/socket.io/
@rederlo
rederlo / crontab.txt
Last active July 18, 2017 17:15
cron cpanel or vagrant
* * * * * php -q -d register_argc_argv=on /path/script.php
@rederlo
rederlo / .htaccess
Created July 7, 2017 20:33
AWS redirect http to https
# the final correct redirect
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@rederlo
rederlo / Calendario.php
Created March 16, 2017 13:27
Exemplo de calendario
<?php
/**
* Class Calendario
*/
class Calendario
{
/**
* @var int
@rederlo
rederlo / strategy.php
Created January 4, 2017 13:05
Exemplo Strategy design patterns
<?php
interface OutputInterface
{
public function load($arrayOfData);
}
class SerializedArrayOutput implements OutputInterface
{
public function load($arrayOfData)
{
@rederlo
rederlo / index.php
Last active October 6, 2016 02:26
Exemplo TCPDF carregar imagem externa.
<?php
/**
* Created by PhpStorm.
* User: ederlo
* Date: 05/10/16
* Time: 21:27
*/
require_once 'vendor/autoload.php';
$pdf = new TCPDF();