Skip to content

Instantly share code, notes, and snippets.

View MMTE's full-sized avatar
🐢
Moving!

Mahdi Taleghani MMTE

🐢
Moving!
View GitHub Profile
<?php
namespace App\Helpers;
class SMS
{
/**
* Gets API Ultra Fast Send Url.
*
@MMTE
MMTE / CaddyController.php
Created January 17, 2023 22:32 — forked from gilbitron/CaddyController.php
Enabling HTTPS (SSL) for Laravel Sail using Caddy
<?php
# app/Http/Controllers/CaddyController.php
namespace App\Http\Controllers;
use App\Store;
use Illuminate\Http\Request;
class CaddyController extends Controller
{
#!/bin/sh
curl https://www.arvancloud.ir/fa/ips.txt > ./r1c_ips.txt;
echo 'running......'
for x in `cat ./r1c_ips.txt`;
do
ufw allow from $x
done
ufw reload > /dev/null
@MMTE
MMTE / laravel setup.sh
Created November 11, 2022 13:07 — forked from rolandstarke/laravel setup.sh
Server setup bash script for Laravel
# Ubuntu 20 LTS Server Setup for Laravel
# Login as root user
sudo su -
# Update list of available packages
apt update
@MMTE
MMTE / forge.sh
Created November 11, 2022 08:25 — forked from pLavrenov/forge.sh
Laravel Forge Setup Script (July 2020) - NGINX + MySQL
# Replace!
# [!server!] (the forge server instance)
# [!sudo_password!] (random password for sudo)
# [!db_password!] (random password for database user)
# [!user.name!] (git user name)
# [!user.email!] (git user email)
# [!server_ip!] (git user email)
#
# REQUIRES:
@MMTE
MMTE / forge.sh
Created November 11, 2022 08:16 — forked from azimidev/forge.sh
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
@MMTE
MMTE / stream_file.php
Created February 25, 2022 19:01 — forked from fideloper/stream_file.php
Stream file from S3 to browser, assume Laravel Filesystem usage
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
@MMTE
MMTE / StringIsLengthRule.php
Created April 19, 2021 19:21 — forked from ralphschindler/StringIsLengthRule.php
Custom Dynamic Validation Rules for Laravel 5.5+
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class StringIsLengthRule implements Rule
{
protected $length;
protected $message = 'The string must be greater than the length';
@MMTE
MMTE / ubuntudocker.sh
Created October 29, 2020 15:05 — forked from fredhsu/ubuntudocker.sh
Shell script to install Docker CE on ubuntu and post-install user configuration
#!/bin/bash
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
@MMTE
MMTE / 00-cloud-config.yml
Created October 17, 2020 15:11 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher