Skip to content

Instantly share code, notes, and snippets.

View nisdis's full-sized avatar

Nissim Dsilva nisdis

View GitHub Profile
@nisdis
nisdis / php-ajax-google-recaptcha-verification-function.php
Last active May 8, 2017 08:05 — forked from chiedo/php-google-recaptcha-verification-function.php
PHP Verification Function for Google recaptcha Server side code
<?php
/*
* Verifies if the captcha data via Google and redirects to the form page if the captcha does not pass.
* Great for custom contact forms.
*
* Important! : this function requires php-curl or php5-curl library
* Parameters:
* Gcaptcha response - the form data submitted with the request.
** Example call if your form used method='get': verify_captcha($_GET['g-recaptcha-response'], "Secret key here");
** Example call if your form used method='post': verify_captcha($_POST['g-recaptcha-response'], "Secret key here");
@nisdis
nisdis / image_ready.sh
Last active May 16, 2017 11:36
This script can be used to resize and watermark tons of images with this single scripts esp. DSLR images to web friendly images
#!/bin/bash
###
# This script can be used to resize and watermark tons of images with this single script
#
#
# Requirements: Imagemagick package installed
# Debian: $ sudo atp-get install imagemagick
# MacOs: $ brew install imagemagick
#
@nisdis
nisdis / monitor.sh
Last active July 27, 2017 10:18 — forked from mheadd/monitor.sh
Simple bash script to check whether MySQL is running.
#!/bin/bash
##checks if mysql and apache is up and running, also can be used to start the service on Debian type systems
## Contact: nissim at companyoftwo dot in
APUP=$(pgrep apache2 | wc -l);
MYUP=$(service mysql status | wc -l);
if [ "$MYUP" -lt 2 ];
then