#remove wordpress shortcode from post_content if get the content directly from database
$content = preg_replace("[\[([^\[\]]*)\]]", '', $content);
#Remove htmltags from content
$content = strip_tags($content);
# basic pfctl control | |
# == | |
# Related: http://www.OpenBSD.org | |
# Last update: Tue Dec 28, 2004 | |
# == | |
# Note: | |
# this document is only provided as a basic overview | |
# for some common pfctl commands and is by no means | |
# a replacement for the pfctl and pf manual pages. |
#remove wordpress shortcode from post_content if get the content directly from database
$content = preg_replace("[\[([^\[\]]*)\]]", '', $content);
#Remove htmltags from content
$content = strip_tags($content);
/** | |
* @param string $moduleName | |
* @param string $type [optional] | |
* @return string | |
* @throws \InvalidArgumentException | |
*/ | |
function df_module_dir($moduleName, $type = '') { | |
/** @var \Magento\Framework\ObjectManagerInterface $om */ | |
$om = \Magento\Framework\App\ObjectManager::getInstance(); | |
/** @var \Magento\Framework\Module\Dir\Reader $reader */ |
For this example I have used magento2 cli. Asuming magento2 cli is located in /var/www/magento2/bin.
#create the script file
echo "export PATH=$PATH:/var/www/magento2/bin" > /etc/profile.d/magento2_bin.sh
#run the file to load
source /etc/profile.d/magento2_bin.sh
#Install Magento cli glovally
export PATH=$PATH:/var/www/html/magento2/bin
#Enable Disable Maintanance mode
Enable or disable maintenance mode
magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:disable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:status
#Prerequisit
cd ~
curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
tar xvf go1.6.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
Source stackoverflow.com
#Use the awesome interactive rebase:
git rebase -i @~9 # Show the last 9 commits in a text editor
Find the commit you want, change pick to e (edit), and save and close the file. Git will rewind to that commit, allowing you to either:
#Install proftpd
Digital Ocean: How To Set Up ProFTPD on CentOS 6
thesysad.com: Setting Up FTP Server Using ProFTPD in CentOS
ProFTPD: Virtual Users
ProFTPD: Logins and Authentication
ProFTPD: Using AuthUserFiles
ftpasswd: tool for ProFTPD's AuthUserFile, AuthGroupFile, UserPassword
Linux and Unix umask command
How to Enable EPEL Repository for RHEL/CentOS 7.x/6.x/5.x
#!/usr/bin/env bash | |
#This script backups selected databases in local MySQL server | |
#REQUIREMENTS | |
##mysqldump gzip | |
##mysql database has no root password. This script uses 'root' MySQL user without password as no 'root' password is set. | |
##This is not good practice. User with more restrictive permission should be used. | |
#set database user |