Skip to content

Instantly share code, notes, and snippets.

View valmirphp's full-sized avatar

Valmir Barbosa dos Santos valmirphp

View GitHub Profile
@valmirphp
valmirphp / nginxfix.sh
Last active June 5, 2019 13:57 — forked from fer-ri/restart-service.sh
Auto Restart PHP5-FPM When Down or Bad Gateway
#!/bin/bash
# add cron: */3 * * * * /root/nginxfix.sh >> /var/log/nginxfix.log 2>&1
# REF: https://www.hrupin.com/2017/07/how-to-automatically-restart-nginx
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ ! "$(/etc/init.d/nginx status)" =~ "active (running)" ]]
then
echo $(date -u) "NGINX server has been stopped. It has now been restarted."
service nginx start
@valmirphp
valmirphp / vod-svg.js
Last active February 18, 2016 04:38 — forked from fergalhanley/vod-svg.js
This AngularJS directive allows changing the color of dynamically loaded SVG files. Subject to same domain policy.
angular
.module('241App.site.directives', [])
.directive('pmtMap', mapDirective)
.directive('pmtIconSvg', iconSvg2Directive);
function vodSvgDirective() {
return {
restrict: 'E',
replace: 'true',
# Cross domain webfont access
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2|svg)$ {
add_header "Access-Control-Allow-Origin" "*";
# Also, set cache rules for webfonts.
#
# See http://wiki.nginx.org/HttpCoreModule#location
# And https://github.com/h5bp/server-configs/issues/85
# And https://github.com/h5bp/server-configs/issues/86