Skip to content

Instantly share code, notes, and snippets.

View patrick-mota's full-sized avatar

Ganon patrick-mota

  • Geneva / Lausanne
  • X @8ice
View GitHub Profile
@webarchitect609
webarchitect609 / php8_docker.sh
Last active April 15, 2023 14:31
Quick docker PHP 8 setup for composer and unit testing
# Terminal Tab #1 (with privileges inside container)
# =============
cd "/the/dir/you/want/to/work/with/php8"
docker run --name php8 \
-it \
-v $PWD:/var/php:rw \
php:8.0-cli-alpine3.12 \
ash
cd /tmp
@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + 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 authenticationu
  • 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 3 framework. The following SF2 bundles are used :

@apsega
apsega / backup.sh
Created April 11, 2016 21:55
Docker containers backup
#!/bin/bash
# Variables
CONTAINER_NAME=$1
IMAGE_NAME=$(docker ps -f name=$CONTAINER_NAME --format {{.Image}})
TMP_DIR="/tmp"
DATE=$(date +"%Y-%m-%d")
DATA_VOLUMES=$(docker inspect --format '{{range .Mounts}}{{.Source}}{{" "}}{{end}}' $CONTAINER_NAME)
BKP_FILE="$TMP_DIR"/"$CONTAINER_NAME"_"$DATE"
@F21
F21 / cleanup-docker.md
Last active March 7, 2024 10:05
Commands to clean up docker

Remove dangling images

docker images -qf dangling=true | xargs docker rmi

Remove dangling volumes

docker volume ls -qf dangling=true | xargs -r docker volume rm
@szydan
szydan / gist:75b8a03b3fb4e099d5c1
Last active April 3, 2022 01:26
delete all commits from repo
git checkout --orphan latest_branch && \
git add -A && \
git commit -am "initial commit" && \
git branch -D master && \
git branch -m master && \
git push -f origin master
Taken from
@lpf23
lpf23 / CNTLM Proxy - Centos
Last active May 11, 2022 08:29
Configure CNTLM Proxy on Centos/Ubuntu
1) Download cntlm rpm package from http://sourceforge.net/projects/cntlm/files/cntlm/
2) Login as root
3) Run command:
$ rpm -ivh cntlm-*.rpm
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration)
$ cntlm -H -d <domain> -u <username>