Skip to content

Instantly share code, notes, and snippets.

View crossmaya's full-sized avatar
🎯
Focusing

JT crossmaya

🎯
Focusing
View GitHub Profile
@thibaut-d
thibaut-d / 0 - docker-compose cheatsheet.sh
Last active August 7, 2022 21:30
Cheatsheet for Docker
https://docs.docker.com/compose/reference/overview/
docker-compose build # build containers (usefull if changed)
docker-compose up # builds, (re)creates, starts, and attaches to containers for a service.
docker-compose up -d # same in detached mode
docker-compose up --force-recreate # stop all containers and recreate
docker-compose up --build # rebuild custom images
docker-compose stop # stop but dont remove
docker-compose start # restart
docker-compose down # stop & remove containers
@rolandstarke
rolandstarke / laravel setup.sh
Last active June 16, 2025 10:54
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
@zmajstor
zmajstor / 0-README.md
Last active December 12, 2023 11:39
Docker on CentOS Linux

NGINX reverse-proxy with Let's Encrypt Certs with Docker Compose

Acts as a single reverse proxy with SSL offloading for any number of dockerized web projects on a single server, using 2 awesome projects:

jwilder/nginx-proxy

  • the reverse proxy is be the only container that actually needs to expose any ports to the world.
  • base image is just a regular nginx
  • the only container that actually exposes anything to the outside world, both port 80 and 443
@ronau
ronau / Nextcloud-Pi3-Setup.md
Last active July 2, 2024 22:23
Nextcloud on Raspberry Pi 3 Setup

Nextcloud on Raspberry Pi 3 Setup

Tip

There is a new and up-to-date version of this gist (with focus on the Raspi setup part): https://gist.github.com/ronau/462731589c44f91bb4a3b7d30d277ecf

This manual describes how to setup a Raspberry Pi 3 with nginx, PHP 7.0, MariaDB and use it as a Nextcloud server. Strong TLS encryption with Let's Encrypt certificates is also used. Of course, Owncloud can be used instead of Nextcloud. As of February 2017, the installation instructions are basically the same.

#!/usr/bin/env bash
export PATH="${PATH}:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
ME="${0}"
if [ "${BASH_VERSINFO[0]}" -lt "4" ]
then
echo >&2 "Sorry! This script needs BASH version 4+, but you have BASH version ${BASH_VERSION}"
exit 1
@tortuetorche
tortuetorche / FiniteAuditTrailTrait.php
Created July 12, 2016 15:32
FiniteStateMachine and FiniteAuditTrail Traits for Laravel 5.1 (WIP)
<?php namespace App\Finite;
/**
* The FiniteAuditTrail Trait.
* This plugin, for the Finite package (see https://github.com/yohang/Finite), adds support for keeping an audit trail for any state machine.
* Having an audit trail gives you a complete history of the state changes in your stateful model.
* Prerequisites:
* 1. Install Finite package (https://github.com/yohang/Finite#readme)
* 2. Use FiniteStateMachine in your model (https://gist.github.com/tortuetorche/6365575)
* Usage: in your Stateful Class use this trait after FiniteStateMachine trait, like this "use FiniteAuditTrailTrait;".
@crystrk
crystrk / deleter.js
Created May 27, 2016 07:09
SweetAlert2 + Laravel | confirmation delete
var deleter = {
linkSelector : "a[data-delete]",
modalTitle : "Are you sure?",
modalMessage : "You will not be able to recover this entry?",
modalConfirmButtonText: "Yes, delete it!",
laravelToken : null,
url : "/",
init: function() {
@trungv0
trungv0 / haproxy.sh
Last active June 25, 2025 21:44
RabbitMQ cluster with HAProxy & Keepalived for high availability
# install haproxy
yum install -y haproxy
# config haproxy for rabbitmq
cat > /etc/haproxy/haproxy.cfg << "EOF"
global
log 127.0.0.1 local0 notice
maxconn 10000
user haproxy
@azizultex
azizultex / WordPress Shortcode with ob_start()
Created March 3, 2016 03:16
WordPress Shortcode with ob_start()
function custom_query_shortcode($atts) {
// EXAMPLE USAGE:
// [loop the_query="showposts=100&post_type=page&post_parent=453"]
// Defaults
extract(shortcode_atts(array(
"the_query" => ''
), $atts));
@rahilwazir
rahilwazir / php7-fpm_xdebug_nginx.md
Last active September 22, 2021 19:32
Quick guide to setup Nginx with PHP7-FPM and XDebug

PHP7

  • Ubuntu 16.04+
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt update
$ sudo apt install nginx php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-soap php7.1-tidy php7.1-dev php7.1-intl php7.1-curl php7.1-zip php7.1-xml php-xdebug