Skip to content

Instantly share code, notes, and snippets.

View fanorama's full-sized avatar

Septian Rifano fanorama

View GitHub Profile

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "[email protected]"
@fanorama
fanorama / install.sh
Created May 22, 2024 04:26 — forked from dinhquochan/install.sh
Install PHP 8.2, Composer, MySQL 8 for Laravel Development on Ubuntu 22.04
## PHP
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip \
php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack \
php8.2-igbinary php8.2-redis php8.2-memcache php8.2-pcov php8.2-xdebug
#!/bin/bash
# Script Name: laravel_apache_setup.sh
# Purpose: Configures file permissions and symbolic links for Laravel applications running under Apache on Ubuntu.
#
# Usage:
# This script must be executed with root privileges to ensure it can correctly set permissions and ownership
# across necessary directories and manage symbolic links. It is intended for use on an Ubuntu server configured with Apache.
#
# Set the APP_PATH environment variable to the root directory of your Laravel application before running the script:
@fanorama
fanorama / laravel setup.sh
Created May 22, 2024 04: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
@fanorama
fanorama / Response.php
Created May 22, 2024 04:06 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@fanorama
fanorama / FileHelper.php
Created May 22, 2024 04:04 — forked from waska14/FileHelper.php
Laravel: create UploadedFile object from base64 string (autoremove temp file)
<?php
namespace App\Helpers\File;
use Illuminate\Http\File;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Arr;
class FileHelper
{