Skip to content

Instantly share code, notes, and snippets.

View fabiomontefuscolo's full-sized avatar

Fabio Montefuscolo fabiomontefuscolo

View GitHub Profile
@fabiomontefuscolo
fabiomontefuscolo / README.md
Created September 17, 2018 13:01
The good README

Project name

  • What is this project? (include the programming language)
  • What this project do?

License

  • Which license is used?
#!/bin/bash
function show_usage() {
echo "$1 [CAT_OPTIONS] filename"
}
if [ "${#}" -lt 1 ];
then
show_usage "$0";
@fabiomontefuscolo
fabiomontefuscolo / genpass.c
Last active June 4, 2021 07:42
Password generator
#include <getopt.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void showHelp(char *biname) {
printf("%s [-l length] [-f 'regex'] [-n]\n", biname);
printf(" -l, --length\n");
printf(" Password length\n");
#!/bin/bash
PHP="/usr/bin/php"
extfile="/usr/lib/php/modules/xdebug.so"
idekey="xdbg"
remote_port=9000
remote_host="127.0.0.1"
$PHP \
@fabiomontefuscolo
fabiomontefuscolo / gist:10c6c283915113ae64bcd01caa992a84
Created May 7, 2018 16:26 — forked from vortec/gist:5843378
Late night implementation of Tornado + Redis PubSub + Websockets. It's late, the code is messy, but it should demonstrate how the general construct works. Feel free to try it on your own after studying it.
import json
import os
import tornado.httpserver
import tornado.web
import tornado.websocket
import tornado.ioloop
import tornado.gen
import tornadoredis

Daily linux

Desktop

Set up abnt2 keyboard

setxkbmap -model abnt2 -layout br -variant abnt2
@fabiomontefuscolo
fabiomontefuscolo / wp-migration.markdown
Last active April 23, 2024 09:28
BedRock WordPress + Nginx w Cache + php-fpm

Instalação dos pacotes do Ubuntu

apt-get install pv nginx-extras                                   \
    php-fpm php-gd php-mbstring php-cli php-mysql php-zip php-xml \
    mariadb-server mariadb-client

Instalação do WP-CLI

@fabiomontefuscolo
fabiomontefuscolo / 000-common.conf
Created February 1, 2018 12:39
Nginx + Wordpress + Varnish + hhvm + php5-fpm
# File: /etc/nginx/sites-enabled/000-common.conf
# Allow large uploads
client_max_body_size 50M;
# Enable caches
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=php_cache:100m inactive=1d;
# Fetch from Varnish on port 7000,
# but if it fail fetch from Nginx o port 80
@fabiomontefuscolo
fabiomontefuscolo / config
Created October 24, 2017 17:31
Let docker run inside LXC
lxc.aa_profile = unconfined
lxc.cgroup.devices.allow = a
lxc.cap.drop =
@fabiomontefuscolo
fabiomontefuscolo / docker-clues.markdown
Last active October 27, 2017 20:10
docker commands

Clues

All rap.host labels

docker ps --filter='label=rap.host' --format '{{join (split (.Label "rap.host") ",") "\r"}}'

All rap.host of wordpress