Skip to content

Instantly share code, notes, and snippets.

View pendexgabo's full-sized avatar

Gabriel Sosa pendexgabo

View GitHub Profile
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running
@pendexgabo
pendexgabo / database-backup.sh
Last active August 29, 2015 14:06
MySQL backup script on steroids
#!/bin/bash
CMD_MYSQL="/usr/bin/mysql"
CMD_MYSQLDUMP="/usr/bin/mysqldump"
CMD_GZIP="gzip"
CMD_MKDIR="/bin/mkdir"
CMD_TAR="/bin/tar"
CMD_RM="/bin/rm"
CMD_S3='/root/s3cmd/s3cmd --access_key=XXXXXXXXXXXX --secret_key=YYYYYYYYYYYYY put --reduced-redundancy' # s3cmd with some options
@pendexgabo
pendexgabo / gist:6689723
Last active December 23, 2015 20:29
stripped down function to get emails from text files. Source: squirrelmail-webmail-1.4.22 functions/url_parser.php
<?php
function parse_emails ($text) {
$IP_RegExp_Match = '\\[?[0-9]{1,3}(\\.[0-9]{1,3}){3}\\]?';
$Host_RegExp_Match = '(' . $IP_RegExp_Match . '|[0-9a-z]([-.]?[0-9a-z])*\\.[a-z][a-z]+)';
$Email_RegExp_Match = '[0-9a-z]([-_.+]?[0-9a-z])*(%' . $Host_RegExp_Match . ')?@' . $Host_RegExp_Match;
preg_match_all('/'.$Email_RegExp_Match.'/i', $text, $regs);
diff --git a/Tws_Service_Google_Storage.php b/Tws_Service_Google_Storage.php
index 1bbe824..e922b0f 100644
--- a/Tws_Service_Google_Storage.php
+++ b/Tws_Service_Google_Storage.php
@@ -150,6 +150,53 @@ class Tws_Service_Google_Storage
return $hash;
}
+ /**
+ * Get MIME type for file
Index: twitter.lib.php
===================================================================
--- twitter.lib.php (revision 2025)
+++ twitter.lib.php (working copy)
@@ -37,6 +37,15 @@
* @package twitterlibphp
*/
abstract class TwitterBase {
+
+