Skip to content

Instantly share code, notes, and snippets.

View superbiche's full-sized avatar
🕹️
Working from everywhere

Michel Tomas superbiche

🕹️
Working from everywhere
View GitHub Profile
@superbiche
superbiche / cache-warmer.py
Last active June 21, 2020 00:17 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
#!/usr/bin/env python
"""
Warm the caches of your website by crawling each page defined in sitemap.xml (can use a local file or an URL).
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --url http://example.com/sitemap.xml -v
"""
import argparse
import multiprocessing.pool as mpool
import os.path
import re
@superbiche
superbiche / graph_models.md
Created August 15, 2019 21:20 — forked from rg3915/graph_models.md
Generate graphic model Django with PyGraphViz

How to generate graphic model Django with PyGraphViz?

sudo apt-get install graphviz libgraphviz-dev pkg-config
virtualenv -p python2.7 .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install pygraphviz
pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
@superbiche
superbiche / glustertop.py
Created May 28, 2019 00:17 — forked from fpytloun/glustertop.py
Real time GlusterFS top-like monitoring
#!/usr/bin/env python
"""
Display gluster traffic
This tool uses gluster profiling feature, parsing cumulative statistics.
To understand correctly the results, you have to divide overall write statistics with number of replicas.
Also striped volumes needs to be taken in mind - overall statistics just print sum of all bricks
read/written bytes.
@superbiche
superbiche / README.md
Created April 2, 2019 23:33 — forked from WengerK/README.md
Programatically use Solr on Drupal 8

🔍 Solr (6.1.0+) search Engine & Tika (1.13+) Extractor

We are using solr for search index.

Solr need to be configured for drupal. Follow the INSTALL.txt found in the search_api_solr module.

As a pre-requisite for running your own Solr server, you'll need Java 6 or higher.

Installation

@superbiche
superbiche / nginx.conf
Created May 1, 2018 16:35 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@superbiche
superbiche / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 28, 2018 12:06 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@superbiche
superbiche / INSTALL.rst
Created April 30, 2017 00:29 — forked from jensens/INSTALL.rst
sentry setup with docker-compose

In order to run this image do: docker-compose up -d to get all up. On first run DB initialization and initial user setup is done like so:

First start a bash in the container: docker-compose exec sentry /bin/bash. Then, inside bash, do sentry upgrade wait until it asks you for an inital user. When finished exit the bash.

When in doubt check with docker-compose ps if all went fine.

@superbiche
superbiche / fix_git_sslread_9806.sh
Last active March 5, 2017 02:04 — forked from entropiae/fix_git_sslread_9806.sh
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git
# If you don't already have php71 installed, replace "reinstall" with "install"
$ brew reinstall php71 --with-homebrew-curl # and any other with/without option offered by "brew info php71"
@superbiche
superbiche / youtube_id_regex.php
Created February 21, 2017 01:56 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@superbiche
superbiche / bash-cheatsheet.sh
Created September 29, 2016 08:42 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04