Skip to content

Instantly share code, notes, and snippets.

View LeoFeitosa's full-sized avatar
💯

LeoFeitosa

💯
  • São Paulo, Brasil
View GitHub Profile
@magnolialogic
magnolialogic / pihole-dietpi-cloudflared.md
Last active March 5, 2024 08:04
DNS over HTTPS with DietPi, Pi-hole, and Cloudflare DNS

DietPi + Pi-hole + Cloudflare DNS + DNS over HTTPS

Summary

Quick and dirty setup instructions to get Pi-hole running with DoH via Cloudflare on a headless Raspberry Pi.

I was originally using Pi-hole with Quad9 as my upstream DNS provider, but noticed that my ISP (Spectrum) was still intercepting and answering some DNS queries so I've switched to Cloudflare and their Argo Tunnel client for DNS over HTTPS.

Yes, I know there are other options out there like unbound, stubby, DNS over TLS, and DNSCrypt, but as of this writing the whole encrypted DNS thing still feels really runny so I went with cloudflared because it's a single package that's easy to configure, update, and remove. This combination gets me to a place where my network is using encrypted DNS + DNSSEC and should automagically support ESNI once Safari implements it, and I could easily back out of DNS over HTTPS if DoT or DNSCrypt becomes more fully-baked before DoH does. I'll also happily switch back to Quad9 if they provide a DoH pr

@vinicius-stutz
vinicius-stutz / readme.md
Created April 28, 2018 23:21
Padrões de Nomenclatura em C# (pt-br)

Namespace

Por padrão toda biblioteca deve conter um nome padrão em seu namespace. Ex.: MinhaEmpresa.SeuNameSpace (padrão PascalCase).

Classes

As classes devem começar com letra maiúscula e para cada palavra, a primeira letra também deve ser maiúscula (padrão PascalCase).

C#

@rafael-neri
rafael-neri / validar_cpf.php
Last active April 27, 2024 21:49
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@MohammadaliMirhamed
MohammadaliMirhamed / PhpFireBaseNotificationSample.php
Last active June 24, 2023 07:38
firebase notification sample in php . if you like this code follow me and star it . i will follow you and use your codes and share them . Simple PHP FireBase (FCM) script showing how to send an Android push notification. Be sure to replace the SERVER_API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call
<?php
#API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = $_GET['id'];
#prep the bundle
$msg = array
(
'body' => 'Body Of Notification',
@stenvdb
stenvdb / gist:2107947
Created March 19, 2012 11:15
jQuery: Capitalize first letter of string
$.fn.capitalize = function () {
$.each(this, function () {
var caps = this.value;
caps = caps.charAt(0).toUpperCase() + caps.slice(1);
this.value = caps;
});
return this;
};