Skip to content

Instantly share code, notes, and snippets.

View williamdes's full-sized avatar
🚀
Catching up on GitHub notifications

William Desportes williamdes

🚀
Catching up on GitHub notifications
View GitHub Profile
@razorsedge
razorsedge / autodiscover-json.php
Last active June 17, 2022 10:50
Simplified version of https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/autodiscover-json.php for anyone wanting to to support email autodiscovery like at https://github.com/gronke/email-autodiscover . Keywords: GET /autodiscover/autodiscover.json?Email=user%40domain.com&Protocol=ActiveSync&RedirectCount=1
<?php
header("Content-Type: application/json");
if ($_GET['Protocol'] == 'ActiveSync') {
echo '{"Protocol":"ActiveSync","Url":"https://' . $_SERVER['HTTP_HOST'] . '/Microsoft-Server-ActiveSync"}';
}
elseif ($_GET['Protocol'] == 'AutodiscoverV1') {
echo '{"Protocol":"AutodiscoverV1","Url":"https://' . $_SERVER['HTTP_HOST'] . '/Autodiscover/Autodiscover.xml"}';
}
else {
@fawkesley
fawkesley / raid-1-luks.md
Created January 11, 2019 10:51
Raid-1 + LUKS encrypted filesystem

make encrypted luks partition on raid-1 array from free space

  • use cfdisk /dev/sda to create a new partition in free space with type "Linux RAID"
  • repeat for /dev/sdb
  • cat /proc/mdstat to see what /dev/mdX device is next
$ mdadm --create --verbose /dev/md4 --level=1 --raid-devices=2 /dev/sda6 /dev/sdb6
@rene-d
rene-d / fantoir.py
Last active April 15, 2021 13:30
Créer une base SQLite3 à partir du fichier FANTOIR de data.gouv.fr
#! /usr/bin/env python3
# rene-d 2018
# Unlicense: http://unlicense.org
"""
Fichier FANTOIR (Fichier ANnuaire TOpographique Initialisé Réduit)
https://www.data.gouv.fr/fr/datasets/fichier-fantoir-des-voies-et-lieux-dits/
crée une base SQLite3 à partir du fichier texte
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 17, 2025 09:00
set -e, -u, -o, -x pipefail explanation
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active February 15, 2025 06:19
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@aroralakshya
aroralakshya / final_submission.md
Last active August 15, 2018 10:55
Google Summer of Code 2018 with phpmyadmin. Final Product submission
title
Final Submission | Lakshay Arora | GSoC 2018 with phpmyadmin

Final Submission

This is the final blog post. Here I'll explain the work done in Google Summer of Code.

The goal of the project was to work on some feature requests(issues tagged as enhancements), big enough to integrate into one project.

<?php
/**
* returns number of cpu cores
* Copyleft 2018, license: WTFPL
* @throws \RuntimeException
* @throws \LogicException
* @return int
*/
@molguin92
molguin92 / flash_fw.sh
Created May 28, 2018 12:11
Flash Firmware Xiaomi
#!/bin/bash -x
# 1) Go to Xiaomis Fastboot Update Page. http://en.miui.com/a-234.html
# 2) Download latest Fastboot ROM. Like latest China dev.
# 3) Extract the content.
# 4) Boot your phone to Bootloader Mode. Vol Down and Power. Until Fastboot shows up.
# 5) Run this script from the root folder of the downloaded files.
echo "Flashing Firmware"
cat "./misc.txt"
@fedir
fedir / openssl-imap-testing.md
Last active February 22, 2024 17:06
Manual testing IMAP via OpenSSL

Manual testing IMAP via OpenSSL

Shell commands

telnet example.com 143
openssl s_client -crlf -connect example.com:993
openssl s_client -connect example.com -tls1_2
nmap --script ssl-enum-ciphers -p 443 example.com

IMAP commands, when working via openssl manually

😀 Grinning Face
😁 Beaming Face With Smiling Eyes
😂 Face With Tears of Joy
🤣 Rolling on the Floor Laughing
😃 Grinning Face With Big Eyes
😄 Grinning Face With Smiling Eyes
😅 Grinning Face With Sweat
😆 Grinning Squinting Face
😉 Winking Face
😊 Smiling Face With Smiling Eyes