Skip to content

Instantly share code, notes, and snippets.

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

Eliyas Hossain eliyas5044

🏠
Working from home
View GitHub Profile
@eliyas5044
eliyas5044 / caddy-django.md
Created November 13, 2024 00:19
Caddy for Django

Caddyfile

  • Update the caddyfile into /etc/caddy/Caddyfile
example.com {
    encode gzip

    # Proxy all requests to the Django app
    reverse_proxy http://127.0.0.1:8000
@eliyas5044
eliyas5044 / laravel-systemd.md
Created October 29, 2024 02:01
Laravel Services with Systemd

Laravel Services with Systemd

This guide outlines how to configure Laravel services with systemd for background tasks like queues and custom commands.

1. Laravel Queue Worker Service

  1. Create the Service File

    Create a service file at /etc/systemd/system/laravel_queue.service. Make sure to adjust the User, Group, and working directory path to match your server configuration.

@eliyas5044
eliyas5044 / caddy-laravel.md
Created October 29, 2024 01:50
Caddy server configuration for a Laravel application

Caddyfile

  • Update the caddyfile into /etc/caddy/Caddyfile
example.com {
	root * /var/www/html/public
	encode gzip
	reverse_proxy /socket/* http://0.0.0.0:8080

	php_fastcgi unix//run/php/php8.3-fpm.sock
@eliyas5044
eliyas5044 / readme.md
Created July 18, 2024 05:37
Deploy Laravel using GitHub action into shared hosting

Storage Folders

  • Create storage folders from terminal
mkdir -p storage/app/public storage/framework/cache storage/framework/cache/data storage/framework/sessions storage/framework/views storage/logs

Let's use the latest version of the in_app_purchase package in Flutter to implement the API integration for getting courses, a single course, and applying promo codes.

Step 1: Add Dependencies

Ensure your pubspec.yaml file includes the latest in_app_purchase package:

dependencies:
  flutter:
    sdk: flutter
  in_app_purchase_storekit: ^0.3.0
  http: ^0.13.3
@eliyas5044
eliyas5044 / api.example.com.conf.md
Created February 2, 2024 17:04
Nginx config for Laravel, PHP

HTTP config

server {
  listen 80;
  server_name api.example.com;
  root /var/www/api/public;

  if ( $scheme = "http" ) {
    return 301 https://$host$request_uri;
  }
@eliyas5044
eliyas5044 / nuxt-nginx-ssl.md
Created December 13, 2023 17:38
Nginx config file for the Nuxt SSR

nginx.conf

  • Modify nginx.conf into /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
  worker_connections 1024; # Adjusted for higher capacity
@eliyas5044
eliyas5044 / web.conf
Created November 18, 2023 19:15
Wordpress Nginx config
upstream php {
server unix:/run/php/php8.2-fpm.sock;
server 127.0.0.1:9000;
}
server {
listen 80;
listen 443 ssl http2;
if ( $scheme = "http" ) {
@eliyas5044
eliyas5044 / laravel-queue.md
Created October 5, 2023 10:28
Laravel queue server using PM2

PM2

We can keep running of Laravel queue server using pm2.

  • Create a pm2 config file
nano ecosystem.config.js
  • Update the config file
module.exports = {
 apps: [
@eliyas5044
eliyas5044 / laravel-echo-server.md
Last active October 5, 2023 10:25
Laravel echo server using PM2

PM2

We can keep running of Laravel echo server using pm2.

  • Create a pm2 config file
nano ecosystem.config.js
  • Update the config file
module.exports = {
 apps: [