Skip to content

Instantly share code, notes, and snippets.

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

Fernando PopocaOrtiz

🏠
Working from home
  • Puebla, Mexico
  • 11:26 (UTC -05:00)
View GitHub Profile
@PopocaOrtiz
PopocaOrtiz / where_null.sql
Created October 19, 2018 16:24
mysql is null condition using variables
set @created_by = null; -- if the var is null, the comparison cant be with '='
select *
from users
where
IF(
@created_by is null, users.created_by is null, -- both var and field are null
@created_by = users.created_by -- normal comparison, when var is not null
)
limit 1;
@PopocaOrtiz
PopocaOrtiz / xvfb
Created November 9, 2016 21:37 — forked from jterrace/xvfb
xvfb init script for Ubuntu
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
@PopocaOrtiz
PopocaOrtiz / ssh-tailf-notify
Created December 14, 2015 17:26 — forked from coderofsalvation/ssh-tailf-notify
flexible desktop notifications using crontab bashscript which uses tail -f on logfiles using ssh
#!/bin/bash
usage='Usage: ssh-tailf-notify <user@server> <logfile> [grep args]
Easy way to receive desktop notifications based on remote logfile-events or named pipes
examples crontab:
* * * * * nohup /home/you/bin/ssh-tailf-notify [email protected] /home/you/irclogs/fnotify.txt -vE "(foo|bar)" &
* * * * * nohup /home/you/bin/ssh-tailf-notify [email protected] /home/sqz/irclogs/EFnet/#python.log -vE "(mynick)" &
* * * * * nohup /home/you/bin/ssh-tailf-notify [email protected] /var/log/messages "-E (memory|booking)" &
<?php
namespace Soap\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Soap\AutoDiscover as SoapWsdlGenerator;
use Zend\Soap\Server as SoapServer;
class SoapController
{