Skip to content

Instantly share code, notes, and snippets.

View floodedcodeboy's full-sized avatar

Jacob Gabriel floodedcodeboy

  • London, United Kingdom
  • 17:31 (UTC +01:00)
View GitHub Profile
@KostyaEsmukov
KostyaEsmukov / _ express-redirect-platform-location.md
Last active October 20, 2023 20:55
HTTP redirects with Angular SSR

HTTP redirects with Angular Server Side Rendering

This service assumes that you followed the SSR receipt at ng-cli (i.e. you use the '@nguniversal/express-engine' package).

@cupracer
cupracer / varnishlog-examples.sh
Last active September 13, 2024 15:57
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@bjornjohansen
bjornjohansen / default.vcl
Created May 11, 2016 23:25
Varnish 4.0 VCL for WordPress
vcl 4.0;
import std;
import directors;
backend server1 { # Define one backend
.host = "localhost";
.port = "8080";
.max_connections = 300;
@Idnan
Idnan / RestControllerTrait.php
Last active February 6, 2023 11:35
Laravel Lumen: RESTful trait
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait {
public function index() {
$model = self::MODEL;
@mlakkadshaw
mlakkadshaw / setup.sh
Last active December 25, 2015 12:28
Setup automatic deployment on your server using this shell script. After this shell script is executed you can deploy code using "git push server master"
#!/bin/bash
# A bash script to setup GIT like deployment on your server
echo "Enter your server address e.g 25.32.132.1 or yourserver.com"
read serverAddress
echo "Enter Username which you use to login to your server e.g ubuntu"
read username
echo "Enter path of the private key (optional)"
read privateKeyPath
echo "Path of your server directory where code should reside: e.g ~/code or /var/www (required)"
read tempPath
@loren138
loren138 / .rocketeerconfig.php
Last active January 17, 2021 08:26
MySQL Master Slave and EC2 Laravel Notes with Rocketeer
<?php
use Rocketeer\Services\Connections\ConnectionsHandler;
return [
// The name of the application to deploy
// This will create a folder of the same name in the root directory
// configured above, so be careful about the characters used
'application_name' => 'resources',
@andrey-str
andrey-str / ufw plexmediaserver app profile.md
Last active June 4, 2024 08:05
Plex Media Server UFW rule
[plexmediaserver]
title=Plex Media Server
description=The Plex Media Server is smart software that makes playing Movies, TV Shows and other media on your computer simple
ports=32400/tcp|1900/udp|32469/udp|5353/udp

Once you have defined your application file, put it in /etc/ufw/applications.d, then tell ufw to reload the application definitions with

ufw app update plexmediaserver
ufw app info plexmediaserver
@cletustboone
cletustboone / commands.md
Last active June 13, 2019 11:17
Varnishlog Cheat Sheet

Reference Post

Requests that make it through to a specific backend

varnishlog -g request -q "Backend ~ 'api_nhl'"

Requests from a specific referrer

Client and backend varnishlog -g request -q "ReqHeader ~ 'sportsnet.ca'"

@msurguy
msurguy / list.md
Last active January 26, 2018 15:16
List of CMSs built with Laravel (stable and in dev)