Skip to content

Instantly share code, notes, and snippets.

Silver Moon silv3rm00n

Block or report user

Report or block silv3rm00n

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@silv3rm00n
silv3rm00n / gist:6211105
Created Aug 12, 2013
25+ examples of Linux find command – search files from command line
View gist:6211105
The Linux find command is a very useful and handy command to search for files from the command line. It can be used to search for files based on various criterias like permissions, user ownership, modification date/time, size etc. In this post we shall learn to use the find command along with various options that it supports.
View .fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
View gist:2964933
a.php ---
$a = shell_exec('php-cgi /var/www/test.php');
echo $a;
test.php ---
echo "Hello World";
View gist:2836118
/*
This will generate the data mart for following report/tables
1. report1 - grouped by referring_domain , landing_domain , campaign , source , click_date
*/
-- Create a temporary table to hold zip counts
create temporary table r_zip_cnt
(
click_id mediumint unsigned ,
cnt smallint unsigned ,
View gist:2718243
/*
This will generate the data mart for following report/tables
1. report1 - grouped by referring_domain , landing_domain , campaign , source , click_date
*/
-- Create a temporary table to hold zip counts
create temporary table r_zip_cnt
(
click_id mediumint unsigned ,
cnt smallint unsigned ,
View gist:2659659
select
c.referring_domain , SUM(zs.cnt) as zip_searches ,
Count(c.click_id) as visits ,
SUM(ds.conv) as conversions ,
SUM(ds.conv_value) as conv_value
from clicks c
left join
(
View gist:2391906
(12:39:24 IST) silv3r_m00n: if error_reporting is set to 0 , will 'log_errors' directive log anything or not ?
(12:41:44 IST) renic: TAS
(12:42:03 IST) GoogleGuy: silv3r_m00n, Of course not.
(12:42:35 IST) silv3r_m00n: renic: yes did , saw that if error_reporting = 0 then no error logging
(12:43:05 IST) GoogleGuy: silv3r_m00n, The error_reporting directive tells PHP's error handler what level of errors to report. If you tell it to report no errors at all it won't. Thus there will be nothing to log since it's not reporting any errors.
(12:43:24 IST) silv3r_m00n: GoogleGuy: read at few places "turn off error reporting on production , but log them to a file" so got confused , how to log without reporting
(12:44:09 IST) GoogleGuy: silv3r_m00n, They might be talking about display_errors. display_errors isn't error_reporting it's just whether or not PHP's error handler sends the error messages to STDOUT.
(12:44:21 IST) GoogleGuy: That's a separate directive that you should turn off in production of course.
View gist:2391903
<?php
ini_set('log_errors' , true);
ini_set('error_log' , '/var/www/php_error.txt');
ini_set('display_errors' , 0);
error_reporting(0);
mango();
View gist:2390363
ini_set('log_errors' , true);
ini_set('error_log' , '/var/www/php_error.txt');
ini_set('display_errors' , '0');
error_reporting( 0 ); //No php_error.txt created
error_reporting( E_ALL ); //php_error.txt created and works
View gist:2376269
<?
error_reporting(E_ALL);
$m = "<p>This is my tertiary message.</p>\n";
?>
<?=$m?>
<?xml version="1.0" encoding="utf-8"?>
You can’t perform that action at this time.