Skip to content

Instantly share code, notes, and snippets.

ls * list file and directory
ls -l *long list file and directory , ll
ls -R *listing the file and directory with recurrsive.
ls -laR
pwd *present working direcory
cd dirname *enter a directory
cd.. back one directory cd - * to enter
cd ../.. *two level dir back
cd/ *root partition
cd and enter * to enter users home directory , "cd~"
# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
config -> vim /etc/nginx/nginx.conf
-> vim /usr/local/nginx/conf/nginx.conf
Reference https://linode.com/docs/web-servers/nginx/how-to-configure-nginx/
window.location.href = 'https://www.example.com';
//Start : Dynamic Title
add_filter('document_title_parts', 'filter_pagetitle',10);
function filter_pagetitle($title) {
$keyword = $_GET['mytitle'];
$check = !empty($keyword);
if($check)
$title['title'] = $keyword;
cd /Applications/MAMP/Library/bin
./mysql -uroot -proot
connect your_database_name
source /path/to/your/file/sql_export.sql
/////////////////
$ mysqldump -u [uname] -p[pass] db_name > db_backup.sql
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
-----------
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
<?php
$mageFilename = 'app/Mage.php';
if (!file_exists($mageFilename)) {
echo $mageFilename." was not found";
exit;
}
require_once $mageFilename;
Mage::app();
try {