How to remove files with “No Content Changes Found” in Git Desktop

There are 3 possible ways git can find a file changed (even if you didn’t change it)

  1. Line Endings have changed
  2. File permissions have changed
  3. Bonus: if modification time has changed

for first case try these settings in bash shell. One of these will fix it for you

$ git config core.eol
$ git config core.autocrlf
$ git config core.safecrlf

For second case, here is the flag

git config core.filemode false

Bonus One: If Modification time was changed

If your working tree has files with updated “last modification time” and you see a huge list of files with “no content changes found”, try this:

git add .
 // ^ dont use . [DOT] if you want to fix for particular sub-folder

You can do git add for all affected files, after that it stops displaying them as modified in git status (and doesn’t actually stage them for commit if there are no changes).

References: https://stackoverflow.com/a/37221298/2229148

How to use VestaCP Cli Commands? – Linux

There are a lot of vestacp commands which are useful in automating things but you see error

sudo: v-list-sys-vesta-ssl: command not found

OR
something like this:

sudo /usr/local/vesta/bin/v-add-web-domain-ssl mage yourdomain
/usr/local/vesta/bin/v-add-web-domain-ssl: line 39: /func/main.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 40: /func/domain.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 41: /func/ip.sh: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 42: /conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 45: format_domain: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 46: format_domain_idn: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 53: check_args: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 54: is_format_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 55: is_system_enabled: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 56: is_system_enabled: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 57: is_object_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 58: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 59: is_object_valid: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 60: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 61: is_object_value_empty: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 62: is_web_domain_cert_valid: command not found
cp: cannot stat '/yourdomain.crt': No such file or directory
cp: cannot stat '/yourdomain.key': No such file or directory
cp: cannot stat '/yourdomain.crt': No such file or directory
chmod: cannot access '/ssl/yourdomain.*': No such file or directory
cp: cannot stat '/ssl/yourdomain.crt': No such file or directory
cp: cannot stat '/ssl/yourdomain.key': No such file or directory
cp: cannot stat '/ssl/yourdomain.pem': No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 89: get_domain_values: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 90: get_real_ip: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 94: prepare_web_domain_values: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 97: add_web_config: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 110: increase_user_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 113: update_object_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 114: update_object_value: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 117: /v-restart-web: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 118: check_result: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 120: /v-restart-proxy: No such file or directory
/usr/local/vesta/bin/v-add-web-domain-ssl: line 121: check_result: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 131: log_history: command not found
/usr/local/vesta/bin/v-add-web-domain-ssl: line 132: log_event: command not found

Solution

type this in command line (ssh)

export VESTA=/usr/local/vesta/

After that use any command like:

sudo /usr/local/vesta/bin/v-add-letsencrypt-domain <username> <maindomain.com> <domainalias.com*>

Dont use < or > or *
* means optional
< and > means replace your info with that


Complete command list : https://vestacp.com/docs/cli/

MySQL error 1449: The user specified as a definer does not exist

Why this error happens?

Most of the times, reason is that your database dump through command line or PhpMyAdmin or even other libraries can have SQL’s Definer statements. Now, as per MySQL’s Official Documentation:

The DEFINER clause specifies the MySQL account to be used when checking access privileges at routine execution time for routines that have the SQL SECURITY DEFINER characteristic.

MySQL Reference Manual v8.0

Solution: MySQL mysqldump create a safe backup to ensure no corruption

Use the following command to create backup of your mysql database. Put the command in terminal

mysqldump -hHOST -uUSERNAME -p DATABASE_NAME | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > BACKUP_NAME.sql

With gzip compression > backup

mysqldump -hHOST -uUSERNAME -p DATABASE_NAME | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip > BACKUP_NAME.sql

Reference: https://stackoverflow.com/a/9447215/2229148

RPM repo not found connection errors on Centos Redhat duplicate problems

yum -y update command failing

Command line will show messages like

xxx is outdated and v abc will be installed
but at the end it shows duplicate binary, please remove duplicate first.

Process

Backup first
Integrity Check
Find Problems
Identify duplicates
Clean duplicates
re build conf cache
update command
remove backup file .prev if successfully solved

\cp -r /var/lib/rpm /var/lib/rpm.prev
yum-complete-transaction
package-cleanup --problems
package-cleanup --dupes
package-cleanup --cleandupes
yum clean all
rpm --rebuilddb
yum update
# if all went OK run 'rm -rf /var/lib/rpm.prev'

Other possible solution

1. Update DNS to google dns 8.8.8.8 and 8.8.4.4 or freenom dns 80.80.80.80 and 80.80.81.81

system-config-network

2. Restart internet while maintaining SSH session (you wont be logged out)

/etc/init.d/network restart

Linux Bash – How to change all filenames to uppercase leaving the file extension unchanged

use this simple code in bash shell. The following code will change all xxx.jpg files to XXX.jpg in any particular working directory.

for i in *.jpg; do 
ext=${i##*.}; 
name=$(basename "$i" ".$ext" | tr '[a-z]' '[A-Z]').$ext; 
if [ "$i" != "$name" ] 
then 
mv $i $name;
fi
done;

How to update Magento community edition using CLI

composer require magento/product-community-edition 2.2.6 --no-update
composer update
rm -rf var/di var/generation var/cache var/view_preprocessed generated/*
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento deploy:mode:set production

if you receive any errors post installation, try this hard fix

rm -rf app/code/Magento/ var/* vendor/*
chmod 777 -R *
composer update && composer install
php -f bin/magento setup:static-content:deploy
find . -type d -exec chmod 775 {}
find . -type f -exec chmod 660 {}
chmod u+x bin/magento
bin/magento maintenance:disable
bin/magento cache:clean