Skip to content

Instantly share code, notes, and snippets.

View Caroga's full-sized avatar

Roberto Gardenier Caroga

View GitHub Profile
server {
listen 80;
server_name _;
root /site/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
---
version: '3.7'
services:
redis:
image: redis
ports:
- 6379:6379
@mirkorap
mirkorap / symfony4-fos-oauth-server-bundle.md
Last active February 22, 2024 14:51
Basic examples how to implement a REST API with Symfony 4 + FOSRestBundle + FOSUserBundle + FOSOauthServerBundle with all oauth2 code flow
@R-Elijah
R-Elijah / init.bat
Created February 16, 2018 13:41
The edited init.bat to run Cmder in PhpStorm
@echo off
set CMDER_ROOT=C:\Users\Elijah\Documents\Portable Installations\cmder-master
set DL=%~d0
set LAST_CD=%cd%
:: Init Script for cmd.exe
:: Created as part of cmder project
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
@unreal4u
unreal4u / 50-httpd-php.conf
Last active February 19, 2022 12:00
Filter for logstash for access and error logs generated by apache2.(2|4) and php7
filter {
# Analyze access log
if [fields][type] == "apache-access" {
# First part: get every common message
grok {
match => { "message" => "^%{IP:[apache2][access][remote_ip]} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] " }
overwrite => "message"
}
# Get the specifics
@ssx
ssx / logstash.conf
Created October 24, 2015 15:09
Laravel Logs to Logstash
input {
lumberjack {
port => 5000
type => "logs"
ssl_certificate => "/shared/logstash-certs/logstash-forwarder.crt"
ssl_key => "/shared/logstash-certs/logstash-forwarder.key"
}
}
## Add your filters here
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@marcojanssen
marcojanssen / 1 zsh
Last active August 21, 2020 09:19
.zshrc
sudo apt install zsh
@subfuzion
subfuzion / global-gitignore.md
Last active July 16, 2024 18:54
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048