Skip to content

Instantly share code, notes, and snippets.

David Fernández driade

View GitHub Profile
@driade
driade / send.php
Created Sep 18, 2018
Send failed messages back to the queue. PHP, Exim4
View send.php
<?php
/**
* This horrible script takes a folder with returned messages and tries to send them again back to the queue.
* Imagine an scenario where your mail server has been offline or unable to send mails for a few days, and the messages fail, so what you have is a copy of them stating it was impossible to deliver them.
* Tested with Exim4. Provided as is.
*/
$fp = opendir('input');
@driade
driade / test.sh
Created Dec 30, 2016
Test gz files recently accessed on this directory, recursively, an ensures they can be decompressed
View test.sh
#!/bin/bash
for file in `find ./ -atime 0 -name "*.gz"`
do
if ! gunzip -t $file &>/dev/null
then
echo "Bad file $file\n"
fi
done
@driade
driade / gist:4e4757ceb7a0da44bc1c
Created Sep 4, 2015
Quick and dirty node script to convert laravel docs into PDF
View gist:4e4757ceb7a0da44bc1c
var fs = require("fs")
var markdownpdf = require("markdown-pdf")
var dir= 'tmp-laravel-docs'
var exec = require('child_process').exec
exec("git clone https://github.com/laravel/docs "+dir, function (error, stdout, stderr) {
var data=fs.readdirSync(dir)
.filter(function (path) {
return (path.indexOf('.md')!=-1);
You can’t perform that action at this time.