Skip to content

Instantly share code, notes, and snippets.

View boscho87's full-sized avatar
🏠
Working from home

Simon Müller boscho87

🏠
Working from home
  • itsCoding
  • Switzerland
View GitHub Profile
@SBejga
SBejga / ssmtp_mail_alias
Last active December 15, 2021 05:05
Bash Script as alias of "mail" using "ssmtp" in ubuntu. Main purpose is sending mails via munin by ssmtp instead of postfix.
#!/bin/bash
# mail syntax: mail -s "any mail subject string" any@mail.com
# or: mail "any mail subject string" any@mail.com
if [ $1 == "-s" ]
then
subject=$2
recip=$3
else
subject=$1
recip=$2
@irazasyed
irazasyed / gist:4340722
Created December 19, 2012 21:32
PHP: Remove directory and its contents
/**
* Remove the directory and its content (all files and subdirectories).
* @param string $dir the directory name
*/
function rmrf($dir) {
foreach (glob($dir) as $file) {
if (is_dir($file)) {
rmrf("$file/*");
rmdir($file);
} else {