Skip to content

Instantly share code, notes, and snippets.

View anytizer's full-sized avatar

Bimal Poudel anytizer

  • Canada
View GitHub Profile
@anytizer
anytizer / bookmarks.txt
Created November 6, 2013 18:43
Good Links
HTML View for Gmail
https://mail.google.com/mail/?ui=html&zy=h
@anytizer
anytizer / weekly-dumps.sh
Created November 10, 2013 06:59
Database backup script for a week
#!/bin/sh
mkdir -p /home/databases
cd /home/databases
DATE=`date '+%a'|tr '[:lower:]' '[:upper:]'`;
mysqldump --routine -uUSERNAME -pPASSWORD DATABASE1 > ${DATE}-DATABASE1.dmp
mysqldump --routine -uUSERNAME -pPASSWORD DATABASE2 > ${DATE}-DATABASE2.dmp
@anytizer
anytizer / sitemap-index.xml
Last active December 27, 2015 23:49
Sitemap Index
<sitemapindex>
<sitemap>
<loc>http://domain.com/sitemap-01.xml</loc>
</sitemap>
</sitemapindex>
@anytizer
anytizer / finder.php
Created November 16, 2013 06:05
finder
<?php
$find = preg_quote('search-term-what-to-find');
$dir='/home/user/public_html';
chdir($dir);
$files=array();
$files[] = 'file1.php';
$files[] = 'file2.php';
$files[] = 'path1/file3.php';
@anytizer
anytizer / encode-decode.sql
Last active December 28, 2015 18:18
Base 64 Encode/Decode in MySQL and URL encode decode
http://wi-fizzle.com/downloads/base64.sql
Corrections at: http://stackoverflow.com/questions/358500/base64-encode-in-mysql
Urlencode/urldecode As MySQL Stored Functions
http://www.dzone.com/snippets/urlencodeurldecode-mysql
http://jeremythomerson.com/2013/05/30/urlencoder-function-for-mysql/
@anytizer
anytizer / resources.php
Created November 25, 2013 09:12
Extract src and href
<?php
$path = '/home/USER/public_html';
function resources($path)
{
$resources = array(
'file' => $path,
'href' => array(),
'src' => array(),
'success' => false,
@anytizer
anytizer / error-logging.php
Created November 27, 2013 06:55
Enable error logging mode in PHP
<?php
ini_set('log_errors', 'On');
ini_set('display_errors', 'On');
ini_set('error_log', dirname(__FILE__).'/error_log');
error_reporting(E_ALL|E_STRICT);
?>
@anytizer
anytizer / large-php-scripts.sh
Created November 27, 2013 06:59
Large PHP scripts
find /PATH -type f -name "*.php" -size +50 > /tmp/large-scripts.log
@anytizer
anytizer / file-finder.php
Created November 28, 2013 06:15
PHP File Finder for matching words
<?php
$find = preg_quote('search-term-what-to-find');
$dir='/home/user/public_html';
chdir($dir);
$files=array();
$files[] = 'file1.php';
$files[] = 'file2.php';
$files[] = 'path1/file3.php';
@anytizer
anytizer / drop-triggers.sql
Created November 30, 2013 06:51
SQL to drop all triggers from your selected database
SELECT CONCAT('DROP TRIGGER `', trigger_name, '`;') FROM information_schema.triggers WHERE trigger_schema = 'DATABASE_NAME';